Jump to content
Posted 24 September 2012 - 07:25 PM
Posted 24 September 2012 - 11:51 PM
Edited by TheDespite, 24 September 2012 - 11:59 PM.
Posted 25 September 2012 - 06:27 AM
Posted 25 September 2012 - 11:32 AM
Posted 25 September 2012 - 04:09 PM
In a typical game, you load the same data on client and server sides, but you "stub out" the graphics-related subsystems on the server, so they don't actually load/keep the graphics data in memory, and the server doesn't actually spend time rendering. A good way of stubbing is to use dependency injection. In C++, this is done through pure abstract base classes; in Java, it's done through interfaces; etc.
I think you absolutely want to have the "physics" data on the clients, too, so that you can give proper UI cues when the client tries to give commands that would walk through a wall or whatever.
If the server generates "secret" data (like the hand of cards in poker) then that should not be sent to the clients until they are supposed to see the data. This may include things like the actual presence of randomly-spawned mobs, for example. However, the location of spawn points and percent chance of spawning ("map data") that may only be useful on the server, can be loaded on the client without ill effect, if it makes the data format and code simpler. It'll just do nothing on the client.
Posted 25 September 2012 - 09:04 PM
Posted 29 September 2012 - 03:23 PM
Edited by KnolanCross, 29 September 2012 - 03:25 PM.