Right-click bug

Started by DragonsLover, October 27, 2009, 05:52:35 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

DragonsLover

I just discovered something weird with the Right mouse button. As you probably already know, when you hold Right mouse button, you're forcing the selection of a Walker. But if you do it on a single Lemming that is performing a task and you Left-click, the previous highlighted Lemming (which could completely be out from the cursor) will be selected to do the task. http://www.lemmingsforums.com/Smileys/lemmings/shocked.gif" alt=":o" title="Shocked" class="smiley" />

Example : you assign the Blocker skill to a Lemming and change the skill selection to Builder. Then, you highlight another Lemming, any of them, without clicking on him. After that, hold down Right mouse button and select the Blocker again, the cursor will stay as a cross. Left-click, without releasing the Right mouse button, and the previous Lemming you highlighted will start building wherever he is.
I like dragons! They're the center of my life! I'll never forget them...

namida

o_O
That could open up some new solutions where the only reason they don't work is inability to select the required lemming at the right time.
Is this replicated in Lemmix (doubt it)?
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

Minim

I tried to do that glitch in Original lemmings but can't do it. In what level have you discovered that?
Level Solving Contest creator. Anybody bored and looking for a different challenge? Try these levels!

Neolemmix: #1 #4 #5 #6
Lix: #2  #7
Both Engines: #3

Clam

 http://www.lemmingsforums.com/Smileys/lemmings/shocked.gif" alt=":o" title="Shocked" class="smiley" />

This is worthy of a DOSBox video. So I made one. http://www.lemmingsforums.com/Smileys/lemmings/laugh.gif" alt=":D" title="Laugh" class="smiley" />  http://camanis.net/lemmings/lemmingswelt/index.php?cmd=get&file=/right_click_bug.zip" class="bbc_link" target="_blank">Link

I love how this game still holds surprises after all this time. This glitch doesn't seem to work in Lemmix unfortunately.

ccexplore

http://www.lemmingsforums.com/index.php?topic=252.msg6808#msg6808">Quote from: Clam Spammer on 2009-10-27 00:38:48
I love how this game still holds surprises after all this time.

Yes, and for once, this was a huge surprise for me too http://www.lemmingsforums.com/Smileys/lemmings/shocked.gif" alt=":o" title="Shocked" class="smiley" /> http://www.lemmingsforums.com/Smileys/lemmings/wink.gif" alt=";)" title="Wink" class="smiley" />, which is also why it doesn't work in Lemmix.  In fact, I'm still not 100% sure with absolute precision what's going on http://www.lemmingsforums.com/Smileys/lemmings/XD.gif" alt=":XD:" title="XD" class="smiley" />, whether the programming responsible for this is part of the stuff I've disassembled and looked at, or elsewhere in some part I haven't worked out yet.  While I don't know exactly right now when/how often the game refreshes its calculation on which lemmings are eligible for skill assignment, when it does refresh, AFAIK it is updating both the prioritized and non-priortized lemming, so the fact that this happens would suggest the game isn't refreshing its calculation in certain situations.

Testing so far seems to suggest that if the original, priortized lemming remains in range of the cursor, the skill assignment can be done to the non-prioritized lemming even when it is out of range.  But as soon as the prioritized lemming also goes out of range, this no longer works. http://www.lemmingsforums.com/Smileys/lemmings/huh.gif" alt="???" title="Huh?" class="smiley" />

(If I ever work out for sure exactly what's going on, I'll post the update information here.)

Mindless

http://www.lemmingsforums.com/index.php?topic=252.msg6808#msg6808">Quote from: Clam Spammer on 2009-10-27 00:38:48
This is worthy of a DOSBox video. So I made one. http://www.lemmingsforums.com/Smileys/lemmings/laugh.gif" alt=":D" title="Laugh" class="smiley" />  http://camanis.net/lemmings/lemmingswelt/index.php?cmd=get&file=/right_click_bug.zip" class="bbc_link" target="_blank">Link

Seems to be corrupt. http://www.lemmingsforums.com/Smileys/lemmings/sad.gif" alt=":(" title="Sad" class="smiley" />

Clam

Hmm, that's not good. I tried to upload the uncompressed file and got this: (pic attached)

I've attached the zip here. I just downloaded it and it seems to work, while the other one didn't when I tried it.

Mindless

http://www.lemmingsforums.com/index.php?topic=252.msg6919#msg6919">Quote from: Clam Spammer on 2009-10-28 23:20:52
Hmm, that's not good. I tried to upload the uncompressed file and got this: (pic attached)

strange... uploading the uncompressed version seems to have worked though http://www.lemmingsforums.com/Smileys/lemmings/winktounge.gif" alt=";P" title="Wink-Tongue" class="smiley" />

ccexplore

Ok, I finally have a solid understanding of what's going on with this bug.  It's actually pretty simple and I should've understood it a lot sooner, had I kept better notes on the mess of variables in Lemmings' programming.  Anyway:

The underlying bug is that instead of checking to see whether there are any lemmings eligible for skill assignments, the game is checking whether there are any lemmings in range of the cursor.  Under most circumstances the two conditions are equal, except one condition:  holding down the right-mouse button.

When you hold down the right-mouse button, only non-prioritized lemmings (more imprecisely, "walker lemmings"--let's shorten it to "NP") are considered for skill assignment.  So you could run into a situation where there are lemmings in range of the cursor (so the game erroneously assumes it can always proceed to skill assignment), but all of them are prioritized (ie. doing an action like building, say), and so there are no NP lemmings found.  Consequently from the details of the game's programming, the game will end up attempting to assign the skill to the last NP lemming found some time ago, even if it has long since walked out of cursor's range.

Note in particular that you don't have to hold down the right-mouse button throughout, nor do you even need to keep the mouse cursor on the same lemming throughout.  All that's necessary is that for the lemming you're targeting, you have the mouse cursor on him at some point while he's NP, and then you make sure you don't move the cursor to any position that would pick up some other NP lemming (since that would change who's the "last NP lemming found").  Then finally when you need to assign the skill to your target lemming, you move the cursor to a position that only picks up prioritized lemmings, hold down right-mouse button, and click left-mouse button as if assigning skill.  You can see this in action in the attached DOSBox video.

This buggy skill assignment still has to go through most of the usual checks (for example, almost no skills can be assigned to a drowning lemming, say), although as seen in the last part of the video, there's one specific check that is effectively skipped as a result (because that check is normally done as part of prioritization calculation, rather than during the skill assignment attempt).  It does require a pretty restrictive setup (as in, basically just what you see in the video) to do anything meaningful though (since most of the usual checks are still performed), so I don't know if there's any level out there right now (custom or otherwise) that would benefit from such a trick (but if you find one, more power to you).

And yes, now that I have a complete understanding on this, I can work towards emulating it in Lemmix as well.  Capturing it in replay should not be too big a problem--I'll basically just need to add a new record type for tracking the most recent NP lemming picked up by the cursor.