Tuesday, June 17, 2014

Server Side Player Properties

An after effect of our server side overhaul is that the game now has a database full of ship, weapon, and projectile configurations. This means the server can pull data from there and send the properties to players upon game starts. In conjunction with the client side GUI to configure a ship, we have a good system going for multi-player games.

The only real issue was wrestling with the timing of script execution, construction, and threads. This caused some issues where the client was not updating its properties when the server sends the data due to the script not existing and therefore not listening for the event. When that happened, the event just disappeared. Unity does allow for script execution ordering but that would not have fit my case as the GameManager Singleton and the SmartFox Client Controller needed to send and receive events before, during, and after other scripts. Therefore, I rolled some code in the C# scripts to time events the way they would work with our system.

No comments:

Post a Comment