Code Monkey home page Code Monkey logo

ecsrx's Introduction

EcsRx

Join the chat at https://gitter.im/grofit/ecsrx Issue Tracking In Style at https://zenhub.com

EcsRx is a reactive take on the common ECS pattern with a well separated design and support for dependency injection (if you want it).

New Info!

We have now also got a real-world example to view @ grofit/ecsrx.roguelike2d

There is also a simple example of a plugin to view @ grofit/ecsrx.buffs

Dependencies

  • UniRx (All)
  • Zenject (Unity Bridge)

The core framework only depends upon UniRx however the unity bridge part of the framework depends upon zenject, however feel free to create your own unity bridge to consume the core framework if you do not want the dependency.

Features

Core

  • 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 and systems and share them with others)

Unity Bridge

  • Simple unity conventions to follow (if you dont like it, easy enough to roll your own)
  • Built in support for editor viewing and editing of components
  • Built in support for dependency injection via Zenject
  • Lots of extension and architectural helpers to help MonoBehaviours interact with the core framework
  • Plays nicely with scene first style setups

Installation

You can take the unitypackage installation file from the relevent release, there are 2 files.

  • EcsRx.Core.unitypackage
  • EcsRx.Unity.unitypackage

The Core package contains the pure project files which are required for the framework to function.

The Unity package contains a wrapper around the Core framework and some unity helpers, this will be built upon going forward.

Quick Start

  • Install both the above packages
  • Install Zenject
  • Install UniRx

Then assuming you are using the unity bridge project just look at one of the example projects and follow the conventions in there. You will ultimately need to create a SceneContext from Zenject then register the DefaultEcsRxInstaller and any of your own installer classes. Then create an your own implementation of EcsRxContainer where you can setup your systems and entities.

Much like any other ECS implementation you have the notion of entities (IEntity), components (IComponent) and systems (ISystem), although there are a few types of systems which you can implement based upon your needs, check out the docs folder for more information on these subjects as its more than just a 1 liner.

Running Examples

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

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

Docs

See the docs folder for more information. (This will grow)

HEADS UP

This was not designed with performance in mind, it should be performant enough for most scenarios, and given its reactive nature and decoupled design you can easily replace implementations at will, but as lots of people love performance metrics etc, I have none and have put performance secondary to functionality.

ecsrx's People

Contributors

bezarius avatar gitter-badger avatar grofit avatar timmeh4242 avatar

Watchers

 avatar

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.