This page is still WIP!
About
This page serves as a rubric for development on our ECS branch. Be aware that as the ECS branch is under active development, the information on this page may be out of date or in need of revision.
What is ECS?
ECS is an architectural pattern, you can read about it on wikipedia.
Why do we want ECS in OpenDiablo2?
As of writing, much of our engine code is tightly coupled. It makes writing tests or re-using code fairly difficult. An ECS implementation will resolve this issue because systems in an ECS architecture are decoupled via the components they use.
What ECS framework are we using?
We have developed our own called Akara.
Please read the akara README for the most up-to-date info regarding basic usage.
Development Guide
Everything in this section needs to be adhered to. PR's will not be merged if they violate anything described herein.
Systems will contain a d2util.Logger and a unique logger prefix
Graphical systems must be implemented as a Scene system
Please read about scene systems here.
Every component should also declare a concrete component factory
This is important because it reduces noise in our code by keeping us from constantly casting akara.Component to the concrete component implementation.
here is an example Color component:
And here is the concrete component factory for this component
File locations
At the time of writing:
- all systems belong in
d2core/d2systems/
- all components and component factories belong in
d2core/d2components/