Author Topic: Trigger areas for rotated objects are not symmetric [BUG][DORMANT]  (Read 2696 times)

0 Members and 1 Guest are viewing this topic.

Offline Nepster

  • Posts: 1829
    • View Profile
We currently move all trigger areas of rotated objects by 5 in both X and Y direction. However if the rotation is combined with flipping the graphics, the trigger areas get moved somewhere less sensible. In particular objects whose sprites are mirrored horizontally, need not have trigger areas that are mirrored in the same way.
As an example I have attached the trigger areas of the fire object:
- Top left: Rotate + Invert
- Top right: Rotate + Invert + Flip
- Bottom left: Rotate
- Bottom right: Rotate + Flip

I suggest that instead of moving +5 horizontally, we move the trigger area -5 horizontally, if the object is flipped.
« Last Edit: April 10, 2017, 11:16:27 AM by namida »

Offline Colorful Arty

  • Posts: 814
  • You are so loved!
    • View Profile
    • Colorful Arty's Youtube Page
Re: Trigger areas for rotated objects are not symmetric [BUG]
« Reply #1 on: April 05, 2017, 06:04:28 PM »
I've noticed just flipping the objects screws up the trigger areas, because they don't move at all. This means upside down water kills lemmings who walk under it, not touching it at all, but doesn't kill lemmings at the top when they are clearly submerged in the water.
My Youtube channel where I let's play games with family-friendly commentary:
https://www.youtube.com/channel/UCiRPZ5j87ft_clSRLFCESQA

My Twitch channel: https://www.twitch.tv/colorfularty

My levelpack: SubLems
For New formats NeoLemmix: https://www.lemmingsforums.net/index.php?topic=4942.0
For Old formats NeoLemmix: http://www.lemmingsforums.net/index.php?topic=2787.0
For SuperLemmini: http://www.lemmingsforums.net/index.php?topic=2704.0

My levelpack: ArtLems
For New formats NeoLemmix: https://www.lemmingsforums.net/index.php?topic=4583.0

Offline Nepster

  • Posts: 1829
    • View Profile
Re: Trigger areas for rotated objects are not symmetric [BUG]
« Reply #2 on: April 05, 2017, 06:09:30 PM »
This was already discussed in the thread "Inconsistent trigger areas for inverted/rotated fire/water objects", but no good solution was found. If you have any new ideas, please share them.

Offline Nepster

  • Posts: 1829
    • View Profile
Re: Trigger areas for rotated objects are not symmetric [BUG]
« Reply #3 on: April 05, 2017, 07:18:40 PM »
I just fixed the original bug (not Colorful Arty's issue) in the player code. The editor code is still untouched. Note that this fix still needs proper testing, but this is best done in the editor.

@namida: I noticed that the trigger areas for rotated objects are only moved 4 pixels horizontally, not 5 pixels as claimed in the thread I linked previously. Is this intended?

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: Trigger areas for rotated objects are not symmetric [BUG]
« Reply #4 on: April 06, 2017, 09:54:50 AM »
The only way we'll get optimal trigger areas when rotating objects is to either (a) set them manually, or (b) use a Lemmini-like system that detects trigger areas based on the center of the lemming.

So as long as it's consistent, either 4 or 5 pixels is fine. Consistency with the offset when flipping vertically does not matter; this is a different operation with different requirements as to how it should behave.
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 IchoTolot

  • Global Moderator
  • Posts: 3608
    • View Profile
Re: Trigger areas for rotated objects are not symmetric [BUG]
« Reply #5 on: April 06, 2017, 10:10:43 AM »
Even though it's a bit of work. I think a) "set them manually" would be the correct call. Objects are very different: water, triggered traps, teleporters....finding a rule that fits for all does not work as we saw already in my old topic.

So I would call to keep the old system for now and make rotated/inverted trigger areas customisable in the future. This standard rule can still be applied when no custom trigger is set.

A few levels would need fixes when some rotated/inverted triggers are changed, but it would not be an incredible ammount.

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: Trigger areas for rotated objects are not symmetric [BUG]
« Reply #6 on: April 06, 2017, 10:54:21 AM »
Probably very few. Use of vert-flipped / rotated objects, especially ones that aren't purely decorative, is extremely rare. (Horizontal flip might be a bit more common, not sure, but at any rate there is no issue with trigger areas there.)

This is something that will definitely need to wait for new formats, though.
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 namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: Trigger areas for rotated objects are not symmetric [BUG][DORMANT]
« Reply #7 on: April 10, 2017, 11:17:29 AM »
I've included Nepster's fix for the asymmetry in V10.13.16. A proper, permanent solution to this will need to wait for new-formats, so this topic shall lie dormant (unless anyone wishes to give further input) until then.
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 Nepster

  • Posts: 1829
    • View Profile
Re: Trigger areas for rotated objects are not symmetric [BUG][DORMANT]
« Reply #8 on: April 22, 2017, 05:10:58 PM »
Sorry, I made a terrible mess out of this: In V10.12.15 the player and the editor had different algorithms to determine the trigger area location: The one in the player was correct, while the editor produced the wrong location shown above.
When I "fixed" the bug, I changed the player algorithm to adapt to the misplacement above. But this only introduced the bug into the player algorithm, too. :-[ And it didn't even help for editor either, because my wrong algorithm got copied to the editor code to replace the equally wrong code there >:(.
I have now reverted my commit to the player code, making the player algorithm correct again.

@namida: Could you please upload a hotfix version with the correct placement. Sorry for creating additional work for you.

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: Trigger areas for rotated objects are not symmetric [BUG][DORMANT]
« Reply #9 on: April 23, 2017, 10:19:33 AM »
Will get this hotfix done later tonight.
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 Nepster

  • Posts: 1829
    • View Profile
Re: Trigger areas for rotated objects are not symmetric [BUG][DORMANT]
« Reply #10 on: September 24, 2017, 07:22:42 PM »
This is fixed in the new-formats version.