-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
221 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
![fennecs logo](https://raw.githubusercontent.com/outfox/fennecs/main/nuget/fennecs-logo-nuget.svg) | ||
|
||
[**fenn**ecs](https://fennecs.tech) is a lightweight, performant, and expressive ECS library for game & simulations written in modern C#. | ||
|
||
It's designed to be easy to use, with minimal boilerplate and no code generation or reflection required. | ||
|
||
## ๐ Quickstart | ||
|
||
๐ฆ`>` `dotnet add package fennecs` | ||
|
||
Here's a simple example to get you started: | ||
|
||
```cs | ||
// Declare a component record. (we can also use most existing value & reference types) | ||
record struct Velocity(Vector3 Value); | ||
|
||
// Create a world. (fyi, World implements IDisposable) | ||
var world = new fennecs.World(); | ||
|
||
// Spawn an entity into the world with a choice of components. (or add/remove them later) | ||
var entity = world.Spawn().Add<Velocity>(); | ||
|
||
// Queries are cached & we use ultra-lightweight Stream Views to feed data to our code! | ||
var stream = world.Query<Velocity>().Stream(); | ||
|
||
// Run code on all entities in the query. (exchange 'For' with 'Job' for parallel processing) | ||
stream.For( | ||
uniform: DeltaTime * 9.81f * Vector3.UnitZ, | ||
static (Vector3 uniform, ref Velocity velocity) => | ||
{ | ||
velocity.Value -= uniform; | ||
} | ||
); | ||
``` | ||
|
||
## ๐ Key Features | ||
|
||
- Modern C# codebase targeting .NET 8 | ||
- Archetype-based storage for cache-friendly iteration | ||
- Expressive, queryable relations between entities and components | ||
- Easy parallelization of workloads across and within archetypes | ||
- Zero codegen and minimal boilerplate | ||
|
||
## ๐ Learn More | ||
|
||
Check out the [fennecs website](https://fennecs.tech) for: | ||
|
||
- ๐ API documentation | ||
- ๐ณ Cookbook with tasty recipes | ||
- ๐ฎ Demo projects to get inspired | ||
|
||
Happy coding! ๐ฆโค๏ธ |