Author Topic: LemmixPlayer ccexplore updates  (Read 19721 times)

0 Members and 3 Guests are viewing this topic.

Offline Clam

  • Posts: 2187
  • Smiley: :8():
    • View Profile
Re: LemmixPlayer ccexplore updates
« Reply #15 on: November 12, 2009, 05:17:24 AM »
I tried it already in the editor playtest and it only works in replays. As soon as you take over from the replay, it won't let you frame advance any more. Can someone who actually has the Lemmix Player test this please?

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: LemmixPlayer ccexplore updates
« Reply #16 on: November 12, 2009, 05:50:41 AM »
I tried it already in the editor playtest and it only works in replays. As soon as you take over from the replay, it won't let you frame advance any more. Can someone who actually has the Lemmix Player test this please?

 ??? I've been attaching my updates to the EXE in this thread, can't you just download it and try it?  Remember, LemmixPlayer is completely standalone since all the necessary graphics sets etc. are embedded in the EXE, so you don't need to set up LemmixStyles.ini like you would with the editor.

The editor playtest differs quite a bit from LemmixPlayer's capabilities (eg. no savestates), so I really won't use that as a model of what LemmixPlayer supports.

And yes, at some later point I'll update Lemmix editor as well--right now I think I'm still missing some files so it doesn't even compile as-is yet.

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: LemmixPlayer ccexplore updates
« Reply #17 on: November 12, 2009, 06:00:01 AM »
cc is right, it's there in the player.
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 Clam

  • Posts: 2187
  • Smiley: :8():
    • View Profile
Re: LemmixPlayer ccexplore updates
« Reply #18 on: November 12, 2009, 08:04:08 AM »
OK, thanks.


??? I've been attaching my updates to the EXE in this thread, can't you just download it and try it?  Remember, LemmixPlayer is completely standalone since all the necessary graphics sets etc. are embedded in the EXE, so you don't need to set up LemmixStyles.ini like you would with the editor.

Ah, I wasn't aware of that. I thought it was another messy setup job like the editor... My bad for not looking into it, I guess.

When (if?) you get assignment while paused implemented, I'll download it and start running some levels. Anything beyond that would just be icing. (Sweet, sweet icing... :D)

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: LemmixPlayer ccexplore updates
« Reply #19 on: November 12, 2009, 11:48:40 AM »
When (if?) you get assignment while paused implemented, I'll download it and start running some levels.

Here you go.  Summary of updates done so far:

1) fix the 3-entrance ordering for non-original-DOS-Lemmings mechanics
2) added support for the steel-digging glitch (and similar) in replays
3) added support for nuke glitch
4) added a form of support for the time pause glitch--press 'z' to toggle the glitch on/off.  When active, the game resets the timer whenever entrance trapdoors start to open; you don't even have to actually pause or anything.*
5) LemmixPlayer.exe now supports all 9 graphics sets.
6) you can assign skills even when paused**

*I still can't guarantee that the amount of time gained from the time pause glitch will match the real game exactly, mainly because it's close to impossible to test it out in the real game, as it refuses to register the F11 key until the level has fully faded in, so you're almost guaranteed to pause later than theoretically allowed.  I'll probably need to disassemble quite a bit more of the game's code to determine for sure the exact amount of maximum time gained.  That said, LemmixPlayer should be quite close enough for most purposes.

**I've made it so that the game automatically advances one frame when you assign skills while paused (actually, the way it is right now, clicking with the left-mouse button anywhere on the level area will advance by one frame when paused, which isn't my intention but seems harmless enough).  I did this because there's no clear evidence right now that it's possible to do multiple skill assignments within one frame in the real game.  So I feel that until more of the game has been disassembled and analyzed to determine the verdict for sure, it makes sense to err on the safe side and not support it.  Skill assignments on consecutive frames on the other hand are confirmed possible (via actually doing it) on the real game and definitely supported in LemmixPlayer (in fact easier now that you can assign skills when paused).

===============

For those who haven't used LemmixPlayer a lot, note that some of the keyboard commands are slightly different from Lemmix editor playtest mode.  See the Lemmix website for details.  I think LemmixPlayer should support all the features in the playtest mode + more, but if there's something supported in playtest mode that seems to be missing in LemmixPlayer, let me know and I'll make sure to get it back in.  Oh, and replays made in either one can be used in the other, as long as the game mechanics match.

