{"id":3645,"date":"2019-09-27T08:30:13","date_gmt":"2019-09-27T00:30:13","guid":{"rendered":"https:\/\/www.gridsagegames.com\/blog\/?p=3645"},"modified":"2019-09-27T08:30:13","modified_gmt":"2019-09-27T00:30:13","slug":"quicksaving-restore-points","status":"publish","type":"post","link":"https:\/\/www.gridsagegames.com\/blog\/2019\/09\/quicksaving-restore-points\/","title":{"rendered":"Quicksaving and Restore Points"},"content":{"rendered":"<div data-tag=\"post-content\">\n<p>For me, permadeath is a huge part of the roguelike experience. When you make enough mistakes that you lose--that&#8217;s it, it&#8217;s over. No immediately starting from a safe checkpoint not long before in order to try again, no in-game benefits carrying over to future attempts. Each run is an isolated attempt in which you&#8217;re armed only with your knowledge and experience, where the lack of second chances clearly raises the stakes, and the consequences of each and every action feel that much more meaningful compared to games where you can simply say &#8220;oh well whatever I&#8217;ll just load my last save.&#8221; Taking on added risks has an all new meaning that fundamentally changes one&#8217;s approach to decision-making.<\/p>\n<p>In that vein Cogmind has been strict on permadeath for its seven years of history to date, but things are [sorta] changing&#8230;<\/p>\n<p>Cogmind today is a much longer game than it used to be (or at least it can be depending on play style and goals), and some people don&#8217;t have the time or desire to be punished by losing a lot of progress\/time to their mistakes, or maybe they simply don&#8217;t have the time to spare but are still eager to enjoy more of the game. These are the same people for whom <a title=\"Adjustable Difficulty\" href=\"https:\/\/www.gridsagegames.com\/blog\/2017\/02\/adjustable-difficulty\/\">multiple difficulty settings<\/a> were added a couple years ago. It&#8217;s an important form of accessibility, and while it isn&#8217;t for me, features like difficulty levels have added a lot of value for a decent chunk of players (no doubt after even more people discover them following the <a title=\"Rebranding Difficulty Modes\" href=\"https:\/\/www.gridsagegames.com\/blog\/2019\/09\/rebranding-difficulty-modes\/\">latest visibility improvements<\/a>).<\/p>\n<p>The same can be said about the ability to save and load progress. If an additional subset of players can better enjoy a roguelike once they have the ability to easily load a save slot, then adding such a feature seems like a good idea already.<\/p>\n<p>People more inclined to want or need this feature are already more likely to do their own save scumming anyway, so why not make it easier? Well, technically there are arguments on both sides of this issue, both sides with merit, so for Cogmind I&#8217;ve ended up opting for a middle ground on this particular feature.<\/p>\n<p>So yes, Cogmind is getting it&#8217;s very own save\/load feature.<\/p>\n<p>But it&#8217;s &#8220;middle ground&#8221; because this feature is not included in the highest difficulty setting, Rogue mode. I decided I want to preserve that mode as the &#8220;intended\/designed way to play,&#8221; and a significant chunk of people who will enjoy the Rogue setting in the first place are going to be into the challenge of traditional roguelikes and permadeath anyway.<\/p>\n<p>The two <em>other<\/em> difficulty modes, on the other hand, both support the designation of an arbitrary save point which can be restored at any time.<\/p>\n<p>When in either Adventurer or Explorer mode, the game menu displays two new buttons for controlling the &#8220;restore point.&#8221; \u00a0As you can see below, if there is a previously saved point to load, the load button becomes available and shows both the location and turn number to be restored.<\/p>\n<div id=\"attachment_3646\" style=\"width: 480px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2019\/09\/cogmind_saveload_game_menu.gif\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-3646\" class=\"wp-image-3646 \" title=\"Cogmind Adventurer\/Explorer Mode Save\/Load Access (game menu)\" alt=\"cogmind_saveload_game_menu\" src=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2019\/09\/cogmind_saveload_game_menu.gif\" width=\"470\" height=\"420\" \/><\/a><p id=\"caption-attachment-3646\" class=\"wp-caption-text\">Accessing the save and load feature from the game menu.<\/p><\/div>\n<p>The feature is also accessible via keyboard without the menu, simply by using Ctrl-F8\/F9 as quicksave\/load buttons while in the main UI.<\/p>\n<p>In terms of architecture, Cogmind was of course already capable of saving runs to be continued later, and even arbitrary input-based saving and loading because I rely on it heavily for testing and debugging. From there it eventually became a Wizard Mode feature available to some <a title=\"Kyrati's Patreon\" href=\"https:\/\/www.patreon.com\/Kyzrati\">patrons<\/a> starting earlier this year. But the next step was a big one--debugging and wizardry are fine with some limitations or quirkiness, whereas a public feature needs to be accessible and robust!<\/p>\n<p>For one, saving and loading need to also be available from the game over screen, in case the run ended prematurely but the player wants to go back and try again from their save point. So that was yet another expansion to that screen, adding a new row to the bottom if and when that option is available.<\/p>\n<div id=\"attachment_3647\" style=\"width: 477px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2019\/09\/cogmind_saveload_gameover_menu.gif\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-3647\" class=\"size-full wp-image-3647  \" title=\"Cogmind Adventurer\/Explorer Mode Save\/Load Access (game over)\" alt=\"cogmind_saveload_gameover_menu\" src=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2019\/09\/cogmind_saveload_gameover_menu.gif\" width=\"467\" height=\"543\" \/><\/a><p id=\"caption-attachment-3647\" class=\"wp-caption-text\">Restoring a save point from the game over screen.<\/p><\/div>\n<p>For convenience that also displays the save point&#8217;s depth and map (if the latter is known to the player).<\/p>\n<p>Overall there were a surprising number of technical considerations behind building a quicksave system that would be compatible with the rest of the game design. It ended up taking a couple days to work through all the possibilities.<\/p>\n<p>Like the game already maintains a save file for the current run, the one that is restored if you exit the game and come back later--should this manual save override that? No, that would conflict with one of the goals of having a manual save in the first place: to be able to go back to an <em>earlier<\/em> point than the most recent progress. Clearly this needs to be a separate file, meaning this system exists outside the normal save system.<\/p>\n<p>So if you die and never explicitly made a save point to recover, this approach would imply that&#8217;s the end of the run there&#8217;s no option to go back. To prevent that situation, I implemented &#8220;automatic manual save&#8221; behavior, whereby if the player has made no save point of their own, at the beginning of each new map the game fills their optional save slot with one automatically. That way if they lose, the game over screen will still present them with the option to load back to that point despite having set no recover point of their own. (Also rather than blindly saving on each new map the game is somewhat smart about it and will skip the save if the player is in very bad shape :P) Anyway, allowing players an opportunity to &#8220;try that last map again&#8221; is possibly a good way to learn without having to go all the way back to the beginning.<\/p>\n<\/div>\n<div data-tag=\"post-content\">On top of that file we also have the previously implemented periodic autosaves--backups in case a save file somehow gets corrupted (but more often for debugging purposes), and the save file used for time travel (yes that&#8217;s how that feature is implemented :P), so together with this new type, there are now four different possible types of save files for the current run!One of the other quirks of the new quicksaves is that they&#8217;re <em>only valid in the current run<\/em>. In other words, once you start a new run the save point from a previous run is no longer accessible--that would get rather confusing, suddenly switching back to a different run, and it would cause a number of other problems too, so I had to put that restriction in place.Altogether the save system is a little different than what&#8217;s found in non-roguelike games, since it was designed to work alongside the original &#8220;run-based system with automatic resuming on return&#8221; more common in traditional roguelikes, while combining the benefits of each.<\/p>\n<p>I&#8217;m pretty sure that even though it&#8217;s now an &#8220;official feature&#8221; of two of the three difficulty modes, runs that have been quickloaded will be excluded from the leaderboards.<\/p>\n<p>The HUD also got a new indicator that pops up in the top-right corner when applicable, showing the number of times the current run has been manually loaded so far.<\/p>\n<div id=\"attachment_3648\" style=\"width: 559px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2019\/09\/cogmind_saveload_HUD_loaded_count.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-3648\" class=\"size-full wp-image-3648 \" title=\"Cogmind Adventurer\/Explorer Mode Load Count Reminder (HUD)\" alt=\"cogmind_saveload_HUD_loaded_count\" src=\"https:\/\/www.gridsagegames.com\/blog\/gsg-content\/uploads\/2019\/09\/cogmind_saveload_HUD_loaded_count.png\" width=\"549\" height=\"193\" \/><\/a><p id=\"caption-attachment-3648\" class=\"wp-caption-text\">The load counter as it appears in the HUD, here having manually restored to an earlier point twice before on this run.<\/p><\/div>\n<p>And for those who want to play Adventurer\/Explorer modes but <em>don&#8217;t<\/em> want to even have the quicksave option available to them (to avoid the temptation to use it), I added a new advanced config option to disable that feature entirely, in which case the hotkeys won&#8217;t work and none of the relevant buttons will appear.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>For me, permadeath is a huge part of the roguelike experience. When you make enough mistakes that you lose&#8211;that&#8217;s it, it&#8217;s over. No immediately starting from a safe checkpoint not long before in order to try again, no in-game benefits carrying over to future attempts. Each run is an isolated attempt in which you&#8217;re armed [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":3648,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[140,4,134,159],"class_list":["post-3645","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-design","tag-accessibility","tag-cogmind","tag-difficulty","tag-permadeath"],"_links":{"self":[{"href":"https:\/\/www.gridsagegames.com\/blog\/wp-json\/wp\/v2\/posts\/3645","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gridsagegames.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gridsagegames.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gridsagegames.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gridsagegames.com\/blog\/wp-json\/wp\/v2\/comments?post=3645"}],"version-history":[{"count":3,"href":"https:\/\/www.gridsagegames.com\/blog\/wp-json\/wp\/v2\/posts\/3645\/revisions"}],"predecessor-version":[{"id":3677,"href":"https:\/\/www.gridsagegames.com\/blog\/wp-json\/wp\/v2\/posts\/3645\/revisions\/3677"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gridsagegames.com\/blog\/wp-json\/wp\/v2\/media\/3648"}],"wp:attachment":[{"href":"https:\/\/www.gridsagegames.com\/blog\/wp-json\/wp\/v2\/media?parent=3645"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gridsagegames.com\/blog\/wp-json\/wp\/v2\/categories?post=3645"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gridsagegames.com\/blog\/wp-json\/wp\/v2\/tags?post=3645"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}