I do everything server side. That fixes things like speed hackers, item hacking etc. My process is like this


  • create an array of connections that contain things like a pointer to an entity, the particular connection id to the client that it refers to, etc..
  • when a client connects i choose an empty array slot, fill it with there information (which i get from a local database that contains player information, such as name, type, health, mp etc.)
  • I then send the info to all clients including the one just created, so that they can update there connection arrays. I also send all previous connected clients information to the new one so it stays up to date.
  • the server than goes through a loop with a variable that repeatedly counts to a specific number than goes back to zero. every time it hits different numbers it does different updates, so lets say it goes to 10, it will go from 0 to 10 thne restart, at 5 it will request key presses, at 10 it will update all connections positions etc. All of the while the server is doing the moving and interacting of all the objects.
  • create an array of connections that contain things like a pointer to an entity, the particular connection id to the client that it refers to, etc..
  • when a client disconnects, the server sends a message to every client that the client with that id has disconnected, and the clients and the server itself all remove that players connection list entry.
  • on a side note while all this is going on the client is also looping through the connections and moving entities to the estimated positions that they should be, this helps eliminate some of the choppyness, and i know samauri and flit know this but inferno, thats called dead-reckoning. If you want to get some decent theory, locoweed a long time ago made a tutorial about mp games with a6.22 its on the aum resource site. It is usesless code wise, but may give you a lot of idead mp theory wise.



That about sums it up. its not too complicated. I do some dead reckoning, and it is not a great idea to have the 1 in 10 frame updates for twitch games, but Im making an orpg and it works fine for that.

Last edited by lostclimate; 08/18/09 13:05.