Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualDeortuka

Posted 16 March 2013 - 09:45 PM

I came up with a very simple way of getting around this issue in my engine when I realized I would have two maps loaded (one for server side calculations and one for client rendering) on the client that was hosting the server. I decided to treat all map resources (maps, models, textures, entities, etc...) as a set of data separate from the client and the server. If the client is connecting to a remote server, it uses the "global" data set to maintain it's copy of the server set. If a server is running as dedicated, it uses this "global" data set to update the game state. If a client is hosting a multiplayer or running a single player game (i.e. connecting to a local server), the server-side code will modify the "global" data set and the client-side code will read from it.

 

Edit: I noticed you came up with the same idea after I wrote this. I recommend that you go for it.


#2Deortuka

Posted 16 March 2013 - 09:41 PM

I came up with a very simple way of getting around this issue in my engine when I realized I would have two maps loaded (one for server side calculations and one for client rendering) on the client that was hosting the server. I decided to treat all map resources (maps, models, textures, entities, etc...) as a set of data separate from the client and the server. If the client is connecting to a remote server, it uses the "global" data set to maintain it's copy of the server set. If a server is running as dedicated, it uses this "global" data set to update the game state. If a client is hosting a multiplayer or running a single player game (i.e. connecting to a local server), the server-side code will modify the "global" data set and the client-side code will read from it.


#1Deortuka

Posted 16 March 2013 - 09:38 PM

I came up with a very simple way of getting around this issue in my engine when I realized I would have two maps loaded (one for server side calculations and one for client rendering) on the client that was hosting the server. I decided to treat all map resources (maps, models, textures, entities, etc...) as a set of data separate from the client and the server. If the client is connecting to a remote server, it uses the "global" data set to maintain it's copy of the server set. If a server is running as dedicated, it uses this "global" data set to update the game state. If a client is hosting a game, the server-side code will modify the "global" data set and the client-side code will read from it.


PARTNERS