Author Topic: [BUG] Blockers don't work on One-Way Fields  (Read 1289 times)

0 Members and 1 Guest are viewing this topic.

Offline WillLem

  • Moderator
  • Posts: 3384
  • Unity isn't sameness, it's togetherness
    • View Profile
[BUG] Blockers don't work on One-Way Fields
« on: May 03, 2023, 08:50:47 PM »
From a conversation on Discord:

Quote from: Flopsy
Blocker fields are ignored on one way fields ... it's occuring in NL too

« Last Edit: March 09, 2024, 09:49:55 PM by WillLem »

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: [BUG] Blockers don't work on One-Way Fields
« Reply #1 on: May 06, 2023, 02:21:18 AM »
One or the other has to take priority in this case. Which one it is, is not going to be changed at this point.
My Lemmings 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)

Offline jkapp76

  • Posts: 377
    • View Profile
Re: [BUG] Blockers don't work on One-Way Fields
« Reply #2 on: May 06, 2023, 03:20:59 PM »
About the blockers getting ignored in one-way zones...

Could you just disallow blockers in these zones? Make the selecting tone (or a fail tone) but not reduce the amount of available blockers?
This would (I think) have a better look and feel.
...Jeremy Kapp

Offline WillLem

  • Moderator
  • Posts: 3384
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: [BUG] Blockers don't work on One-Way Fields
« Reply #3 on: May 06, 2023, 08:03:06 PM »
Could you just disallow blockers in these zones? Make the selecting tone (or a fail tone) but not reduce the amount of available blockers?

Agreed; since it has to be one or the other then it seems best to just not allow Blockers to be assigned on a OWF, in the same way that Miners/Diggers can't be assigned when walking on steel. This has now been fixed in Commit ed5d6b8db.

Meanwhile, a fail sound would be ideal for any and all disallowed assignments... this is something that would have to be done separately though, I'll add it to the to-do list.
« Last Edit: May 06, 2023, 08:12:38 PM by WillLem »

Offline Flopsy

  • Global Moderator
  • Posts: 955
  • Lix Nerd
    • View Profile
Re: [BUG] Blockers don't work on One-Way Fields
« Reply #4 on: May 06, 2023, 08:49:16 PM »
It's weird because the blockers used to work on One Way Fields, the replay I used was from a 2017 version of NL and the blocker would keep the Lemmings in a bunch on the one way field, they would be trapped in a pixel effectively.

Just don't know what has occurred in the NL code to stop this behaviour suddenly?

Offline WillLem

  • Moderator
  • Posts: 3384
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: [BUG] Blockers don't work on One-Way Fields
« Reply #5 on: May 07, 2023, 12:16:39 AM »
Just don't know what has occurred in the NL code to stop this behaviour suddenly?

If it's past behaviour that doesn't work now, it's likely the result of a bugfix elsewhere. I've had a quick look through the trigger areas code and can't find anything obvious that's causing Blockers to be ignored.

I've re-opened this topic because tbh I can't see any reason why Blockers shouldn't work on OWFs; if I can figure out how to restore this behaviour, and if it turns out that it was more of a design choice than a bugfix, then I'll bring it back. Otherwise, the best option as it stands is to prevent Blockers from being assignable; the next update will behave this way to prevent confusion in the meantime.
« Last Edit: May 07, 2023, 04:22:43 PM by WillLem »

Offline jkapp76

  • Posts: 377
    • View Profile
Re: [BUG] Blockers don't work on One-Way Fields
« Reply #6 on: May 07, 2023, 01:53:14 AM »
Meanwhile, a fail sound would be ideal for any and all disallowed assignments... this is something that would have to be done separately though, I'll add it to the to-do list.
You could use the same (assign) tone but pitch it down to sound negative.
...Jeremy Kapp

Offline WillLem

  • Moderator
  • Posts: 3384
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: [BUG] Blockers don't work on One-Way Fields
« Reply #7 on: May 08, 2023, 06:56:23 PM »
There's a further complication to this; Blockers are only ignored on left-facing OWFs, not right-facing ones (it's the same in NL as well).
« Last Edit: May 08, 2023, 07:38:25 PM by WillLem »

Offline jkapp76

  • Posts: 377
    • View Profile
Re: [BUG] Blockers don't work on One-Way Fields
« Reply #8 on: May 08, 2023, 07:35:28 PM »
disallowing OWF blockers fixes this as well, right?
...Jeremy Kapp

Offline WillLem

  • Moderator
  • Posts: 3384
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: [BUG] Blockers don't work on One-Way Fields
« Reply #9 on: May 08, 2023, 08:11:10 PM »
disallowing OWF blockers fixes this as well, right?

Yes, it nullifies the problem completely. However, I'd prefer to allow Blockers on OWFs.

There's an else statement in the force-field trigger check which, if removed (so that each statement has it's own independent if-then), switches the behaviour around (so Blockers are ignored on right-facing fields, and work on left-facing ones).

So, it would seem that, as things currently stand, Blockers only work on either left-facing or right-facing one-way-fields. And, even when it does work, the lemmings flip back-and-forth between facing left and facing right, which looks wierd and buggy.

Offline WillLem

  • Moderator
  • Posts: 3384
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: [BUG] Blockers don't work on One-Way Fields
« Reply #10 on: May 08, 2023, 08:12:39 PM »
OK, I think I've found a fix.

Lemmings now do a separate check for the specific case that they have a contradictory force-field vertically in front of them. If this is the case, their X position is increased (or decreased, depending on the direction they're facing) by 1 pixel. This stops the flipping back-and-forth, whilst keeping them walking in place at the Blocker/Vertical field's trigger area. Basically, like this:



Testing is needed, and this fix may cause issues with overlapping contradictory fields in general, but - for now - it's better than only having Blockers work in one direction, and not being able to assign them at all.

Commit 9c948f9e4 implements this fix.