This is actually the biggest networking issue. I have been wondering about that too... Especially in the context I plan on programming my engine (game engine separated from game library). I have found out that there were two primary ways to network a game.
First way is to do it like Quake 2, Quake 3 and Half-Life. Those games dont really send entities over the network... What they do is send what the client will notice. The client is only a renderer, so the server will take the client input, and in return it will send the sounds, the visual effects and some dummy entities with their model names, positions, angles, velocity (all basic characteristics).
Pros:
- The client does not need the game code, you can have server-side only modifications
- The game code does not need to do any networking, you just have to program your entity code and voila.
Cons:
- Reduced level of client-side prediction, cannot predict custom client input
- If the game code registers console commands, they cannot be called on the client side without being parsed by the server
- The game code is limited, visual effects have to be defined in the engine or in downloadable files
- Lots of network traffic, you need to regularly send all entities the client can see
Second way is to basically network all entities... Or network them using common actions that can be performed between entities (movement, using another entity, etc). An update needs to be sent everytime something changes. It can be hard to know when something is actually happening.
Pros:
- True client-side prediction, possibly smoother on the client machine
- Possibly less network traffic than method 1
- The game library can extend the engine behavior alot, it can define effects, register client-side console commands etc
- Entities are less limited... You can, for example, have more than one model per entity
- Possibility to create a distributed server system since clients actually run a true simulation of what happens on the server
Cons:
- The clients need the game library, you can hardly download it from the server, this implies no server-side only mods
- More complicated, the game code has to do some networking, it becomes harder to program entities
Obviously, its very complicated to network a game. Each of these two methods has qualities and inconvenients. The problem we have is actually having two computers speak with each other and describe a complete game world.
To conclude... If you want to keep things simple, make a single-player game, its MUCH easier... If you wish to network your game, you need to decide of how you will do everything since the start... You can't network a game when the engine is half-way done and didnt have any start of network support.
Looking for a serious game project? www.xgameproject.com [edited by - Max_Payne on October 28, 2003 1:55:16 PM]