I'm working on a basic roguelike using HTML5 and jQuery, and I've come across a problem.
The way the game currently stands, the system only saves the game state every time the user moves between floors - to minimize overhead. The peril of this is that, if the user gets in trouble, they can simply close the window and return to their game at the beginning of the current floor. This drastically reduces the difficulty of the game (and almost defeats the purpose of a roguelike) - but it's unreasonable to save the game state with every single player movement or attack.
I've researched ways to save the game state on browser window close, but I'm not happy with them. My question is this: assuming "saving a game state" means a moderately heavy ajax/post request, how do I thwart this cheating behavior? Is there a known methodology to quantify incremental/procedural changes to a 2d map, as opposed to saving the entire map state? Please note, I'm not asking for "the most efficient way" - I'm looking for existing methodologies to rectify my inexperience.
Thanks in advance for your input - if there's a way I can word this better, please let me know.