Vigilance 0.2.17
dotnet add package Vigilance --version 0.2.17
NuGet\Install-Package Vigilance -Version 0.2.17
<PackageReference Include="Vigilance" Version="0.2.17" />
<PackageVersion Include="Vigilance" Version="0.2.17" />
<PackageReference Include="Vigilance" />
paket add Vigilance --version 0.2.17
#r "nuget: Vigilance, 0.2.17"
#:package Vigilance@0.2.17
#addin nuget:?package=Vigilance&version=0.2.17
#tool nuget:?package=Vigilance&version=0.2.17
Vigilance
Vigilance is a 2D game engine/framework for C# and .NET, built on Raylib and focused on developer experience and performance, and it is compatible with Native AOT.
Documentation
The engine documentation and API reference are available at vigilance.samaelheaven.workers.dev.
Features
- Entity component system: components are stored in sparse sets, so adding, removing, and iterating them stays cheap. Structural changes can be deferred while you iterate, and every add, set, and remove can be observed through events.
- Scenes: a scene ties everything together. It holds your entity hierarchies and the systems that act on them, and supports names, prefabs, and transitions between scenes.
- Game loop: the frame runs through update, fixed update, and render phases, each with its own pre and post steps. Transforms are interpolated between fixed updates, so motion stays smooth at any frame rate.
- Systems: write your logic as ordered systems that hook into any phase. Built-in systems already handle physics, sprite batching, drawables, animations, UI, and more!
- Rendering: draw sprites, animations, shapes, and text with FreeType fonts, use shaders, render textures, and cameras, and batch sprites through instancing.
- Physics: Box2D bodies and shapes, with contact and sensor events and ray casts.
- UI: high-level UI elements laid out with flexbox, usable in both immediate and retained mode.
- Input: keyboard, mouse, gamepads, and the clipboard.
- Audio: sounds, music, and audio streams.
- Utilities: collections, math, tweens, timers, assets, logging, HTTP requests, and more!
Supported platforms
- Desktop: Windows, Linux, and macOS, running natively.
- Web: browsers, through WebAssembly.
- Mobile: Android.
Installation
Vigilance targets .NET 10 and later.
dotnet add package Vigilance
Vigilance.Debug is the same engine with internal assertions enabled, for catching misuse during development. To use it
in Debug builds and the regular package in Release builds, add both references to your project, replacing x.y.z with
the latest version:
<PackageReference Include="Vigilance" Version="x.y.z" Condition="'$(Configuration)' == 'Release'" />
<PackageReference Include="Vigilance.Debug" Version="x.y.z" Condition="'$(Configuration)' == 'Debug'" />
Benchmarks
The engine's entity operations and queries are compared against Flecs.NET after each release. The ratio column compares each Vigilance benchmark with the Flecs.NET baseline of the same operation; the measurements come from a shared CI machine, so the ratios are more meaningful than the absolute times.
BenchmarkDotNet v0.16.0-preview.2, Linux Ubuntu 26.04.1 LTS (Resolute Raccoon)
AMD EPYC 7763 3.24GHz, 1 CPU, 2 logical cores and 1 physical core
Memory: 7.75 GB Total, 4.42 GB Available
.NET SDK 11.0.100
[Host] : .NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v3
Job-NHQAEU : .NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v3
Entities
EnvironmentVariables=DOTNET_TieredCompilation=0 InvocationCount=1 IterationCount=12 UnrollFactor=1 WarmupCount=4
| Method | Categories | EntityCount | Mean | Error | StdDev | Ratio | RatioSD | Gen0 | Gen1 | Gen2 | Allocated | Alloc Ratio |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Vigilance_AddComponent | AddComponent | 1000 | 22.41 μs | 0.659 μs | 0.436 μs | 4.88x faster | 0.09x | - | - | - | 41408 B | NA |
| Flecs_AddComponent | AddComponent | 1000 | 109.33 μs | 1.357 μs | 0.808 μs | baseline | - | - | - | - | NA | |
| Vigilance_AddComponent | AddComponent | 100000 | 2,179.02 μs | 24.659 μs | 19.252 μs | 5.18x faster | 0.08x | - | - | - | 4598704 B | NA |
| Flecs_AddComponent | AddComponent | 100000 | 11,294.51 μs | 202.137 μs | 157.816 μs | baseline | - | - | - | - | NA | |
| Vigilance_Create | Create | 1000 | 41.37 μs | 4.793 μs | 3.170 μs | 1.19x faster | 0.09x | - | - | - | 59608 B | NA |
| Flecs_Create | Create | 1000 | 48.84 μs | 0.261 μs | 0.204 μs | baseline | - | - | - | - | NA | |
| Vigilance_Create | Create | 100000 | 5,642.40 μs | 40.956 μs | 27.090 μs | 1.26x slower | 0.04x | 1000.0000 | 1000.0000 | 1000.0000 | 6958728 B | NA |
| Flecs_Create | Create | 100000 | 4,474.07 μs | 214.592 μs | 155.164 μs | baseline | - | - | - | - | NA | |
| Vigilance_CreateWithComponents | CreateWithComponents | 1000 | 81.07 μs | 12.293 μs | 8.888 μs | 3.06x faster | 0.28x | - | - | - | 142424 B | NA |
| Flecs_CreateWithComponents | CreateWithComponents | 1000 | 245.79 μs | 1.625 μs | 0.967 μs | baseline | - | - | - | - | NA | |
| Vigilance_CreateWithComponents | CreateWithComponents | 100000 | 11,732.66 μs | 300.883 μs | 217.558 μs | 2.13x faster | 0.04x | 2000.0000 | 2000.0000 | 2000.0000 | 16156736 B | NA |
| Flecs_CreateWithComponents | CreateWithComponents | 100000 | 25,003.13 μs | 228.906 μs | 165.514 μs | baseline | - | - | - | - | NA | |
| Vigilance_Destroy | Destroy | 1000 | 80.89 μs | 13.907 μs | 10.056 μs | 1.54x slower | 0.18x | - | - | - | 8392 B | NA |
| Flecs_Destroy | Destroy | 1000 | 52.70 μs | 0.205 μs | 0.136 μs | baseline | - | - | - | - | NA | |
| Vigilance_Destroy | Destroy | 100000 | 7,415.99 μs | 29.965 μs | 19.820 μs | 1.49x slower | 0.01x | - | - | - | 1048944 B | NA |
| Flecs_Destroy | Destroy | 100000 | 4,988.13 μs | 28.514 μs | 20.618 μs | baseline | - | - | - | - | NA | |
| Vigilance_RemoveComponent | RemoveComponent | 1000 | 19.33 μs | 0.256 μs | 0.170 μs | 4.04x faster | 0.04x | - | - | - | - | NA |
| Flecs_RemoveComponent | RemoveComponent | 1000 | 78.08 μs | 0.902 μs | 0.596 μs | baseline | - | - | - | - | NA | |
| Vigilance_RemoveComponent | RemoveComponent | 100000 | 1,827.82 μs | 28.268 μs | 20.440 μs | 4.49x faster | 0.07x | - | - | - | - | NA |
| Flecs_RemoveComponent | RemoveComponent | 100000 | 8,201.79 μs | 157.629 μs | 104.262 μs | baseline | - | - | - | - | NA |
Components
IterationCount=12 WarmupCount=4
| Method | Categories | EntityCount | Mean | Error | StdDev | Ratio | RatioSD | Allocated | Alloc Ratio |
|---|---|---|---|---|---|---|---|---|---|
| Vigilance_Get | Get | 1000 | 2.904 μs | 0.0346 μs | 0.0270 μs | 7.91x faster | 0.13x | - | NA |
| Flecs_Get | Get | 1000 | 22.963 μs | 0.5299 μs | 0.3505 μs | baseline | - | NA | |
| Vigilance_Get | Get | 100000 | 291.540 μs | 2.6020 μs | 2.0315 μs | 7.91x faster | 0.12x | - | NA |
| Flecs_Get | Get | 100000 | 2,307.133 μs | 42.8608 μs | 33.4629 μs | baseline | - | NA | |
| Vigilance_Has | Has | 1000 | 2.023 μs | 0.0268 μs | 0.0209 μs | 11.15x faster | 0.13x | - | NA |
| Flecs_Has | Has | 1000 | 22.549 μs | 0.1998 μs | 0.1560 μs | baseline | - | NA | |
| Vigilance_Has | Has | 100000 | 209.206 μs | 3.3916 μs | 2.6479 μs | 10.96x faster | 0.19x | - | NA |
| Flecs_Has | Has | 100000 | 2,293.135 μs | 36.4738 μs | 28.4763 μs | baseline | - | NA | |
| Vigilance_Set | Set | 1000 | 9.038 μs | 0.0970 μs | 0.0758 μs | 4.25x faster | 0.05x | - | NA |
| Flecs_Set | Set | 1000 | 38.432 μs | 0.4890 μs | 0.3818 μs | baseline | - | NA | |
| Vigilance_Set | Set | 100000 | 1,047.909 μs | 67.7764 μs | 44.8299 μs | 3.68x faster | 0.14x | - | NA |
| Flecs_Set | Set | 100000 | 3,854.739 μs | 13.1543 μs | 8.7007 μs | baseline | - | NA | |
| Vigilance_Write | Write | 1000 | 3.937 μs | 0.0272 μs | 0.0212 μs | 5.81x faster | 0.06x | - | NA |
| Flecs_Write | Write | 1000 | 22.855 μs | 0.2933 μs | 0.2120 μs | baseline | - | NA | |
| Vigilance_Write | Write | 100000 | 389.328 μs | 2.1225 μs | 1.4039 μs | 5.91x faster | 0.08x | - | NA |
| Flecs_Write | Write | 100000 | 2,300.756 μs | 39.1813 μs | 30.5902 μs | baseline | - | NA |
Queries
IterationCount=12 WarmupCount=4
| Method | Categories | EntityCount | IsFragmented | Mean | Error | StdDev | Ratio | RatioSD | Allocated | Alloc Ratio |
|---|---|---|---|---|---|---|---|---|---|---|
| Vigilance_OneComponent | OneComponent | 1000 | False | 734.0 ns | 13.02 ns | 8.61 ns | 1.08x faster | 0.02x | - | NA |
| Flecs_OneComponent_Each | OneComponent | 1000 | False | 790.2 ns | 20.41 ns | 15.94 ns | baseline | - | NA | |
| Flecs_OneComponent_Iter | OneComponent | 1000 | False | 777.9 ns | 4.90 ns | 3.24 ns | 1.02x faster | 0.02x | - | NA |
| Vigilance_OneComponent | OneComponent | 1000 | True | 720.3 ns | 10.97 ns | 7.93 ns | 1.82x faster | 0.03x | - | NA |
| Flecs_OneComponent_Each | OneComponent | 1000 | True | 1,310.3 ns | 27.65 ns | 21.59 ns | baseline | - | NA | |
| Flecs_OneComponent_Iter | OneComponent | 1000 | True | 1,390.8 ns | 17.71 ns | 11.71 ns | 1.06x slower | 0.02x | - | NA |
| Vigilance_OneComponent | OneComponent | 100000 | False | 68,810.2 ns | 1,407.74 ns | 1,099.07 ns | 1.06x slower | 0.02x | - | NA |
| Flecs_OneComponent_Each | OneComponent | 100000 | False | 64,864.4 ns | 963.78 ns | 752.45 ns | baseline | - | NA | |
| Flecs_OneComponent_Iter | OneComponent | 100000 | False | 63,727.0 ns | 612.10 ns | 404.87 ns | 1.02x faster | 0.01x | - | NA |
| Vigilance_OneComponent | OneComponent | 100000 | True | 68,110.7 ns | 1,515.88 ns | 1,183.50 ns | 1.01x slower | 0.02x | - | NA |
| Flecs_OneComponent_Each | OneComponent | 100000 | True | 67,480.3 ns | 1,072.70 ns | 837.50 ns | baseline | - | NA | |
| Flecs_OneComponent_Iter | OneComponent | 100000 | True | 65,783.0 ns | 376.30 ns | 272.09 ns | 1.03x faster | 0.01x | - | NA |
| Vigilance_ThreeComponents | ThreeComponents | 1000 | False | 564.7 ns | 7.89 ns | 5.71 ns | 1.06x faster | 0.02x | - | NA |
| Flecs_ThreeComponents_Each | ThreeComponents | 1000 | False | 598.7 ns | 9.21 ns | 7.19 ns | baseline | - | NA | |
| Flecs_ThreeComponents_Iter | ThreeComponents | 1000 | False | 544.4 ns | 12.82 ns | 10.01 ns | 1.10x faster | 0.02x | - | NA |
| Vigilance_ThreeComponents | ThreeComponents | 1000 | True | 576.2 ns | 15.30 ns | 11.94 ns | 1.75x faster | 0.04x | - | NA |
| Flecs_ThreeComponents_Each | ThreeComponents | 1000 | True | 1,006.7 ns | 20.33 ns | 15.88 ns | baseline | - | NA | |
| Flecs_ThreeComponents_Iter | ThreeComponents | 1000 | True | 1,137.0 ns | 23.65 ns | 18.47 ns | 1.13x slower | 0.02x | - | NA |
| Vigilance_ThreeComponents | ThreeComponents | 100000 | False | 54,352.9 ns | 329.62 ns | 218.02 ns | 1.07x slower | 0.01x | - | NA |
| Flecs_ThreeComponents_Each | ThreeComponents | 100000 | False | 50,783.2 ns | 540.92 ns | 391.12 ns | baseline | - | NA | |
| Flecs_ThreeComponents_Iter | ThreeComponents | 100000 | False | 42,779.0 ns | 188.66 ns | 136.41 ns | 1.19x faster | 0.01x | - | NA |
| Vigilance_ThreeComponents | ThreeComponents | 100000 | True | 54,576.2 ns | 531.83 ns | 415.22 ns | 1.05x slower | 0.01x | - | NA |
| Flecs_ThreeComponents_Each | ThreeComponents | 100000 | True | 51,948.4 ns | 760.05 ns | 502.72 ns | baseline | - | NA | |
| Flecs_ThreeComponents_Iter | ThreeComponents | 100000 | True | 44,805.9 ns | 312.24 ns | 206.52 ns | 1.16x faster | 0.01x | - | NA |
| Vigilance_TwoComponents | TwoComponents | 1000 | False | 1,023.1 ns | 15.50 ns | 11.21 ns | 1.23x slower | 0.01x | - | NA |
| Flecs_TwoComponents_Each | TwoComponents | 1000 | False | 830.3 ns | 5.84 ns | 4.22 ns | baseline | - | NA | |
| Flecs_TwoComponents_Iter | TwoComponents | 1000 | False | 812.1 ns | 11.18 ns | 7.40 ns | 1.02x faster | 0.01x | - | NA |
| Vigilance_TwoComponents | TwoComponents | 1000 | True | 1,019.8 ns | 12.25 ns | 8.86 ns | 1.50x faster | 0.02x | - | NA |
| Flecs_TwoComponents_Each | TwoComponents | 1000 | True | 1,529.9 ns | 14.41 ns | 9.53 ns | baseline | - | NA | |
| Flecs_TwoComponents_Iter | TwoComponents | 1000 | True | 1,777.4 ns | 16.15 ns | 10.69 ns | 1.16x slower | 0.01x | - | NA |
| Vigilance_TwoComponents | TwoComponents | 100000 | False | 95,640.1 ns | 775.08 ns | 512.67 ns | 1.35x slower | 0.02x | - | NA |
| Flecs_TwoComponents_Each | TwoComponents | 100000 | False | 71,052.1 ns | 1,057.58 ns | 764.70 ns | baseline | - | NA | |
| Flecs_TwoComponents_Iter | TwoComponents | 100000 | False | 71,446.2 ns | 1,021.91 ns | 738.90 ns | 1.01x slower | 0.01x | - | NA |
| Vigilance_TwoComponents | TwoComponents | 100000 | True | 95,850.2 ns | 658.83 ns | 514.37 ns | 1.28x slower | 0.01x | - | NA |
| Flecs_TwoComponents_Each | TwoComponents | 100000 | True | 74,857.6 ns | 1,014.30 ns | 603.59 ns | baseline | - | NA | |
| Flecs_TwoComponents_Iter | TwoComponents | 100000 | True | 75,710.4 ns | 724.14 ns | 565.36 ns | 1.01x slower | 0.01x | - | NA |
License
Vigilance is licensed under the zlib License.
| 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. net11.0 is compatible. |
-
net10.0
- Box2D.NET (>= 3.1.654)
- FreeTypeSharp (>= 3.1.0)
- JetBrains.Annotations (>= 2026.2.0)
- LinkDotNet.StringBuilder (>= 3.8.1)
- ZLinq (>= 1.6.1)
-
net11.0
- Box2D.NET (>= 3.1.654)
- FreeTypeSharp (>= 3.1.0)
- JetBrains.Annotations (>= 2026.2.0)
- LinkDotNet.StringBuilder (>= 3.8.1)
- ZLinq (>= 1.6.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.