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

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

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Gronkling

OK, Fun 11 in 1722 Frames (~34s)

https://youtu.be/iBW1KlVfMAQ

This is the first level I'd consider properly difficult. There's a lot of different ways to go about going over the wall, the usual method of climbing over and bashing through is obviously far too slow. You can't bash underneath the arrows with steel glitches either as arrow placement is more accurate in this port. The fastest technique I could think of is to implement the sliding glitch. I can't remember the basher mask in other ports, but in this one the backstroke causes this unique shape.


(Black = Air, Cyan = Solid terrain, Blue = Builder terrain, Red = Floor)

Once that is created, most of it can be filled in with builders, leaving a one pixel hole in jumping distance (shown with an arrow). Miners are also used to turn around to complete the filling faster. Filling that in at the correct moment allows the group of lemmings compressed into one location by a blocker trap to get stuck in a jumping state and slide to the top of the wall. (The air bashers delay the filling to the right moment) A climber also goes over and makes sure the lemmings won't splat.
The random blockers and screen-scrolls at the end reduce lag frames a bit.

This can almost definitely be optimised some more, but this is most likely the basic sort of route.

ccexplore

I'm not sure if it will help, but if you have the climber build one brick when he's 2 pixels away from the cliff, then dig, his position would be immediately beyond the cliff, then when you assign blocker he will be able to fall down and reach the exit himself.  Digging down 5 times should be sufficient to make the fall survivable (though I suggest 6 instead of 5 just in case, to take full advantage of the maximum amount you can fall per physics update).

Gronkling

#47
Unfortunately that adds some more lag frames, and also in this version seeing as how all the lemmings that need to be saved all end up on the same x-position it won't have any effect on the final outcome. Technically it would allow you to release the others one lemming earlier, however due to the very complex controls/timing I'm not sure if that would be possible/save time

EDIT: Used a bomber for the climber rather than a digger, saving 2 lag frames. New record is 1720F
EDIT2: Made a thread for this over on the TASvideo forum

ccexplore

I found that in Fun 11, by simply scrolling to the right as soon as possible (ie. immediately after assigning the builder that triggers sliding), you end up with 5 fewer lag frames.  See attached which is based on your "FUN11 1720F.bk2".

One other weirdness I discover:  it seems that 5-cycles can sometimes occur, apparently.  For example in the movie, notice how byte at F54D has value 2 on frames 1485, 1486 and 1487 (in the memory watch).  I first noticed it due to seeing consecutive frame counter values listed when my script outputs the list of lag frames.  Yet there isn't really anything obvious during those frames that would warrant such an unusual occurrence. ???

Gronkling

