monofuel / badmars

html5 multiplayer rts game
https://japura.net/badmars
Other
4 stars 1 forks source link

Refactor net/client.ts #53

Open monofuel opened 6 years ago

monofuel commented 6 years ago

as the difference between units server-side and client-side are increasing (eg: is the unit visible, or the factory build queue) and it's getting harder to keep track of changes to units over time, sending changes to the user should be refactored.

possible solution: Have the server have a 'gameState' property that has some of the properties of the client-side GameState, that gets synced periodically with the client.

monofuel commented 6 years ago

This would also mean that the majority of websocket events could be simplified to either 'gameState' (for full state) or to 'gameStateDelta' (for modifications of the game state)