bug in Lemmix/LemmixPlayer: incorrect entrance order for 3-entrance levels!

Started by ccexplore, June 27, 2009, 03:16:08 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ccexplore

I just discovered a major bug with Lemmix/LemmixPlayer in its handling of entrance order for 3-entrance levels.  Instead of A B C B A B C B..., Lemmix is currently doing A B C A A B C A.  This needs to be fixed ASAP.

For now, to re-create the correct ordering for a level, you can edit the level by adding a 4th entrance.  Make sure it has the highest index of all entrances, and place it at the same location as the 2nd entrance.

ccexplore

Some good news:  I tested a little more and find that Lemmix has the correct 3-entrance ordering for DOS Original Lemmings, so it looks like this is affecting only ONML and Holiday Lemmings on Lemmix.

I suspect this might be an unintended consequence of handling the quirky ABBA 2-entrance order unique to DOS original Lemmings.

Clam

This affects Custom Lemmings mode as well. I actually noticed this a long time ago, but never thought much of it. My level "Dig This!" has three visible entrances, and I had to put a fourth one in to get the ordering right.


EricLang

I'm looking around in my sourcecode. If the order is indeed wrong for the versions after original lemmings, all lemmix replays for these versions (with 3 entrances) will become invalid.

EricLang

I found the bug:
In Original Lemmings the order of releasing is ABCB ABCB ABCB etc.
In the subsequent versions the order is ABCA ABCA ABCA etc.
I'll fix this as soon as possible, which will be somewhere next week, I hope.
Because I have been busy extending the LemmixPlayer with custom levelpacks, I have to do some exttra work to avoid introducing new bugs.

I'll add some way to alert the user that a replay has gone wrong. Normally when playing a replayfile Lemmix just ignores this and the user regains control over the game.

ccexplore

Actually, before fixing this, give me a chance to look at another problem ClamSpammer found, namely that in one of the Holiday Lemmings levels, a fake exit in the level worked as a real exit in Lemmix.  It shouldn't take me more than a day to work out when exactly that happens in Lemmix.  Then you could fix both.

Clam

I'd hate to turn this into a "Lemmix wishlist" thread, but there's another game-mechanical difference between Lemmix and DOS Lemmings that we (ccexplore and I) found recently. At the moment, Lemmix cuts off all terrain beyond the left edge of the map, which DOS Lemmings doesn't do. This opens up the possibility of some glitches being used (eg. bombers falling down the side of the map if they stop walking at the exact moment they turn around) in situations where they shouldn't. The glitch itself is a part of the original game, but it should work only when the terrain piece actually ends at the edge of the map.

ccexplore

It's not a 1-day work for me to figure out where exactly the game clips the terrain at the left/right boundaries.  Granted, those boundaries are clearly outside of the boundaries the lemmings are usually permitted to walk to, but since there might be circumstances where you can force a lemming to get farther left/right than they normally could (eg. blockers?), I think it's better to hold off on that one until I've worked out the details.

The only reason I mentioned the fake exit problem is because I'm assuming the problem would be relatively easy to identify and fix, plus it has proven to affect a level from the official games.  If it turns out not easy, I'd definitely be okay with just fixing the 3-entrance issue for now.

Clam

http://www.lemmingsforums.com/index.php?topic=86.msg1364#msg1364">Quote from: ccexplore on 2009-06-29 16:07:14
It's not a 1-day work for me to figure out where exactly the game clips the terrain at the left/right boundaries.  Granted, those boundaries are clearly outside of the boundaries the lemmings are usually permitted to walk to, but since there might be circumstances where you can force a lemming to get farther left/right than they normally could (eg. blockers?), I think it's better to hold off on that one until I've worked out the details.

I probably should have given more details when I posted this in the Glitches thread. Yes, you can use a blocker to push the lemmings off the side of the screen. This isn't likely to come up much (it doesn't help in any level that I'm aware of) so it's probably not a high priority to fix this.

ccexplore

http://www.lemmingsforums.com/index.php?topic=86.msg1358#msg1358">Quote from: ccexplore on 2009-06-29 13:30:18
Actually, before fixing this, give me a chance to look at another problem ClamSpammer found, namely that in one of the Holiday Lemmings levels, a fake exit in the level worked as a real exit in Lemmix.  It shouldn't take me more than a day to work out when exactly that happens in Lemmix.  Then you could fix both.

Ok, I immediately see what the problem is when I examine Blitz 3 in LemEdit and then in Lemmix.  Actually I think it was something I've pointed out to Eric a long while ago.

Basically right now Lemmix cannot handle "gaps" in object indices.  When loading/saving levels it will effectively re-index all objects with consecutive numbers starting from 0.  Although the ordering of objects by index is preserved, obviously this renumbering can cause problem with fake objects becoming non-fake.

