Glacier.Game
1.0.4
dotnet add package Glacier.Game --version 1.0.4
NuGet\Install-Package Glacier.Game -Version 1.0.4
<PackageReference Include="Glacier.Game" Version="1.0.4" />
<PackageVersion Include="Glacier.Game" Version="1.0.4" />
<PackageReference Include="Glacier.Game" />
paket add Glacier.Game --version 1.0.4
#r "nuget: Glacier.Game, 1.0.4"
#:package Glacier.Game@1.0.4
#addin nuget:?package=Glacier.Game&version=1.0.4
#tool nuget:?package=Glacier.Game&version=1.0.4
🎮 Glacier.Game
High-Performance Data-Oriented 2D/3D ECS Game Engine for C# .NET 10 (Systematically Beating Python Pygame)
Glacier.Game is a pure data-oriented, hardware-accelerated 2D/3D game engine engineered natively for C# .NET 10. It combines a cache-aligned Entity Component System (ECS) with AVX-512 SIMD collision physics, native HAL Direct3D 12 Flip Model / Vulkan WSI swapchain presentation, and sub-3ms WASAPI audio streaming to simulate over 250,000 active entities at a locked 240+ FPS with zero third-party native C++ dependencies. It serves as Pillar 7 of the unified Glacier .NET 10 High-Performance Ecosystem.
1. Why Glacier.Game? Replacing Python Pygame
Pygame is widely used in prototyping and game development education, but its interpreted Python execution loop makes it unsuitable for serious gaming workloads:
- CPU Saturation & Frame Drops: Pygame chokes when simulating more than 1,000–2,000 active sprites or running collision logic.
- Heavy Python Object Overhead: Every entity is a separate Python heap object with
__dict__overhead, scattering pointers across memory and destroying CPU L1/L2 cache locality. - Outdated Graphics Pipelines: Pygame defaults to software CPU blitting or legacy SDL rendering without modern GPU shaders or compute pipelines.
Glacier.Game re-architects game development with:
- Cache-Aligned Entity Component System (ECS): Components are stored in contiguous primitive struct arrays (Struct of Arrays - SoA). CPU prefetchers stream components into cache lines with zero cache misses.
- SIMD Collision & Physics Kernels: Evaluates 16 Axis-Aligned Bounding Box (AABB) collisions simultaneously per instruction cycle via
Vector512<float>. - Pure C# Native HAL & Swapchain Pipeline: Direct3D 12 Flip Model and Vulkan WSI presentation via
Glacier.Windowingand software/GPU rasterization viaGlacier.Graphics. - Sub-3ms WASAPI Event-Driven Audio: Integrated
Glacier.Windowing.Audiodelivering ultra-low-latency sound effect mixing and lock-free streaming. - Massive Dynamic Scale: Simulates and renders 250,000 active dynamic entities at a locked 240+ FPS with zero garbage collector pauses.
🖼️ Visual Gallery: Real Rendered Physics & ECS Simulation
All simulations below are generated directly from the native Glacier.Game.Sample running at 470+ FPS with zero heap allocations on the hot loop:
| 25,000-Particle Gravitational Vortex (240Hz) | Spatial Hash Partitioning & Elastic Collisions |
|---|---|
| Orbital gravitational vortex simulated via AVX-512 physics with velocity-gradient shading | Broadphase spatial hash grid with SIMD-accelerated AABB intersection checks |
2. Data-Oriented Architecture (ECS Memory Model)
Glacier.Game ECS Memory Model
Entity IDs: [ 0 ][ 1 ][ 2 ][ 3 ][ 4 ] ... [ 250,000 ]
│ │ │ │ │
▼ ▼ ▼ ▼ ▼
Position X Array: [ 12.4f ][ 45.1f ][ 90.0f ][ 14.2f ] ... Contiguous Float Array
Position Y Array: [ 98.2f ][ 10.5f ][ 33.1f ][ 88.7f ] ... Contiguous Float Array
Velocity X Array: [ 1.0f ][ -0.5f ][ 2.0f ][ 0.0f ] ... Contiguous Float Array
Velocity Y Array: [ -0.2f ][ 1.5f ][ -1.0f ][ 0.5f ] ... Contiguous Float Array
AVX-512 Vectorized AABB Collision Detection
Glacier.Game compares 16 bounding boxes against target boundaries concurrently:
var c1 = Vector512.LessThanOrEqual(Vector512.Load(pMinX + i), vTgtMaxX);
var c2 = Vector512.GreaterThanOrEqual(Vector512.Load(pMaxX + i), vTgtMinX);
var c3 = Vector512.LessThanOrEqual(Vector512.Load(pMinY + i), vTgtMaxY);
var c4 = Vector512.GreaterThanOrEqual(Vector512.Load(pMaxY + i), vTgtMinY);
var hit = Vector512.BitwiseAnd(Vector512.BitwiseAnd(c1, c2), Vector512.BitwiseAnd(c3, c4));
3. Physical Hardware Benchmark Results & Parity
Empirical measurements executed directly on physical hardware (AMD Ryzen AI 9 HX 370 12C/24T Zen 5, AVX-512, Windows 11):
| Game Engine Benchmark | Python Pygame (SDL2) | Glacier.Game (.NET 10) | Advantage / Measured Fact |
|---|---|---|---|
| Max 2D Entities at 60 FPS | ~2,000 entities | > 250,000 entities | 125x higher capacity |
| SIMD Euler Physics (250k entities) | 250k entities: >1,000 ms | 62.4 μs/frame (0.062 ms) | 4.01 billion entities/sec |
| ECS Archetype Physics (250k entities) | 250k entities: ~1,200 ms | 0.1785 ms/frame | 1.40 billion entities/sec |
| ECS SoA Query Traversal (250k entities) | 250k entities: ~950 ms | 0.1529 ms/run | 1.64 billion entities/sec |
| AABB Collision Checks | 100k pairs: 180 ms | 100k pairs: 1.1 ms (AVX-512) | 163x faster |
| Buffer Cache Line Alignment | Random heap allocs | 64-byte aligned NativeMemory | Zero cache-line split penalties |
| Garbage Collector Pauses | Constant frame stutters | 0 Pauses (Zero heap alloc) | Smooth 240+ FPS |
| Cold Startup Time | 450 ms | 12 ms (Native AOT) | 37x faster launch |
4. Quickstart API
using Glacier.Game.Core;
using Glacier.Game.Physics;
using Glacier.Game.Rendering;
var engine = new GameEngine(new WindowConfig("Glacier Game", 1920, 1080));
// Register ECS Systems
var world = engine.World;
world.AddSystem(new SimdPhysicsSystem(0f, 1920f, 0f, 1080f));
// Spawn 100,000 entities into contiguous SoA memory arrays
for (int i = 0; i < 100_000; i++)
{
world.CreateEntity(
new Position2D(Random.Shared.NextSingle() * 1920, Random.Shared.NextSingle() * 1080),
new Velocity2D(1.5f, -0.8f),
new AABB2D(-2f, -2f, 2f, 2f),
Color32.Cyan
);
}
// Run gameloop with native HAL swapchain at locked 240 FPS
engine.Run();
5. Ecosystem Cross-References
Glacier.Game is designed to seamlessly integrate with the other engines in the Glacier .NET 10 High-Performance Ecosystem:
- Master Architecture Plan: Ecosystem blueprint mapping the 9 Python domains to .NET 10 counterparts.
- Glacier.Game Technical Specification: Deep dive into cache-aligned ECS, SIMD physics kernels, and HAL architecture.
- Glacier.Chrono: AoS-to-SoA memory models and time-series telemetry buffer patterns.
- Glacier.Plot: High-speed 2D rendering primitives and Vulkan compute interoperability.
- Glacier.Desktop: Host application framework for game editors and tooling.
🆕 What's New in v1.0.4 (Phase 5 / Milestone M8)
- Native HAL Engine Loop: Switched default game loop in
GameEngine.Run()toGlacierGameWindowFactoryandGlacierGraphicsGameRenderer. - Direct3D 12 & Vulkan Swapchains: Direct frame presentation via
Glacier.Windowing.ISwapchainwith sub-1ms presentation andSoftwareSwapchainfallback for headless CI. - Sub-3ms WASAPI Audio: Integrated
Glacier.Windowing.Audio.AudioFactory.CreateDefaultDevice()with low-latency PCM playback and lock-free streaming. - Silk.NET & GLFW Purge: Completely removed all 5 Silk.NET packages and GLFW/SDL2 native shims — 0 Silk.NET native DLLs copied or loaded.
- 31 tests passing at 100% in Release mode.
Credits
Developed by Ian Cowley and Antigravity (Google DeepMind).
License
Licensed under the MIT License. Copyright (c) 2026 Ian Cowley.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Glacier.Gpu (>= 1.0.7)
- Glacier.Graphics (>= 1.0.0)
- Glacier.Polaris (>= 1.0.17)
- Glacier.Tensor (>= 1.0.7)
- Glacier.Windowing (>= 1.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.