Topic: Replay savegame not loadable: Clarification
| jmoerschbach   Topic Opener | Posted at:
        
            
    2020-06-19, 14:14 UTC+2.0 Hi, regarding https://www.widelands.org/forum/topic/4755/?page=8#post-33564 and Github issue #3945 I need help understanding some fundamental requirements regarding replays and savegames. So here is what I know/think:we have 2 separate directories for save-files in .widelands: "replays" and "save". Whenever the player saves a current game, it is placed under "save" (both multiplayer and singleplayer games that are manually saved). But there is no manual "save as replay" afaik. So, the game creates automatically (in a specific interval?) files under "replays" while playing. In the code, we have an  In loadOrSaveGame.cc (which is the basis of all loading screens) we differentiate according to this enum and create different flavors of the savegameTable/savegameLoader which only shows the files of the "right" type. We have 3 different "entry points" for getting into a loading screen from the menu: 
 The first two look into "save" folder (but showing only single player save games, that is  Is this behaviour generally accepted so far? It is quite a while this way already and nobody complained  Now the tricky part as far as I understand:When watching a replay (Watch Replay and then select a file), the "player" (more specifically: the spectator) can once again save the replay. This results in a new savegame file located in "save" folder but with gametype=4 which is  So, from my point of view, we have now an invalid file in "save" folder which is filtered out and not displayed (as described above). Thus, my big question to you guys is: What is the purpose of saving a replayfile again? And why is it saved in "save"-folder but with  Currently, I am not convinced that we have a bug here, rather a different behaviour many people seem to be used to. However, if I understood something wrong, please let me now and I'll be happy to fix  
            Edited:
            
                
    2020-06-19, 14:22 UTC+2.0
            
          Top  Quote | 
| Nordfriese   | Posted at:
        
            
    2020-06-19, 14:35 UTC+2.0 
 Correct 
 When you start a game (or load one), the game will create a savegame immediately under ~/.replays (xyz.wrpl.wgf). Additionally a replay stream (xyz.wrpl) will be written during the game containing info about the playercommands sent while playing. 
 Yes, this is what it should be like. There are sometimes comments that it would be nice to be able to load SP games as MP and vice versa, but this would not work out of the box in all cases and is not a big problem, so changing this behaviour is not worth the effort imho. 
 It used to be possible to continue a game saved from within a replay like a multiplayer savegame. That's no longer possible. This is what the bug is about as I understand it … 
 … however, for debugging lengthy replays it would be very nice to change this behaviour instead to create a new replay by using the save button that is equal to the running replay starting at the point of the save. E.g. when debugging a bug in a ten-hours replay, I always have to resume watching from the start in every debugging session which is very annoying. Watching the first nine hours once, then hitting Save, and then being able to watch the remaining hour over and over again would be a nice feature. I suggest to change the use of the Save button like this. Probably not trivial though.  Top  Quote | 
| jmoerschbach   Topic Opener | Posted at:
        
            
    2020-06-19, 14:49 UTC+2.0 
 This must be confirmed from more people I think. I still do not get it completely to be honest. Is this then used as some kind of recovery if a multiplayer game crashed and the replay is somehow "misused" as an automatically saved game? 
 Yes, I get you, full ack. Not quite sure if this is complicated. The "save-algorithm" must be adapted to save a replay to "replays" and otherwise to "saves".  Top  Quote | 
| Nordfriese   | Posted at:
        
            
    2020-06-19, 14:54 UTC+2.0 
 I have no idea what this is useful for. I guess you can use it to undo a playing mistake if you have no backup savegame available – but other than that I don't see a real reason to have this feature. Otherwise I wouldn't have proposed replacing it…  Top  Quote | 
| niektory   | Posted at:
        
            
    2020-06-19, 15:06 UTC+2.0 It's sometimes useful for debugging, I used it once or twice.  Top  Quote | 
| kaputtnik   | Posted at:
        
            
    2020-06-19, 17:53 UTC+2.0 In the past it was always possible to create a savegame from a replay and afterwards load it again. Otherwise the possibility for saving a replay makes no sense at all  Sometimes one may want to play a foreign replay from a specific point on as a normal game. Just to compare if he would make some things better than the player in the replay.  Top  Quote | 
| WorldSavior   | Posted at:
        
            
    2020-06-19, 18:38 UTC+2.0 
 +1 
 It's an extremely valuable feature. It can always be used to create a savegame when autosave fails or if savegames are broken, which also happens. If replays work properly (which is finally the case after b19) the feature can replace autosave partly. It's just very useful to be able to create for every match a replay for any second when you wish. You can then look closer at any settlement in the game at any time. What's the point of removing a feature - especially a great feature? 
 For example, yes 
 I wouldn't call it misuse, it provides excellent backup to savegames. 
 No. If you save from a replay, it's like you save a game, so the file has to go to the save folder. How do you want to easily load a savegame from the replay folder? The save files in the replay folder are used to load a replay. 
 But this would be a very good additional feature! With another button for example. 
 By the way, as the feature is missing because of the regression bug currently: Is there a simple way to convert a LAN-savegame and a Savegame-from-replay into usable Multiplayer savegames? 
            Edited:
            
                
    2020-06-19, 18:41 UTC+2.0
            
         Wanted to save the world, then I got widetracked  Top  Quote | 
| niektory   | Posted at:
        
            
    2020-06-19, 20:46 UTC+2.0 
 You can unpack the savegame (it's a ZIP archive) and open the   Top  Quote | 
| jmoerschbach   Topic Opener | Posted at:
        
            
    2020-06-19, 21:37 UTC+2.0 Pull request is up: https://github.com/widelands/widelands/pull/3948 From my point of view, it is a workaround though. There should never be a file in "saves" with gametype=kReplay (gametype=4). So when loading a replay via "Watch replay" and then saving it, gametype should be correctly set to the correct value. Don't know how much work this is... When a replay is successfully loaded via single/multiplayer load menu (possible on the new branch) and then once again saved, its gametype is changed... After all, it looks a bit messy to me   Top  Quote | 
| WorldSavior   | Posted at:
        
            
    2020-06-20, 21:29 UTC+2.0 
 Thanks 
 Currently "4" is the correct value ; ) 
 Why would one load a replay in single/multiplayer? 
 Those problems could (and should ? ) be fixed by "there aren't 4 different types of saves, but just one" Wanted to save the world, then I got widetracked  Top  Quote | 

 
         
		 
		 
		 
		
 
  
 
