I just want to share this with you. I started a beginners how to use an entity system with a simple game example.
The idea is that you can copy paste the code and read some explanations why and the like.
Very well written, I always thought ESes were a lot like scene graphs. Now I see how completely wrong I was… One question though, I don’t think you mentioned it, but are there any performance gains compared to the classic way of doing things?
There can be. But much of the time the structure off the app is so different that it’s hard to decide why. Rethinking processes into data-oriented approaches often has a performance benefit. Not as much in Java (definitely performance boosts in natively compiled languages with respect to cache-coherency, etc)… but there are still some benefits.
And the fact that multithreading is free and lock-free can be a big boon also.
Very great. I got to know about Zay-ES framework. Thanks
So for your Systems you extended AbstractAppState and for your Components (which are classes with just variables and setters and getters ) you implemented EntityComponent . Am i right?
The next thing I get is how ZayES approach is different from JME’s controllers.
Actually in JME when we add one controller to some spatials it create new instance of same controller for each spatial and the update method for each spatial is triggered from main loop of game. [and every spatial has an ArrayList which contains its systems (controllers).]
But with Zay-ES the approach is different than controllers [actually we have no controller and just use AbstractAppState for systems.]. So for every system we just have one instance of that system (extension of AbstractAppState) and in its update method we loop through all the entities which have that system and do our logic … . Am I right ?
Yes I think you got the idea pretty well. And exactly I implement EntityComponents. In the next article I will show the famous decay system and its usage. On it.
Note: while I haven’t read the articles yet (hope to soon), if you would like to host these on the Zay-ES wiki in github then I can probably make that happen (give permissions, etc.).
would love to see them on Zay ES side. Maybe there we should do it in a more serious format lesser in a story. Maybe.
I’m not finished yet. I also would like to hear what you think of my example as you did all that once explain it to me
If you send me your github user I will see about setting up wiki permissions.
Maybe not… if we put them in a more story-oriented section then it could be fine. I haven’t read them, though… so maybe they are crazy and I will change my mind. But it doesn’t sound like an issue on the surface.
ia97lies is as well my github username. Ok have a look. I think to port them to Zay ES is probably only copy past as it is all in markdown. You can change/correct it any time either
Be aware I’m not finished yet. I think 3 more at least will follow to bring that penny’s dropped effect it had to me.
I was thinking maybe we can have a user stories section for stuff like this. As we tease out useful advice then we can build more ‘documentation-like’ pages that have that direct advice perhaps with forward/back links to the stories about why.
yeah I like that idea. I would make it similar to the jme beginners section actually. so my blog articles should have good names on zay es side. in the blog I tried some funny ones, well I thought they are
I will look tomorrow at your invited now I need some sleep first.
As well I started to work on the Zay ES Wiki currently just copy pasted my markdowns from the blog. But I will polish a little more and make them more a wiki text than a blog like article.