Skip to content

Deepslate.Ecs is a Entity Component System (ECS) library implemented in C#. It is designed to be fast, flexible and easy to use.

License

Notifications You must be signed in to change notification settings

Handsome-cong/Deepslate.Ecs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

example workflow

Deepslate.Ecs is a Entity Component System (ECS) library implemented in C#. It is designed to be fast, flexible and easy to use.

warning: This library is still in development and is far from being ready for production.

Roadmap

  • Entity struct with just 64 bits representing your entities
  • IComponentData interface for tagging components
  • ISystemExecutor interface for defining systems that run every tick
  • Query for iterating over entities with specific components
    • Generic QueryBuilder for strongly typed query configuration
    • Generic Query for explicit query requirements
    • Generic enumerator for generic query results
    • Source generator for generating query configuration code
  • Archetype for storing entities and components
    • Managed and unmanaged component storage
    • ArchetypeBuilder for strongly typed archetype configuration
    • ArchetypeCommand for limitary access to entities
  • World for managing entities, components and systems
    • WorldBuilder for fluent world configuration
  • Scheduler for running systems in parallel
    • Stage for grouping systems
    • Automatic parallelization of systems with no conflicting queries
    • Execution of deferred command created by EntityCommand
  • EntityCommand for creating, destroying and modifying entities and components in tick
  • GlobalCommand for creating, destroying and modifying entities and components out of tick
  • Resource for global data
  • Reactive systems for handling events

Api Conventions

  • With prefix for methods that add or overwrite something, if the arguments of multiple calls are the same or partially the same.
  • Add prefix for methods that may add something multiple times, even if the arguments are the same.
  • Additional arguments for build methods of builders mean that the arguments are not optional and must be provided.

How To Build

Prerequisites

  • .NET 8.0 SDK
  • .NET Compiler Platform SDK (Roslyn)

Visual Studio / Rider

Just open the solution and build it. You may need to execute the t4 templates manually.

Powershell

Run the build script in the root directory of the repository.

./build.ps1

If you run this script in visual studio developer powershell, the "TextTransform.exe" will be used to execute the t4 templates. Otherwise, "dotnet-t4" will be installed as a local tool and do the job.

Benchmark

Here are some benchmarks comparing Deepslate.Ecs with traditional OOP implementations.

Create Entities

Create 256, 1024, 4096 entities with single component. CreateEntitiesBenchmark

Modify Components

Modify single component of 256, 1024, 4096 entities. ModifyComponentsBenchmark

Modify Components In Parallel

Modify two components of 256, 1024, 4096 entities in parallel. Auto parallelization in Deepslate.Ecs and manual parallelization in OOP. ModifyComponentsInParallelBenchmark

About

Deepslate.Ecs is a Entity Component System (ECS) library implemented in C#. It is designed to be fast, flexible and easy to use.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published