Jump to content
Sign in to follow this  
radopenev

Replays after saving - unreplayable

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

Share this post


Link to post
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 (-_-)

Share this post


Link to post
Share on other sites

Hi!

 :)Triplicarius, as you can see, from the attachments,  the offset  of turn numbers is OK :)

..... the script was written before posting...

Edited by radopenev

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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?

Share this post


Link to post
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!

Share this post


Link to post
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.

Share this post


Link to post
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'...?

 

 

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
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

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×