[Genesis] Lemmings (Genesis Port) TAS (WIP)

Started by Gronkling, January 27, 2016, 04:59:09 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Gronkling

Quote from: möbius on February 28, 2016, 03:21:36 AM
I don't quite get why you're counting lag as time against you considering the game clock also slows down when lag happens.

The in-game clock is very imprecise and is different speeds on different ports. We are measuring how long the run takes in proper real-time including lag frames as it's an interesting (to me anyway :P ) challenge and most speedruns are recorded that way. The lag frames we talk about occur on actual consoles too and are part of the way the game works, they're not just emulator side-effects.

Gronkling

Fun 28 in 4365 frames (~1m 29s)

https://youtu.be/6jsQrlTlSj4

Mostly similar to Mayhem 5's regular route, lots of stuff happening offscreen though, due to high amounts of lag, so this isn't exactly the most interesting video.

namida

One thought - could some release rate manipulation, and a basher instead of a climber, perhaps cut a few frames off near the start?
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)

Gronkling

I'll keep that in mind when I come back to that level.

Fun 29 in 2591 frames (52s)

https://youtu.be/oBKU2R-dMeU

namida

Here's an idea for Fun 30. This takes 305 PUCs under NeoLemmix (probably a couple more under DOS / Genesis), but it isn't 100% optimized, but rather just demonstrates the general idea - you'll notice I sort of demonstrated a digger/basher staircase, but firstly that I didn't do it to the full extent possible, nor did I make use of one for the drop to the exit. You don't actually have to rush the working too much, as you'll have the entire path to the exit made before the 40th lemming even spawns anyway.

Another possible improvement - if the fall from the entrance isn't exactly a multiple of 3 pixels, then start the digger/basher staircase underneath it instead of leaving one solid pixel. Or, better yet, use builders to shorten it.

EDIT: Actually, I dunno if maybe just doing that staircase directly to the exit might be quicker...
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)

Gronkling

A small difference between Genesis Fun 30 and NX is that on Genesis the save requirement is 36/60 rather than 40/60 so you are slightly more pushed for time. I also couldn't get the basher staircase thing to really work as it requires almost constant attention that could be spent doing other things (cursor movement is a bit limited) and it's very hard to actually get the lemming you want to bash/dig, so I mainly used a miner in my solution with a small bit of staircase at the end.
I may also recommend using the original lemmix, or better yet emulated genesis on bizhawk to try solutions as it has useful glitches.

Here's my solution, Fun 30 in 987 frames (~20s)

https://youtu.be/1nOoncQeKSQ

Uses a miner glitch to jump over the 2nd holding cell, most of the rest is reducing falling distance. Also uses the direct drop floater glitch to save a few frames.

So that's a baseline solution down for all of fun! Now I'm going to look over some levels and see if I can reduce frames further before making a compilation and moving onto tricky

ccexplore

