Websockets allow bi-directional connection between client and server.
This would avoid server pooling and make the interface much more responsive.
It could also be used to implement in-game chat.
Any thoughts on this ?
There is a theory that all applications end up being chat applications. I would rather this application remains doing one thing and one thing well which is allow the playing of terraforming mars online.
As for using the WebSocket API. That would work fine, it may also have the benefit of separating the display logic from the game logic. A web server would be needed and a web socket server. This would add a lot of complexity for a turn based game. When I originally wrote this I figured it would operate like words with friends where turns could be spaced hours apart. Using the web socket api would assume most games were taking place in real time. The polling and HTML usage I think strikes a good balance between games taking place with quick turn around times and longer turn around times.
There is a theory that all applications end up being chat applications. I would rather this application remains doing one thing and one thing well which is allow the playing of terraforming mars online.
As for using the WebSocket API. That would work fine, it may also have the benefit of separating the display logic from the game logic. A web server would be needed and a web socket server. This would add a lot of complexity for a turn based game. When I originally wrote this I figured it would operate like words with friends where turns could be spaced hours apart. Using the web socket api would assume most games were taking place in real time. The polling and HTML usage I think strikes a good balance between games taking place with quick turn around times and longer turn around times.
As far as I'm concerned, I play real time games most of the time.
Having the display logic from the game logic would also help a lot to better grasp how things are working together, it is often very difficult for me to fathom what is running on the server side vs what is running on the client side.
I agree this will add a lot of complexity for something working already fine.
Most helpful comment
There is a theory that all applications end up being chat applications. I would rather this application remains doing one thing and one thing well which is allow the playing of terraforming mars online.
As for using the WebSocket API. That would work fine, it may also have the benefit of separating the display logic from the game logic. A web server would be needed and a web socket server. This would add a lot of complexity for a turn based game. When I originally wrote this I figured it would operate like words with friends where turns could be spaced hours apart. Using the web socket api would assume most games were taking place in real time. The polling and HTML usage I think strikes a good balance between games taking place with quick turn around times and longer turn around times.