All Projects → EcsRx → Ecsrx

EcsRx / Ecsrx

Licence: mit
A reactive take on the ECS pattern for .net game developers

Programming Languages

csharp
926 projects

Projects that are alternatives of or similar to Ecsrx

3d Game Shaders For Beginners
🎮 A step-by-step guide to implementing SSAO, depth of field, lighting, normal mapping, and more for your 3D game.
Stars: ✭ 11,698 (+3961.81%)
Mutual labels:  unity, unity3d, game-development, godot
Ecs
LeoECS is a fast Entity Component System (ECS) Framework powered by C# with optional integration to Unity
Stars: ✭ 578 (+100.69%)
Mutual labels:  ecs, unity, unity3d, game-development
Unity Design Pattern
🍵 All Gang of Four Design Patterns written in Unity C# with many examples. And some Game Programming Patterns written in Unity C#. | 各种设计模式的Unity3D C#版本实现
Stars: ✭ 2,600 (+802.78%)
Mutual labels:  unity, unity3d, game-development, design-patterns
Entitas Csharp
Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
Stars: ✭ 5,393 (+1772.57%)
Mutual labels:  ecs, unity, game-development, design-patterns
Gdk For Unity Fps Starter Project
SpatialOS GDK for Unity FPS Starter Project
Stars: ✭ 119 (-58.68%)
Mutual labels:  ecs, unity, unity3d, game-development
Endless Runner Entitas Ecs
Runner template for Unity
Stars: ✭ 41 (-85.76%)
Mutual labels:  ecs, unity, game-development
Ecs Snake
Simple snake game powered by ecs framework.
Stars: ✭ 41 (-85.76%)
Mutual labels:  ecs, unity, unity3d
Noahgameframe
A fast, scalable, distributed game server engine/framework for C++, include the actor library, network library, can be used as a real time multiplayer game engine ( MMO RPG/MOBA ), which support C#/Lua script/ Unity3d, Cocos2dx and plan to support Unreal.
Stars: ✭ 3,258 (+1031.25%)
Mutual labels:  unity, unity3d, game-development
Unitynuget
Provides a service to install NuGet packages into a Unity project via the Unity Package Manager
Stars: ✭ 257 (-10.76%)
Mutual labels:  unity, unity3d, nuget
Anything about game
A wonderful list of Game Development resources.
Stars: ✭ 541 (+87.85%)
Mutual labels:  ecs, unity, game-development
Learning Unity Ecs 2
A bunch of small Unity projects where I explore and learn Unity's new ECS and Job System. Updated for the new API.
Stars: ✭ 65 (-77.43%)
Mutual labels:  ecs, unity, unity3d
Unity Programming Patterns
A collection of programming patterns in Unity with examples when to use them. These are primarily from the book "Game Programming Patterns," but translated from C++ to C#
Stars: ✭ 272 (-5.56%)
Mutual labels:  unity, unity3d, design-patterns
Svelto.ecs
Svelto ECS C# Lightweight Data Oriented Entity Component System Framework
Stars: ✭ 605 (+110.07%)
Mutual labels:  ecs, unity, game-development
Voxelman
Unity ECS + C# Job System example
Stars: ✭ 1,086 (+277.08%)
Mutual labels:  ecs, unity, unity3d
Unity resources
A list of resources and tutorials for those doing programming in Unity.
Stars: ✭ 170 (-40.97%)
Mutual labels:  ecs, unity, game-development
Entitas Sync Framework
Networking framework for Entitas ECS. Targeted at turnbased games or other slow-paced genres.
Stars: ✭ 98 (-65.97%)
Mutual labels:  ecs, unity, game-development
Ecs
ECS for Unity with full game state automatic rollbacks
Stars: ✭ 151 (-47.57%)
Mutual labels:  ecs, unity, unity3d
Uecs
Ubpa Entity-Component-System (U ECS) in Unity3D-style
Stars: ✭ 174 (-39.58%)
Mutual labels:  ecs, unity3d, game-development
Actors.unity
🚀Actors is a framework empowering developers to make better games faster on Unity.
Stars: ✭ 437 (+51.74%)
Mutual labels:  ecs, unity, unity3d
Firefly
Unity ECS example for special effects
Stars: ✭ 489 (+69.79%)
Mutual labels:  ecs, unity, unity3d