[edit: see latest post for most update version to download]

Offline Clam

  • Posts: 2187
  • Smiley: :8():
    • View Profile
Re: LemmixPlayer ccexplore updates
« Reply #20 on: November 12, 2009, 07:47:58 PM »
Quote
*I still can't guarantee that the amount of time gained from the time pause glitch will match the real game exactly, mainly because it's close to impossible to test it out in the real game, as it refuses to register the F11 key until the level has fully faded in, so you're almost guaranteed to pause later than theoretically allowed.  I'll probably need to disassemble quite a bit more of the game's code to determine for sure the exact amount of maximum time gained.

How much time can you gain with the current setup? I know that in DOS it's possible to gain just over 2 seconds (2s = 34 frames), but I don't know exactly how much over. Maybe instead of going through the code again, you could run DOSBox frame by frame (by setting CPU cycles low) and count the frames?


Quote
**I've made it so that the game automatically advances one frame when you assign skills while paused

Despite my best efforts, I can't seem to assign two skills at the same time in DOS. When I assign a skill and pause at the same time, it appears to advance a frame (and begin execution of the skill) before play stops. This shouldn't be an issue at all - if anything it simplifies matters by reducing the number of possibilities.

And the hotkey "n" for frame advance seems rather appropriate - by pressing it you're saying "no" to skill assignment on the current frame.

Offline GuyPerfect

  • Posts: 363
    • View Profile
Re: LemmixPlayer ccexplore updates
« Reply #21 on: November 12, 2009, 08:40:43 PM »
I still can't guarantee that the amount of time gained from the time pause glitch will match the real game exactly, mainly because it's close to impossible to test it out in the real game, as it refuses to register the F11 key until the level has fully faded in, so you're almost guaranteed to pause later than theoretically allowed.  I'll probably need to disassemble quite a bit more of the game's code to determine for sure the exact amount of maximum time gained.  That said, LemmixPlayer should be quite close enough for most purposes.

This may sound like a roundabout approach, but I had a similar encounter with Paper Mario a few years ago. I had the game run in an emulator at the maximum speed in order to brute force all the recipe combinations in the game with a mixture of user input and GameShark codes. What I ended up doing was writing a program that took a peek at what was currently in the emulator window, and if it was at a user-input prompt, it would provide the user input.

You may be able to set up a similar watcher for Lemmings. Windows can programatically inject mouse and keyboard events into the input queue without actually receiving any mouse or keyboard input, so the process can be automated.

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: LemmixPlayer ccexplore updates
« Reply #22 on: November 12, 2009, 09:07:59 PM »
Interesting idea.  Unfortunately, because we need to measure exact timing for this case, your proposed method might lack the precision needed to do so.  The main difficulty right now is this:

1) While the game fades-in the screen to the level, keypresses to pause the game are ignored.
2) The problem with repeatedly pressing F11, whether by hand or by program, is that the same key both pause and unpauses.  So pressing F11 too many times can also lead to inaccurate results.
3) It might be possible to try to detect the end of the fade-in.  This still assumes though that the game starts accepting F11 keypresses exactly starting at when the pixel has reached the target brightness, which may or may not be the case.

There are still many things I could consider/try, so I won't say it's an impossible task, just that it'll take more effort for something that probably doesn't matter that much 99% of the time--the current implementation shouldn't be off by more than a few frames.

Offline GuyPerfect

  • Posts: 363
    • View Profile
Re: LemmixPlayer ccexplore updates
« Reply #23 on: November 12, 2009, 09:45:19 PM »
Is it possible to click the Pause button manually before the screen fades in all the way?

Offline Clam

  • Posts: 2187
  • Smiley: :8():
    • View Profile
