First questions first: Is anyone working on a ECS ...
# korge
t
First questions first: Is anyone working on a ECS for this? I haven't even checked the most basic tutorial so I have to read up more... Anyways, have a great day, guys!
d
Whats ECS?
t
SO, ECS stands for Entity Component System and is a way to not use the main game loop in a game engine, not directly. So entities would be very tiny objects, basically only containers for Components that hold data. So a component could be for instance "Transformation" containing x,y,z and rotation. Another component could be "PlayerComponent" or "SpriteCOmponent".
Then you write systems that do stuff with all entities that have a certain set of these components. For libgdx there is an ECS system called Ashley and for Flash games there used to be one called Artemis
So it is a way to structure the game code to make very isolated systems that manage large amounts of entities based on their components. One system, again, could be a physics system, updating the box2d world, for instance.
So one system updates box2d world, another takes those changes and updates all transform components for all entities, then a third system takes all transformations and paints the textures at the correct positions, etc etxc.
I just really like the concept and perhaps it is even built into the engine already, I have no idea...
d
There is a view tree. Each view has a transformstion and defines how to render
Then you can attach components to those views
So maybe the views are the entities, and the system is what the renders stuff? If thats the case maybe we are already doing it. But didnt know there was a name for it
t
Hehe. It sounds a bit like what you are doing is a view graph or something like that, this is even more general than just for rendering. I will look into it some and if it is something that is needed I might give it a go to write one. Its not super compelx
complex
d
Okay. Ty 👍
r
@Tommie Nygren do you have any progress with ECS in korge? We're going to discuss the ECS approach and maybe implement it soon in korge