GithubHelp home page GithubHelp logo

handsome-cong / deepslate.ecs Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 287 KB

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

License: MIT License

C# 99.80% PowerShell 0.20%
ecs entity-component-system

deepslate.ecs's Introduction

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

deepslate.ecs's People

Contributors

handsome-cong avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

zxc6114

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.