Re: LemmixPlayer ccexplore updates
« Reply #24 on: November 12, 2009, 10:03:41 PM »
I've finally downloaded it to try it out, and found a serious problem. Sometimes when I restart the level, commands are delayed slightly or missed altogether, and after one command is missed any subsequent ones don't register. I'm not sure what causes it, but I know it isn't just because I clicked on the screen with the intention of advancing a frame through the replay (which, of course, would cause it to stop replaying).
EDIT: Saved replays have the same problem :(


Quote
There are still many things I could consider/try, so I won't say it's an impossible task, just that it'll take more effort for something that probably doesn't matter that much 99% of the time--the current implementation shouldn't be off by more than a few frames.

It "doesn't matter" only 94% of the time. On average, one frame of difference is going to affect the results in one level out of every 17 (i.e, 6%). I really think this is worth getting right.

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: LemmixPlayer ccexplore updates
« Reply #25 on: November 12, 2009, 11:13:43 PM »
I've finally downloaded it to try it out, and found a serious problem. Sometimes when I restart the level, commands are delayed slightly or missed altogether, and after one command is missed any subsequent ones don't register. I'm not sure what causes it, but I know it isn't just because I clicked on the screen with the intention of advancing a frame through the replay (which, of course, would cause it to stop replaying).
EDIT: Saved replays have the same problem :(

Yikes.  :XD: Ok, I'll need you to tell me the level and attach the replay (preferably including the text version as well) exhibiting this problem.  Especially surprising when you said commands are delayed, I didn't think that was possible.  Are the delayed commands always the ones where you assigned skills with the game paused?  (Just a wild guess but most likely to be the culprit.)  Also try and see if using the frame-stepping feature may lead to these problems, as it would seem to be another likely culprit.

Offline Clam

  • Posts: 2187
  • Smiley: :8():
    • View Profile
Re: LemmixPlayer ccexplore updates
« Reply #26 on: November 12, 2009, 11:55:18 PM »
I figured out what's causing it. The problem occurs when I change release rates while frame advancing. Attached is a replay (+ text) for Mayhem 12 (which I chose for testing steel digging and the nuke glitch).

What should happen: First lemming builds as soon as possible, RR up to 99 three frames later (when the second lemming hits the ground), second lemming builds on the end of the brick laid by the first.

What really happens: Well, see for yourself. The RR change comes at the right time, but the lemmings don't build.

And in all that frame advancing, I noticed something else - the Player is missing the first frame of the trapdoor opening animation.


By the way, is it possible to play in windowed mode?

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: LemmixPlayer ccexplore updates
« Reply #27 on: November 13, 2009, 02:26:50 AM »
Okay, finally figure out what's going on.  The existing code has some optimization to elide replay records when paused, so that for example, insteading of recording every RR change you made while paused, it would just record the most recent one you did, having it overwrite the previous recorded RR change instead of creating a new replay record.

The ability to frame advance however breaks this optimization in obvious ways, since the game isn't truly in pause anymore once you do that, but the current code doesn't recognize this.  In fact, even before I added the new stuff, I believe the frame advance feature already breaks replays in an example like this:  you change the RR, then frame advance until another lemming comes out, and then you change the RR again.  The optimization logic would incorrectly remove the earlier RR change.

I won't be back on a machine with Delphi for a few more hours, so you'll need to wait a little before I can release a fix, but at least I know how to fix it now.  Thanks Clam! :thumbsup:

By the way, is it possible to play in windowed mode?

One thing at at time. :P

Offline Clam

  • Posts: 2187
  • Smiley: :8():
    • View Profile
Re: LemmixPlayer ccexplore updates
« Reply #28 on: November 13, 2009, 02:33:44 AM »
By the way, is it possible to play in windowed mode?

One thing at at time. :P

Oh, sorry, I was asking whether it was implemented already and I just didn't know how to use it. If it's not, then never mind :D

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: LemmixPlayer ccexplore updates
« Reply #29 on: November 13, 2009, 10:24:53 AM »
Okay, I've fixed the replay problem related to frame advance.  I've also added 2 features:

- Pressing the '-' key will now rewind the game back approximately 1 game second.  I said "approximately" because the code should've rewind it 17 frames earlier, but the existing code right now related to savestates (which I borrowed for doing rewinds) is not behaving as expected--passing it the current frame number, and it seems to end up advancing by one frame instead of staying on the same frame.  I did try 18 instead of 17 but that still doesn't match up exactly with the effects of ' ' (space key), which supposedly advances by 10 game seconds (170 frames).  Clearly one or both of the commands isn't behaving exactly as advertised.  Oh well.  If I understand what's going on better in the future I'll make the appropriate changes.

- If you issue one of the "jump" commands (skip forward 10 seconds, rewind 1 second, or rewind to savestate) while paused, these commands will automatically put the game to pause after the jump completes.

I haven't done extensive testing of these new features in conjunction with replays.  So far I'm not seeing any buggy behavior with respect to replays, but most testing is always appreciated.