Organizing your data in client and server
I'm going to make a simple multiplayer game and after reading articles here on GameDev.net and Gamasutra as well as googling a bit I've realized that I have basic understanding of many aspects (motion prediction, protocols etc.) but have a problem with deciding on how to organize my data structures inside the client and server process. I've been thinking about making a general Entity class that would know how to move based on position, velocity, acceleration etc. and derive classes like Starship that would be able to rotate, shoot etc. Quite easy when making a game for a single computer, but those classes should be different on client and server. For example the server should store the time the last state update of a certain entity was sent, the client doesn't need this. How are you dealing with this? Are there any articles that I've missed? Maybe it's the problem with my little experience with OO programming... I'm going to look for some source code of simple multiplayer games out there on the Net, but those usually are written by beginners like myself, so I'd like to hear a few suggestions. -- Cinus Pospolitus
Have one struct called actor, and once called proxy_actor.
The proxy is for the client and is mirroring the state of the real actor on the server, it should also provide functionalty for directing userinput requests back to the actor on the server.
In addition dependiong on how you implement it, it can also handle stuff like a pointer to its 3dmodel and such.
As for articles there is one about this kind of stuff in GPG3 by Thor Alexander, there is also an extended version of it in his book.
The proxy is for the client and is mirroring the state of the real actor on the server, it should also provide functionalty for directing userinput requests back to the actor on the server.
In addition dependiong on how you implement it, it can also handle stuff like a pointer to its 3dmodel and such.
As for articles there is one about this kind of stuff in GPG3 by Thor Alexander, there is also an extended version of it in his book.
Shields up! Rrrrred alert!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement