LemmixPlayer ccexplore updates

Started by ccexplore, November 10, 2009, 03:21:25 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Clam

http://www.lemmingsforums.com/index.php?topic=271.msg7422#msg7422">Quote from: ccexplore on 2009-11-13 04:24:53
- 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.


You'll be pleased to know that I caught this one some time ago:

http://www.lemmingsforums.com/index.php?topic=96.msg2034#msg2034">Quote from: Clam Spammer (Glitches in Lemmix) on 2009-07-24 02:38:23
the 10-second skip takes off slightly too much - maybe just one frame. It's more noticeable if you hold it down.

In theory, if you hold down the spacebar while playing, the last digit of the timer should tick over at the same rate as normal, but it actually counts down more than twice as fast. This seems to suggest that it's advancing one frame too many. And I just checked this in the Player and the same happens.

ccexplore

Thanks for the reminder on the Lemmix glitch thread.  Going through that thread, I see the following list of things to fix.  I've ordered them in terms of importance (my ranking):

- fix fake object support (Lemmix doesn't pay exact attention to object indices)
- make frameskip more accurate
- fix missing trapdoors inert trigger areas
- changing difficulty ranking should reset level no. to 1
- fix emulation of glitch related to left edge of map

namida

While not too important, the difficulty level change reset one should be by far the easiest to fix, so shouldn't that be first on the list?
My 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)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

Clam

I found a couple of problems with explosion particles:

1) If you fast-forward through the explosion, sometimes the particles stay on the screen until you scroll across. For some reason though, it doesn't happen when you frameskip up to the point when the explosion occurs. If you play my 3-minute solution to Mayhem 23 from the start in fast forward, the explosion about 40 seconds into the replay leaves particles on the screen.
2) Using frameskip while there are particles on the screen causes massive slowdown. Which is odd, because it works fine if there aren't any particles at the time when the frameskip is used, even if there is an explosion during the skipped period.

I also noticed that skills can't be selected or assigned in fast-forward mode, and using frameskip while in fast-forward drops you back to normal speed. The editor playtest doesn't have these limitations.

And while the one-second reverse is good, I would prefer one-frame reverse. This makes it easier to go back if you advance too far - and when you're trying to push things to the limit, that's going to happen quite a lot. (I recommend "b" as the hotkey for this, since it's next to the key for frame advance.)

ccexplore

http://www.lemmingsforums.com/index.php?topic=271.msg7473#msg7473">Quote from: Clam Spammer on 2009-11-15 02:44:34
I found a couple of problems with explosion particles:

Strange.  If I figure out what's going on I'll fix them of course; that said, it doesn't actually affect the level solution or replay, correct?

http://www.lemmingsforums.com/index.php?topic=271.msg7473#msg7473">Quote from: Clam Spammer on 2009-11-15 02:44:34
and using frameskip while in fast-forward drops you back to normal speed. The editor playtest doesn't have these limitations.

I believe this was by design--not by me, but it was requested from someone back in the old old forums (tseug perhaps?).  More simply, unpausing always put you back to normal speed (doesn't matter if you frame advance or not), perhaps because it's easy to forget that you were in fast forward, and such a mistake may require you to replay some moves.

I don't really know what people prefer.  I can probably put it back the way it is in the editor if that's what people want.  Ultimately I'd like to create a UI for you to set options for various miscellaneous things like this, but that'll take a little time.

http://www.lemmingsforums.com/index.php?topic=271.msg7473#msg7473">Quote from: Clam Spammer on 2009-11-15 02:44:34
I also noticed that skills can't be selected or assigned in fast-forward mode

Don't know about this one.  Possibly an attempt at mistake prevention in a similar light to above, though I can't come up with a good rationale myself.  I can probably fix this.

http://www.lemmingsforums.com/index.php?topic=271.msg7473#msg7473">Quote from: Clam Spammer on 2009-11-15 02:44:34
And while the one-second reverse is good, I would prefer one-frame reverse. This makes it easier to go back if you advance too far - and when you're trying to push things to the limit, that's going to happen quite a lot. (I recommend "b" as the hotkey for this, since it's next to the key for frame advance.)

Okay.  Just keep in mind that reverse can be a bit more processing intensive than frame advance, since there's no true reversal--the game actually has to replay the whole thing from the beginning at hyperspeed up to the frame you want.  So if you're towards the end of a relatively long solution, you may find that it might actually be quicker to jump back once and then frame advance a few times, rather than one-frame reverse a few times, depending on computer speed etc.

Still, one-frame reverse certainly do come in handy now and then.  I'll add it in.

ccexplore

Just want to note that I haven't forgotten about this topic, just that real life busy-ness has intruded again and I don't have as much time to deal with all these changes and things to investigate right now.  I still hope to post an update within 2-3 days, maybe earlier.

ccexplore

Okay, I've gathered enough information now from the game's code and Lemmix's code to understand all the timer-related differences, and unfortunately it doesn't make my job very easy:

A) It turns out that right now, the entrances are being opened in Lemmix a frame earlier than in the actual game.  However, Lemmix also cuts off a frame earlier than the actual game when you run out of time.  So the total number of frames given, not using the pause trick, is the same, but nonetheless, this discrepency obviously affects what you see in the game timer (a solution that seems to just make it before going from 4:30 to 4:29 would, in the actual game, hit 4:29, because of how the entrances are being opened a frame too early in Lemmix).

B) There's a further twist though with the actual game.  When the game decides it's "done", as a result of either no lemmings left, no time left, or the user pressing ESC to abort, it doesn't immediately declare "abort".  Instead:

1) it sets a flag signaling that it's now in the "fade-out" phase
2) Then in the next iteration, it starts carrying out the fade-out
3) then it continues to do one frame of lemmings updating,
4) and then just before running the code for updating the game timer, it checks if you're in the fade-out phase.  If you are, it skips over the updating of the game timer, and either jumps to the post-level screen if the fade-out finishes, or continues on for more iterations of lemmings-updating (ie. back to step #2) if the fade-out is still in progress.