Thanks for the improvement!
And yeah... I guess 5-cycles can happen. On that frame I assign a basher, moving the assignment slightly stops it and turns it into a 4-cycle. (saving 1 more frame making new solution 1714F) Possibly all the arrow walls put more strain on the system and that basher pushed it a bit further, but it's still strange and unpredictable as you'd expect the later basher to cause a 5-cycle (Which it doesn't).


ccexplore

I started scrolling to the right earlier and more aggressively, and manage to save 18 (!) lag frames.  Although in the process I sort of messed up and didn't use the bomber to make the safe fall, so I wound up using the digger instead which might've been slightly slower.  I didn't replicate the timing of the bashers though so I might've managed to save a frame there by happy accident.  Anyway, the net result seems to be exactly 18 frames improvement from my 1715F attempt (but please check my math/movie), but may be improved slightly by redoing it with the bomber for the safe fall.

I don't know for sure whether it really needs to be so aggressively scrolled that you can't even see the sliding glitch in action (maybe it's enough to keep the first bomber explosion offscreen?).  It would be kinda unfortunate if fastest times force most of the interesting stuff to happen offscreen to avoid the lag phenomenon. :XD:

Gronkling

Thanks again for the improvement, I re-added to bomber saving a further 2 frames making the record 1695F

And yeah a bit of an unfortunate side effect of TAS stuff is it's often hard to see what's actually happening. (eg sonic TASes tend to be really confusing) I might make two versions of some movies like this one, a fast one and a pretty one that removes some lag saving features for better viewing, that'll be one of the last steps though.

Gronkling

#52
Fun 12 in 1629F (~33s)
https://youtu.be/MarsBrcV4mg

I use a lower path as there's less falling/jumping happening (Mining on the top path caused way too many lag frames) Then to get to the exit I make a basher staircase. I also block to remove extra lemmings at the end to reduce some lag.




Also found a glitch that I haven't seen reported so may be exclusive to this port. If a miner mines through terrain to the bottom of the screen and is aligned at the right hight, the lemming will clip through one pixel and fall out the bottom of the screen leaving a miner shaft that other lemmings can turn around in easily. Don't know if it will ever come in useful but it's there. (Example movie attached)



EDIT: Did this one too as it's easy in this port

Fun 13 - We All Fall Down in 1929 frames (~39s)
https://youtu.be/niIbz6JWKaw
The genesis has some digger mechanics (Placing another digger near, though not necessarily exactly, the centre of the first stops the first one) which means I don't have to do this tedious level series properly. There's a lot of boring walking though which takes up most of the time...

ccexplore

We all fall down improved to 1926F.  This is optimal barring unknown exploits (the final fall takes the exact same amount of frames in 1926F as in 1929F, but avoids a fall down the first step).

ccexplore

Yet another stab at optimizing Fun 11, now down to 1689F I believe.

This time I didn't scroll all the way to the right (since scrolling almost guarantees a lag frame each time the screen position shifts), just enough to hide the first explosion.  I avoided the second explosion altogether as it seems to add too many lag frames at that screen position, going back to the digger yet again. ;P

Through testing, I've found that the precise x-position of where the digger starts digging can apparently have an effect on how many lag frames it may contribute while digging.  Specifically, at the position seen in the movie, or it seems other x-positions offset from that point by multiples of 4 pixels, the digger seems able to dig without generating much lag frames beyond one or two shortly after the skill assignment, while other positions seem to fare worse.  Indeed, one variant I've tried simply has him start digging 4 pixels left of where he digs in the attached movie.  Doing that avoids the business with the builder and seems to work just as well in avoiding the digger-induced lag frames, but it also somehow wound up adding some lag frames during the fade-out, and so ended up not as optimal as the attached movie.

It does suggest more generally that the lag frame phenomenon from certain skill usages may potentially be minimized by tweaking the exact position of the lemming, if feasible.

I'm also wondering now whether an explosion-free approach in this level may wound up completely eliminating the need to scroll, and thus further reduce the associated lag frames?  (Though it may become very difficult if not impossible to achieve the precise timing for doing the sliding glitch, if that lemming also has to free the blocker.)

Gronkling

Great! Fun 13's solution is great because it can be applied basically identically to the 3 other levels in the series (though each will have more lag/waiting time)




With the Fun 11 solution, I swapped a bunch of things around so one less lemming has to jump up whilst the climber survives. This got off another 23 frames, making the record now 1666 frames! (Attached) Not sure about the bomber free thing. It would be technically possible, but it would take plain longer and miners still cause a lot of lag.




And here's the first genesis exclusive level, fun 14 in... 6649 Frames :'( (~2m 14s)
https://youtu.be/ryywFg6WMSA
Time with no exit! There doesn't seem to be a nice and short way to complete this level other than the long boring normal route. If somehow the bit of terrain just above the exit could be bashed away that'd change everything. This level also generates monstrous amounts of lag, this solution having over 18 seconds of lag alone, this can almost definitely be improved in some ways...

grams88

Hi Gronkling, Is that not very hard to do the tool assisted speedrun? Keep up the good work. :)

Gronkling

Thanks! It can be quite hard but that's why its a challenge 8-)

Tea Time in Ball Country - 1700 frames (~34s)
https://youtu.be/tR2386HFdsk
This is as generic as these solutions come... just a bunch of power bashing/mining. There was something weirdly demotivating about this one.

ccexplore

Took a stab at reducing some lag frames on Fun 14, now down to 6596 frames if I calculated correctly.  It seems I manage to save more frames than the mere reduction of lag frames.  Some of that can be accounted by the resulting route having less jumping and falling.  I also experimented with occasionally using the cursor to scroll the screen in place of A+left/right arrows, but I'm rather uncertain whether it helped.  Also unknown whether there may be a better timing for scrolling the screen back to the left.

===========

But more importantly, I've finally updated my lag frames tracking script to work with savestates.  This means you should be able to use it while re-recording movies for improvements, rather than only able to use it to test a movie after the fact, as reloading savestates will no longer interfere with the script's ability to track things correctly.  Now of course, if you load a savestate that was captured previously without this (or future) versions of the script running during capture, the savestate won't contain the supplementary data the script needs when the savestate is reloaded, so those still won't work.

I also fixed a minor performance issue with the script's outputting the full list of lag frames when it detects the level has finished.  You may still experience a slight hiccup in the emulator at that moment, but nowhere as bad as it used to be (Fun 14 is a good test for this due to its large amount of lag frames).

Next plan for the script is better output of the lag frames.  Looking at documentation, Bizhawk seems to allow LUA scripts to create its own UI window and child UI elements, which could provide better ways to present the lag frames compared to dumping them in the LUA console window like it currently does.

Gronkling

Thanks on both counts!
I can't think of any advantage of using the cursor to scroll the screen, the cursor seems to be unaffected by lag frames and doesn't seem to cause them. In fact one tiny interesting thing is that the cursor can still move even on lag frames, which means technically they could be used to get the cursor to places it normally couldn't in time, though I definitely haven't had to even come close to doing this.

With your script however it doesn't seem to be working with TAStudio savestates which is what I use when working on solutions (this is after creating a new project with the new script). I believe they are stored in a different way, though if I just have to use regular savestates to check LFs I don't mind. It works perfectly with normal savestates, great work :thumbsup:
I'm not too bothered by the results just being printed in the LUA console.




Also Fun 16 in 1977 frames (~40s)
https://youtu.be/gaWTlrTIX5w
Another uneventful one with a load of power-skilling, nothing really to remark on...