Rate my client/server structure
Posted: Tue May 22, 2018 3:30 pm
Greetings denizens,
I'm making my first game in LÖVE for a school project. It's a 2d shooter, a remake of Stick Soldiers 2. I want to have online multiplayer, so it has client and server components. Both use the same 'Game' object. Game has a 'getState' method which grabs the status of each in-game object (xy coords, which weapons each player has, how much ammo/capacity each weapon has, etc.). Game also has an 'unpackState' method that, for each part of the state passed in, it updates or creates the corresponding object in the game.
Right now I'm running getState on every update on the server side, and sending it to the client, who runs 'unpackState' on their end. This is waaaaay too slow, but I'm not sure what the best way to make it good??? Help???
I'm making my first game in LÖVE for a school project. It's a 2d shooter, a remake of Stick Soldiers 2. I want to have online multiplayer, so it has client and server components. Both use the same 'Game' object. Game has a 'getState' method which grabs the status of each in-game object (xy coords, which weapons each player has, how much ammo/capacity each weapon has, etc.). Game also has an 'unpackState' method that, for each part of the state passed in, it updates or creates the corresponding object in the game.
Right now I'm running getState on every update on the server side, and sending it to the client, who runs 'unpackState' on their end. This is waaaaay too slow, but I'm not sure what the best way to make it good??? Help???