Now, on the "PC-compatible" mode with the "fast" fade-out, the fade-out is done within a single iteration--nothing is being updated during the fade out.  (In other words, the complete fade-out sequence happens entirely within step 2, putting the game loop on hold while it's going.)  However, as detailed above, after the fade-out is being carried (ie. the screen is actually black), the remaining portions of the game loop will still update the lemming before going to the post-level screen, but the game timer is not updated.  This means pressing ESC at the right time, you can preven the game timer from going down another game second even though it normally would've.

Of course, the real advantage comes with the "High Performance PC" mode with the "slow" fade-out.  The slow fade-out is done over several frames (I haven't determined yet how many, but it could easily be another game second).  In other words, in that mode, the step #2 above in each iteration just does a little more of the fade-out, and the whole fade-out sequence is spreaded over several iterations.  During all these frames, as noted above, lemmings continue to be updated (and you can even assign skills), but the game timer is not updated.  So instead of holding off the game clock by merely one frame, the ESC abort can actually hold off the game clock around 1 game second or so in the "high performance PC" mode.

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

All of this means I've my work cut out for me in getting Lemmix to a state that supports all these "special effects" related to the game clock.  Even if I ignore high-performance mode, the regular mode is still already off by one frame in terms of the game clock (w/o the pause glitch), and there's the matter of ESC "holding off" the game clock by one frame.  Even if we ignore all these silly "game clock" shenanigans and just go purely with counting number of frames (kinda my preference now actually since it's frankly a more honest indication of time compare with the timer, given all these idiosyncracies), I would still have to at least provide a way to show the frame counter in-game.  I also need to be careful that my changes don't invalidate existing replays--for example, merely making the entrances open one iteration later would cause existing replays to be all off by one frame, which could be disasterous.  So I would also need to compensate by putting an adjustment factor between the iteration number stored in the replay, and the actual iteration counter value in Lemmix.

Frankly, at this point I'm far more likely to get the "easier" stuff out of the way first, like the one-frame reverse, proper fake object, entrance trapdoor inert trigger area support, and resetting level number to 1 on changing difficulty ranking.

ccexplore

I thought some of you might be interested in testing out some of the stuff I've said, especially when I do get around to supporting all that in Lemmix and you want to see how accurate it truly is.

To that end, here's a hacked version of VGA DOS Lemmings that is basically slowed down by a factor of 12.  It's not very usable as far as actual playing goes, because as you quickly realize when you try it, the game updates the mouse cursor at the same rate as the rest of the screen, so moving the mouse cursor will feel pretty sluggish.  You'll also need to hold down any key you want to press by the length of at least one frame for it to take effect (and probably likewise for mouse button presses).

When I test my Lemmix changes, I'll likely use the unhacked version for things I can easily test w/o the slow-down, and use this version for things to test where the slow-down really helps.

Clam

Found another problem - nothing major though. Sometimes the game plays music, even though it's turned off. It only happens sometimes, so I'm not sure why it does this. It doesn't seem to happen with sound effects.

namida

Are you turning it off with the hotkey or in the main menu?
Turning off with the hotkey is not permanent, it only lasts until the level ends.
My 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)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

Clam

I turned it off in the menu. When I start it up again it still appears to be off, and most of the time it doesn't play. And I never get sound effects either. http://www.lemmingsforums.com/Smileys/lemmings/huh.gif" alt="???" title="Huh?" class="smiley" />

namida

Sound effects are sometimes glitchy for me in Windows 7, never had any trouble in XP. It's not a major issue though.

Anyway... cc, if you're still around, any chance you can post the full source (including your updates)? I lost some of the vital files in a reformat...
My 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)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

ccexplore

Here's what I have on the computer right now.  It hasn't been touched in over half a year since I stopped working on it, so I have no idea what state it is in.

Now, let's see if the forum lets me upload a 12+MB zip file...... [edit: guess not, let me try Lemmingswelt instead...]

[edit2: still not working.  Not sure if it's my home's buggy wireless router or just that it's too big (though I see a similarly sized "Lemmix 0.0.10.0 source" zip file on there already?  May try again later at work.

In the meanwhile, maybe you can start off with said zip file on http://camanis.net/lemmings/lemmingswelt/index.php?dir=root" class="bbc_link" target="_blank">lemmingswelt (it probably doesn't have my updates though).  I can also try uploading a smaller zip file that doesn't have the large music and graphics resources, which you can get from the existing said zip file on lemmingswelt.]

namida

I wasn't able to upload even the LPDOS Player on there, I think it's got a limit that wasn't previously there (or maybe was bypassed for that file).
If you email it to me, I could upload it to one of my own websites so we've got a permanent download for it. My email is the same as always, namida_verasche[at]hotmail[dot you know what].
My 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)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

ccexplore

I try emailing to your hotmail address but it looks like hotmail is reject my email because the attachment is too big.

I think I'll need to go with the route of removing the big stuff like music and graphics from the attachment.  Use the lemmixplayer source from lemmingswelt file portal to retrieve that stuff.  Too busy to deal with this right now, maybe later tonight or tomorrow.