For example, in the Holiday Lemings levels, after using indices 0-13 for objects (mostly for the decorative top parts of the exits), it skips to 16 for the entrance and then 17 for the leftmost fake exit.  Lemmix however cannot handle this gap, and so 16 becomes 14 and 17 becomes 15, which is how the leftmost fake exit becomes functional in Lemmix.

I don't know how easy or hard it is to fix, and I guess it only affects levels that have fake objects, which are rare (certainly rarer than 3-entrance levels).  So I'll leave it up to Eric to decide when to fix this.

lorcan

Maybe a stupid question... How does the original  Holiday Lemmings game interpret/detect/know that the other doors in this level are fake? Something to do with coordinates? Something in the level description which overwrites the trigger effects specified in the graphic sets? You told about gaps in the interactive objects indices in a level, what happens in the original DOS game concerning these indexes? I don't know such a rule which mentions that such or such indice gives a fake door... So this interests me http://www.lemmingsforums.com/Smileys/lemmings/smiley.gif" alt=":)" title="Smiley" class="smiley" /> Same thing with other traps?

ccexplore

The level file format has 32 slots for objects, numbered 0 to 31 (that's what the "index" is referring to).  Basically, the game only processes slots 0 thru 15 for collisions with lemmings, so objects placed in slots 16 or higher are "fake" and will not affect lemmings (entrance trapdoors are the exception, since they do not operate on lemmings, they just put out new ones).  This includes exits as well as traps, one-way walls, water/lava, etc.

This behavior holds for all versions of DOS Lemmings (original, Oh No and Holiday).  I don't know for sure if they hold for other platforms (eg. Amiga) but it's possible, or at least they probably have something similar if not exactly 0 thru 15.  I think Blitz 3 is the only level though that actually make use of this feature.

lorcan

Wow! I didn't know this! I knew that there were only 32 x 8 byte slots in a level reserved for objects but I didn't know about the last 16 inactive objects. Thanks for this information ccexplore  http://www.lemmingsforums.com/Smileys/lemmings/wink.gif" alt=";)" title="Wink" class="smiley" />

BTW it appears to me that you know tons of things regarding the original game mechanics/data structure/etc.  and I already knew you're a Lemmings guru http://www.lemmingsforums.com/Smileys/lemmings/wink.gif" alt=";)" title="Wink" class="smiley" /> Have you written extra articles in addition to those available in the Lemmings Archive? (aka http://camanis.net/lemmings/tools.php" class="bbc_link" target="_blank">http://camanis.net/lemmings/tools.php). Or do you know where I can find such articles/analysis documents? This could help me to learn new things and avoid mistakes in my remake project  http://www.lemmingsforums.com/Smileys/lemmings/laugh.gif" alt=":D" title="Laugh" class="smiley" />

Thanks!  http://www.lemmingsforums.com/Smileys/lemmings/wink.gif" alt=";)" title="Wink" class="smiley" />

EDIT: I've just tested the Amiga version and the behavior is the same (doors are fake)

ccexplore

http://www.lemmingsforums.com/index.php?topic=86.msg1386#msg1386">Quote from: lorcan on 2009-07-02 01:31:44
EDIT: I've just tested the Amiga version and the behavior is the same (doors are fake)

Of course they would be, otherwise that level wouldn't work, since the whole point is that all but one exit is fake.

What I haven't tested is whether Amiga has only 32 slots for objects and where the index cut-off is between real and fake objects.  Presumably the internal level format is probably very similar if not identical between Amiga and DOS, but to my knowledge no one has actually verified this yet.  [edit: actually now I remember Mindless did port the Amiga versions of original Lemmings levels over to DOS, so the level file format is probably identical in Amiga and DOS.  But the real/fake index cut-off might still be different]

Note that the Amiga version, many levels have additional water/lava objects that are missing in the DOS version.  I've always wondered if some of those objects may have index higher than 15 and if so, whether their fakeness (if indeed they are fake) can actually be tested out in the actual level.

Quote
BTW it appears to me that you know tons of things regarding the original game mechanics/data structure/etc.  and I already knew you're a Lemmings guru http://www.lemmingsforums.com/Smileys/lemmings/wink.gif" alt=";)" title="Wink" class="smiley" /> Have you written extra articles in addition to those available in the Lemmings Archive? (aka http://camanis.net/lemmings/tools.php" class="bbc_link" target="_blank">http://camanis.net/lemmings/tools.php). Or do you know where I can find such articles/analysis documents? This could help me to learn new things and avoid mistakes in my remake project  http://www.lemmingsforums.com/Smileys/lemmings/laugh.gif" alt=":D" title="Laugh" class="smiley" />

It can be tricky trying to capture the DOS Lemmings mechanics, with all its idiosyncrazies, in English.  I believe Eric had released the source code for Lemmix (written in Delphi) on this website, so if you have some programming background, that might be your best bet in learning the details of the DOS Lemmings game mechanics.