In step 41 of his Supernatural devlog, Wouter Bovelander The Highlander71 dives into refining Supernatural enemy behavior for the Commodore 64 project. This update introduces a full lineup of new enemies: the ghost skeleton, wolfman, floating eye, and a leaping toad. Each has its own animation logic, movement pattern, and bug—or several.
The video opens with gameplay showcasing each new enemy type before jumping into the code. The ghost skeleton is straightforward: it doesn’t move, just animates. The wolfman, however, is a whole different beast. He walks, occasionally jumps, and—thanks to an issue in his state machine logic—rarely jumps again. Wouter pokes at this stubborn behavior, tweaking probability code and comparing outcomes to expected animation states. It’s an exercise in debugging Supernatural enemy behavior one frame at a time.
The Code Behind the Monsters
After the demo, Wouter examines the core implementation. He walks through the animation tables, sprite pointer base logic, and the random jump initiation (which barely works). There’s a detour through a faulty jump probability calculation, eventually traced to a compare instruction that always evaluates positively—rendering the wolfman practically grounded.
Toads come next. These enemies don’t walk; they jump left or right based on collisions, flipping direction when they hit a wall. Their behavior is more complex, requiring unique jump tables and a tighter animation sequence. Wouter outlines how their sprite states are tracked, when animation updates occur, and how direction toggling is managed based on obstacles.
How the State Machine Works—and Why It Barely Does
All enemies are controlled using state machines. Wouter explains that the current structure—built with flags, sprite states, and delay counters—quickly spirals into spaghetti. While functional, it’s difficult to debug, inflexible, and forces repetitive state checks. He recommends a clearer, more modular approach in future revisions. Even the eye enemy, which only moves diagonally and animates with an open-close cycle, has room for improved logic.
He closes with a few notes on optimization—like placing sprite and bitmap data at specific memory locations to avoid costly copying at startup.
Watch It for the Bugs, Stay for the Brains
Whether you’re building your own C64 game or just curious how classic game logic is crafted, this breakdown of Supernatural enemy behavior is packed with detail, insight, and enough debugging tangents to make any retro dev nod in solidarity.