Started a Blog Series how to use an Entity System

Fixed. Thanks for the correction at least you read it :smile:
EDIT: the bullet snipped I have to investigate, don’t understand the messed markup.
EDIT: Fixed both now.

1 Like

Just wanted to say: I am very glad you make this. :chimpanzee_smile:

A year ago I wanted to learn about ES via websites and blogs - but everything was rubbish or not detailed enough. So I really hope to finally find some good material on that subject.

I’m just not ready to start with ES right now, but I will in a while (maybe some 1 or 2 months or so).

1 Like

I really enjoyed the blog. I only briefly heard about entity systems as I am new to jme, and thought they really could only applied for certain games. However I now see they can pretty much be implemented practically in any game. Only thing I still have to wrap my head around is the use of AbstractAppStates vs AbstractControllers as Ali_RS tries to explain.

1 Like

control vs app state: control cares for one object only and is some kind of a ego perspective. app state in a ES environment is the similar but you don’t care only for your own but for all objects, so it is kind a “we” perspectiv.
maybe that helps


damn son, your blog be blowing up the internet…

This website is under heavy load

We’re sorry, too many people are accessing this website at the same time. We’re working on this problem. Please try again later.

1 Like

His original site or the new one?

Articles are being moved to the Zay-ES wiki… which is github. When github is down we are all sad pandas.

1 Like

logdown problems :frowning: github is fine. glad to move it there :smile:

1 Like

A couple random things after skimming through it…

  1. it’s screaming for some screen shots. :smile:

  2. for the ship, you can use a WatchedEntity and avoid the ‘set of one’ thing you’ve got going on.

…hmmm… I guess I haven’t released a version with that in it yet so it’s only available when building from source. So maybe wait I guess if you are trying to be compatible with the downloadable release.

1 Like

Also, the writing style is very conversational “I this” “you that” which is good for a tutorial. But because it’s so personal with all of the “I” it reads like a blog (which it should I think) and so maybe deserves to have you introduce yourself at the beginning. Maybe we make that a regular thing where other authors can also present their own case studies. It also may remove some of the pressure to be 100% ‘correct’ on all points.

The other thing I missed was a link at the bottom that took me to the next article.

Edit: and by introduction, I mean something like “My name is **** and I’m developing a *** and got turned onto ES because ***” kind of thing. Just a short intro and slight ‘sales pitch’ as to what originally got your excited about an ES.


Sounds like good idea. I will do some introduction my self this evening. Add links to prev next tutorial. I didnt know about that watched entity thing. May I ask you for a sample or a linkt to one, maybe a test or the like?
As well then the beginners section should be renamed to case studies.

1 Like

Note: new releases are up that include WatchedEntity:

You grab a WatchedEntity in a similar way to an entity set except that you give it a specific entity ID.

WatchedEntity ship = ed.watchEntity(shipId, Position.class, Model.class);

You can then use it exactly like any other Entity, calling set/get on it. In this case, if the entity doesn’t have a component then get() will return null.

Where it differs from a regular entity is that you can call applyChanges() on it to get the latest component values.

It’s precisely designed to cover cases like the player avatar, player status, player ship, etc… the thing you will know you have exactly one of and need to deal with that one thing directly and using an EntitySet of one item is clumsy.


Cool blog! It’s clean, organized and clear! Keep up the good work, I like your tutorials!

And BTW, here’s a video that also explains this “component based architeture” very well. Just for inspiration xD


I added an about section for my person and a “Previous” | “Next” Link for easier navigation to the Zay ES wiki: Case Studies.
EDIT: Feel free to change it or correct it. Or just tell me what I should change/correct/move/remove :smile:

Maybe I will add some screen shots and model pictures to the zay es wiki for my case study.

1 Like

Update: I released my 5th article. As well I added it (slightly changed) to the Zay ES wiki:

Stay tuned, I planed a 6th article to show how I deal with effects like explosions.

As well I thought of kind a “design” pattern catalogue for ES, I would like to have that on the Zay ES wiki in a more technical way. I will come back to that pattern idea as soon as I have something to show up.

1 Like

Good as the other parts. However there is a set of typos in the last snippet, you stream attackingParts with entity name “damagingPart” but then try to reference it in he block as “attackPart”.

Also do you have any plans down the road to look at zay-es-net? It would be cool to see a tutorial on that aswell sometime :smile:.

Many thanks for your feedback. yeah I renamed the damageing to attack while writing this last one and now I ended up in inconsistent naming :frowning: howevere it should work.
I will overhaul it this evening and try to eleminate the typos…

and yep Zay ES Net case study would be cool. maybe I could do a two player mode with two ships.
but to be honest I have no clue how to design that with Zay Es Net. So currently I do not have plans to do but who knows…

fixed and tested. should now work at least the collision state.

I asked because I am looking at zay-es-net for my game, I actually just got back to looking at it today. If I get any example going ill be sure to share it.

Unfortunately, the best example is still MonkeyTrap.

…though with JME 3.1 this is even simpler as there is a service model. I think I wrote about this in another thread.