Crystalis Randomizer

The developer blog

View project on GitHub

Why tink?

steve_hacks
23 Jul 2020

A common question the developers get is about what’s known as “tinking”, where attacking an enemy with the wrong sword causes a tink sound, but still does damage, unlike in the original game where tinking indicates full immunity.

Newer players first running into this (either by playing the current stable release, or by turning on the “tink mode” flag in newer experimental versions) are surprised by this behavior. On the other hand, more seasoned players are surprised that newer versions are removing this functionality. To understand why, it will help to give some historical development context.

Logic

The randomizer employs logic to ensure a seed is completable. This logic is mostly unaffected by the player’s level, but there are a few situations where we must guarantee that a player is able to gain levels. In particular, while it’s often possible to cross the poison swamp or walk through a gauntlet of shooting statues without the proper defensive items (gas mask or barrier), it may require a significant amount of initial HP. If the player cannot damage any enemies and is therefore stuck at level 1, it may make the seed impossible if this blocks progression.

The solution is to make sure that the logic knows exactly what items are required to defeat a reachable enemy. Unfortunately, early versions of the randomizer (before the upcoming 1.3 release) did not have access to the enemy randomization during item shuffle, since enemies were randomized after item placement.

Ideally we’d rearrange the randomization so that enemy shuffle happens first. This was difficult because enemy shuffle is intricately tied to the choice of pattern tables and palettes: each location is allowed only two pattern tables and two color palettes, making many enemy combinations impossible without graphical glitches. The presence of a treasure chest in a location restricts the pattern table selection slightly, but mimics are much more restrictive (some may recall the glitchy mimics that looked like jumping angry faces). Mimics therefore needs to be decided before enemies are shuffled, since otherwise most enemy choices will preclude mimic placement. Mimics were originally placed during item shuffle, which makes our ideal fix impossible.

Original solution

A more tractable approach is to simply decouple the item placement logic from the enemy randomization by ensuring that all enemies can be killed with any sword. This changes the logic requirements from needing a specific sword to kill an enemy to instead allowing any sword. Modifying the enemy damage routine to ensure tinks still do a single damage conveniently circumvents this problem, while retaining the same general “feel” of the original game.

This quickly led to an ineresting “hard mode” flag: matching sword not guaranteed. Some skilled players enjoyed the challenge of the logic requiring the player to possibly have to tink bosses at 1 damage per hit, which wouldn’t have been possible with the game’s original programming.

New version

In more recent versions, we’ve normalized on a pattern where affordances (primarily glitches) are either logically required, or else they’re disabled and removed from the game entirely. Tinks are similar and it made sense to give them the same treatment. The key change that made this possible was to realize that mimics can be shuffled separately from item placement, in a significantly earlier step in the process. By simplifying the item randomization flags to simply (1) whether mimics are shuffled at all, and (2) whether unique items are shuffled with non-unique items, we were able to finally make this separation and thus move enemy shuffle to before item placement.

As of the upcoming version 1.3, tinking no longer does any damage, just like in the original game. This more closely matches the original game’s mechanics and feel, and should increase challenge slightly. For players who want to challenge themselves with the possibility of tink fights, the option has been left in as an optional hard mode flag, but now enabling the old tink mode means that it may be logically required (i.e. Mado 2 might be weak to water, but be holding the Sword of Water). We hope this change proves enjoyable.