https://kotlinlang.org logo
#korge
Title
# korge
t

Tommie Nygren

06/08/2020, 11:44 AM
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

Deactivated User

06/08/2020, 12:04 PM
Whats ECS?
t

Tommie Nygren

06/08/2020, 12:06 PM
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

Deactivated User

06/08/2020, 12:09 PM
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

Tommie Nygren

06/08/2020, 12:12 PM
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

Deactivated User

06/08/2020, 12:13 PM
Okay. Ty 👍
r

RezMike

07/02/2020, 1:53 PM
@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