[FEAT] The Freezer Skill

Started by WillLem, July 02, 2023, 03:03:23 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

WillLem

Introducing the new Freezer skill!

The lem freezes-in-place, chilling for a bit inside an ice cube 8-) It looks like this:



Like the Stoner, it's a terrain-constructive skill that can be assigned in midair and it isn't climbable.

Unlike the Stoner, Freezers can be rescued!

Instead of the lem being removed from the level, they transition to a "Frozen" state. Whilst in this state, they can then transition to Walker or Faller if a reasonable amount of ice is removed from around them.

The explosion particles have now been recoloured to look like ice water (looks better, plus it's a visual cue that the lem itself hasn't exploded).

Freezers can also be assigned to Timebombers during countdown, meaning that they can be used to stop a Timebomber in midair - no other skill can do this!

Whilst Frozen, lems are zombie-proof, and remain uninfected if a zombie bumps into their cube.

More updates to follow, but for now this is looking pretty cool! 8-)

WillLem

#1
In SuperLemmix 2.4, the Freezing/Unfreezing states will be animated as an overlay rather than hard-baked into the sprite graphic.

This essentially means that these states will be way easier to customise. The actual sprites themselves stay the same colour throughout, with the overlay being added afterwards in-game to provide the "freeze-fade" effect. This will preserve spriteset recolouring for the underlying sprites, whilst also making them easier to animate and manage.

Any custom sprites that are the same shape as default lemmings can just copy the same overlay graphic into their sprites folder, since the overlay is generic and will work for any lemming-shaped sprite in both resolutions.

Meanwhile, Freezing/Unfreezing overlays for differently-shaped sprites will need a bit of tweaking, but should be easy enough to adapt from the existing defaults. Ask if you need help with this.

NOTE: Whilst these overlays are a clear improvement for these states, they also limit sprite height to 10px (as does the Freezer skill in general, incidentally), so no custom sprites can be taller than this. This will remain the case indefinitely.

WillLem

Another update to the Freezer skill has been implemented for 2.6.

It's an edge-case which is primarily a bugfix, but is also something of a new feature that has only been worth doing because we now have the Ballooner.

In 2.5.x, if a Freezer is assigned with their foot position below the bottom edge of the level, the Freezer lem immediately unfreezes and falls out of the bottom of the ice cube (the ice cube remains in place). This is because terrain is not rendered outside of the level borders, so there is nothing for the frozen lem to "stand" on; this satisfies one of the conditions for a lem to begin unfreezing, and so they go ahead and unfreeze.

As of 2.6, a Freezer in this position must now have at least 5px removed from the top of the ice cube (this reduces to 4, 3, 2 and 1 if there is less than 5px of ice cube showing) in order for the lem to unfreeze, at which point they still fall from the bottom of the level... :forehead:

...However! As of 2.6 we will also have the Ballooner skill, which can be assigned to the unfrozen lems in order to bring them back up into the level area.

All of this is, in practice, much simpler than it sounds and makes visual sense when you try it out. I might do a video demo at some point, since it showcases a unique feature of the Ballooner skill as well as the Freezer.

Implemented in Commit 48fd40208, with revisions in Commit 5f3c433bb.

WillLem

Paiy discovered a bug with the Freezer, reported on Discord.

Essentially, when in midair, if any amount of the bottom part of the Freezer's cube is still intact when the Freezer has finished unfreezing, they fall:


--->


We agreed that this doesn't feel quite right; the Freezer lem should react to the part of the cube that's still intact.

One possible fix is to raise the Freezer lem by 1px after they've finished unfreezing. However, that results in this possible situation, which also feels somewhat buggy:



The Freezer lem can now begin an action from that bottom pixel of the cube, opening the game up to annoying levels which could exploit this mechanic. Now it seems better that they should fall.

Haven't fixed anything yet. Level and replay are attached to show the original behaviour. Does this seem right? Any suggestions for fixes, or should we leave it as it is?

jkapp76

...Jeremy Kapp

namida

Only allow the unfreezing lemming to become a walker if the solid terrain at the bottom is within the distance a walker can step up (and in such a case, step him up that distance automatically). Anything above that, he unfreezes directly to an ascender (of course, this is all assuming a situation where he doesn't just unfreeze as a faller).

Alternatively, simply prohibit non-permanent skill assignments (or maybe just all assignments, to keep it simple) for one frame after unfreezing.
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)

WillLem

#6
Quote from: namida on October 19, 2024, 07:24:10 AMunfreezes directly to an ascender

This works :thumbsup:

So, if the unfreezing lem sees terrain above their foot position, they will ascend. Otherwise, they will either walk or fall depending on whether there is terrain directly at their foot position.

This has been implemented in commit 5ac52fcea. Note: Existing Ascender logic already prevents Y-sliding.