Errors in replays of reloaded games

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
SlowThinker
Posts: 876
Joined: November 28th, 2008, 6:18 pm

Errors in replays of reloaded games

Post by SlowThinker »

this is the original text, obsolete
I loaded a replay of a MP game that was reloaded, and values of some WML variables are doubled.
It looks like a prestart event went twice, and the variables weren't cleared at the beginning of the 2nd run.
Does anybody know more about this problem?

(A note: The game was saved 3 times / reloaded 2 times: The replay of the 1st savefile is correct. The replay of the 3rd savefile (a twice reloaded game) got the problem too, and the values are not tripled, just doubled.)

(I searched the forums for similar problems, and found this one:
The GRAND TAG! - a 2vs2 Tournament, 2nd Edition
But this problem didn't happen to me, there is only one [replay] and one [replay_start] in my savefile.)
--------------------------------------------------------

The problem:
Replays of some scenarios produce OOS errors if they were saved and reloaded in the middle of the game:
you save in point (A) then load it and save in point (B). Then you try to replay (B) but you get errors.

(It happens especially (but not only) with add-ons that create random variables by "rand=")
Edit: It looks like a clear and simple bug:
I ran this test: I saved a game (let's name the savefile save_1), loaded it and saved immediately (save_2). As I said above, the replay of save_1 works, the replay of save_2 doesn't work.
One would suppose save_1 and save_2 should be almost identical, but they aren't:
  • in save_1 the container replay_start.variables is empty
  • in save_2 the container replay_start.variables is not empty (and contains all variables probably)
If you empty the container replay_start.variables then the replay of save_2 works correctly.

(tested with 1.8.5 + 1.9.3, Win XP Pro)

More info: https://gna.org/bugs/?19258

for scenario creators - how to prevent this bug has any effect
Put this code just in the [multiplayer] tag (i.e. create multiplayer.variables)

Code: Select all

[variables]
	dummy=
[/variables]
Explanation: If you save in point (A) then load and save in point (B), then BfW snapshots all the variables in point (A) and add them to the save of (B). The replay of (B) starts from the very beginning, but with variables from point (A). The code above just clears all variables in the beginning of a scenario.
Last edited by SlowThinker on February 1st, 2012, 1:28 am, edited 2 times in total.
I work on Conquest Minus • I use DFoolWide, Retro Terrain Package and the add-on 'High Contrast Water'
I moved to Nosebane's corner (Doc Paterson's signature); I am spending my time there, so PM me if I don't answer your post in forums
SlowThinker
Posts: 876
Joined: November 28th, 2008, 6:18 pm

Re: Errors in replays of reloaded games

Post by SlowThinker »

For players:
How to correct a savefile of a reloaded game, so that the replay works
Load the savefile into a text-editor (if the savefile is packed then you need to unpack it first)
Your goal is to find the following section in the text...

Code: Select all

[replay_start]
	---a block of text here---
	[era]
		---a block of text here---
	[/era]
	[side]
		---a block of text here---
	[/side]
	... [side] is repeated several times
	[side]
		---a block of text here---
	[/side]
	[variables]
		---you need to empty this--- 
	[/variables]
[/replay_start]
... and to delete 'you need to empty this' (many lines of text may be there). Then the text should look like

Code: Select all

...
	[/side]
	[variables]
	[/variables]
[/replay_start]
...
Edit: added info in the starting post
I work on Conquest Minus • I use DFoolWide, Retro Terrain Package and the add-on 'High Contrast Water'
I moved to Nosebane's corner (Doc Paterson's signature); I am spending my time there, so PM me if I don't answer your post in forums
MCP
Posts: 518
Joined: May 23rd, 2005, 5:23 pm
Location: California

Re: Errors in replays of reloaded games

Post by MCP »

This can be fixed very easily. Please fix it someone.

Playing a local game, there were a few times my friend and I stopped and reloaded later.

I manually did it:
1. gunzip replay
2. Find [replay_start] and find [variables], note start line number (Line 13448 in the example file)
3. Now find [/replay_start] and go backwards, finding [/variables], note end line number (Line 27426 in the example file)
4. Delete everything in between start and end lines.
5. gzip replay text

Start watching replay and it works.

Undo previous changes, re-watch replay, OOS appears on turn 1 after pressing start.
Attachments
SXRPG_EvilDead_Zeus_MCP_Expert_replay.gz
Original file
(367.53 KiB) Downloaded 144 times
SXRPG_EvilDead_Zeus_MCP_Expert_replay_good.gz
Manually correct file
(335.21 KiB) Downloaded 148 times
SlowThinker
Posts: 876
Joined: November 28th, 2008, 6:18 pm

Re: Errors in replays of reloaded games

Post by SlowThinker »

MCP wrote:This can be fixed very easily. Please fix it someone.
The bug is waiting for a fix already, see a link to gna.org in my first post.
(Also Mabuse can prevent the bug in the SXRPG add-on.)
I work on Conquest Minus • I use DFoolWide, Retro Terrain Package and the add-on 'High Contrast Water'
I moved to Nosebane's corner (Doc Paterson's signature); I am spending my time there, so PM me if I don't answer your post in forums
Post Reply