Anyway, maybe someone can give me some insight to this. I'm using Artemis Entity System (http://gamadu.com/artemis/) which is pretty easy to setup and use and I have really become a big fan of it. Now I have implemented the *most* simple client/server using Kryonet (server trusts the clients, clients just send positional updates at ~30 times per second, server distributes updates to the other clients, you know the drill), which also works fine.

But here comes the "problem". I'm not 100% sure about my way of implementation in regards to the entity system, because what I do now is:

* Client and Server both have their own entity system world (server runs on another thread). - Client sends positional update to the server (I know, I know ). - Server receives update and updates the corresponding entity (the player) the moment it receives the update. - Server sends the update to the clients and they update the entity the moment they receive it

Now the last 2 parts are what concerns me. I don't know if that is the right way to go about networking in an entity system. If you tried an entity system you know the systems iterate through their components on every frame and *then* do their magic. I'm just not sure how to implement an "this-entity-received-an-update-so-update-it-on-the-next-turn" system.

I know it doesn't really matter in "the most simple client-server-game-thing", performance-wise, but I want to know the "correct" way to go about this.

Maybe someone here has done something like this before and can give some insight into this?

Basically, whenever I create a specific type of entity, I add it to a tree. Both in Client and Server. Works the same way.When you receive a package that applies "Move X to the right", search for the entity in the tree and make your changes to it. Remember to always use thread-safe collections and consider that your networking events shouldn't change the order of the updates or change whatever is already built..

Don't think it has a huge performance impact anyway. Shouldn't be much slower than adding it to a queue and have the component update on the next system-iteration. Listening to myself, it's probably faster :p

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org