EcsRx

EcsRx is a reactive take on the common ECS pattern with a well separated design using rx and adhering to IoC and other sensible design patterns.

Build Status Code Quality Status License Nuget Version Join Discord Chat Documentation

Features

  • Simple ECS interfaces to follow
  • Fully reactive architecture
  • Favours composition over inheritance
  • Adheres to inversion of control
  • Lightweight codebase
  • Built in support for events (raise your own and react to them)
  • Built in support for pooling (easy to add your own implementation or wrap 3rd party pooling tools)
  • Built in support for plugins (wrap up your own components/systems/events and share them with others)

The core framework is meant to be used primarily by .net applications/games, there is a unity specific version here which is currently being ported over to use this version.

Installation

The library was built to support .net standard 2.0, so you can just reference the assembly, and include a compatible rx implementation.

Quick Start

It is advised to look at the setup docs, this covers the 2 avenues to setup the application using it without the helper libraries, or with the helper libraries which offer you dependency injection and other benefits.

If you are using unity it is recommended you just ignore everything here and use the instructions on the ecsrx.unity repository as that has not been fully mapped over to use this core version yet so is its own eco system until that jump is made.

Simple components

public class HealthComponent : IComponent
{
    public int CurrentHealth { get; set; }
    public int MaxHealth { get; set; }
}

You implement the IComponent interface which marks the class as a component, and you can optionally implement IDisposable if you want to dispose stuff like so:

public class HealthComponent : IComponent, IDisposable
{
    public ReactiveProperty<int> CurrentHealth { get; set; }
    public int MaxHealth { get; set; }
    
    public HealthComponent() 
    { CurrentHealth = new ReactiveProperty<int>(); }
    
    public void Dispose() 
    { CurrentHealth.Dispose; }
}

Any component which is marked with IDisposable will be auto disposed of by entities.

Simple systems

public class CheckForDeathSystem : IReactToEntitySystem
{
    public IGroup TargetGroup => new Group(typeof(HealthComponent)); // Get any entities with health component

    public IObservable<IEntity> ReactToEntity(IEntity entity) // Explain when you want to execute
    {
        var healthComponent = entity.GetComponent<HealthComponent>();
        return healthComponent.CurrentHealth.Where(x => x <= 0).Select(x => entity);
    }
    
    public void Process(IEntity entity) // Logic run whenever the above reaction occurs
    {
        entity.RemoveComponent<HealthComponent>();
        entity.AddComponent<IsDeadComponent>();
    }
}

Systems are conventional, so there are many built in types like IReactToEntitySystem, IReactToGroupSystem, IManualSystem and many others, but you can read about them in the docs/systems, you can add your own conventional systems by extending ISystem and systems are handled for you by the ISystemExecutor.

Check the examples for more use cases, and the unity flavour of ecsrx which has more examples and demo projects, and drop into the discord channel to ask any questions.

Running Examples

If you want to run the examples then just clone it and open examples project in the src folder, then run the examples, I will try to add to as the library matures.

There are also a suite of tests which are being expanded as the project grows, it was written with testability in mind.

Note on infrastructure/view namespaces and going forward

This library started out as a unity specific project but has moved to a generic .net library, due to this the movement of functionality from the unity layer down into the core has been incremental.

We are now at a point where the underlying infrastructure module (mainly for EcsRxApplication and dependency injection notions) has been added, and the generic view module has been moved here. While both of these libraries offer a stepping stone to get up and running quicker they unfortunately are not as easy as just including and off you go.

The examples folder shows examples on how to create your own application implementations, but hopefully once things have been ironed out in the whole Rx world this area will improve more as we start to add another layer which will let you just drop in and go (like the unity version).

If you want to know more about this drop into the discord chat and we can discuss more.

Docs

There is a book available which covers the main parts which can be found here:

Documentation

This is basically just the docs folder in a fancy viewer

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].