Author Topic: [bug] [player] Autoreplay empty, manual replay OK  (Read 2610 times)

0 Members and 1 Guest are viewing this topic.

Offline Simon

  • Administrator
  • Posts: 3879
    • View Profile
    • Lix
[bug] [player] Autoreplay empty, manual replay OK
« on: March 07, 2016, 07:16:52 PM »
Edit: This post has a confusing description. I have a better test case in answer #2.

NL 1.43-D on Nepsterlems 1.1.

The attached Replays are for Nepsterlems, 3rd rank, level 4, The Block-Store. *-06-54.lrb is a manual save of a solution, and *-07-00.lrb is an automatic save. The manual replay (06-54) plays back the solution as I want it.

I use the option that supresses skill selections.

Expected: The autosaved replay plays back the same solution.

Observed: The autosaved replay (07-00) seems to be empty. No red R, no replayed assignments in that one. See next post.

-- Simon
« Last Edit: March 07, 2016, 08:54:04 PM by Simon »

Offline Simon

  • Administrator
  • Posts: 3879
    • View Profile
    • Lix
Re: [bug] [player] Autoreplay empty, manual replay OK
« Reply #1 on: March 07, 2016, 07:20:36 PM »
Okay, I'm an idiot, and both replays play back properly.

I have other autoreplays from the same level. They are from different attempts. They should solve the level. See attachment for 2 more such autoreplays.

Observed: They don't solve the level, and appear empty.

-- Simon

Offline Simon

  • Administrator
  • Posts: 3879
    • View Profile
    • Lix
Re: [bug] [player] Autoreplay empty, manual replay OK
« Reply #2 on: March 07, 2016, 08:51:22 PM »
More testing. Here's what I do:

1. Enter any level.
2. Set up a solution, such that the lemmings will walk towards the exit.
3. Save manually (file A)
4. Assign leftover skills to the crowd walking to the exit, but don't destroy the path by doing that.
5. Save manually (file B)
6. Let the remaining lemmings enter the exit. This makes an autoreplay (file C), because I have solved the level.
7. Play and watch all 3 replays.

Expected: file C == file B.
Observed: file C == file A.

I use the option that supresses skill selection during replays. (Mentioned this in the original post, but I believe it's important.)

-- Simon

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: [bug] [player] Autoreplay empty, manual replay OK
« Reply #3 on: March 07, 2016, 09:24:50 PM »
Is file B also == file A, or does file B save properly? <pressing key during game>, <pressing key during postview screen> and <autosave upon completion> all call the same function to handle saving. The last one does pass a parameter of "true" that the others don't (the parameter in question defaults to false if not provided), but the only thing this should affect is where the file is placed and how it's named.

(See: TLemmingGame.Save in LemGame.pas, TGamePostviewScreen.CloseScreen in GamePostviewScreen.pas)
« Last Edit: March 07, 2016, 09:31:12 PM by namida »
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: [bug] [player] Autoreplay empty, manual replay OK
« Reply #4 on: March 07, 2016, 10:18:44 PM »
From testing:

1. Ignore Replay Skill Selection (or lack thereof) has no effect.
2. Saving replays during gameplay or not also has no effect.
3. A manual save on the postview screen does not seem to have problems.
4. There is no sign of corruption in the file. This leads me to think that the replay data is being cleared before the replay is autosaved.

I haven't yet been able to test this on Windows; only under WINE on Linux. Simon also has Linux+WINE. I will test on Windows when I get a chance later today.
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: [bug] [player] Autoreplay empty, manual replay OK
« Reply #5 on: March 07, 2016, 10:26:23 PM »
I've tracked down the cause of this to the functions in GamePostviewScreen.pas:
TGamePostviewScreen.Form_KeyDown
TGamePostviewScreen.HandleMouseClick

The replay is being cleared before CloseScreen is called, in the case of a right-click / pressing Esc (both of which exit to main menu). CloseScreen itself handles the auto-save. It doesn't get cleared before CloseScreen in the case of a left-click / pressing Enter (both of which advance to the next level), so the bug should not occur when doing that.

I'll fix and release an update once I'm on my main PC.
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: [bug] [player] Autoreplay empty, manual replay OK
« Reply #6 on: March 08, 2016, 02:38:35 AM »
Fixed for next update.

Semi-related, less major issue: Replay data in memory is meant to be erased when exiting to the main menu. It is possible to go to the main menu and keep replay data intact:
1. Finish level
2. Continue to next level
3. Exit to main menu from new level's preview screen
4. Enter code (doesn't have to be the proper code; the cheat-type codes also work for this) for the level you just played
5. Play it; replay data is still intact

EDIT: Fixed.
« Last Edit: March 08, 2016, 02:43:58 AM by namida »
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)