by Spike » Tue Apr 01, 2008 11:37 am
This nearly reminds me of Total Annihilation.
For the uninitiated, Total Annihilation is a peer-to-peer real-time strategy game.
Basically, each client runs the units belonging to the local player, with the other clients seeing copies of those units. There's some sort of interpolation in there too, to keep it smooth.
The effects of lag in this game proves to be fairly interesting. Other people's units that are killed by you linger after death until your client has told the other player's client that you just hit them for X damage, and for their client to tell yours that they've actually died. Until that response, their unit will continue moving around shooting at stuff.
In your mod's case, the server ultimately controls all units, preventing any manipulation by lag (aka: invincible units).
Your mod is still a pure client/server architecture. The server owns all units. If a unit is destroyed by another unit ('enemy dead'), then the server will be removing the unit shortly anyway. Entities required for 'Shooting and everything' are never known by the server, so can be removed freely.
If the 'unit dead' event is the same unit, but morphed, you can spawn an explosion where the unit died. On the plus side, you can extend the remove/spawn grace period. :)
So, if a unit is killed locally, set its health to 0 and wait for the server to kill it properly. This is safest when it comes to prediction inaccuracies anyway, and may prevent inaccuracies from building up further.
.