Entity System - Networking

Heya,

I know

etc. etc. :smiley:

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 :D).
  • 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?

Thanks a lot :slight_smile: