node.js storing gamestate, how?

Posted by expressnoob on Stack Overflow See other posts from Stack Overflow or by expressnoob
Published on 2011-01-15T20:04:27Z Indexed on 2011/01/15 23:53 UTC
Read the original article Hit count: 161

I'm writing a game in javascript, and to prevent cheating, i'm having the game be played on the server (it's a board game like a more complicated checkers). Since the game is fairly complex, I need to store the gamestate in order to validate client actions.

Is it possible to store the gamestate in memory? Is that smart? Should I do that? If so, how? I don't know how that would work.

I can also store in redis. And that sort of thing is pretty familiar to me and requires no explanation. But if I do store in redis, the problem is that on every single move, the game would need to get the data from redis and interpret and parse that data in order to recreate the gamestate from scratch. But since moves happen very frequently this seems very stupid to me.

What should I do?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about database