[FEAT] Lemmings are now drawn to 2 different layers depending on state

Started by WillLem, June 14, 2023, 10:36:28 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

WillLem

As of SuperLemmix 2.4, lemmings are now drawn on 2 different, adjacent, layers. This is so that we can have certain lemming states always appear behind other lemmings, regardless of where they are in the lemming index.

An obvious example of where this is beneficial is the exploder states. The explosion graphic is large, and even though it only appears for a single frame, it may be useful when fine-editing a replay to be able to see exactly what's going on with the nearby active lemmings:


Freezer explosion - note the other lems walking in front of the explosion graphic, even though the Freezer is "earlier" than them in the index, and so would normally appear above them.


Timebomber explosion - note that other lems, including the Freezer lem in the ice cube, appear above the explosion graphic.


Grenader explosion (it's a bit clearer here that the Frozen lem appears in front - we want this, since it's better to be able to see the position of the Frozen lem for that single frame, and the grenade destroys the ice cube anyway).

Freezer lems are actually drawn on the same "lower" layer as the explosion graphics. In the above examples, the indexing draws the Freezer lems first because they existed "earlier" and so are drawn further forward. Conversely, in this following example, the Freezer appears behind the other lemmings despite existing "earlier", because the other lems are being drawn on the "higher" layer:



This was done primarily to fix a bug where the Frozen lems appeared in front of lems that existed later, thus breaking the illusion of them being inside the ice cube. Rather than mess about with the indexing itself, it seemed a better idea to simply draw them on a lower layer.

Then, it seemed a good idea to also draw other explosion-related lemming states here - currently, all Freezer states, ohnoer, and all explosion graphics are drawn on the lower layer. We can extend this idea to other lemming states as well, if needs be.