[Fixed][BUG][Player] Splitter graphics are backwards for flipped splitters

Started by nin10doadict, April 25, 2018, 06:45:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nin10doadict

To reproduce:
-Place a splitter in the level without flipping it. It works as it should, and the graphics match.
-If you flip the splitter in the level editor, it works as if it is flipped in-game and the editor displays this properly, but now the graphics do not match in-game.

nin10doadict

Upon further investigation, this happens with hatches too. Place a flipped hatch in a level and it will release the lemmings in the opposite direction as it should, but the graphics are not flipped in-game. This can be especially problematic with hatches like the ones in Raymanni's Toy tileset because they aren't symmetrical.
Other categories of objects don't seem to be susceptible to this bug; it's only splitters and hatches for some reason.

Proxima

Previous topic on flipped hatches.

The outcome of the previous discussion was: Hatches should not flip their graphics (because flipping them looks wrong in the case of nearly symmetrical hatches with lighting from one side, like the L1 / ONML hatches). If you have an asymmetrical hatch and you want a flipped version, make separate objects for the left- and right-facing hatches. Also, hatches now have an arrow marker that appears at the start of the level to indicate the spawning direction.

Nepster

The big main problem is, that NeoLemmix still distinguishes between flipping the physics and the sprite. I certainly plan to merge all of this into one flag, but this is a bigger undertaking and may take a while.

nin10doadict

Making it so the graphics don't flip in game for hatches is fine, but I'd like it if the editor had some way of showing this as well. Otherwise I'd try to place decorative pieces around the flipped graphic only to find that it doesn't actually get flipped.
This is still not a proper fix for the splitter though. A flipped splitter not appearing flipped causes a gameplay problem; you may plan a route around a wrong assumption because you don't know which way the splitter is starting until you have a Lemming trigger it. And if the graphics are backwards in-game, it just looks bad. A lemming touched the splitter that was displaying a big right-arrow, and he was forced to turn left? :sick:

Nepster

Ok, I finally fixed the issue. Unfortunately it was not just the distinction between "flip physics" and "flip image" (which is history now, btw.). Splitters have a very weird relationship between graphics and physics. Behold the ingenuity:
- When read from the level file, the info whether the starting direction is flipped or not is stored in the FlipPhysics flag.
- Then the images for the splitter are determined and the flipped images are loaded if the FlipPhysics flag is set.
- When finally creating the actual gadget, the starting frame (of the two sprites a splitter may have) is chosen depending on the FlipPhysics flag.
- The actual game physics are then tied completely to the frame index and each passing lemming swaps the frame index. This does not care at all whether the splitter is actually flipped or not.