Lemmings Forums

Lemmings Boards => Challenges => Topic started by: Gronkling on January 27, 2016, 04:59:09 PM

Title: [Genesis] Lemmings (Genesis Port) TAS (WIP)
Post by: Gronkling on January 27, 2016, 04:59:09 PM
Hiya, I haven't been here for a while, but I'm here with a new project I'm working on, a TAS (Tool-Assisted Speedrun) of Lemmings. I'm using the Genesis port as TAS support for DOS is very poor, and I like how the genesis cuts out really long levels and has extras. I'll also try and explain what's going on in each post. The frame count I give is from when the level fully loads to when the result screen starts loading.  The ingame clock isn't being used and differs from port to port so is unreliable to compare some solutions.

Number of frames for each level with links to the current best solution:

12345678910
11121314151617181920
21222324252627282930
FUN0:17.91(890) (https://www.youtube.com/watch?v=UKIENe4-Eqk)0:20.78(1033) (https://www.youtube.com/watch?v=XspInYypWVU)0:21.39(1063) (https://www.youtube.com/watch?v=qfWRQwtRQ9M)0:38.17(1897) (https://www.youtube.com/watch?v=aD4QFYYGFlM)0:30.48(1515) (https://www.youtube.com/watch?v=CVzdmfsaVfI)0:23.44(1165) (https://www.youtube.com/watch?v=juNiYOV_Mdg)0:40.48(2012) (https://www.youtube.com/watch?v=nCk9ykm7TOw)0:29.74(1478) (https://youtu.be/q6nLzmjyZr0)0:34.87(1733) (https://www.youtube.com/watch?v=rH1DpB74q70)0:12.43(618) (https://youtu.be/hy0i5mog0ao)
0:33.34(1657) (https://youtu.be/pEGGuAFHs1k)0:32.78(1629) (https://youtu.be/MarsBrcV4mg)0:38.29(1903) (https://youtu.be/niIbz6JWKaw)1:57.85(5857) (https://youtu.be/ryywFg6WMSA)0:34.20(1700) (https://youtu.be/tR2386HFdsk)0:39.78(1977) (https://youtu.be/gaWTlrTIX5w)0:25.47(1266) (https://www.youtube.com/watch?v=kEIG0eUZcIg)0:49.37(2454) (https://youtu.be/-961ZucnrWM)1:13.92(3674) (https://youtu.be/_BJBjvizQdI)0:35.49(1764) (https://youtu.be/i4NT_OYMWpw)
1:16.84(3819) (https://youtu.be/0gm-Aj2IQKA)0:59.52(2958) (https://youtu.be/ccCVp3cxz4A)0:48.57(2414) (https://youtu.be/41boqO8wg2A)0:26.30(1307) (https://youtu.be/VJe1jmYUf5k)0:42.96(2135) (https://youtu.be/ZWG8cxCDPW4)0:37.22(1850) (https://youtu.be/4x2qwTzaT78)0:20.70(1029) (https://youtu.be/RrgVnPt232s)1:27.82(4365) (https://youtu.be/6jsQrlTlSj4)0:52.13(2591) (https://youtu.be/oBKU2R-dMeU)0:18.67(928) (https://youtu.be/1nOoncQeKSQ)
whole rank:0:22:11 (https://youtu.be/tRMrXi3RTNg)
TRICKY0:43.12(2143)0:47.65(2368) (https://youtu.be/45dfY4iySYk)0:36.26(1802) (https://youtu.be/MJEta6r-nTk)0:59.05(2935) (https://youtu.be/A3s1fGAMNEc)1:37.02(4822) (https://www.youtube.com/watch?v=1Gij0kcpsek)0:30.70(1526) (https://www.youtube.com/watch?v=SW4kS9dOpGk)0:37.61(1869) (https://youtu.be/xhytpD2EmuE)0:47.70(2371) (https://www.youtube.com/watch?v=zJScBKOyV94)0:44.73(2223) (https://youtu.be/qvXQvyaQFQ0)0:54.97(2732) (https://www.youtube.com/watch?v=VAmzL80ldG4)
0:17.50(870) (https://www.youtube.com/watch?v=LRf2Vq2OkPI)0:31.27(1554) (https://www.youtube.com/watch?v=_Dv8arIgGbg)0:56.82(2824) (https://www.youtube.com/watch?v=hGnWWWAVg5o)0:57.58(2862) (https://www.youtube.com/watch?v=WY9u_ky8ab8)0:16.26(808) (https://www.youtube.com/watch?v=a76hUMRDnPY)0:49.80(2475) (https://www.youtube.com/watch?v=hsehxVtUfnk)0:33.70(1675) (https://www.youtube.com/watch?v=YUhN0MbTh4I)0:27.40(1362) (https://www.youtube.com/watch?v=By43Y7av8fQ)0:51.55(2562) (https://www.youtube.com/watch?v=jAXOPIvfYHw)0:55.49(2758) (https://www.youtube.com/watch?v=A_Klq91ybCE)
0:52.68(2618) (https://www.youtube.com/watch?t=38&v=vl5KFDKZEYo)0:30.92(1537) (https://youtu.be/9PHSDBj3iIE)0:45.81(2277) (https://www.youtube.com/watch?v=-AjnuLyZFPA)0:52.96(2632) (https://www.youtube.com/watch?v=zWNo85PKCTg)0:54.35(2701) (https://www.youtube.com/watch?v=NlHpNqk2doA)0:37.28(1853) (https://www.youtube.com/watch?v=VnDzhhXQh90)0:31.51(1566) (https://www.youtube.com/watch?v=S1c91kAWJ0M)0:39.80(1978) (https://www.youtube.com/watch?v=AIgR12qMTDU)1:33.14(4629) (https://www.youtube.com/watch?v=_YXiayTQIfY)0:39.46(1961) (https://www.youtube.com/watch?v=F1ELsGGMvbM)
whole rank:0:24:23 (https://www.youtube.com/watch?v=nIQHfXs0ZtE)
TAXING1:03.64(3163) (https://www.youtube.com/watch?v=C4r4NOd4DXU)1:27.87(4367) (https://www.youtube.com/watch?v=gyAclXF3_gw)1:13.52(3654) (https://www.youtube.com/watch?v=cemvfaAIye0)0:24.49(1217) (https://www.youtube.com/watch?v=V8LSov2vUA8)0:43.36(2155) (https://www.youtube.com/watch?v=6hAM5pd19qQ)0:32.62(1621) (https://www.youtube.com/watch?v=ORH9nwDNep4)1:48.21(5378) (https://www.youtube.com/watch?v=kZFDVhnrpb4)1:19.05(3929) (https://www.youtube.com/watch?v=wFc8_ix6y2M)0:27.79(1381) (https://www.youtube.com/watch?v=RKD2wnIC8jQ)0:43.02(2138) (https://www.youtube.com/watch?v=42r531iG7rQ)
1:10.10(3484) (https://www.youtube.com/watch?v=7_O7hdjVdXI)1:19.50(3951) (https://www.youtube.com/watch?v=2j7zWxEgBRo)0:24.71(1228) (https://www.youtube.com/watch?v=qZHWjrbwWB0)0:45.33(2253) (https://www.youtube.com/watch?v=cOsBWyN5UPA)0:51.13(2541) (https://www.youtube.com/watch?v=8O1z2L2CkBw)1:10.18(3488) (https://www.youtube.com/watch?v=rOUBhB-QQn4)0:55.92(2779) (https://www.youtube.com/watch?v=v32icgwe96k)0:57.14(2840) (https://www.youtube.com/watch?v=CZ4QRZXXJ3s)0:52.74(2621)1:59.72(5950) (https://www.youtube.com/watch?v=bRRXyUKsd7Y)
0:39.68(1972) (https://www.youtube.com/watch?v=72-5tz3iwjk)0:33.42(1661) (https://www.youtube.com/watch?v=vTVza5W2lAo)1:59.64(5946) (https://www.youtube.com/watch?v=UhUI8Um-P18)1:28.11(4379) (https://www.youtube.com/watch?v=W7MlI5TeXVk)1:37.97(4869) (https://www.youtube.com/watch?v=6hoZe868P_s)0:48.29(2400) (https://www.youtube.com/watch?v=2NW13PF3Y44)1:19.72(3962) (https://www.youtube.com/watch?v=oybBei-Lxb0)1:14.10(3683) (https://www.youtube.com/watch?v=FkSzfrDpw6M)1:07.38(3349) (https://www.youtube.com/watch?v=8SklIobvsKc)0:48.55(2413)
MAYHEM0:55.55(2761) (https://www.youtube.com/watch?v=I9axMpTJg_4)---------
----------
----------
PRESENT----------
----------
----------
SUNSOFT0:10.16(505)---------
--------0:10.46(520)-
----------

Italic values have outdated videos.
Bold values are very 'messy' levels, lots of lemmings, lag and building etc. There is likely improvements possible on any of these but they will be tedious & illogical.
Radioactive values use glitches
Green values are trivial (or at least close) solutions.
Strike-through values need to be redone.
Tricky 1, Taxing 19, use almost exactly the same file as their fun counterparts so don't need a video

Current estimated time: 0:28:40
Current average frame count: 1977
Estimated completed time: 2:08:39

Solutions can be found as original .bk2 files here (https://drive.google.com/folderview?id=0B24bnHjK2QUDU0ZsdFpPWXFnVWs&usp=sharing)
TASvideo forum thread (http://tasvideos.org/forum/viewtopic.php?p=427973#427973)

(Note: Early on the frame count was level load - last button press which was unreliable in some ways, so some old solutions may have lower frame counts than they actually do in some places, see this post. (http://www.lemmingsforums.net/index.php?topic=2425.msg55241#msg55241) All values in the table, Youtube and .bk2 archive are accurate with modern frame count.)

Some other notes (click to show/hide)



Anyway here is the first level, Just Dig!, in 836 frames or around 18 seconds from fade in to fade out.
https://www.youtube.com/watch?v=q879Wd9XL54

What happens here is that I assign diggers to each lemming at the moment the digger before it digs another layer, which almost instantly creates a 2 pixel dig rather than a 1 pixel. At the same time I have it so the release rate causes the lemming to be at the furthest right when this opportunity happens, so it has the maximum rightwards reach. This is to reach some of the terrain just above the exit that is slightly higher than the rest, causing a quicker breakthrough.

This is repeated for each apart from the very last which waits a bit before digging so as to be somewhere in the middle of a digger's shaft when it begins (though still at another 2 pixel dig opportunity), which causes the previous digger to become a walker. This can then just walk towards the exit, falling through the space the last digger creates to the exit, without the extra frames diggers need to complete their animation cycle before falling.

Finally A and Start are pressed as early as possible to finish the level as soon as possible
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on January 27, 2016, 05:48:30 PM
Hope you don't mind me double-posting to keep each level in separate linkable posts!

Only Floaters can Survive This in 978 Frames (~20 seconds)
https://youtu.be/XspInYypWVU

Not much can really be done in this one, just a floater on the first lemming on the last possible frame, the others can be ignored :devil:



EDIT: Actually these two levels are both trivial and un-noteworthy enough I'll just combine them rather than causing a triple post

Tailor-made for Blockers in 1008 Frames (~21 seconds)
https://youtu.be/XceZ2K_NSOU

Again, nothing much to this one, just a matter of placing the blockers as early as possible, though not so early the others clip through them. Also a very easy choice between 2 different pathways I guess.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on January 27, 2016, 09:23:36 PM
I kinda expected there would've been one out there already, presumably Google hasn't found anyone else doing a TAS for the Genesis port yet?

Best of luck and hope you don't get burned out too soon. :thumbsup: This kind of challenge has been difficult in the past because it can quickly get tedious in later, longer levels to micro-optimize.

Here are some past challenge topics that might be useful as reference.  Obviously they are for DOS version (Lemmix) so not everything is directly applicable.

What levels could be beaten in under one minute? (http://www.lemmingsforums.net/index.php?topic=1005.0)
How fast can you solve the following levels? (http://www.lemmingsforums.net/index.php?topic=1073.0)
Least amount of time needed to beat levels (http://www.lemmingsforums.net/index.php?topic=1033.0)

I'm also anticipating that unless you're really being a stickler for it (in which case you may burn out faster, so keep that in mind), you may not be doing the levels strictly in order.  This can make results for particular levels harder to find.  It would be nice to follow the format of most other challenge topics, to include a table or list in the first post of the thread tracking all known results so far by level.

=========

For Just Dig, as you may be aware, in Genesis it's possible for one digger to free another digger without having to dig at the exact same position as the digger being freed.  Makes me wonder if that might help further optimize the solution?  Just throwing it out there just in case.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Proxima on January 27, 2016, 09:28:41 PM
Will you be combining the videos into one video for each rank? That would make it much more enjoyable to watch, compared to having to watch each one separately.

Good luck! :thumbsup:
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on January 27, 2016, 10:17:00 PM
I forgot to ask: does this TAS include or exclude any time spent with the game paused?  Like if you need to pause in order to perform some sequence of skill assignments and/or scrolling the screen.  Since you have to use the d-pad to move the cursor and the speed of movement is constant IIRC, so there would potentially be a difference in some cases that are dependent on how pausing is treated.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on January 27, 2016, 11:02:48 PM
Thanks for the support! I do expect to get burned out for periods but I'll just take a break, I needed something relaxing and kind of repetitive/tedious to do sometimes at the moment so this is a good option. I'll answer your questions:
Quote
I kinda expected there would've been one out there already, presumably Google hasn't found anyone else doing a TAS for the Genesis port yet?
There is a TAS of the mayhem rating and extras of the SNES port, but that is all I know of. I'll make a thread on the actual TASvideos forum once I have around 10 videos done (though this thread will continue to be the main place I post)

Quote
I'm also anticipating that unless you're really being a stickler for it (in which case you may burn out faster, so keep that in mind), you may not be doing the levels strictly in order.  This can make results for particular levels harder to find.  It would be nice to follow the format of most other challenge topics, to include a table or list in the first post of the thread tracking all known results so far by level.
Yes I'm not going to necessarily be doing them in order, just using that as a rough order to do things in. If I get totally stuck on a level, I'll move onto the next and revisit that one later. I added a table to the first post as suggested.

Quote
For Just Dig, as you may be aware, in Genesis it's possible for one digger to free another digger without having to dig at the exact same position as the digger being freed.  Makes me wonder if that might help further optimize the solution?  Just throwing it out there just in case.
Yes I knew this, the final digger in my solution is not exactly spot on in the centre and some of my earlier routes used that glitch/feature. I am planning on putting all the files online at some point so others can help contribute at some point.

Quote
Will you be combining the videos into one video for each rank? That would make it much more enjoyable to watch, compared to having to watch each one separately.
Yes I will! And into one large video when everything is done.

Quote
does this TAS include or exclude any time spent with the game paused?
Yes it will, I will need to pause for short times in later levels to move the cursor/select skills and this will have to be done strategically to minimise time.

Any way onto the next level...



Now Use Miners and Climbers in 1877 Frames (~39 seconds) E:[OBSOLETED]
https://youtu.be/m8ksE9bqtuQ

This one I'm not quite sure on, it feels a bit messy but there isn't much choice of things to do. Basically I just joggled the release rate so the 3rd lemming will not walk over the miner shaft (the 2nd one doing that is unavoidable) whilst the release rate is the highest it could be, which also ensures the last will be out as soon as it could. I feel like this one may be able to be improved but I can't see how right now, perhaps I will revisit it much later on.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on January 27, 2016, 11:44:39 PM
For Fun 4 (climbers and miners), I can't quite tell from the video whether the last lemming out wound up just in front of or just behind the 2nd lemming out (ie. the one that can't avoid overtaking the miner).  If that last lemming winds up just behind the 2nd lemming out, perhaps you should consider instead dropping the RR such that most lemmings (including the last one out) wouldn't get turned around by an unfinished mining tunnel, ensuring that the 2nd lemming out is the last one to exit.

Basically this level seems likely to boil down to a choice between optimizing the exit of the 2nd lemming out versus that of the last lemming out.  I feel like the 2nd lemming out will in fact be the last lemming to exit in the optimized solution, but I'm not 100% sure.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on January 28, 2016, 01:54:15 AM
I gave Fun 4 a go briefly in Lemmix for what I think an optimal TAS solution might look like when translated back into Genesis.  First, don't look at the game timer in Lemmix because DOS's goes down slightly slower than Genesis's, so they simply aren't comparable that way.  Here are the things I tried to improve on:

1) I try to make the 2nd lemming out overtake the miner as soon as possible, assuming that the 2nd lemming out will be the last to exit and therefore should be optimized.  The goal is to eliminate the amount of wasted frames due to any jumping and falling that would otherwise occur for that lemming to get up the mining tunnel's end.  In Lemmix, it looks like you need the RR to be at least 40 before the 1st lemming is out, to completely eliminate any jumping and falling there (walkers can walk up a step of 2 pixels in the same frame of moving forward 1 pixel, so upward steps of 2 pixels or smaller are okay).  I don't know if this RR increase is feasible in Genesis especially for TAS.  You may have to settle for a value lower than 40, resulting in less reduction (2 frames I think will be wasted in jumping up a 4-pixel step, if you can't do RR 40).

2) The RR is then reduced to 29 before the 2nd lemming is out.  This is the minimum amount of reduction from 40 that still ensures the 3rd lemming out cannot also overtake the miner.  40 -> 29 I'm guessing should be achievable, and if you can't even reach 40 in step 1 in the first place, then you have even less problem here, as you won't need to lower the RR as much.

3) As you can see, the 3rd and 4th lemmings out will turn around in the mining tunnel, then the 5th lemming out onwards will not need to turn around anymore as the mining is completed by then.  You need to start raising the RR to maximum as soon as the 4th lemming is out (and maybe even a little earlier, as long as you can ensure the 5th lemming out won't turn around), to ensure the last lemming out will not be slower than the 2nd lemming out (the one that overtook the miner), who will then be the last to exit as predicted.  I purposely didn't pause to do this final RR increase, to get a sense of feasibility.  Obviously may work out differently on Genesis depending on how fast the RR can go up.

One thing I haven't optimized yet is the idea of having the 1st lemming out start mining a little further to the right.  What this can achieve is to allow the 2nd lemming out to turn around sooner relative to the progress of mining, which can potentially reduce the amount of wasted time falling into the miner tunnel when it is walking left (because the mining tunnel wouldn't have reached as far downwards).  Of course, doing so would also increase the amount of walking of the 3rd and 4th lemmings, and you don't want them to end up behind the 2nd lemming out.  So there's likely something to tweak and test there to squeeze out yet a few more frames.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on January 28, 2016, 02:12:24 AM
Sorry for triple-posting, but I'm wondering if it's worth including some information about the controls in Genesis in the first post.  For example I noticed in your video that there apparently seems to be a way to increase the RR without moving the skill selection cursor (in the skills toolbar) or the lemming selection cursor (in the level area), something I wasn't aware of.  I feel other there may be people who'd appreciate learning about some of the less-known controls available (especially if they didn't play the Genesis port that much), if they were to try their hands on this TAS.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on January 28, 2016, 10:04:03 AM
Thank you for your suggestions, I converted your solution into Genesis, the release rate changes are just possible and match the lemmix version. This solution saves 22 Frames, making it the new record of 1855F.
This solution leaves a final arrangement of this:
(http://i.imgur.com/QwPnaIA.png)

Therefore if optimisation can take place, it will be by the 2nd lemming coming out faster which I'm going to try and do now

(Also added controls to the start of the post)

EDIT: With optimisation, by getting the 2nd lemming out as soon as possible whilst still making sure the release rate can be decreased in time to allow the 3rd lemming not to walk over the miner, I saved 6 frames, not too much but everything counts! That brings the frame count to 1849 (~38s)

The new solution can be seen here: https://youtu.be/vYadsCyLe5A
(Old videos will be marked obsoleted and made unlisted)
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on January 28, 2016, 05:15:15 PM
Here's my solution for Fun 5 - You Need Bashers this Time in 1507 Frames (~31s)
https://youtu.be/WHmBuH4X0H0

Quite a deceptively tricky one, when bashing one after each other here, there are two different ways. One is bashing just before it turns around however this causes the basher tunnel to curve upwards slightly. By the end of the large bash area in the centre of the level this causes some slight frame wasting due to falling at the end. Therefore each bash should be done just before the last minute.
This level also requires some rather intensive memory watching due to the mass of lemmings that is created by the end of this level and some rather small differences between different choices.

For reference this is what happens when using the last moment to start the next bash.
(http://i.imgur.com/WJCAeqr.png)
This might become useful in later levels.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Clam on January 28, 2016, 07:01:33 PM
Following this with interest :8():

In one of the threads mentioned earlier, I played through about 50 levels of the DOS version, making Lemmix replays and a textfile of notes (http://www.lemmingsforums.net/index.php?topic=1033.msg32457#msg32457).

Of course, Genesis has completely different levels in places. I don't remember which levels are replaced, but IIRC it tended to be the wider ones (which I largely avoided anyway).

As you know, real time vs game time changes things quite a lot. I often pause to set the RR; your ability to change RR in real time is more limited. This already affects the result for Fun 4 (I set the RR higher than is possible without pausing). DOS also has the "pausing for time" trick, which is obviously irrelevant here (this doesn't change solutions at all, it just knocks off a fixed amount of time from every solution).

There's also the small matter of Glitches (http://www.lemmingsforums.net/index.php?topic=1382.0;all). I don't know if these work in the Genesis version - if they don't, then most of my solutions are out of the window :P. Most of these could potentially help towards an optimal solution, but here are the ones with the most impact from my experience:
Title: Re: Lemmings (Genesis Port) TAS
Post by: namida on January 28, 2016, 07:18:37 PM
I believe Genesis has every glitch that DOS does, except for the nuke glitch (and maybe direct drop)? However, the slight difference in digger mechanics also needs to be taken into account, as well as of course the lack of RR changing when paused.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Proxima on January 28, 2016, 07:23:34 PM
Genesis certainly has all the main glitches except nuke glitch, and it does have direct drop. It's clear the designers weren't aware of this as they left in some major direct-drop backroutes on a couple of levels, so don't forget to take advantage of those!
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on January 28, 2016, 07:27:17 PM
Thanks, I hadn't seen that speedrun folder, I'll use it for reference :8():

In terms of glitches, most do work (I just haven't come into a level where real glitches are needed/possible yet which will change with the next level, my planned solution using the same push through glitch as yours) The nuke glitch does not work unfortunately... .
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on January 28, 2016, 08:12:32 PM
Here are a couple other random things off top of my head that may be different in Genesis compared to DOS:

- I know that in Amiga, the basher's stroke reaches one pixel further horizontally compared to DOS's, and the "backstroke" (the amount of terrain removed "behind" the basher) is a bit more than DOS's as well.  The former is most apparent with a level like "I have a cunning plan", where in Amiga the two bashers given is just enough to get through the pillar, whereas you'd be one short in DOS.  I don't remember which behavior Genesis has for bashers, I'd suspect Amiga's but should be tested.

- I also recall some subtle differences with climbers that affected the maximum-save solution for "From the Boundary Line", but that is much less likely to affect a solution.

- I remember that "Don't Follow Me" cannot be solved in DOS without fiddling with the RR--if you try, the final miner will splat in a fall that walkers can survive, while in Genesis the exact same moves appear to be survivable.  Again, not that likely to affect a solution in general, but a possible difference nonetheless.

- Finally in DOS, the trigger area of a one-way-wall ("OWW") object is actually offset 4 pixels above the object's visual boundaries.  This leads to cases like "Tribute to M.C. Escher" where there is actually a gap between the steel areas and the bottom of the OWW triggers, a gap that can be bashed through.  I don't know if this glitch exists in Genesis or not (heck, I don't even know what happens in Amiga off top of my head).

On that note, that glitch in DOS where you can't mine OWW even in the correct direction (for one of the directions of OWW, I forgot which), I don't think that carries over to Amiga, so probably not in Genesis either but not sure.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Simon on January 28, 2016, 08:52:29 PM
For reference this is what happens when using the last moment to start the next bash.
[picture]

Awesome research, with great explanations and a detailed picture. This is quality research, well presented, very enjoyable to follow. Looking forward to what's coming up.

Level 5 (basher level): In the video, on the exit platform, you don't make a perfectly smooth path across the platform. Instead, the crowd walks over a little hump left over. Why isn't this a problem for overall time?

-- Simon
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on January 28, 2016, 08:57:14 PM
A behaviour I have just noticed in this version of lemmings is that scrolling the screen can delay lemmings by a few frames... I'm not yet sure if this happens every time the screen scrolls or just under certain conditions, this means another thing I'm going to have to keep in mind is how much I scroll the screen during levels, and also that Fun 2, 4 and 5 will probably be able to be optimised by a further few frames, as I used more scrolling than needed to show things happening on screen. This is something I'm going to look into.

EDIT: This doesn't seem to be entirely the case... there seems to be something happening though which I'm looking into. Removing a cosmetic screen scroll has both sped up a solution, slowed down a solution and left some solutions unaffected.  Individual lemming's x-values are unaffected. Maybe it's something to do with object trigger areas being scrolled a bit oddly, or vertical movement, but whatever it is it's quite interesting. I haven't been able to get any sort of consistent result.
Fun 2 seems unaffected by any sort of screen scroll.
Fun 4 was improved by 5 frames when I removed the screen scroll (making the new result 1844)
(I'm not going to try fun 5 until I properly understand this due to how finicky it is)

Quote
Level 5 (basher level): In the video, on the exit platform, you don't make a perfectly smooth path across the platform. Instead, the crowd walks over a little hump left over. Why isn't this a problem for overall time?
Thank you! I left the \ on the left of the second grate unbashed as it seemed to save some frames HOWEVER due to the effects of the screen-scroll lag I describe above I am not currently sure if this is the case, this level will have to be partly re-done after more research on the effect is done.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on January 29, 2016, 02:01:50 AM
A behaviour I have just noticed in this version of lemmings is that scrolling the screen can delay lemmings by a few frames...

Yikes, as if the TAS isn't annoying enough as-is. :XD:  It seems to suggest that game-state updates on Genesis are not locked to a strictly constant number of frame updates, and furthermore scrolling can sometimes apparently affect exactly how many frames need to happen before the next update to the game-state (ie. where lemmings' actions and their effects are processed).

Normally I would suggest trying out the solution in Lemmix (with the Genesis version of the level of course), but since the basher is involved and there might be physics differences as I noted previously, this may not be feasible here.  Maybe we should create a modified build of Lemmix that uses Genesis version's bashing masks......

====

Anyway, regarding Fun 5, in addition to testing the difference noted by Simon, it may also be worth testing the path where you don't bother bashing the first hump at all, instead start bashing at the first valley after having walked up and past the first hump.  You'd end up using 7 bashers instead of 8.  There are too many effects at play, but I do note that Clam uses that exact path in his speedrun for Lemmix, which would suggest it probably helps, and if nothing else is at least worth testing.  My main worry with that path is whether it's more proned to lemmings overtaking the basher and escaping the intended path entirely, but looking at Clam's speedrun that appears to be a non-issue.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on January 29, 2016, 10:13:40 AM
Yeah, I originally skipped the first hump, but it ended up being a few more frames. I'm not going to work more on fun 5 until I understand this scroll thing better though, as it's the only level so far that requires a scroll, and the difference between different bashing routes are all different by only a few frames, making it even more vulnerable to scroll mix ups.

Scrolling the screen seems to delay sprite cycles and connected movement by one frame... sometimes. Other times it just doesn't change. It might be something to do with the amount of stuff on screen, I haven't been able to cause any frame delays on Fun 2. In general, as of yet screen scrolls should be avoided.

One of the other things I've noticed is that climbing is not constant y-change rather its more of a cycle.
It takes 15 frames to move 1 upwards once, then it takes 3 frames to move 1 upwards 3 times. This means the frame difference between moving 1 pixel upwards is this sequence:
15, 3, 3, 3, 15, 3, 3, 3, 15, 3, 3, 3...
This might be used to save some frames later on.

Walking however just moves 1 across every 3 frames. I'm going to try and map every skill out like this now. ;)
EDIT:

Climber
y   1 ,1,1,1,1 ,1,1,1,1
f   15,3,3,3,15,3,3,3,15

Walker
x   1,1,1,1,1,1,1,1,1
f   3,3,3,3,3,3,3,3,3

Faller
y   -3,-3,-3,-3,-3
f   3 ,3 ,3 ,3 ,3

Floater
y   -2,-2,-2,-2,-2,-2,-2,-2,-2
f   3 ,3 ,3 ,3 ,3 ,3 ,3 ,3 ,3

Digger
y   -1,-1,-1,-1
f   24,24,24,24

Basher
x   1 ,1,1,1,1,1 ,1,1,1,1,1
f   36,3,3,3,3,36,3,3,3,3,36

Miner
x   2 ,0 ,2 ,2 ,0 ,2
y   0 ,-1,-1,0 ,-1,-1
f   36,27,9 ,36,27,9

Builder
x   2 ,2 ,2 ,2
y   1 ,1 ,1 ,1
f   48,48,48,48
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on January 29, 2016, 11:20:24 AM
Ok, so without the scrolling-induced delays, it looks like it's 1 game update every 3 frames.  The movements more or less match DOS's (yes, the climber is not constant y-change in DOS either).

I'm still a little thrown off by your report that in some cases removing the scrolling actually slows a solution down.  I think I'd like to see the two movies for this case (ie. the original faster version with more scrolling against the slower version with less scrolling).  In fact, maybe the original movie in the emulator's formats (basically anything where no intra-frame compressions are applied that may affect any frame-by-frame comparisons, so definitely not something like MP4).

Fun 4 does have those constantly animated, relatively large acid objects in addition to the usual tiny exit top.  That would be my current suspicion as far as why there's no delay in Fun 2 while there is in Fun 4.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on January 29, 2016, 11:45:11 AM
Yes, I noticed this whilst working on a solution for Fun 6, I've attached 2 bizhawk movies (they're played with the bizhawk emulator with Lemmings Genesis European ROM loaded). The version with the cosmetic screen scroll at the end saves 4 frames. (The actual solution isn't perfect as I got sidetracked by this) For quick reference here's two pictures, the frame count is at the point where 20% are saved in the upper left corner. Objects are also pointed out and counted. (EDIT: I added a 3rd picture)

(Pictures under spoiler)
Spoiler (click to show/hide)

Notes: There's less lava shown on the slower solution. Fire blower is shown on both. Exit is shown on faster solution but entrance isn't. Again less lemmings shown on slower solution.
If the screen is scrolled all the way to right a further 3 frames are saved.
Scrolled all the way to the left and it's still slower but is 1 frame faster than no screen scroll.
Excessive screen scrolling just causes delays though.

Frames are still lost during the scroll (on certain levels?), but afterwards there is some kind of trade off that reduces lag, what that is is still a mystery.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on January 29, 2016, 01:11:14 PM
It looks like things first diverged on frame #1691, but the funny thing is, at that particular moment it's actually the 1992F movie that got ahead of the 1988F movie at that point. :XD:

The movies however, did confirm one thing: even without any scrolling, the # of frames per game update is not strictly constant.  Or to put it differently, there must be other factors that can cause deviations from a strict 3-frames-per-physics-update cadence.  For example, observe that on frames 1507-1511, it took 4 frames rather than the normal 3 for the next game update to happen (ie. the lemmings move forward), even though there is no scrolling or even any cursor movements whatsoever.  I don't know if that's actually the first frame that broke the 3-frames-per-update cadence.  I did note that after that point, it starts fluctuating with unclear pattern between 3 and 4.

Perhaps it's not just objects, but all sprites that are onscreen?  That would also include things like lemmings, the explosion countdown numbers, explosion particles, etc.  Basically anything besides terrain and steel.  But then I'm not quite sure how that would translate to an irregular 3-4 fluctuations though (you would've expect it to just become a constant 4, since the number of sprites clearly isn't decreasing at that point in time).
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on January 29, 2016, 01:25:23 PM
Yeah, from what I've observed it is only 3 or 4, I haven't seen any 5 frame updates (and I hope I don't ;P ), it's just finding any rhyme or reason about it, screen scrolling itself definitely tends to set it to 4 for some levels, but what else affects is still a mystery
1507-1511 is the first time I see a 4-cycle rather than a 3 too, so this is going to be what I focus on
The thing that happens on this frame is the 50th and last lemming out's sprite is drawn (or the 49th still shown on screen)
A picture of frame 1511 is shown, with sprites (excluding the cursor) counted
Spoiler (click to show/hide)

I'm going to try and reduce the RR part way through the level and see if this causes less delays
EDIT: Yes this has stopped the 1507-1511 4-cycle, 20% saved is now at frame 1949 saving 43 frames (with no screen scrolls at the end), in fact doing this has removed all 4-cycles in the level, so it's definitely something to do with either sprites or keeping track of lemmings. (Scrolling still causes 4-cycles at the end though)

EDIT2: Decreasing the release rate on Fun 3 (Blockers) didn't save any frames despite having the same number of lemmings, it has less object sprites so I'm going to assume that's why.

EDIT3: There are some 4-cycles in Fun 1 when a lot of digging is going on, not sure what's causing these or if there's anything that can be done about them. I have a feeling it's the particles from the digging, scrolling the screen left at the end saved 1 frame. Some more frames may be saved if I scroll the screen as left as possible at all times. (Due to a lack of objects or lemmings or sprites screen-scrolling doesn't seem to delay this level)
EDIT3.1: No more frames were saved that way.

I attached my current memory watch list to this post too which makes things a lot easier to see (it has each lemmings x-position etc)
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on January 29, 2016, 07:41:37 PM
Well taking a break from weird cpu cycle lag scroll stuff... here's an actual new level solution

Fun 6 - A Task for Blockers and Bombers in 1111 frames (~23s)
https://youtu.be/QjT0MakayRY

First a bomber is set to get through the first floor as to the right as possible. Right below that a blocker is set so no lemmings go the wrong way. Another blocker is set to keep lemmings grouped temporarily, letting two go on. Very temporarily in fact because that blocker was set to be a bomber earlier, so it will be a blocker as short as possible before exploding and releasing the others.
Meanwhile the second of the two loose lemmings is turned into a bomber and the first one blocks just before the thin pillar on the right, pushing the bomber through just as it explodes so there is no period of oh-no-ing time wasting, the resulting explosion removing the wall and freeing the blocker.
The release rate is also decreased due to the recently discussed cpu lagging, the same reason the screen isn't scrolled at the end.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Apjjm on January 29, 2016, 08:13:50 PM
This is really interesting and looking forward to seeing where this goes :lemming: - I hope you get to the bottom of the frame loss with objects & scrolling, i like reading about the technical stuff like that which goes into a tas.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on January 29, 2016, 08:23:31 PM
I'm at work and don't have the computer with the emulator with me, but I wonder if the emulator may have some sort of "sprite counter" or similar that could be helpful for the lag thing, just like it has a counter for frames.

[edit: extra stuff moved to another post]
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on January 29, 2016, 08:51:52 PM
The emulator doesn't have a sprite counter that I know of, though I found earlier you can remove the terrain layer leaving just the sprites. There may also be a memory value somewhere in the games code that tracks that.
(Genesis -> Settings -> Disable bg layer B)
It looks like this
Spoiler (click to show/hide)
(Particles and lemmings are on their own layer)
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on January 29, 2016, 09:09:30 PM
Incidentally, it would be good to attach the .bk2 movies for all non-trivial solutions, for obvious reasons.

For Fun 6, I wonder if it's worth testing having an exploding faller free the 2nd blocker (ie. the "temporary" one), instead of having that blocker itself explode.  This has two effects: 1) you may be able to free that blocker sooner (and have him exit in lieu of the faller you exploded), though it's unclear whether that would have any effect on the last lemming to exit; 2) it may be possible to have a slightly shallower explosion pit.  This saves 1 frame by avoiding a 3-pixel stepping-up in the explosion pit that a walker would have to jump for one frame to get up to [2-pixels is the max to avoid triggering jumping], and possibly a little more if it also reduces the amount of falling into that explosion pit.

The technique of blocker-pushing the lemming through the thin wall to explode without oh-no is interesting, but its benefits are somewhat less clear since there seems to be so much time between that explosion and the final-lemming-to-exit getting there.  I'm sure I probably overlooked something, but I'd expect the main benefits there to be related to some minor reduction (if any) in time spent falling there?
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on January 29, 2016, 09:39:59 PM
Here's all the solutions as .bk2 files (https://drive.google.com/folderview?id=0B24bnHjK2QUDU0ZsdFpPWXFnVWs&usp=sharing)

I did experiment with falling bombers, but I couldn't save any frames with it, it still may be an option however. The limiting factor here is the final few lemmings coming from the entrance and walking as fast as possible to the exit. A shallower pit has some hope of reducing this time I feel.

The blocker push isn't actually needed in this solution, I just left it there as it didn't make the solution worse and is accommodating to possible later frame reductions (e.g. experiments with falling bombers often require this to happen) if no other frame reductions are found that require it I'll most likely remove it
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on January 29, 2016, 10:53:34 PM
in fact doing this has removed all 4-cycles in the level

Out of curiosity, did you determine that through spot-checking (or maybe even an exhaustive bunch of framestepping?? :lem-mindblown:), or did you already have some sort of automated tool that can detect exactly where the 4-cycles are in a movie?

I'm thinking that having such a tool would be useful as I fear it may be very difficult to determine the exact conditions of 4-cycles without some sort of detailed understanding of the game hardware and software.  At least then we know exactly how many frames were wasted in a given solution due to 4-cycles; you might not be able to eliminate all of them but it'd give a target to strive towards, as well as yielding a minimum margin of improvement you need to definitively beat an existing solution (ie. if an existing solution has at most N "wasted" frames from 4-cycles and the new solution saves more than that).

I'm tempted to try my hand at creating such a tool, though I doubt I have the time.  I'd also need to explore the memory a little more, to find the right locations to watch in order to determine when the game does a physics update.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on January 29, 2016, 11:10:05 PM
I just frame-stepped through the whole thing :P It only took 2-3 minutes though. I have thought of automated tools but I don't know how to go about making one, there should be some good memory watches to find though which is what I'll work on next

EDIT: Well I found something that seems very promising
Value F54D is a counter that goes up by 1 every frame, looping every 3 frames. (1,2,3,1,2,3,1,2,3,...)
Physics updates everytime the value is 2. On a 4-cycle it hangs for 1 frame on 1. (1,1,2,3,1,1,2,3,...)
Freezing this address instantly crashes the game, so it's important.

EDIT2: 2byte value FFD8 is another interesting one, cycling like this (0,4,255,0,4,255,...)
On 4-cycles however it goes like this (0,63826,4,255,0,63826,4,255,...)
This is useful because 63826 is a big and eye-catching number, this value is a lot more unpredictable though.

EDIT3: I redid fun 5 so there's less screen scrolling etc removing 31 frames making the current record 1476F
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on January 30, 2016, 01:05:46 PM
Ok, I've something ready to help with counting these lag frames.  It uses the LUA scripting feature in Bizhawk and F54D memory watch.  I'm new to this so there are some limits to what can be done with it at the moment.  How to use:

1) save the attached LUA script to the "Lua" subfolder under the main folder of Bizhawk.  (You can save it elsewhere too if you must.)
2) load a movie
3) pause the emulator (ie. pausing the emulation, not the game itself)
4) in the menu bar go to "Tools" -> "Lua Console".  This shows a "Lua Console" popup window.
5) in Lua Console's menu bar, go to  "Script" -> "Open Script...".  Find the script file from step #1, select it and open it.  It should now be listed in the Lua Console with an icon next to it at the left that looks like a "play" triangle, indicating script is active.
6) resume emulator and let the movie play out.  Once it gets to the actual level you'd start seeing a "lag frame counter" displayed near the bottom of the emulator window.

Due to how the script works and how the emulator apparently works, note the following:

A) Whenever a level is loaded and user is at its preview screen (the one that tells you the title, save requirement, etc. of the level you're about to go into and play) , it appears to clear the memory at F54D to 0, a value never seen while actually playing a level.  I catch this condition as an indication to "reset" and hide the lag frame counter.

B) The script starts tracking lag frames and show the counter at the moment F54D first goes from 0 -> 1, which happens shortly after you press START to actually start playing the level.  Fun fact: from testing so far, apparently at the beginning it will always do 0->1, then 1->1, and then finally the regular 1-2-3 cadence.  So apparently there is always a lag frame at the very start.  I'm assuming this is unavoidable so I've adjusted the script to basically ignore that one when reporting the lag frame count.

C) The script is set up to have the emulator call it on each frame update, then it checks and see what happens with F54D.  It can handle the frame counter going up by 1 or down by 1, so normal speed,  turbo speed, and framestepping forward and reverse all works as expected for the lag counter, whether in movie mode or actual play mode.  Anything else that cause the frame counter to change by other amounts will break the tracking.  The script will detect that and report this condition, along with freezing the reported lag count value to the most recent one (until the whole thing is reset again by reloading the level or reloading the script, a la A above).

D) Savestates do not work with this.  It looks like the scripting feature does provide a way to load and save custom data into savestates, which would be required in order for the script to properly handle savestates.  Currently loading a savestate will likely trigger the "stop tracking" behavior mentioned in C.  I'll make another post if I ever get the script updated to work with savestates.

E) It seems that the emulator will disable the script whenever you select another movie to play, or tell it to replay movie from beginning.  You can tell this happened in the Lua Console by seeing the icon next to the script's name changed from a play icon to a red paused icon.  In those cases you'd have to re-open the script in the Lua Console to re-enable it after such actions.  You can do this quickly by going to the Lua Console's menu and do "File" -> "Recent Scripts" and re-pick the script from there, instead of browsing for it all over again.

F) I've tested and found that the script still works when you pause the game (ie. not the emulator itself); F54D's value continues to cycle the same way (and can lag as well if you do scrolling or other such intensive actions) whether game is paused or not.

G) Currently the script lacks a way to detect that you have exited the level.  Once you exit the level, apparently F54D's value will be stuck at whatever value it most recently has, which will confuse the script into thinking it's lagging forever at this point.   So you'll see the lag counter constantly going up alongside the frame counter at that point.  Once you load a new level and go to the preview screen, that will finally reset F54D's value to 0 which will reset everything (as explained in A above).  I'll fix this bug once we figure out what memory we can watch for to determine whether you have exited the level or not.

H) I mentioned in previous post I intend to also output the exact frame counter values for which each lag have occurred.  This is not yet currently done, but the lag counter itself should be enough for now to help you out in this regard, even if it means you may have to framestep forward and backwards to do so.

Anyway, let me know if you have any questions or problems with using this.

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

From my script, the lag counts for the solutions you've uploaded so far:

Fun 1 835F: 4
Fun 2 978F: 0
Fun 3 1008F: 7 (all of them occurred after you press A+start so currently not part of the frames you are counting; the question is if there's some way to eliminate these, would you be able to press A+start sooner?)
Fun 4 1844F: 2
Fun 5 1507F: 55 (49 of which occurred before A+start)
Fun 6 1111F: 1
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on January 30, 2016, 01:25:52 PM
Oh wow, thanks a lot! This will be useful
However I'm having trouble running this script, it crashes the emulator and throws this error
[fixed]
Maybe it's because of different emulator settings? I've attached my settings (config.ini) to this post.

I fixed the problem nvm :D

With fun 3, those lag frames can be removed by decreasing the release rate, they don't allow A+Start to be done earlier but they do make the fade out at the end go faster by 7 frames which will affect the total TAS time so should be removed.
This issue points out a flaw in what I've been doing so from now on I will count frames from when the level finishes loading to when the results screen starts loading. The other values will be changed to reflect this.

Fun 1 835F -> 890F
Fun 2 978F -> 1033F
Fun 3 1008F -> 1063F (including removing lag frames)
Fun 4 1844F -> 1896F
Fun 5 1476F -> 1528F
Fun 6 1111F -> 1166F

EDIT: Got the 1 lag frame out of fun 6, making new solution 1165F
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on January 30, 2016, 03:40:06 PM
...removing the 2 lag frames just using screen scrolling from Fun 4 made the solution longer :XD:
Removing both resulted in an extra frame
Removing just one resulted in 2 extra frames
Adding one to make 3 total lag frames resulted in 4 extra frames
I'm not sure why but it might be something to do with win conditions only being checked 1/3 frames like a lot of other things, and having extra frames makes the cycle sync up better or something... I added movies to this post so you can see for yourselves

EDIT: Caused by a silly mistake on my behalf, ignore it
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on January 31, 2016, 12:04:17 AM
Fun 7 done, this one was annoying :sick:

Builders will help you here in 2012 frames (~40s)
https://youtu.be/nCk9ykm7TOw
This level is a real pain to optimise due to the genesis's limited controls, so I'm sure there'll be more frames knocked off in the future. Not much special to say about it
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on January 31, 2016, 11:40:39 AM
...removing the 2 lag frames just using screen scrolling from Fun 4 made the solution longer :XD:

I finally got around to playing the movies, but I am not seeing what you are reporting? ???  In the 2LF version, frame counter 772 is first frame where the level starts becoming visible, 2649 is where the post-level screen starts becoming visible, and 2659 is when the fade-in completes.  In the 0LF version, it's 772, 2647, and 2657, exactly 2 frames less.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on January 31, 2016, 11:56:18 AM
Ah, looking back over the two solutions I see that there isn't any strangeness happening, the 0LF version is indeed 2 frames shorter , there's just a small quirk with the TAS editor that can make it seem like that's the case in certain situations which I now know how to avoid, so yeah disregard that post :-[:lix-ashamed: Checked other solutions for same errors, fun 5 had one meaning real time so far was 1531F rather than 1528, every other one had no errors.



EDIT: Might as well get this mega easy level out the way
Not as Complicated as it Looks in 1486 Frames (~30s)
https://youtu.be/Vlt-Zn1Lb48
Nothing interesting here, just a blocker and your done. You don't even have to do anything to reduce lag frames.

EDIT2: Already obsoleted, got a builder under the entrance which reduced falling time, so new solution is 1478F and may be optimised further, this level is no longer 'mega easy' :P
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on January 31, 2016, 09:12:16 PM
As Long as You Try Your Best in 1733F (~35s)
https://youtu.be/rH1DpB74q70

2 solutions here, both the same length.
1st one is the trivial solution, just two bashers through the middle pole.
2nd one places a builder under the entrance to reduce falling times. This one has more potential but I couldn't get it better than the trivial solution.

I'll use the first solution if I can't improve the 2nd one later on.

Also going to update the youtube videos.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Simon on January 31, 2016, 09:33:40 PM
Reading your 2nd solution, I've imagined something quite different from what you did in the video.

I thought you would build under the hatch with a lem that has just landed. After building 1 or 2 steps, bash or mine to cut off. Again build with a fresh lander, cut off. Do it a 3rd or 4th time, if necessary.

Doing this 3 times shortens the fall by 1 frame (lems fall 3 pixels per frame), and you rescue all the builders, because you cut off the stairs.

This hinges on keeping the right end of the builder construction nicely sloped downwards.

-- Simon
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on January 31, 2016, 10:02:44 PM
Unfortunately doing that results in this, the builder doesn't reach back enough

EDIT: Another error, it does work.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 01, 2016, 10:21:16 AM
5 Miles (aka Smile) if you Love Lemmings in 631 Frames (~12s)
https://youtu.be/hy0i5mog0ao

Quite simple (so far).. Blocker and floaters to solve the level as normal, the miner at the top shortens the falling by a few frames.

Shortest level yet :D
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 01, 2016, 10:55:15 AM
Unfortunately doing that results in this, the builder doesn't reach back enough

No, you just didn't do it right, it is possible to build right on the landing spot.  I think you need to press C slightly before you actually see the lemming land.  See attached emulator movie.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 01, 2016, 12:37:33 PM
I've updated the lag-frame counting LUA script (just replace the file with the attached version to use) as follows:

- It can now detect end-of-level condition and avoids the false detection of lag frames past that point.  I'm using the byte at memory location F9E2, which from observation appears to be 1 while in-level and 0 otherwise.  Note that at that point the post-level screen is not at all visible yet, but it is the memory location I found that changed early enough to avoid any false detection of lag frames (it is basically at the exact point where the screen resolution changes going from in-level to post-level).

- It now outputs the frame counter values of each lag frame detected, in the "Output" section of the Lua Console window.  Specifically, whenever time moves forward and a lag frame is detected, a line is written there showing the frame counter value for which the lag frame was detected.  Also, upon detecting the end-of-level condition per first point above, it will output a whole summary section describing when (frame counter value) it detected end-of-level, and the full list of all lag frames' times (ie. the frame counter values each occurred at).

The output can get a little noisy especially if you start framestepping backwards and forwards, potentially causing the same lag frame to be outputted multiple times (don't worry, it won't double-count anything).  The script does clear the entire output whenever you reload the script, and you can also clear the Output section at any time by right-clicking it and select "clear" from the context menu.

Savestates still not supported yet.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 01, 2016, 01:08:01 PM
Thanks for the update, I'll use it lots.
And oops another stupid mistake from me :'( not sure how I missed that; but unfortunately this technique still hasn't managed cut frames, Fun 9 is very sensitive to lag frames for whatever reason and all the building/bashing causes enough of them that it negates any benefits (if they didn't exist, it would be faster) I often ran into upwards of 100 lag frames.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 01, 2016, 07:09:33 PM
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.

(http://i.imgur.com/Kj4ytKq.png)
(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.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 01, 2016, 08:15:36 PM
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).
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 01, 2016, 09:02:03 PM
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 (http://tasvideos.org/forum/viewtopic.php?p=427973#427973)
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 02, 2016, 11:41:52 AM
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. ???
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 02, 2016, 12:22:19 PM
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).

Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 02, 2016, 01:14:30 PM
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:
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 02, 2016, 02:03:59 PM
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.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 02, 2016, 07:13:59 PM
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...
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 03, 2016, 07:31:25 AM
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).
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 03, 2016, 02:03:25 PM
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.)
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 03, 2016, 03:30:22 PM
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...
Title: Re: Lemmings (Genesis Port) TAS
Post by: grams88 on February 04, 2016, 12:07:47 AM
Hi Gronkling, Is that not very hard to do the tool assisted speedrun? Keep up the good work. :)
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 08, 2016, 12:24:42 AM
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.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 08, 2016, 03:01:54 PM
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.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 08, 2016, 08:45:07 PM
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...
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 08, 2016, 11:54:01 PM
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.

I noticed that using the cursor to scroll the screen one tiny amount can sometimes avoid causing a lag frame, compare to A+left/right, which scroll the screen by a much larger amount at once but almost always cause a lag frame.  So the idea is that maybe with some sequence of cursor-scrolls and A+left/right-scrolls, where all the cursor-scrolls cause no lag frame and there are enough of those, maybe you could potentially end up scrolling the same/larger distance while using slightly less lag frames.  But so far I'm not sure I'm getting enough of those no-lag cursor-scrolls to gain any advantage.

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).

Hmm, I haven't used TAStudio at all yet, will have to play around with it and see.  Unfortunately there may not be a good (or at least easy) way to deal with this, as I only see one thing in the reference documentations (http://tasvideos.org/Bizhawk/LuaFunctions.html) that allows me to save supplementary data to a savestate, which has no mention that it doesn't work with TAStudio savestates.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 10, 2016, 09:39:08 PM
hmm interesting, it depends if you can scroll fast enough as scrolling 1 pixel at a time on certain frames will be much slower + the cursor will also have to be moved if it's needed away from the edge of the screen, but it could be used in some situations later I'm sure... I will definitely keep it in mind. Using A+S scrolling at the start of the level almost never makes lag frames so that's the best method as of yet.

TAStudio allows for more precise/easy jumping around, though it's not a huge bother if the script doesn't work with it because it's perfectly useful as it is :)



Fun 17 in 1270 Frames (~26s)
https://youtu.be/kEIG0eUZcIg
Only paying attention to the first two groups seem to cause the best result. Some hectic bashing through the two right pillars, and then a steel glitch to reduce the amount of floaters needed so that the time can be spent bashing the stairs next to the exit to reduce time due to jumping.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 12, 2016, 03:05:55 AM
TAStudio allows for more precise/easy jumping around, though it's not a huge bother if the script doesn't work with it because it's perfectly useful as it is :)

I looked into it.  It might still be possible to support TAStudio despite its savestates not able to carry the script's data, but will probably require some hacks to make it work.  The hack is that TAStudio movies have per-branch markers list, and it looks like you can associate any frame of a movie with a marker (which is just some arbitrary text).  Normally markers are used by the user to annotate points of interest in the movie, but can certainly be repurposed by the script to store its tracking data in a per-branch fashion, given that some frames in the movie are almost never going to be annotated by user (eg. the first few frames after power on are not interesting and therefore prime candidates for script-inserted markers).

Essentially we use markers as a poor-man's method of allowing the script to "savestate" its tracking data to the branch.  While you are messing around within the same branch, the marker will always be updated by the script after each frame to reflect the most current state of the branch:  jumping backwards any # of frames => roll back all lag frames seen by script after the target frame you jumped backward to; advancing forward in time works as usual.  If you switched branch in between frame updates, it restores the state (which would include the markers, ie. the script's own savestate) of the branch at the time you created it or last updated the branch, effectively working like you load a normal savestate.  Saving the TAStudio project itself takes the current state (including markers) and save that, so reloading the project would restore to that state, similar to the branch switching case.

At least that's the theory.  Having to cram the script's data into text and back on each frame could end up tricky performance-wise, will have to do some tests and see.  This endeavor will definitely be more complex than adding support for normal savestates (which was already somewhat hacky and technically tricky in parts).  Don't expect progress anytime soon. :XD:

===========

Quote
Fun 17 in 1270 Frames (~26s)

I'm wondering if there's a good reason to assign the floaters so last-second?  You don't really need to optimize those lemmings--it's the last few to exit for save requirement that needs optimizing.  In any case, just like in "We All Fall Down", I believe you should dig down exactly multiples-of-3 times before stopping the digger (it currently does 4).  This will save 3 frames (ie. one physics update cycle aka "PUC") over non-multiples-of-3, assuming no changes in resulting lag frames.

Bashing the stairs next to the exit like you currently do, would turn a 4-pixel step into a 3-pixel step, which saves 3 frames (ie. one PUC) per change, though I don't know if the bashing itself may introduce lag frames that would slightly offset the advantage occasionally.  With a digger+basher possibly lowering the 3-pixel step further into a 2-pixel step, you can save another 3 frames (1 PUC) each by not having the lemming do a jumper transition to go up the step, but again dependent on whether/how the additional skill usages may introduce lag frames.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 13, 2016, 05:07:24 PM
Manage to remove 6 more lag frames from Fun 11 (so down to 1660F with 12 lag frames).  It seems that having less lemmings in the compressed crowd can help reduce lag frames during the fade-out.  I first did a quick test of that idea by first manipulating the memory to artificially remove some of the lemmings in the crowd, and found that removing 4 from the crowd seems able to get down to just 1 lag frame during fade-out, while removing more doesn't seem to help.  Granted, that test is obviously not the same as an actual solution, but at least with this actual solution (which reduces the crowd size by sending more climbers up during the beginning), it did work out to getting just 1 lag frame during fade-out as the test suggested.

I did determine that a no-scrolling solution is probably not optimal, even if you avoid using the bomber.  Probably due to the one-way wall animations, it seems that once enough lemmings have entered the level and are on-screen, merely walking will still generate lag frames.  Scrolling also seems to require 1 lag frame per movement in this level even with no lemmings around (again, probably the one-way walls to blame).  So it seems like there's probably a minimum of around 10 frames required from just scrolling the left side offscreen.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 13, 2016, 09:09:30 PM
Quote
Don't expect progress anytime soon. :XD:
Yeah don't worry about it! ;)

Using your suggestions for fun 17, I saved a further 4 frames making new solution 1266F. The stair bashing at the end definitely saves frames.

Thanks for the new fun 11 improvement!



And Fun 18 in 2562 Frames (~52s)
https://youtu.be/-961ZucnrWM
Just bombing at strategic points and scrolling to try to remove lag frames caused by large numbers of lemmings.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 14, 2016, 01:35:28 PM
Took a stab at lag frames reduction on Fun 18.  Now down from 166 lag frames to 58, so 2454 frames.

"Fun" fact:  you'd notice when I scroll back to the left, I continue to held down A+Left for a bit of time even after the screen already cannot be scrolled further left.  That apparently somehow makes a difference with lag frames, believe it or not. :lem-shocked:  If I release the buttons immediately after the screen has reached the leftmost position, I can wind up with up to 3 more lag frames.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 14, 2016, 08:12:06 PM
Oh wow, that's a very odd fact, quite "Taxing"... so seemingly useless inputs can affect lag frames too hmm :-\ these things keep getting more and more mysterious. I'll assume that it only happens on very lag sensitive levels such as that one.. but I guess for now its just something to trial-and-error

Good job on getting the lag frames out there too!



Fun 19 in 3994 frames (~1m 20s)

https://youtu.be/_BJBjvizQdI

One of those levels where there's no choice but to do a very normal solution that takes a while. Lots of anti-lag-frame scrolling though, and I even manage to get a cosmetic scroll at the end for no cost.

Also it seems youtube suddenly want to upload my videos in 144p despite not changing any options, so sorry that these videos have been all blurry
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 15, 2016, 02:49:18 AM
and another one...

Fun 20 in 1764 frames (~35s)
https://youtu.be/i4NT_OYMWpw

A pretty interesting one. Two builders get over the first gap as soon as they can, and then bash to start walking again, also keeping there being no fall distance to the top of the steps. Miners are then used to shave off the corners to reduce falling times (this surprisingly doesn't cause many lag frames). The thin pipes are bashed through as you'd expect.

The last gap is the tricky one, a regular builder goes over the top to let the last few lemmings needed get over quickly. It's stopped with a basher as soon as possible. The ones that fall down create a basher staircase to the exit. It's constructed in such a way that it won't cause anyone going through the normal bridge route to fall down and step up. There's also a blocker to turn around a couple of stragglers from the basher staircase.



EDIT:
Let's get this one out the way
Fun 21 in 3819F (~1m 17s)

https://youtu.be/0gm-Aj2IQKA

Not the marble one of the same name which will be much more interesting. This is another one where there's no choice in what to do. Screen scrolls to reduce lag frames. The release rate had to be figured out by trial-and-error, there are probably better RR changes out there.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 15, 2016, 02:35:17 PM
Nice job on Fun 20! :thumbsup:

I was able to reduce 3 more frames out of Fun 11 (so 1657F), by using those climbers I sent up to smooth out some of the steps on top of the wall.  Doing so unsurprisingly adds a bunch of lag frames (precisely, 6 more), but still apparently add up to a small overall savings of frames.

==========

For Fun 19, here are a bunch of ideas to think about:

- By using a blocker at the starting area, you can alter the timing of the crowd with finer control such that you may be able to send them up a little sooner.  This is not the only way to alter timing, but likely the one method that gives you the most control over timing of crowd release.  Setting the blocker in the mining tunnel could also work, though it'll likely scatter the crowd slightly if some lemmings overtake the miner before it breaks through.

- The miner can start mining up to 5 pixels further to the right than where you're currently mining (ie. at the landing spot from the build bridge) without hitting steel.  This allows the miner to break through in 11 strokes instead of 13, which might again help allow you to release the crowd sooner.  (I think somewhere around 180 non-lag frames sooner.)

- If you don't use the blocker, you can instead send another climber ahead such that he overtakes the builder after the bridge is long enough but before the builder finishes.  (It can also be made to work if this second worker ends up behind the builder, but less efficient time-wise.) Have this second worker explode at exactly 5 pixels away from the leftmost column of pixels of the steel wall.  Then have the first worker start mining at the leftmost pixel of the lowest part of the bomb pit.  (So basically this setup is the lowest and furthest to the right you can get with a bomb pit, that still allows you to start mining without steel interference.)  This allows the miner to break through in 7 strokes, which might allow you to release the crowd sooner (though now you can't afford the blocker to help with timing, so I don't know).
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 15, 2016, 04:45:37 PM
Using the bomber suggestion, I saved 320 frames! (~6.5 seconds), record now 3674F (~1m 14s) The timing was very, very precise so I un-marked the solution as trivial. I ended up having to use the blocker too, to slightly delay the one to be a miner whilst the bomber exploded. That steel area does not give much room.

Fun 22 is annoying as expected :XD:
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 16, 2016, 02:25:12 AM
Fun 22 in 2958 Frames (~59s)

https://youtu.be/ccCVp3cxz4A

Eeek a beast of a level to optimise definitely! This takes the prize away from fun 7 for most tedious level so far... The main feature is the big basher staircase below the exit, this has to be recalibrated every time a small change is made to the method of getting through the trees due to different lag frames and lemmings distributions. There are almost certainly improvements that can be made here. It even takes a long time to load...

Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 16, 2016, 12:55:54 PM
I finally figured out and fixed one of my major pet peeves with my lag frames counting script:  that it keeps getting disabled after things like reloading a movie, core reset, etc., forcing you to reload it manually. >:( Now it no longer does that! :thumbsup:  Once you opened the script in the lua console, it will remain active throughout the entire emulator session.

No other changes have been made in this script update.  Everything should behave just like it does today, except you no longer need to keep reloading the script whenever you replay a movie, load a different movie, core reset, etc.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 16, 2016, 11:06:58 PM
Aah thanks! :D :laugh:

Fun 23 in 2414 frames (~49s)

https://youtu.be/41boqO8wg2A

Quite fun but not much to explain, basically just a lot of fall distance/step reduction. Levels are starting to take longer now though, mostly taking over 2000 frames recently.


EDIT

Fun 24 in 1318 frames (~27s)

https://youtu.be/VJe1jmYUf5k

Mining through terrain as normal. A small step is built to shorten a fall.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 18, 2016, 07:55:01 PM
For Fun 24 seems like fall-shortening can be applied to other falls as well?  In fact because all the other fall distances are not multiples of 3, you should already get a saving by reducing them down to nearest multiple of 3 with just 1 or 2 build steps.  Falling from first to second platform is 25 pixels, and the final fall to exit platform is 31 pixels.  The fall from entrance I think is 19 pixels (at least it should be on DOS Lemmings, so hopefully same in Genesis). [edit: still haven't tested, but since the fall from entrance do not involve a walker -> faller transition, resulting subtle differences in fall distance tracking might mean you need to use 2 build steps instead of 1 to actually effect a saving there.  Again, you need to test]

One other possible trick:  in DOS Lemmings anyway, fallers can't exit until on the frame where they land, but floaters (once they started the transition to floating, which can happen immediately after assignment if the lemming already fell for 16 or so pixels) can even before landing.  So depending on how exactly the exit trigger is set up in Genesis, it might be possible that if you set up the fall to happen directly over the exit trigger, you may be able to make exiting happen slightly earlier by assigning the lemming floater just one or two physics updates before it would've normally started landing and exiting, if it's able to trigger exiting before actually landing.  It is not a guaranteed savings though since I think the faller -> floater transition itself always eats up one physics update with no falling (again, based on DOS anyway), so it may well wind up that you save just as much time or more merely by shortening the final fall to 30 pixels instead.  You need to test especially since I don't know if the physics details in Genesis match DOS exactly here.  If float-exiting does help, the difference is small enough that you should only need to assign the floater to the last lemming that needs to exit for save requirement.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 18, 2016, 11:22:40 PM
It is not a guaranteed savings though since I think the faller -> floater transition itself always eats up one physics update with no falling (again, based on DOS anyway)

This turns out to be not true in Genesis based on a quick test I was able to sneak in right now.  In DOS Lemmings (or at least Lemmix, but I'd be really surprise if it's not the same in actual DOS Lemmings, since the game disassembly from DOS I just looked at leads to the same conclusions), if the fall is long enough to matter (more than 16 or so pixels), assigning the floater during the fall will always eat up one physics update cycle ("PUC") during which the lemming doesn't move (ie. the faller -> floater transition).  It is especially clear if you have another lemming following closely behind (eg. RR 99) that isn't assigned floater, or better yet, if you can achieve a setup where both lemmings are at the exact same position--after even a last minute floater assignment during the fall (as oppose to one that happened upon landing, which granted are two cases hard to tell apart), they should end up separated by one pixel.

In Genesis however, based on my testing, things behave more normally--the transition does not skip the falling during that PUC like it does in DOS.

What that means is that there is no waste of time in Genesis from the floater assignment itself, so there's a slightly better chance that float-exiting would help, unless of course there are other differences to offset this (eg. differences in positioning of trigger areas, or the ordering in which trigger checking is done relative to other updates, etc.; heck, I don't even know if floaters do bypass in Genesis the landing check for exit that normally applies to fallers).  Again, you just have to test in Fun 24 and find out the optimal time to assign the floater and see how/if it affects the timing.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 19, 2016, 01:44:57 AM
Calculating each fall distance needed, and building to round it down to the next lowest multiple of 3, I was able to save a further 7 frames making Fun 24 now 1311F.
The floater thing is certainly interesting. Skills can be assigned during the fadeout, and applying a floater to the last just before it goes into the exit causes the exiting sfx to play slightly earlier, however it doesn't seem to allow exiting out of the level any earlier so I couldn't get any frames saved unfortunately. It may have potential though...

Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 19, 2016, 02:06:52 AM
The floater thing is certainly interesting. Skills can be assigned during the fadeout, and applying a floater to the last just before it goes into the exit causes the exiting sfx to play slightly earlier, however it doesn't seem to allow exiting out of the level any earlier so I couldn't get any frames saved unfortunately. It may have potential though...

Hmm...haven't looked at your updated movie yet, but can you actually try applying the floater assignment a little earlier?  One of the assumption is that the trigger area is like DOS, where it actually extends 4 pixels above ground level, even though normally a faller still has to land first to exit due to the faller check.  If the floater behaves like DOS in bypassing that faller check, you should visually see the exiting lemming's animation be above ground level.  Depending on the exact falling distance, it could even potentially allow the exiting to start 2 PUC earlier and not just 1 PUC.  Also worth noting that the first 3 or 4 updates after floater assignment the lemming should still be falling by 3 pixels per physics update (in other words, it takes a little bit of time before the floating actually starts slowing down the descent), so there's a slight margin of forgiveness in how early you can assign the floater.

Also sorry to state the obvious, but remember to try starting the fadeout earlier as well if you haven't already--if the lemming truly is able to exit earlier, you should be able to start the fadeout correspondingly earlier as well.

Anyhow, I'll probably try this level out tonight myself to verify some of these points above, if you haven't beaten me to it by then.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 19, 2016, 02:13:34 AM
Testing with sunsoft 1 (Rules to fall) confirms a floater before exiting can make a difference. It saves 3 frames in that level. It's strict, only allowing assignment in a 1PUC time-window to save frames.

EDIT: And now I got the trick to work in fun 24, not sure what I was doing differently before...

EDIT2: Using this, 4 frames saved again, now record is 1307F!

EDIT3: and now fun 25, which isn't particularly interesting so I'll just add it here.

Fun 25 in 2135 frames (~43s)

https://youtu.be/ZWG8cxCDPW4

Reducing fall distance etc. Blocking to stop lag frames.

This video's pretty good showing lag frames though, the music syncs perfectly to the lemming count going up, until there's lots of them on-screen at which point it desyncs
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 20, 2016, 08:10:08 AM
Fun 26 done in 1878 frames (~38s)

https://youtu.be/4x2qwTzaT78

Uses a new trick where a builder alternates turns, stopping with a basher after 1 brick, as the one in front has placed one. This makes a fast way to travel almost horizontally through air. Also uses a small basher staircase to reduce climb time.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 20, 2016, 08:28:12 AM
Here's my attempt at Sunsoft 1.  I've never bothered to work out exactly where Gronkling's counting the start and end so I don't know how many frames exactly. :XD: I'm 99.999% sure it's optimal though, details below:

First, no lag frames to worry (yay)!  Based on my math and testing, the earliest lemming that can be saved after the digger must come out no earlier than 32 PUCs after the 1st lemming, and that's with assigning a floater early during the its initial fall, for extra delay.  This lemming will successfully turn twice in the dig pit, without then walking too far to the right by the time digger breaks through that he would've missed the exit trigger.  The solution in the emulator movie has every other lemming that came after all be released as fast as possible at RR 99 (movie shows RR 98 which as we all know and you can verify, is completely equivalent to RR 99) and all get saved along with the digger.  So first 12 lemmings except #2 and #3 were saved.  Digger (aka 1st lemming out aka "hero") cannot be sped up in any way, and as you can see in movie, hero ends up 1 PUC behind the 12th lemming out in falling.  And so I used the floater-exiting trick on the hero (it's the final floater assignment you see happening, with a very precisely positioned cursor and specific timing of assignment, shortly after the fadeout has started).  Using Gronkling's memory watches, I see that lemming #4 (ie. the one that entered 32 PUCs after the hero's entrance) and a few other lemmings who were assigned floaters "early" (and therefore suffer a slightly slower descent to exit when digger broke through), only wind up 1 PUC behind the hero in their exiting, and no other lemmings amongst the first 12 exits any later than that.

From testing, if you don't use an early floater assignment, the earliest lemming out after the 1st needs to be 34 rather than 32 PUCs after the 1st lemming just to avoid escaping the dig pit on the left, let alone not walking too far to the right afterwards to have gone past the exit trigger.  Delaying his entrance of course would delay every subsequent lemmings' as well, and 34 is more than 1 from 32.  Therefore avoiding any early floater assignments would force you to delay the release of lemmings more than you can make up for in their slightly faster descent.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 20, 2016, 09:52:33 AM
Aaa thanks a lot! :D I won't reach that level for a while (I'm continuing to go in level order initially to keep things organised and not end up with a bunch of horrible levels to do in a group at the end) but it gets it out the way early. This solution clocks in at only 505 frames (only around 10 seconds!), making it the fastest level yet.

Frame counts are took from when the level initially finishes loading, to when the results screen begins loading. In this movie that is frame 714 to frame 1219.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 20, 2016, 02:47:05 PM
For Fun 26 you may want to consult Clam's Lemmix replays (http://www.lemmingsforums.net/index.php?topic=2425.msg55168#msg55168).  It uses that same builder-basher speed-building technique, plus a whole gauntlet of additional tricks to minimize turnaround time on the right area where you need to pave a way upward through the terrain.  I don't know whether all skill assignments seen in the replay are feasible on Genesis without pausing, but even with some pausing you may well still save time overall.  The mechanics should be close enough for the solution to work.
Title: Re: Lemmings (Genesis Port) TAS
Post by: 607 on February 20, 2016, 07:19:18 PM
This is great! I didn't read all of it, as it's quite a lot, but spent a good 20 minutes in this topic ;)
I'm looking forward to reading and seeing more of this! :)
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 22, 2016, 12:02:27 PM
Fun 27 1029 frames (~21s).  Miner glitch FTW!
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 22, 2016, 05:46:05 PM
Oh wow! That's an amazing solution, I had managed to get it down to 1044F with direct drop but it hit a dead end. I didn't actually know of that glitch/trick :O I'm marking this one as hard on the table, which basically could mean 'uses a lot of precise glitches' I'll record the youtube videos of your two new solutions later today. I've been a bit busy the past few days, but my next task will be trying to apply clam's solution to Fun 26

And I'm glad you're enjoying this 607! :D

edit: https://youtu.be/RrgVnPt232s fun 27 solution up on youtube
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 22, 2016, 08:05:59 PM
Hmm, interesting.  Based on my calculations you'd need at least 16 build steps to reach the exit trigger on Fun 27 with direct drop.  So the best I can probably do with such a setup is to use the miner glitch to prevent vertical gains from the builders.  So I probably can't directly combine direct drop with the miner glitch for improvements, but, I can potentially use the leftover miners (plus builders etc.) to create a few more mid-air steps to lower the fall slightly (as falls of 3 or less pixels are "free" since they don't trigger walker->faller transitions), assuming it doesn't add too many lag frames to offset.  Will have to try this later tonight.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 23, 2016, 07:14:49 PM
Slightly out of topic, but when TAStudio is active in the Bizhawk emulator, I can't seem to change the inputs on an existing frame of the movie except through the "piano roll" interface in the TAStudio window.  In the common scenario where I'm trying to re-record parts of the movie, I'd like to do it through the normal controller input mechanisms of the emulator like I could when TAStudio is not active.

I did find that if I do a "truncate movie" in TAStudio, then controller inputs can be accepted starting from the truncated frame onwards.  But that's not the most convenient thing because each time you want to rewind back and re-record, you'll have to do the "truncate movie" again and again.  I suppose it's not that different from re-recording outside of TAStudio, where currently rewind is unsupported during recording and you'd have to reload a savestate to an earlier frame instead (which incidentally can't seem to be done either while TAStudio is active?), but it kind of defeats some of the usefulness of TAStudio.

I'm just wondering if there's something I'm missing about how to use TAStudio to rerecord parts of a movie, or is TAStudio just designed oddly?
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 23, 2016, 07:34:28 PM
I always put in inputs straight into the spreadsheet thing, that's the way that works best for me and I much prefer it over controller inputs so I haven't really tried getting the two to work, I think it took a little bit to get used to though.

I have reloaded save-states in the past with TAStudio open, though it's usually much quicker just to go to the frame you want to go back to and add then remove an input. This also keeps all inputs past that point the same.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 23, 2016, 07:45:52 PM
I always put in inputs straight into the spreadsheet thing, that's the way that works best for me and I much prefer it over controller inputs so I haven't really tried getting the two to work, I think it took a little bit to get used to though.

Hmm, that could work okay for some things, but I feel moving the cursor, a pretty common and significant action in this game, is more conveniently done through controller inputs rather than using the spreadsheet, though maybe I'm just not used to the spreadsheet thing.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 26, 2016, 05:31:06 AM
I use the spreadsheet for cursor movement too, it makes certain TAS-only movements (eg interlacing cursor movement with skill changes) much more easy.
Got another 28 frames off fun 26, making new record 1850F.
Fun 28 is proving a bit of a nightmare as expected, so far it's still in the 6000 frames range..
Title: Re: Lemmings (Genesis Port) TAS
Post by: namida on February 26, 2016, 05:39:50 AM
I'd guess that for Fun 28, the fastest solution would be a Mayhem 5-like route, using climbers and floaters to release the lemmings at the optimal times. Perhaps rather than climbers, a setup of good timing with bashing out the side and digging down a layer would prove more optimal.

I don't know how well I described this, so I'll have a go at performing an optimal solution in NeoLemmix and you can watch the replay and see if it helps. 1286 frames; might need a few more in Genesis due to the right-facing entrance.

(I am assuming that Fun 28 isn't one of the replaced ones... if it is, let me know the name and I'll take a look at it.)

EDIT: "Frames" in NeoLemmix is synonymous with what you call "physics update cycles" in this topic. So, assuming 3 or 4 frames per PUC, it'd be 3858 ~ 5144 frames. This still might be an improvement. And it can probably be improved further.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 27, 2016, 07:36:00 AM
A route using the sliding glitch may well be a contender for Fun 28.  See attached for general setup (crowd compression setup left as reader's exercise).  It definitely uses less build steps (~26 vs 50) than a Mayhem-5-style solution, but admittedly it's also offset by the extra amount of sliding up, bashing, and falling back down the route will take, so it's hard to say for sure which actually ends up better time-wise.  There's also possibly the ceiling route, but it's even harder to determine how many build steps that'd take, and how having somewhat less falling but potentially more bashing (etc.) would affect the total time needed.
Title: Re: Lemmings (Genesis Port) TAS
Post by: namida on February 27, 2016, 10:19:31 AM
Would it be quicker to, rather than sliding all the way up, time a bomber to go off at the right height to build to the exit from? Although I'm not sure how you'd go about getting a worker there too.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 27, 2016, 11:02:08 AM
I'm not quite sure how well the sliding solution will work as there is a small gap between the top and the exit platform.

(http://i.imgur.com/TCgRUIV.png)

This may be able to be able to be built over, however attempting to place a brick that close to the top of the screen causes the builder to fall through the brick it placed. I used some memory pokes to place a lemming where the sliders would end up, and bashing does end up very short of the platform.

(http://i.imgur.com/xX0yrlm.gif)

It is probably possible to get there if you were to also use diggers or miners, but it would take even longer.

Namida's regular mayhem 5 route so far is the fastest, my first draft of it takes 4916 frames (so neolemmix frames do mean 1 PUC).
My earlier attempts were ceiling routes, though these are very very hard to optimise, even 30 builders are not enough to work with.

Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 27, 2016, 11:13:30 AM
Interesting.  Looks like the top-boundary behavior is slightly different in Genesis and may cause some inconvenience that aren't present in DOS Lemmings. :XD: The memory poke is a good idea for testing purposes, can you give me the (x, y) values you are using?

Incidentally, when I examine it in DOS I had the lemming starting a few pixels even higher so that it wouldn't need to build over that gap you are falling through.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 27, 2016, 11:21:33 AM
I used y value 0, which causes the lemming to just clip down to the highest possible place (y=8). X-value was 50 there, though it could be anything lower too. So (50,0)
Title: Re: Lemmings (Genesis Port) TAS
Post by: namida on February 27, 2016, 11:26:11 AM
Hm, I didn't think about going right to the top and bashing across. Perhaps if you start from a bit lower (time a bomber to achieve this?) you can actually manage the build to the exit. Depending on the timing with the basher, you might be able to build without any further crowd control tactics; if not, a well-placed blocker near the left side may cut off some unnessecary frames.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 27, 2016, 11:45:32 AM
There's a lot of overhang that makes building very difficult, here's a build from y=15 which takes ~550 frames.

(http://i.imgur.com/f2vv82g.gif)
Title: Re: Lemmings (Genesis Port) TAS
Post by: namida on February 27, 2016, 12:14:13 PM
Could you perhaps use a bomber, then start two bashers, one a bit higher than the other, to get rid of some/all of that overhang? Somewhat like the setup used here, but using a bomber instead of the as-is terrain layout to set it up:

https://youtu.be/wKJmaO-8FVQ?t=6m31s

(Which reminds me... now that that level is no longer officially part of Lemmings Plus series, I should make a new level that uses that trick in some way...)
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 27, 2016, 01:38:33 PM
This is how I've adjusted the endgame portion so far, for Genesis with a sliding solution.

To test this, I got 70 lemmings out, then modified game memory to move all of them to x=26, y=33, facing left, sliding.  The y part is arbitrary, the x part matches where my proposed sliding route should put the lemmings at.  Starting from the frame where the sliding crowd reaches the top, it takes 752 frames before reaching the attached screenshot where you first see the crowd exit.

So it looks like I started the builder at y=12.  2 miners were used to get there from y=8, and since a miner lowers you fully within its first few update cycles in the stroke, I can relatively quickly switch over to bashing or building.  3 build steps are needed rather than just 2, since Genesis doesn't allow the lemming to get as high as you can in DOS.  And it turns out speed-bashing doesn't really work at the top in Genesis (lemmings tend to jump as they reach the end of bash tunnel where the latest bash stroke is only partially there, and near the top, unlike at more normal elevation, jumping easily turns lemmings around).
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 27, 2016, 02:45:49 PM
I can't seem to get that sliding set-up you had with the basher at the bottom of the pillar. I've included a movie that gets up to around the point where that would be created in case you want to try, for now I'm going to try and work on optimising the mayhem 5 technique.
Title: Re: Lemmings (Genesis Port) TAS
Post by: 607 on February 27, 2016, 05:49:16 PM
What is sliding?
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 27, 2016, 06:52:47 PM
What is sliding?

It's a glitch where lemmings get stuck in their jumping state, which is a 'hidden skill' that causes vertical upwards movement and normally happens just to walk over 3-6 pixel steps. If you time a builder incredibly precisely so that it occurs whist a lemming is jumping up to that higher piece of terrain, the jumper gets stuck in its jumping state moving vertically upwards until it reaches open space. It looks like this:

(http://i.imgur.com/hrKMwJc.gif)

It's very versatile and useful, but also very hard to pull off.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on February 28, 2016, 01:28:05 AM
I can't seem to get that sliding set-up you had with the basher at the bottom of the pillar.

To be fair, I haven't completely worked out the details yet of the setup.  The attached movie shows where to do the remaining builder assignments, but obviously doesn't quite work timing-wise as the crowd died, and in an actual solution, you wouldn't want to have to wait for workers to turn around and walk back to the pillar to finish the setup anyway like in the movie.  Looking at the setup, perhaps it's better to start the building to the pillar two pixels to the right of where we started building in the movie.

In my setup, I also have in mind for the crowd to be held in a digger's pit, between the pit's left wall and a blocker (with a builder to lead lemmings to land in the middle of the pit rather than the right edge of it, so they would get trapped left of the blocker and not the right), which makes it more versatile to send additional workers up via climbers if necessary.  That may or may not be needed to successfully make the sliding setup work, but is something to keep in mind.

I'll work on it a little more later tonight and see if I can get it to work fully.
Title: Re: Lemmings (Genesis Port) TAS
Post by: mobius 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.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 28, 2016, 04:25:55 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.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on February 28, 2016, 01:34:43 PM
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.
Title: Re: Lemmings (Genesis Port) TAS
Post by: namida on February 28, 2016, 03:40:36 PM
One thought - could some release rate manipulation, and a basher instead of a climber, perhaps cut a few frames off near the start?
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on March 01, 2016, 03:26:52 PM
I'll keep that in mind when I come back to that level.

Fun 29 in 2591 frames (52s)

https://youtu.be/oBKU2R-dMeU
Title: Re: Lemmings (Genesis Port) TAS
Post by: namida on March 01, 2016, 04:13:13 PM
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...
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on March 02, 2016, 12:15:51 PM
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
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on March 02, 2016, 03:35:41 PM
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.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on March 02, 2016, 05:25:20 PM
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)
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on March 03, 2016, 02:04:28 PM
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.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on March 03, 2016, 02:42:42 PM
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
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on March 03, 2016, 07:14:36 PM
: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)
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on March 03, 2016, 08:12:16 PM
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.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Simon on March 03, 2016, 08:26:09 PM
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
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on March 03, 2016, 09:15:08 PM
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.

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.]

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

Precise 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".
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on March 04, 2016, 12:37:19 AM
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.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on March 04, 2016, 01:08:14 AM
Hmm, reviewing the Genesis version of Fun levels in Lemmix editor, seems like Fun 8 and Fun 10 should benefit from a single build step like it would for Fun 28 and 30.  Yet you reported that it didn't help on Fun 10.  Perhaps the abnormally positioned exit-trigger part is specific to the Hell exit after all?

Fun 1, thanks to the uneven terrain near the exit trigger, might work for the inverse case (which admittedly haven't even been tested to work on any levels yet, so it's all speculation at this time).  If it works at all, you'd need to have a second lemming following very closely (4 pixels or less behind the lemming that would first reach exit), and have that second lemming dig once to erase most or all of that tiny bump leading right to the exit trigger.  The hope is remove the bump will expose a portion of the trigger area, positioned closer to you as you approach exit from the left.

I guess what would really help is to find out where in memory the trigger map may be stored, so that the exact configuration of trigger areas in a level can be determined directly.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on March 04, 2016, 10:36:08 AM
Yes, building in Fun 8 and 10 definitely doesn't have an effect. Possibly in this port trigger areas are defined for each object separately, rather than a trigger area being assigned to a set exit class, so the fire exit has a slightly different trigger area to other exits...

Digging near Fun 1's exit also didn't have an effect.

Now I'm going to dig around in the memory to see if I can find anything
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on March 04, 2016, 11:28:09 AM
OK, so the trigger map is around the memory locations between 7800 and 8200.
Fun 1 has exit triggers on values 802D & 806D
Fun 30 has exit triggers on values 811C/D & 815C. It seems a lot like a typo actually that wasn't noticed as it doesn't have an effect on normal gameplay.
it looks like this:

          C   D
802-  01 10
806-  11 00

so yes the trigger for the fire exit is slightly diagonal

The crystal tileset's exit trigger also is diagonal. This is what each tileset's exit's trigger area looks like (each pink square is 4x4 pixels)

(http://i.imgur.com/8zDlXjG.png)

Exit trigger value is 1, other values being triggers for different things.

Here's what each trigger value means:
0 - Nothing
1 - Exit
2 - Left side of a blocker
3 - Right side of a blocker
4 - Water
5 - Constant trap
6 - Left one-way arrows
7 - Right one-way arrows
8 - Steel (This may come in useful too)
9 - Middle of a blocker
A,B,C,D,E,F - Tied to specific distinct traps in a level

Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on March 05, 2016, 03:35:19 PM
Okay, finally successfully worked through some of the kinks in my earlier Fun 30 solution, now it's down to 928F.

One interesting technique to note:  it may be rare, but there are times when it can be better to select a skill using the cursor rather than B+left/right.  Particularly at the beginning when your frames are typically tied up with increasing the RR, while the cursor has little to do since no lemmings are out yet.  Since cursor movement, unlike all other actions in the game, can occur every frame instead of every PUC, at the beginning you can basically interleave cursor movement with RR increase to reach the skills toolbar.  The actual clicking on the skill icon will still need to take one frame away from RR increment, but that's still better than multiple B+left/right (where each press will take a frame away from RR increment) to reach the same skill.  And since an even RR is equivalent to the next odd RR, it's possible in some cases to take a frame or two away from RR increment without actually changing the timing of when lemmings come out.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on March 05, 2016, 05:20:16 PM
Here's a quick and dirty script to print out the trigger map as ASCII art.  I realize it's not sufficient as it's difficult using it alone to tell where the triggers are located in relation to the terrain, but at least it'll help identify any other unusually shaped triggers for now.

To use:  once you're inside a level, go to LUA console, then open and run the script (but first, you might want to right-click on the console output box and select the "clear" context-menu command to erase any previous output).  The script will immediately produce the ASCII output in the console output box, although it probably won't look correct there due to insufficient line width.  Just copy and paste it to Notepad or some other text editor with a line width of at least 128 characters (and use a fixed-width font of course) for proper viewing.  You'll need to reopen the script each time you want an output of the map.

Sidenote: I intentionally include one extra row of cells above and below the proper boundaries of the map, which is why you'll see some garbage for the first and last line of the ASCII map; those two lines are actually outside the 512x160 level area, and the script's just interpreting whatever's in the memory there as part of the trigger map.  This is on the (very) off-chance that we discover some glitch that tries to read or write values from/to trigger map for locations outside the 512x160 level area.  It's quite possible there's no glitch and the game will do the proper checks before trying to read/write (or that you can never get a lemming to a location in the level area that could lead to such read/writes), but you never know.

Legend:

X  -- exit
L  -- blocker left
R  -- blocker right
^  -- water
#  -- constant trap
<  -- one-way wall left
>  -- one-way wall right
S  -- steel
B  -- blocker middle
!  -- triggered trap
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on March 05, 2016, 06:58:04 PM
Excellent script! I'm going to save the trigger maps of each of the Fun levels.

Good idea showing extra cells, the data above appears to be another map interestingly, I really wish Bizhawk would let you adjust the number of values shown on each line but I guess nothing's perfect. Poking values in it messed with the graphics of terrain  so I'm guessing that it's to do with terrain drawing.
Have no idea what the data below is. Something to do with terrain graphic loading at the start of the level.

Marble's cutter traps are slightly odd, looking like this:
  ######
###### 
######

Fire's fire pit traps look like this:
   #######
#######

Steel areas are also a bit slanted in some places.

I didn't find any extra/missing triggers in the fun rating (other than the two pieces of steel at the very edges of Fun 28 not being steel, but I doubt that will come in useful :P )

AND

Fun 14: 6596F -> 6479F (-117F / 2.35s)
   ^- I used that cursor on the edge for small screen movement trick to save frames quite a bit here
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on March 07, 2016, 08:36:01 AM
The compilation of the whole Fun rating is here! It's total time as of now is 22 minutes, 11 seconds, though of course improvements still may be made to solutions.

https://youtu.be/tRMrXi3RTNg

In less interesting news, I did a solution to Tricky 1. aka I opened the solution to Fun 13 and put more waiting at the end ;)
Time for that level is 2143F (43s)
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on March 07, 2016, 08:01:26 PM
Maybe it's just an illusion, but watching the youtube video of the compilation, I feel like some of the transitions from the pre-level screen to the level are of slightly different lengths in different levels, which is somewhat unexpected.  Can you upload the BK2 emulator movie (or perhaps better yet, the TAStudio project) of the compilation in your Google Drive so we can take a closer examination at those?
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on March 07, 2016, 08:20:03 PM
Yes, some levels take longer to load for whatever reason which appears as hanging on the pre-level information. Especially fun 22 probably because it's a special level. You can see the different loading times in the regular movies too which accounts for most variation in frame count starts. I uploaded the bk2 to the drive (I made the compilation by manually editing the input log in a text editor and savestates so there's no tasproj file, it would be too large.)
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on March 07, 2016, 09:01:50 PM
Yes, some levels take longer to load for whatever reason which appears as hanging on the pre-level information.

Thanks, that makes sense now, I kept forgetting how underpowered the console can be.  So this is expected after all and not likely anything we can optimize on.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on March 08, 2016, 03:15:19 AM
Here's a potential solution for Genesis Fun 14 ("Room with No Exit") that I haven't gotten around to testing on the actual Genesis game, but is worth looking into.  The attached zip file contains the level in LVL format suitable for Lemmix (open with "original DOS Lemmings" style so the game mechanics match the one recorded in the replay file), and associated replay illustrating the basic idea.  Actual implementation on Genesis will vary slightly due to minor differences in a bash stroke's reach, but should otherwise work.  (Just make sure the fall from the 2n-thin-platform-from-top down to the 4th has some sort of stepping stone to break the fall--directly falling from one to the other would be 64 pixels which is 1 higher than the maximum safe-fall distance.)  The idea of course is to reduce one round of back-and-forth walking on the left side to save time.

Cursor placement will likely need to be very exact in order to select those lemmings that need to bash the "wrong way" (instead of incoming lemmings from the crowd getting selected, which will usually be favored due to the default of later-entered lemmings getting priority).  It's quite possible that in some cases the lack of pausing may even become a factor there, though hopefully not.  (And remember that in some cases, if the crowd's interfering with a particular skill assignment, it may be possible to make the interfering lemming air-bash at an earlier time, to effectively shift its position away from one that will later interfere with the skill assignment in question.)  And of course, it's likely that you'll get more lag frames with this solution due to needing to do more work on the left side, so I can't guarantee that even if the solution works out, its gains won't get wiped out by potential increase in lag frames.

[edit: note that the way I handled the bottom-left in the replay using a "backstroke" of the basher, it is obviously suboptimal.  The position I started the backstroke at ends up moving the wall there slightly further to the left (especially with the bash mask in Genesis), a wall that the walking crowd will need to turn around at.  The correct way should be to start the backstroke 1 or 2 pixels further right to avoid changing where the wall's at, or have the trapped crowd there free themselves instead of using the backstroke with a lemming outside that crowd.]
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on March 08, 2016, 05:46:51 AM
Incidentally, it looks like the compilation video is still using the obsolete solution for Fun 18 instead of the lag-reduced (http://www.lemmingsforums.net/index.php?topic=2425.msg55790#msg55790) one I provided.  Not that it matters since chances are good we'll find improvements elsewhere anyway.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on March 08, 2016, 11:28:24 AM
Good idea! This works in the genesis version and saves quite a lot of time. I don't even need a stepping stone on the 2nd floor here.
Saved 617 frames (so far) or 12.4 seconds. There may be more lag optimisation etc to be done though.
New record is 5862F

Also oops to using an outdated fun 18 solution, but yes that compilation will definitely have outdated solutions anyway, it's more for people to look at quickly.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on March 15, 2016, 12:39:27 PM
Here's another short, out-of-order try in Sunsoft, namely 19 ("Let's Go Camping").  I thought this might actually be the shortest for the game, but turns out it's slightly longer than Sunsoft 1 after all (520F vs Sunsoft 1's 505).
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on March 15, 2016, 09:24:52 PM
Thanks for the solution, another very quick level definitely

I've started on Tricky because I might as well, so here's Tricky 2 in 2387 frames (~48s)

https://youtu.be/45dfY4iySYk

This level has two equally viable solutions, the one shown here involving the sliding glitch which I've been able to get the fastest so far, or using a big basher staircase. They are quite close matched, around 100 frames difference right now.
Title: Re: Lemmings (Genesis Port) TAS
Post by: grams88 on March 17, 2016, 11:49:40 PM
I like the way that the lemmings just go up in that level you just did there.

Very Very sneaky but it's probably the quickest way you can do that level. :)

The fun special level, wow that is fast. :)

Title: Re: Lemmings (Genesis Port) TAS
Post by: Proxima on March 18, 2016, 01:26:13 AM
Just watched the Fun compilation. Awesome stuff, it's great to see what tricks can be pulled off on the most surprising of levels. I particularly enjoyed Fun 26 and 27 :)

Good luck with the rest, and I'm looking forward to the next compilation ;)
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on March 18, 2016, 11:47:56 AM
Thanks! :D



Tricky 3 in 1821 frames (~37s)
https://www.youtube.com/watch?v=MJEta6r-nTk
Title: Re: Lemmings (Genesis Port) TAS
Post by: Proxima on March 23, 2016, 05:16:05 PM
I haven't watched it yet, but this (https://www.youtube.com/watch?v=byC680Jde1g) came up in my Recommended videos today. It purports to be a TAS on the SNES version that includes all levels, unlike the previous one on YouTube that just did Mayhem as being the fastest way to get to the end of the game  :P  It might give you some ideas for route planning that transfer to the Genesis version.
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on March 23, 2016, 06:01:26 PM
I haven't watched it yet, but this (https://www.youtube.com/watch?v=byC680Jde1g) came up in my Recommended videos today. It purports to be a TAS on the SNES version that includes all levels, unlike the previous one on YouTube that just did Mayhem as being the fastest way to get to the end of the game  :P

Nope, it's the exact same one by the same person that started on Mayhem.  To be fair, it was stated the reasoning behind doing it that way was because the game lets you start on Mayhem without using passcodes (and let's be honest, probably also because it'd be super-tedious to do the whole game for real, especially since SNES contain a lot more of the non-port-unique builder-heavy levels).
Title: Re: Lemmings (Genesis Port) TAS
Post by: Proxima on March 23, 2016, 08:38:37 PM
Oh, I'm sorry :-[ It did say "all levels" in the video title, but I should have realised that was the case from the video length...
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on May 18, 2016, 11:55:41 AM
Took a break from this, but now I'll probably be coming back to it.

So here's Tricky 4 in 2935F (~59s):
https://youtu.be/A3s1fGAMNEc
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on August 06, 2017, 06:56:49 PM
Over a year later (sorry) and a new solution. I had several crashes whilst doing tricky 5, one of my least favourite levels, which demotivated me, and I'm skipping it for now.

Tricky 6 in 1545F (~31s)
https://www.youtube.com/watch?v=SW4kS9dOpGk

One interesting thing I don't think I noticed yet is that when you stop a basher tunnel to make a step, there's an extra pixel on the ceiling
(http://i.imgur.com/eHgsoxy.jpg)
This can be used to make an incredibly simple holding area that can be walked into which doesn't require a blocker.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Simon on August 06, 2017, 07:31:30 PM
Haha, love it. Excellent application in the level, looks like magic. Looking forward to more!

Skip finnicky levels until the end. I hope you can easily stitch together multiple movie files into a full TAS, even if you didn't record them one after another.

-- Simon
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on August 06, 2017, 07:33:56 PM
I'm going to go back to Tricky 5 in a few levels time, leaving until the end would give a huge lump of unfun levels instead of scattered about, and I'd just end up never doing them.

The files can be stitched together relatively easily, I already did it with the full fun ranking video.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on August 06, 2017, 10:51:22 PM
Tricky 7 in 2018 frames (~40s)
https://youtu.be/xhytpD2EmuE

There's basically no time to do anything meaningful in this level due to having to assign all the floaters and climbers at the start. Trying to put a small step on the wall that must be climbed doesn't seem possible as I haven't been able to change the digger once it starts due to all the lemmings walking in front. Extending the small platform to reduce the fall distance adds more lag frames, it is at the optimal height.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Simon on August 06, 2017, 11:11:28 PM
Skill music. 8-) The RR adjustment and floater spamming forces the strange intervals between for the waypavers. I see how there is no choice here.

At the ledge, you build immediately. My hunch would have been to mine/dig into the ledge with the leader, then build after the first swing made a dent. Maybe a small dent wouldn't have made a difference for the last exiter anyway? Fall distance costs time only for every 3rd pixel.

-- Simon
TAS with copy-paste is cheating >_>;;
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on August 06, 2017, 11:46:34 PM
the timing on the bridge across the gap near the end is already incredibly tight, adding a bit of mining/digging at the beginning makes it virtually impossibly tight especially without adding lag frames

E: Tricky 7 2018F -> 1937F (-81F, ~1.62s)
Title: Re: Lemmings (Genesis Port) TAS
Post by: ccexplore on August 08, 2017, 02:00:24 AM
Good job discovering that extra pixel left by basher with Tricky 6. :thumbsup: I guess normally that pixel gets taken out immediately by subsequent frames of the bash stroke, so it's not noticeable unless you specifically stop the basher on that frame.  And even then, it also has to have bashed far enough into wall, which often tends not to be the case when you're trying to set up sliding against a wall.

Unfortunately I have no chance of contributing to this effort in any way nowadays (probably not even updating any emulator scripts like I might've mentioned on past postings) from lack of time, but will be cheering you on as you progress through the levels. ;)
Title: Re: Lemmings (Genesis Port) TAS
Post by: 607 on August 08, 2017, 02:23:50 PM
Nice to see some more progress on this! :)
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on August 09, 2017, 03:00:50 PM
Tricky 8 in 2371 frames (~ 47 seconds)

https://www.youtube.com/watch?v=zJScBKOyV94

Quite tricky, some steel glitches used.
Title: Re: Lemmings (Genesis Port) TAS
Post by: Gronkling on August 11, 2017, 09:19:16 PM
Tricky 9 in 2223F (44s)

https://youtu.be/qvXQvyaQFQ0

Annoying level with a not very interesting solution.
Title: Re: [Genesis] Lemmings (Genesis Port) TAS (incomplete)
Post by: Gronkling on January 18, 2021, 09:12:03 PM
Had an urge to come back to this after like 3 years. I'm still having problems with bizhawk crashing for some reason though, which was one of the main reasons I quit back then. Anyway quite a few glitches used in this one (steel glitches and a little bit of climbing through terrain)

Tricky 10 in 2732F (~55s)

https://www.youtube.com/watch?v=VAmzL80ldG4
Title: Re: [Genesis] Lemmings (Genesis Port) TAS (incomplete)
Post by: Gronkling on January 19, 2021, 02:02:40 AM
Tricky 11 in 870 Frames (~17.5 seconds)

https://www.youtube.com/watch?v=LRf2Vq2OkPI

Nice and fast :D Fairly obvious skip here that I think a lot of people are aware of, freeing the miners in a fast way with no bashers is hard though, only figured out two of the four of them. The second to mine shows an interesting behaviour I've never seen before where it gets cancelled almost instantly in a unique way. It'd be nice if this happened for the fourth miner too but I think it needs super precise timing that's probably cancel out the time advantage of doing it.

---
EDIT: no new post on this one since its not very interesting

Tricky 12 in 1554 frames (~31 seconds)
https://www.youtube.com/watch?v=_Dv8arIgGbg
Title: Re: [Genesis] Lemmings (Genesis Port) TAS (incomplete)
Post by: Gronkling on January 22, 2021, 03:04:04 AM
Tricky 13 in 2824 frames (~56.8 seconds)

https://www.youtube.com/watch?v=hGnWWWAVg5o

Things are definitely getting less open ended now, but still room for creativity with some mini-basher staircase sort of things going on here.

---EDIT

Tricky 14 in 2862 frames (~57.6 seconds)

https://www.youtube.com/watch?v=WY9u_ky8ab8

One of those chaotic, messy levels, almost certainly improvements can be made somewhere in here, but under 1 minute has me happy enough for the time being.

---EDIT2

Tricky 15 in 808 frames (~16.3 seconds)

https://www.youtube.com/watch?v=a76hUMRDnPY

Second quickest yet (and faster than fun 1), nothing really exciting though. Maybe it's possible to get it so the 4th lemming doesn't turn around, but I couldn't

---EDIT3

Tricky 16 in 2475 frames (~49.8 seconds)

https://www.youtube.com/watch?v=hsehxVtUfnk

A surprisingly hard one, specifically bombing through the netting at the end in a way the doesn't result in too many lemmings turning around. Also the lag reduction here means you can't see the bombing. I'm sure this can be improved, but it'll be annoying

---EDIT4

Two more fairly uninteresting ones

Tricky 17 in 1675 frames (~ 33.7s)
https://www.youtube.com/watch?v=YUhN0MbTh4I
(theres nothing much you can do with this one since there's only 2 skills)

Tricky 18 in 1362 frames (~ 27.4s)
https://www.youtube.com/watch?v=By43Y7av8fQ
pretty much the same as one of the standard ways to solve this level
Title: Re: [Genesis] Lemmings (Genesis Port) TAS (WIP)
Post by: Gronkling on January 26, 2021, 03:15:29 AM
Tricky 19 in 2562 frames (~ 51.55s)
https://www.youtube.com/watch?v=jAXOPIvfYHw

This one uses a fun trick, cancelling the basher with a miner, then cancelling the miner with a digger. This gives a step that lets the lemmings get up the first obstacle without using a builder, so I don't need to use loads of time bashing and mining through the terrain, giving a solution under a minute.
Title: Re: [Genesis] Lemmings (Genesis Port) TAS (WIP)
Post by: Gronkling on January 26, 2021, 12:06:36 PM
Not a solution but a TECH POST

Decided to look into the difference between NTSC and PAL. We've been using PAL due to the ROM being more easily accessible back when this started, but most speedruns tend to use NTSC and this port was made in an NTSC region, so I wanted to see if there was a big difference.

The PAL version updates everything every 3 frames, whilst the NTSC version updates everything every 4 frames, so played at the same framerate, the NTSC version is 25% slower than the PAL version.
PAL megadrive has framerate of 49.70146, whilst NTSC genesis has framerate of 59.92275 (http://tasvideos.org/PlatformFramerates.html), so running the same thing, NTSC is about 20% faster than PAL
Putting this together, the NTSC version should be 10% slower than the PAL version

I did an experiment to check:
Loaded FUN 8, made an input on first frame that the first lemming falls off the platform.
In NTSC, this took 1364 frames, so ~22.76 seconds
In PAL this took 1028 frames, so ~20.68 seconds
1028/1364 = ~0,75
20.68/22.76 = ~0.9
So my predictions work out

Therefor the we should continue using the PAL version because it's faster 8-)

The only thing that does move faster during NTSC gameplay is the cursor since that isn't bound by the physics update cycle

---EDIT

I changed the table on the first post to be more accessible to people not as familiar with frames.

And here's tricky 20 in 55.49 seconds (2758 frames)

https://www.youtube.com/watch?v=A_Klq91ybCE

Loads of lemmings here which means its a "don't look directly at the lemmings" level, oh well. Goes under the one way wall as you'd probably expect.

---EDIT2

Tricky 21 in 52.68 seconds (2618 frames)

https://www.youtube.com/watch?t=38&v=vl5KFDKZEYo

This one features a newly discovered (I think) glitch seen at around 0:38 where a bomber instantly explodes, skipping the oh-no state, due to being caught in a trap at the same time. A bit of a messy and hard to optimise level, I'm sure a few more seconds can be saved here.
Title: Re: [Genesis] Lemmings (Genesis Port) TAS (WIP)
Post by: Gronkling on February 02, 2021, 10:23:13 PM
I'm just adding new solutions to the OP now since no one was replying, for now I'll make a new post if I come across something interesting, such as...

Today's Genesis mystery:
Sometimes pressing the A button stops a frame or two of lag. For example, I managed to save 4 frames on the tricky 28 solution just by pressing the A button at certain points whilst the game was lagging. I have absolutely no idea why this happens, or how to predict when you should press A.

Got 5 frames off lag-fest fun 14 with this
Title: Re: [Genesis] Lemmings (Genesis Port) TAS (WIP)
Post by: Gronkling on February 04, 2021, 01:43:17 AM
Finished going through each tricky level now, for the next step I will go back through them and check for any time saves that I can think of with a fresh look at the level and a better understanding of things like lag. Unfortunately ccexplore's LUA scripts no longer work due to a major bizhawk update at some point in the last few years, and my programming knowledge isn't good enough to fix them, so I will have to guess a bit at the lag patterns.

I'll edit this post to list improvements
Tricky 1 - No improvement
Tricky 2 - 0:48.03(2387) -> 0:47.26(2349)
Tricky 3 - 0:36.64(1821) -> 0:36.26(1802)
Tricky 4 - No improvement
Tricky 5 - 1:45.77(5257) -> 1:37.02(4822)
Tricky 6 - 0:31.09(1545) -> 0:30.70(1526)
Tricky 7 - 0:38.97(1937) -> 0:37.61(1869)
Tricky 8 - No improvement
Title: Re: [Genesis] Lemmings (Genesis Port) TAS (TRICKY complete)
Post by: Gronkling on February 19, 2021, 01:18:03 AM
The full compilation of ALL current tricky solutions is here! The full tricky rank in 24 minutes 23.96 seconds
https://www.youtube.com/watch?v=nIQHfXs0ZtE
Title: Re: [Genesis] Lemmings (Genesis Port) TAS (WIP)
Post by: Gronkling on March 03, 2021, 07:22:11 PM
Spent a bit learning some LUA and put together this simple script to track lag during gameplay
Small green square shows in lower left on frames where assignments can be made, so you don't have to keep RAMwatch open all the time
Small red square shows in lower left on lag frames, allowing you to spot them more easily (currently won't give you a total at all like ccexplore's old script though)

I also got ccexplore's trigger map script to work with the modern version of Bizhawk
Title: Re: [Genesis] Lemmings (Genesis Port) TAS (WIP)
Post by: Paiy on August 14, 2023, 05:29:29 AM
im not that farmilliar with genesis lemmings but on snes this strat for taxing 12 is faster i dont know if its faster or even possible on genesis https://youtu.be/mSfPeFgkW-4