Fun 30 improved to 963 F (and I already spot at least one thing that can be improved, but don't have time to redo it right now).  Instead of alternating between digger and basher like namida suggested, alternating between digger and miner works better.

Gronkling

#112
Oh wow, miner-digger most certainly works better than basher-digger :o Thanks!

I improved the solution by a further 6 frames, new record if 957F

Also



Fun 5:1531F->1515F(-16F / 0.3s)
Fun 8:631F->618F(-13F / 0.25s)

ccexplore

I got Fun 30 down to 952F.  I expected this steeper (and much tricker to execute) version of miner-digger staircase would save more than that, but apparently didn't turn out that way. :( I think I didn't quite do the beginning part quite right though, so there's probably some room for minor improvement.

Gronkling

#114
I managed to get off another 12 frames, not by altering your solution but just by simply placing 1 builder brick next to the exit :lem-shocked:
The new record for that level therefore is 940F! This trick/glitch most likely can be used on other levels too which I'm going to try next, I'm not sure why it happens but 12 frames is a lot for such a simple little thing.

Testing results:

Fun 9   - Adds extra frames
Fun 10 - Adds extra frames
Fun 11 - No effect (Though it caused some extra lag frames on some timings)
Fun 17 - No effect
Fun 25 - No effect
Fun 27 - Adds extra

So this must only work under some kind of quite specific set of circumstances

ccexplore

:lem-mindblown: indeed!  Too bad I won't be able to run the emulator for a while until I'm home later today, I could really use it to better understand what the heck is happening. :thumbsup: I certainly can't think of anything in DOS mechanics for example that could produce such a result.  Does it look like it alters the exit-trigger collision detection so that lemmings are exiting sooner, or is something else happening?  Also, based on your verbal description of the trick, the trick affects the crowd and not just the builder himself?

Perhaps the trick depends on the graphics style (ie. only works with the "Hell" exit)?  Fun 30 is also notably in the minority of levels where the crowd approaches the exit from the right.  (edit) Hmm, so is Fun 28 on both counts, worth a quick test there? (although maybe it'd take too long there to insert the build brick before enough lemmings have already exited)

Gronkling

Yes this affects the whole crowd, the builder exits far before the last lemming.

I tested another right-exit fire level, Mayhem 2 [The Boiler Room] (using memory pokes), I found no effect caused by putting a builder near the exit there ruling out fire set and right approaching being sole factors of this working.

Testing with Fun 28 (again with memory pokes) however, gives the same result as Fun 30, 12 saved frames.

Some things in Fun 30
With builder, lemming #1 (one of the last to exit) exits at (235,147) on frame 1645.
Without builder, lem #1 exits at (231,148) on frame 1657

So adding a builder in this level causes lemmings to exit 4 pixels earlier, and as walkers move at 1px per PUC, this saves 4PUC or 12 frames.

And in Fun 28
W/ Builder - Exits at (91,63)
W/o Builder - Exits at (87,64)

In mayhem 2, the one that didn't show effects.
W/ Builder - (59,61)
W/o Builder - (59,62)

The thing that jumps out to me is that on ones where builders did affect positively, the Y-values were multiples of 4 without a builder, whereas the one with no effect was not a multiple of 4. I don't know why this would affect exit collision though.
Adding 2 steps on mayhem 20, which would bring the y-value to a multiple of 4 didn't affect collision either however.

Simon

Excellent reading. I don't understand everything, yet I'm looking forward to the Fun compilation video like a 5-year-old for christmas.

Precise definitions wanted! PUC is what?

A frame is an update of the emulated hardware (roughly 50 per second), not an update of the physics (roughly 17 per second).

What, then, is a lag frame -- it cannot be purely a frame in which the physics don't advance, even though they should. Is it an extra frame (in the 50-frames-per-second meaning) that is inserted between two physics updates? Which would mean 3, instead of the regular 2, non-physics-updating frames between physics-updating frames?

-- Simon

ccexplore

#118
Quote from: Gronkling on March 03, 2016, 08:12:16 PMThe thing that jumps out to me is that on ones where builders did affect positively, the Y-values were multiples of 4 without a builder, whereas the one with no effect was not a multiple of 4.

Good work! :thumbsup: This actually makes sense to me.  In DOS, trigger areas, steel areas and blocker fields are all tracked in a map that has a coarser resolution than individual terrain pixels, instead it can only track in 4x4 pixel grid cells.  It follows that other ports with very similar physics to DOS/Amiga would likely follow a similar implementation, and the fact that you observed a multiple-of-4 effect further supports this.  So for example, in Fun 28, the "normal" exit spot at (87,64) actually corresponds to a 4x4 cell in the trigger map with upper-left corner (84,64) and lower-right corner (87,67).  The "surprise exit spot" with builder at (91,63) would correspond to the 4x4 cell spanning (88,60)-(91,63), in other words the cell immediately upper-right of the "normal" cell.

It suggests that, perhaps due to a bug in how the game sets up the trigger map in Genesis, parts of an object's trigger area may be shifted horizontally one cell to the right from its intended location in the map, resulting in an effectively non-rectangular shape.

I forgot to take the trigger-map resolution into account when I suggested things to test.  It's quite possible that the trick can work in other levels but may require more builders, as one builder may not be enough to take the walking path out from one grid cell of the trigger map to another.  For example, in Mayhem 2, the "normal" exit cell would be (56,60)-(59,63) based on what you reported.  The extraneous one would therefore probably be at (60,56)-(63,59).  Since the normal exit location without builders is at y=62, to reach y=59 you'd need 3 build steps rather than just 1.

If my theory about bugs in how the game sets up the trigger map is correct, it's possible that the graphics style may not matter as much (similar effect may be available for the other styles of exits), but the direction of approaching the exit will probably still matter (since there's a fixed direction to how the trigger area gets shifted).  [In other words, if it's not clear enough already, you may want to re-test the levels where you approach exit from the right, taking into account the multiple-of-4 effect and use more build steps accordingly.]

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

Quote from: Simon on March 03, 2016, 08:26:09 PMPrecise definitions wanted! PUC is what?

Sorry, I invented that acronym as shorthand for typing "physics update cycle".  When talking about timing of things related to game physics, we can't use frames as the unit of time due to the lag frame phenomenon (for which the definition you asked about ["Is it an extra frame..."] is precisely correct, minus the fact that occasionally it may even be more than one extra frame).  For lack of better phrasing, I'd use "number of times physics got updated or will be updated" as the unit of time when talking about physics, leading to "physics update cycle" and then "PUC".

ccexplore

I had a chance to look at Mayhem 2 in Lemmix editor just now.  One important difference between that level and a level like Fun 28 or 30, is that in Mayhem 2, the exit object is more buried into the ground than in Fun 28/30.  So the portion of the exit trigger that is accessible at ground level may already be the upper portion that was shifted right, consequently you won't get any further improvements by trying to build up, as that portion is already accessible as-is without any builders.

This does suggest an inverse possibility though:  in a level where the exit object is more buried into the ground than usual (like in Mayhem 2), and you are approaching the exit from the left, you may save some frames by digging or otherwise lowering the ground before the "normal" exit trigger.