Jump to content

Replays after saving - unreplayable


radopenev
 Share

Recommended Posts

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-session0ADGoldIsland.thumb.png.0c89800d4f9a4bb9f7c238737a98c747.png

AllCommands.tar.gz

Edited by radopenev
Link to comment
Share on other sites

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 by Guest
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by radopenev
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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'...?

 

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. 

  • Thanks 1
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

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.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

  • Thanks 1
Link to comment
Share on other sites

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. ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...