Note that there are some explanatory texts on larger screens.

plurals
  1. POAdvice on writing a scalable real time turn based strategy game using websockets and node.js
    text
    copied!<p>I'm planning to write a real time turn based strategy game server ontop of node.js using websockets. I will be catering to modern browsers with good html5 support and am not too concerned with backwards compatibility.</p> <p>The games served will each be played/observed by a small number of players at a time (say 2-10) and will have a clock timer as used in chess and as implemented at www.chess.com. The timed games will last an hour at most &amp; there may also be the option of playing non-timed games.</p> <p>The servers will take care of the players' ratings, players' friend lists, as well as managing running/finished game state, and running the game clocks. The game state will just be a bit of json, and will be a few kilobytes at most per game.</p> <p>One constraint is that <strong>all</strong> of the actual game logic <strong>must</strong> take place on the clients, not on my servers. Because of this I need a mechanism by which if a client signals an illegal move, either because it or its opponent is malfunctioning/malicious, then an unrelated client or clients (i.e. somebody else using my site) will have the game state loaded up into their browser in the background and the dispute will be settled there.</p> <p>That about sums up my requirements.</p> <p>This is not a toy project, and I am hoping to have many users, so I would like to think about backend architecture and scalability up front. I am not particularly knowledgeable about node.js or website deployment in general, so any advice or insights vis a vis architecture, technologies/libraries, scalability/proxying/load-balancing, how to implement the clock and deal with latency issues, where/how to store game state, etc, much appreciated. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload