Entity structure for 3d-game - what´s best?

Hello everyone,

I am pretty new to the Jme, but I have done XNA and Libgdx for simple 2d-game development before.
Anyways, this year my friend and I are starting a project for school and we´ve decided to do a 3d-game with the Jme. As this is our first relatively big game project, we are unclear about the way we should handle entities in Jme. Up to now, we handled them in a typical entity hierarchy or once used our own entity component system.
As we go along learning Jme, we recognized the concept of Controls, which are added to the Spatials. So my question now is, if this type of controlling the game entities will do it for a middle sized game (should be a little survival game with focus on cel-shading - nothing too fancy), or we should better use an entity-component system (i thought of something similar to the Artemis framework). For the latter approach I am a little bit unclear, how to implement an ECS in Jme, because I don´t know how to combine it with the scenegraph structure.

Anyways, any good recommendations?
Btw. sorry for my English

The original concept of jME is to use Controls, and it allows creating arbitrary complex games, even if you go without a ECS. However, there is a ECS made specifically for jME! It is called Zay-ES, I am using it in my current project and it is very enjoyable!

PS: also, here is my recent question on this: Zay-ES and JMEs Controls

1 Like

Thanks for your quick answer, so i took a look at the documentation of the ECS and it is nearly what i wanted. But i have some questions still:
It is logical that adding a spatial to a component is no good idea, but how would I implement a graphical component then, because all the graphical objects have to be attached to the scenegraph in order to get rendered (and therefore i need a spatial for every entity to be rendered if i understood this right). Furthermore, if i see the entity as the model, wouldn’t it be a little bit much of an overhead to create a new appstate as a view for the model?
Sorry if i understood sth wrong, just took a quick look - i will read more tomorrow.

Such a situation is common when dealing with ECSs. Actually there is a number of ways dealing with that. For a concrete example, look at the examples: https://code.google.com/p/jmonkeyplatform-contributions/source/browse/trunk/zay-es/examples/#examples I am sure, after a while you could invent at least a couple of ways of doing that, consistant with the ECS paradigm

Ahh ok thx, now i got a few things
Just storing a string in a component to identity the appropriate spatial with it, i try thinking for a similar solution.
Still, i am thinking of using a traditional entity hierarchy (altough i know the cons), because relevant games(like minecraft) show that it is possible to come up with a nice design (correct me if minecraft uses some other entity design-but bukkit definitely uses no ECS).
What’s your opinion? I think you have more experience.

If you are talking about Voxel Engines, I would ask @pspeed to join us, because he’s developing Mythruna based on it’s own ECS Zay-ES. I’m very interested on this discussion, because I have my questions about it, but since this is a Game Design question related, I need to read more about it before wishing to join in a discussion.

Anyway, I’m watching this thread closely :sunglasses: .

You can use Controls (and AppStates) as simple Systems in your ES that do scenegraph-related tasks based on the entity / component info. E.g. a Control that starts the actual animation on the model or things like that.

So after thinking more about our game, I´ve decided to use a classic entity hierarchy, although it´s not as flexible as an ECS and can lead to code duplication, or diamond of death, and so on…
But for my project this should do it, but I will definitely come back to this topic some other time.
Maybe I will figure out my own little entity system, to be in full control of what fits my needs. But first, I need to get more experience with Jme.

Anyways, thanks for the help :sweat_smile: .