egordorichev / LastTry

:deciduous_tree: LastTry is open-source game written in Java, using LibGDX library and inspired by Terraria :deciduous_tree:
MIT License
118 stars 17 forks source link

Entity-Component-System [Discussion] #111

Closed pollend closed 6 years ago

pollend commented 6 years ago

I would like to propose implementing an ECS model. Instead of an inheritance scheme from entity -> character and Entity -> player you would just have an Entity and each entity is described but the components used. The behaviour of each entity would be dictated by the components used to describe that entity. You basically have a collection of systems that manipulate the Entity based of what components each entity has. An Entity may have a location component that describes the location/rotation of the entity. The render will use the LocationComponent to determine where to draw the Entity. We would need to figure out the base components that would be used by LastTry and how they will behave for each system.

Wikipedia:

Examples: https://github.com/libgdx/ashley https://github.com/junkdog/artemis-odb

egordorichev commented 6 years ago

Sooo, big update here. The project is not dead. I'm working on it on the remake branch, implementing something like https://github.com/libgdx/ashley . I enjoy this pattern, thanks for pointing me onto it ;)