Hi,
Hmm.. I am currently going through different designs of game server back-ends and it gets me wonder: how would you scale single-threaded server?
What comes to my mind atm. is that if the server is made using back-end like node.js would it be possible to start e.g. 4 node.js processes which all are executing the same game server program? (to benefit from amount of cores available).
I noticed that this is called "clustering" in node.js or something.
Nevertheless, the problem which troubles me is the fact that I think (?) I cannot control which of these processes are getting the requests and I would like all of the players from 4 different processes to be able to interact in a same virtual world through websockets. That leads to a question that has anyone done anything similar?
Hence, I had also an idea of using redis as an intermediate to store the game state, so all processes can read/write to it:
redis
process 1 -- | -- process 2
process 3 -- | -- process 4
But that would still mean that each of these processes has their own game loop and it confuses me concerning the interactions? when player i and j stands next to each other they could come from process 1 and 2... can they even collide like that? :wacko: any ideas? thus, couldn't find any material of using multiple server-side game loops like this.