{"id":65,"date":"2012-07-06T14:45:11","date_gmt":"2012-07-06T12:45:11","guid":{"rendered":"https:\/\/blogs.scummvm.org\/jakimushka\/?p=65"},"modified":"2022-04-18T07:10:55","modified_gmt":"2022-04-18T05:10:55","slug":"savefiles-embedding","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/jakimushka\/2012\/07\/06\/savefiles-embedding\/","title":{"rendered":"Savefiles embedding"},"content":{"rendered":"<p>It&#8217;s needed to make a recording self-sufficient and independent from save files. At the moment, user should make following sequence of actions to playback loaded game:<\/p>\n<ol>\n<li>choose game<\/li>\n<li>select playback record<\/li>\n<li>press &#8220;Playback&#8221; button<\/li>\n<li>in pop up dialog box select is it need to load from savegame.<\/li>\n<li>if loading from savegame choosed, show load game dialog<\/li>\n<\/ol>\n<p><!--more--><\/p>\n<p>After I implement this feature, 4th and 5th steps will be removed. Also, will be sufficient only recording file to playback the gameplay. Will not be necessary to share save file.<\/p>\n<p>At first glance, it&#8217;s easy to implement this feature: just current save file during the recording and give it to<br \/>\nengine during the playback. But it&#8217;s not so easy to do, using the current engine API.<\/p>\n<p>First of all, every function related to saving and loading works only with slot numbers and save files name generation is different for each engine, so our function can&#8217;t get filename of current save. I&#8217;ve tried to solve this by adding the virtual funtion getSaveFileName to engine class. Anyway, this function is in every engine in different forms: somewhere it part of loading function, somewhere it&#8217;s separate function, but it exists in any engine. So, i think it&#8217;s a good idea to make an unificated interface for it.<\/p>\n<p>Next issue is to load savefile from recording. As I said above, we can load savefiles only by their slot number. There was to ways to solve it: write procedure which loads game state from given stream or create some virtual slot used only for recordings. First way requires to large code rewriting, so we chosen second.<br \/>\nI&#8217;ve almost implemented it, and now I&#8217;m doing testing and fixing a bugs. Hope to show a demo soon.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s needed to make a recording self-sufficient and independent from save files. At the moment, user should make following sequence of actions to playback loaded game: choose game select playback record press &#8220;Playback&#8221; button in pop up dialog box select is it need to load from savegame. if loading from savegame choosed, show load game [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-65","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/jakimushka\/wp-json\/wp\/v2\/posts\/65","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/jakimushka\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/jakimushka\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/jakimushka\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/jakimushka\/wp-json\/wp\/v2\/comments?post=65"}],"version-history":[{"count":2,"href":"https:\/\/blogs.scummvm.org\/jakimushka\/wp-json\/wp\/v2\/posts\/65\/revisions"}],"predecessor-version":[{"id":67,"href":"https:\/\/blogs.scummvm.org\/jakimushka\/wp-json\/wp\/v2\/posts\/65\/revisions\/67"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/jakimushka\/wp-json\/wp\/v2\/media?parent=65"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/jakimushka\/wp-json\/wp\/v2\/categories?post=65"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/jakimushka\/wp-json\/wp\/v2\/tags?post=65"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}