radopenev Posted November 4, 2018 Report Share Posted November 4, 2018 (edited) AllCommands.tar.gzHi! According to #3963 ,from bug tracker "...the replay will end with the disconnect and a new one will be written starting after the connect, containing only turns after that time....means the replay will become unreplayable" My question is: in new command.txt "will be written starting after the connect, containing only turns after that time"(?) if I'm correct ? Let's define : * start-commands.txt - the turns before saving the game-session *end-commands.txt - the turns after saving the game-session which is exactly unreplayable and the appending of start-commands.txt and end-commands.txt turns will solve the problem? Something like attachments.... the new one commands.txt is result of appending .... but it NOT solving nothing ... replay is go, but final is not the same like new game-session AllCommands.tar.gz Edited November 4, 2018 by radopenev Quote Link to comment Share on other sites More sharing options...
Guest Posted November 4, 2018 Report Share Posted November 4, 2018 (edited) Your methodology is correct. But you missed one little detail. IIRC, the replay after the save would have turns as starting from turn 0. After appending the two files, you would need to offset turn numbers of the last replay. So that the files would be continued. Easiest way to do it would be to write a script which adds the number of turns in the first replay to all turn numbers in the second one. Edited November 4, 2018 by Guest Quote Link to comment Share on other sites More sharing options...
radopenev Posted November 4, 2018 Author Report Share Posted November 4, 2018 (edited) Hi! Triplicarius, as you can see, from the attachments, the offset of turn numbers is OK ..... the script was written before posting... Edited November 4, 2018 by radopenev Quote Link to comment Share on other sites More sharing options...
Guest Posted November 4, 2018 Report Share Posted November 4, 2018 The replay file had some errors. I assume they were introduced by the script. There are two "end"s being next to each other. Which should never happen. Same with some stray "turn"s. Quote Link to comment Share on other sites More sharing options...
radopenev Posted November 4, 2018 Author Report Share Posted November 4, 2018 (edited) Can you show me a numbers of the "end"s which are next to each other.... please ? ... p.s. regex( turn(.*)\nturn end\nend ) search show me nothing sorry, I can not reply , forum-admin say: "You have reached the maximum number of posts you can make per day.", may be because I'm new user and can only edit old posts, so yes: Replay not playing out as the real game finishing. To the saving moment everything is OK( no news here), but after that "scenario" happens not like the real game, definitely.... and final is tragedy! Edited November 4, 2018 by radopenev Quote Link to comment Share on other sites More sharing options...
Guest Posted November 4, 2018 Report Share Posted November 4, 2018 Apparently, there weren't any such things. Must have been an editor issue or something. Anyway, my script generated the same result. So, it should work. What exactly is the issue here? Replay not playing out as the real game? Quote Link to comment Share on other sites More sharing options...
radopenev Posted November 5, 2018 Author Report Share Posted November 5, 2018 The first, may be my mistake - lets explain what exactly is the issue here!?! * game: singel player * save game and reopen after that and finish successfully in the replay folder: 1) dir / commands.txt; metadata.json/ to the saving moment 2)dir/ commands.txt; metadata.json/ from the saving moment to the end Replay 1) start and go OK... but 2) for the reasons described on #3963 is unreplayable! OK .... I want to make 2) replayable *According to #3963 and Let's define : * start-commands.txt - from 1) *end-commands.txt - from 2) which is exactly unreplayable *remove "header" of 2) and get everything after/ "turn"s,"end"s,"cmd"s *set the offset of turn numbers in 2) like continued of 1) ( from the (last number of 1))+1 .....to the end) * change command.txt from 2) with the new commands.txt generated from start-commands.txt and (end-commands.txt modified) Finally start replay 2) ..... Replay not playing out as the real game finishing. To the saving moment everything is OK( no news here), but after that "scenario" happens not like the real game, definitely.... and final is tragedy! Quote Link to comment Share on other sites More sharing options...
Guest Posted November 8, 2018 Report Share Posted November 8, 2018 Seems like this is the result of a known bug. The AI cant be deterministically serialized. Not really relevant here, but the AI would behave differently in a 1 hour game to a game that you saved and loaded at 30 minutes. Quote Link to comment Share on other sites More sharing options...
Gurken Khan Posted November 8, 2018 Report Share Posted November 8, 2018 9 hours ago, (-_-) said: Seems like this is the result of a known bug. The AI cant be deterministically serialized. I don't know what bug that would be. And I'm too dumb uninformed to understand your second sentence. Does the AI play a role in replays? I would expect a replay to do just that, replaying what was recorded, and that no 'decision making' would be necessary for that. Besides that I sometimes don't even have a replay of my last game, maybe that would explain at least a part of what I consider 'rubbish replays'...? Quote Link to comment Share on other sites More sharing options...
Guest Posted November 8, 2018 Report Share Posted November 8, 2018 1 minute ago, Gurken Khan said: Does the AI play a role in replays? I would expect a replay to do just that, replaying what was recorded, and that no 'decision making' would be necessary for that. Replays just contain the commands people/bots sent out. All remaining stuff has to be calculated just like a regular game. In the end, its just the same thing which doesnt allow rejoining a multiplayer game with bots. It would go out-of-sync. Bot cant go back to its pre-save state after loading the game. In this case, a pre-save and post-save replay is added together. And the game went oos silently. Unlike the loud oos in multiplayer. Atleast, thats what I think happpened. Quote Link to comment Share on other sites More sharing options...
Gurken Khan Posted November 8, 2018 Report Share Posted November 8, 2018 Thanks. I think I have an idea what you mean. If everything is re-calculated in replays, can't that lead to inconsistencies? Like a unit surviving an attack during the game, while in the replay it might die because in that calculation it took more damage? Quote Link to comment Share on other sites More sharing options...
Silier Posted November 8, 2018 Report Share Posted November 8, 2018 Hi, @Gurken Khan. Short answer is no. Unit will not survive in replay if did not survived in game. Taken and recieved damage will be exactly the same and AI deceisions too. Since game is not saved / loaded during playing all is exactly the same. Even events based on random values will get the same result, as random seed value is the same for game and its replay. 1 Quote Link to comment Share on other sites More sharing options...
Servo Posted November 8, 2018 Report Share Posted November 8, 2018 If you play a game then you save it say halfway or maybe minute 30. Then you reload the saved game continued playing It for 5 minutes then you quit the game. If you replay that 5 minutes the game start from the base beginning (1 CC with 9 units), why is it like that? Quote Link to comment Share on other sites More sharing options...
Silier Posted November 8, 2018 Report Share Posted November 8, 2018 As @(-_-) mentioned above, replays contain only set of commands, that are executed. They do not contain the state of the game when they have been created. Replay manager assume every replay starts from the scratch. That means from new game. Quote Link to comment Share on other sites More sharing options...
Gurken Khan Posted November 18, 2018 Report Share Posted November 18, 2018 Sooo... Let's assume I had three 'replays' which together I guessed would be the replay of my last game. last_replay.zip What would I have to do to make that a working replay? Quote Link to comment Share on other sites More sharing options...
Guest Posted November 18, 2018 Report Share Posted November 18, 2018 You would have to concatenate the three files (like put one just after the other) and fix the turn numbers. Which is pretty much adding the turn count of the first replay to the turn numbers of the current replay. However, it seems doing this with AIs result in the game going oos silently due to the above mentioned bug. Quote Link to comment Share on other sites More sharing options...
elexis Posted November 18, 2018 Report Share Posted November 18, 2018 On 11/8/2018 at 6:19 PM, (-_-) said: Replays just contain the commands people/bots sent out Replays only contain command sent by human players. The commands AI players order are determined at runtime and are not present in the replayfile. On 11/8/2018 at 6:35 PM, Gurken Khan said: If everything is re-calculated in replays, can't that lead to inconsistencies? Like a unit surviving an attack during the game, while in the replay it might die because in that calculation it took more damage? The Pyrogenesis engine is deterministic, which means in theory the replay should always compute the same state and serializing/deserializing (=rejoining a multiplayergame or saving+loading a game) should too. If it computes a different state sometimes, it's an "Out-of-sync" error, which is one of the worst errors that can happen and a release-blocker bug as it breaks multiplayer games and replays. In order to verify that there is no such error, the simulation state is hashed (you can see the hash in multiplayer replay files commands.txt). I'm wondering if we shouldn't add hashing for singleplayer replays too for that purpose (replay integrity). AI bots are not deterministic, they are Out-of-sync, because they create new plans upon each deserialization (savegame loading, multiplayer rejoin), rather than serializing and deserializing their plans. Fixing that is important as we can't play multiplayer games with AIs currently - players will drift into parallel universes when playing with AI currently if one of the players rejoins the match. (Also performance of AI is tough) 6 hours ago, Gurken Khan said: What would I have to do to make that a working replay? Replays starting from savegames will probably work with my patch hack linked above. If you're not familiar with patching and reading code, lobby to have me commit this replay+load commandline option, otherwise wait (possibly some years, or put a high enough price on the feature for devs to prioritize finding some solution). Notice that savegames can be 2-10MB or something each, so there can be an accumulation problem if its stored for every replay starting from a savegame and every replay of a match starting from a rejoin. Otherwise that what smiley said. 1 1 Quote Link to comment Share on other sites More sharing options...
Gurken Khan Posted November 18, 2018 Report Share Posted November 18, 2018 @(-_-) @elexis Thanks for your answers. Why can't 0AD 'simply' continue the replay file when a game is loaded/rejoined? Clearly, having one (working) replay is what I'd want after a game, and not this current fragmented sh state of things. Quote Link to comment Share on other sites More sharing options...
elexis Posted November 19, 2018 Report Share Posted November 19, 2018 17 hours ago, Gurken Khan said: Why can't 0AD 'simply' continue the replay file when a game is loaded/rejoined? Because the savegame of that point is not saved to the disk and hence can't be loaded before the replay starts. 1 Quote Link to comment Share on other sites More sharing options...
Gurken Khan Posted November 19, 2018 Report Share Posted November 19, 2018 1 hour ago, elexis said: Because the savegame of that point is not saved to the disk and hence can't be loaded before the replay starts. Hope you bear with me for a bit! I don't know if your statement is true for all cases or just mp-clients? Clearly the game saves the, uh, gamesave at some point? The replay I posted above had three parts. So I guess I saved two times during the game? What is saved then? And when I load a game, what is loaded? 0AD knows which specific game I am loading/rejoining, so why can't it 'simply' load and continue the files of that game? Quote Link to comment Share on other sites More sharing options...
elexis Posted November 20, 2018 Report Share Posted November 20, 2018 When you click on "save", you get the savegame. The replay still doesnt know which savegame relates to which replay file - with the patch above you can load them by hand. When you rejoin a multiplayer game, the server sends you a savegame which is loaded into memory and forgotton. 1 Quote Link to comment Share on other sites More sharing options...
Gurken Khan Posted November 20, 2018 Report Share Posted November 20, 2018 3 hours ago, elexis said: The replay still doesnt know which savegame relates to which replay file mkay. My 'simple' suggestion here would be to tell ~it, so the replay can be loaded and continued. 3 hours ago, elexis said: When you rejoin a multiplayer game, the server sends you a savegame which is loaded into memory and forgotton. There are most likely totally valid reasons why the savegame is forgotten; else I'd 'simply' suggest to remember and continue that... And that's probably how deep I will have ventured into this topic. Quote Link to comment Share on other sites More sharing options...
elexis Posted November 20, 2018 Report Share Posted November 20, 2018 Currently at 100+ cleanup commits 1 Quote Link to comment Share on other sites More sharing options...
gameboy Posted November 25, 2018 Report Share Posted November 25, 2018 @mimo Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.