Vigilance 0.2.14
dotnet add package Vigilance --version 0.2.14
NuGet\Install-Package Vigilance -Version 0.2.14
<PackageReference Include="Vigilance" Version="0.2.14" />
<PackageVersion Include="Vigilance" Version="0.2.14" />
<PackageReference Include="Vigilance" />
paket add Vigilance --version 0.2.14
#r "nuget: Vigilance, 0.2.14"
#:package Vigilance@0.2.14
#addin nuget:?package=Vigilance&version=0.2.14
#tool nuget:?package=Vigilance&version=0.2.14
Vigilance
Vigilance is a 2D game engine/framework for C# and .NET, built on Raylib and focused on developer experience and performance. It runs natively on desktop and in the browser through WebAssembly, 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!
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 9V45 4.26GHz, 1 CPU, 2 logical cores and 1 physical core
Memory: 7.75 GB Total, 4.02 GB Available
.NET SDK 11.0.100
[Host] : .NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v4
Job-NHQAEU : .NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v4
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 | 17.354 μs | 1.4881 μs | 1.0760 μs | 3.62x faster | 0.21x | - | - | - | 41408 B | NA |
| Flecs_AddComponent | AddComponent | 1000 | 62.620 μs | 0.3270 μs | 0.2364 μs | baseline | - | - | - | - | NA | |
| Vigilance_AddComponent | AddComponent | 100000 | 1,416.796 μs | 22.9007 μs | 15.1474 μs | 4.92x faster | 0.22x | - | - | - | 4598704 B | NA |
| Flecs_AddComponent | AddComponent | 100000 | 6,965.807 μs | 399.8207 μs | 312.1537 μs | baseline | - | - | - | - | NA | |
| Vigilance_Create | Create | 1000 | 48.209 μs | 26.5725 μs | 20.7460 μs | 1.56x slower | 0.65x | - | - | - | 59608 B | NA |
| Flecs_Create | Create | 1000 | 30.811 μs | 0.3963 μs | 0.3094 μs | baseline | - | - | - | - | NA | |
| Vigilance_Create | Create | 100000 | 3,935.334 μs | 30.3264 μs | 21.9279 μs | 1.37x slower | 0.09x | 1000.0000 | 1000.0000 | 1000.0000 | 6958728 B | NA |
| Flecs_Create | Create | 100000 | 2,876.205 μs | 291.6402 μs | 210.8750 μs | baseline | - | - | - | - | NA | |
| Vigilance_CreateWithComponents | CreateWithComponents | 1000 | 51.083 μs | 4.7286 μs | 3.4191 μs | 2.97x faster | 0.18x | - | - | - | 142424 B | NA |
| Flecs_CreateWithComponents | CreateWithComponents | 1000 | 151.180 μs | 1.8407 μs | 1.2175 μs | baseline | - | - | - | - | NA | |
| Vigilance_CreateWithComponents | CreateWithComponents | 100000 | 8,339.263 μs | 141.8017 μs | 110.7094 μs | 1.83x faster | 0.06x | 2000.0000 | 2000.0000 | 2000.0000 | 16156736 B | NA |
| Flecs_CreateWithComponents | CreateWithComponents | 100000 | 15,261.299 μs | 562.1265 μs | 438.8714 μs | baseline | - | - | - | - | NA | |
| Vigilance_Destroy | Destroy | 1000 | 41.807 μs | 0.7517 μs | 0.5436 μs | 1.32x slower | 0.02x | - | - | - | 8392 B | NA |
| Flecs_Destroy | Destroy | 1000 | 31.661 μs | 0.2510 μs | 0.1815 μs | baseline | - | - | - | - | NA | |
| Vigilance_Destroy | Destroy | 100000 | 4,111.531 μs | 40.9279 μs | 29.5936 μs | 1.32x slower | 0.02x | - | - | - | 1048944 B | NA |
| Flecs_Destroy | Destroy | 100000 | 3,125.872 μs | 56.4444 μs | 40.8130 μs | baseline | - | - | - | - | NA | |
| Vigilance_RemoveComponent | RemoveComponent | 1000 | 9.635 μs | 0.2384 μs | 0.1724 μs | 4.80x faster | 0.10x | - | - | - | - | NA |
| Flecs_RemoveComponent | RemoveComponent | 1000 | 46.199 μs | 0.8737 μs | 0.5779 μs | baseline | - | - | - | - | NA | |
| Vigilance_RemoveComponent | RemoveComponent | 100000 | 959.663 μs | 16.3640 μs | 12.7759 μs | 5.45x faster | 0.24x | - | - | - | - | NA |
| Flecs_RemoveComponent | RemoveComponent | 100000 | 5,231.272 μs | 297.7108 μs | 232.4330 μs | baseline | - | - | - | - | NA |
Components
IterationCount=12 WarmupCount=4
| Method | Categories | EntityCount | Mean | Error | StdDev | Ratio | RatioSD | Allocated | Alloc Ratio |
|---|---|---|---|---|---|---|---|---|---|
| Vigilance_Get | Get | 1000 | 1.620 μs | 0.0167 μs | 0.0121 μs | 8.66x faster | 0.10x | - | NA |
| Flecs_Get | Get | 1000 | 14.034 μs | 0.1976 μs | 0.1429 μs | baseline | - | NA | |
| Vigilance_Get | Get | 100000 | 162.225 μs | 1.9807 μs | 1.5464 μs | 8.59x faster | 0.10x | - | NA |
| Flecs_Get | Get | 100000 | 1,392.610 μs | 15.9501 μs | 10.5500 μs | baseline | - | NA | |
| Vigilance_Has | Has | 1000 | 1.101 μs | 0.0141 μs | 0.0102 μs | 12.49x faster | 0.22x | - | NA |
| Flecs_Has | Has | 1000 | 13.751 μs | 0.3000 μs | 0.2169 μs | baseline | - | NA | |
| Vigilance_Has | Has | 100000 | 110.334 μs | 1.1044 μs | 0.8622 μs | 12.53x faster | 0.31x | - | NA |
| Flecs_Has | Has | 100000 | 1,382.174 μs | 52.4905 μs | 34.7192 μs | baseline | - | NA | |
| Vigilance_Set | Set | 1000 | 4.750 μs | 0.0987 μs | 0.0714 μs | 4.83x faster | 0.09x | - | NA |
| Flecs_Set | Set | 1000 | 22.962 μs | 0.4395 μs | 0.3178 μs | baseline | - | NA | |
| Vigilance_Set | Set | 100000 | 520.766 μs | 6.6866 μs | 4.8348 μs | 4.56x faster | 0.10x | - | NA |
| Flecs_Set | Set | 100000 | 2,374.135 μs | 64.0882 μs | 50.0359 μs | baseline | - | NA | |
| Vigilance_Write | Write | 1000 | 1.810 μs | 0.0211 μs | 0.0164 μs | 7.70x faster | 0.17x | - | NA |
| Flecs_Write | Write | 1000 | 13.929 μs | 0.3766 μs | 0.2940 μs | baseline | - | NA | |
| Vigilance_Write | Write | 100000 | 182.051 μs | 2.1360 μs | 1.6676 μs | 7.60x faster | 0.12x | - | NA |
| Flecs_Write | Write | 100000 | 1,383.765 μs | 24.1868 μs | 18.8835 μ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 | 543.4 ns | 10.68 ns | 8.34 ns | 1.04x slower | 0.02x | - | NA |
| Flecs_OneComponent_Each | OneComponent | 1000 | False | 520.5 ns | 4.59 ns | 3.32 ns | baseline | - | NA | |
| Flecs_OneComponent_Iter | OneComponent | 1000 | False | 406.2 ns | 9.36 ns | 6.77 ns | 1.28x faster | 0.02x | - | NA |
| Vigilance_OneComponent | OneComponent | 1000 | True | 545.7 ns | 5.75 ns | 3.80 ns | 1.47x faster | 0.02x | - | NA |
| Flecs_OneComponent_Each | OneComponent | 1000 | True | 800.3 ns | 13.12 ns | 9.49 ns | baseline | - | NA | |
| Flecs_OneComponent_Iter | OneComponent | 1000 | True | 716.5 ns | 17.33 ns | 13.53 ns | 1.12x faster | 0.02x | - | NA |
| Vigilance_OneComponent | OneComponent | 100000 | False | 48,050.9 ns | 966.93 ns | 639.57 ns | 1.17x slower | 0.02x | - | NA |
| Flecs_OneComponent_Each | OneComponent | 100000 | False | 41,200.3 ns | 570.68 ns | 445.55 ns | baseline | - | NA | |
| Flecs_OneComponent_Iter | OneComponent | 100000 | False | 28,388.1 ns | 328.67 ns | 256.60 ns | 1.45x faster | 0.02x | - | NA |
| Vigilance_OneComponent | OneComponent | 100000 | True | 48,642.0 ns | 676.93 ns | 489.47 ns | 1.10x slower | 0.02x | - | NA |
| Flecs_OneComponent_Each | OneComponent | 100000 | True | 44,062.2 ns | 1,139.39 ns | 889.56 ns | baseline | - | NA | |
| Flecs_OneComponent_Iter | OneComponent | 100000 | True | 29,003.1 ns | 427.14 ns | 308.85 ns | 1.52x faster | 0.03x | - | NA |
| Vigilance_ThreeComponents | ThreeComponents | 1000 | False | 421.3 ns | 6.69 ns | 4.83 ns | 1.06x faster | 0.02x | - | NA |
| Flecs_ThreeComponents_Each | ThreeComponents | 1000 | False | 447.4 ns | 8.24 ns | 6.44 ns | baseline | - | NA | |
| Flecs_ThreeComponents_Iter | ThreeComponents | 1000 | False | 436.8 ns | 8.00 ns | 6.25 ns | 1.02x faster | 0.02x | - | NA |
| Vigilance_ThreeComponents | ThreeComponents | 1000 | True | 424.7 ns | 5.65 ns | 4.41 ns | 1.53x faster | 0.02x | - | NA |
| Flecs_ThreeComponents_Each | ThreeComponents | 1000 | True | 647.7 ns | 9.71 ns | 7.02 ns | baseline | - | NA | |
| Flecs_ThreeComponents_Iter | ThreeComponents | 1000 | True | 658.0 ns | 9.00 ns | 6.51 ns | 1.02x slower | 0.01x | - | NA |
| Vigilance_ThreeComponents | ThreeComponents | 100000 | False | 36,690.1 ns | 580.25 ns | 453.02 ns | 1.00x faster | 0.01x | - | NA |
| Flecs_ThreeComponents_Each | ThreeComponents | 100000 | False | 36,752.2 ns | 306.27 ns | 239.11 ns | baseline | - | NA | |
| Flecs_ThreeComponents_Iter | ThreeComponents | 100000 | False | 30,734.9 ns | 332.59 ns | 259.66 ns | 1.20x faster | 0.01x | - | NA |
| Vigilance_ThreeComponents | ThreeComponents | 100000 | True | 36,901.6 ns | 917.79 ns | 716.55 ns | 1.05x faster | 0.02x | - | NA |
| Flecs_ThreeComponents_Each | ThreeComponents | 100000 | True | 38,595.7 ns | 598.83 ns | 467.53 ns | baseline | - | NA | |
| Flecs_ThreeComponents_Iter | ThreeComponents | 100000 | True | 36,868.5 ns | 680.02 ns | 530.92 ns | 1.05x faster | 0.02x | - | NA |
| Vigilance_TwoComponents | TwoComponents | 1000 | False | 601.8 ns | 19.74 ns | 14.28 ns | 1.03x faster | 0.02x | - | NA |
| Flecs_TwoComponents_Each | TwoComponents | 1000 | False | 618.8 ns | 6.24 ns | 4.51 ns | baseline | - | NA | |
| Flecs_TwoComponents_Iter | TwoComponents | 1000 | False | 643.1 ns | 21.28 ns | 16.61 ns | 1.04x slower | 0.03x | - | NA |
| Vigilance_TwoComponents | TwoComponents | 1000 | True | 597.3 ns | 12.08 ns | 8.73 ns | 1.69x faster | 0.03x | - | NA |
| Flecs_TwoComponents_Each | TwoComponents | 1000 | True | 1,008.5 ns | 12.23 ns | 8.84 ns | baseline | - | NA | |
| Flecs_TwoComponents_Iter | TwoComponents | 1000 | True | 1,081.5 ns | 19.46 ns | 12.87 ns | 1.07x slower | 0.02x | - | NA |
| Vigilance_TwoComponents | TwoComponents | 100000 | False | 53,620.5 ns | 536.51 ns | 387.93 ns | 1.03x slower | 0.02x | - | NA |
| Flecs_TwoComponents_Each | TwoComponents | 100000 | False | 52,240.5 ns | 1,046.50 ns | 756.69 ns | baseline | - | NA | |
| Flecs_TwoComponents_Iter | TwoComponents | 100000 | False | 54,219.7 ns | 1,391.54 ns | 1,086.42 ns | 1.04x slower | 0.02x | - | NA |
| Vigilance_TwoComponents | TwoComponents | 100000 | True | 55,676.7 ns | 892.20 ns | 645.12 ns | 1.01x faster | 0.03x | - | NA |
| Flecs_TwoComponents_Each | TwoComponents | 100000 | True | 55,964.8 ns | 1,821.11 ns | 1,421.80 ns | baseline | - | NA | |
| Flecs_TwoComponents_Iter | TwoComponents | 100000 | True | 58,122.6 ns | 1,140.39 ns | 890.34 ns | 1.04x slower | 0.03x | - | 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)
- Raylib-cs (>= 8.1.0)
- 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)
- Raylib-cs (>= 8.1.0)
- 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.