Trigger areas for rotated objects are not symmetric [BUG][DORMANT]

Started by Nepster, April 05, 2017, 05:31:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nepster

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.

Colorful Arty

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.

Nepster

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.

Nepster

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?

namida

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

IchoTolot

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.

namida

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

namida

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

Nepster

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.

namida

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)

Nepster