More From Displaced Gamers on Dr. Jekyll and Mr Hyde

We presented Displaced Gamers’/Behind the Code’s video on the jankiness of kusoge disgrace Dr. Jekyll and Mr. Hyde back on Saturday. They did another video on that game, that delves into why the game’s frame rate is so inconsistent. In summary, its engine throttles its framerate in a terrible way, using long delay loops. It’s a pretty awful idea! It’s 19 1/2 minutes long. The video claims it’s even geekier than their first video on the game, but I think it’s actually slightly less technical, at least it doesn’t fill the screen with as much 6502 assembly code.

Another fact about J&H: the Japanese version had two full levels that were cut from the U.S. version, which replaced them with replays of other levels. It made a bad game even worse!

Now, because of Behind The Code, you know more about the Dr. Jekyll and Mr. Hyde game than many much better NES titles. Congratulations!

Behind the Code: Dr Jekyll and Mr. Hyde

For some reason there’s been a lot of Youtube videos lately that fit our eclectic purview, so here’s a code-heavy dive into infamous NES disasterpiece Dr. Jekyll and Mr. Hyde.

It’s 19 minutes long, and is even geekier than is usual for us, going into a disassembly of the game’s machine code in its quest to make the game marginally less awful.

As long as we’re on the topic, here’s Jeremy Parish’s NES Works episode on Dr. J & Hyde, which is also 19 minutes, and also covers the somewhat better (but not hugely so) game Amagon:

While we’re on the subject, did you know that Jekyll & Hyde has a secret ending? Both endings are shown here (4 minutes):

The “bad” ending is the normal one, and shorter, but is arguably a happier conclusion to the story. To get it, all you have to do is get to the end of Stage 6 with Jekyll. That’s all.

To get the other ending, get to Stage 6 with Jekyll, then turn into Hyde and get to the end of his version of the stage. Usually, if Hyde gets as far into his level as Jekyll has gotten into his, he’s struck by lightning and dies. But in this level he’ll be allowed to reach the end of his version of the level for some reason, where there’s a boss! Beat it, and when you return to Jekyll’s world the enemies will be gone, and he’ll be free to finish the level without harassment. However, ending events will be different….

SjASMplus

No image this time. There’s nothing to take a screenshot of! SjASMplus is, simply, a cross-platform assembler targeting the Z80 platform, the processor that runs many classic arcade games. (I refuse to say “powers,” that’s not what that word means!) If you have interest in writing new games for old arcade platforms, it’s something you’ll need.

It’s the holidays still, and I’m trying to unwind a bit. I’m failing, but at least the effort is there: the effort to reduce effort. Maybe someday.

Godot 4.2 Released

Events often resist efforts to package them up and stamp a Convenient Narrative on them, but it’s really tempting to me to say the history of the internet in this era is that of many people rejecting the hegemony of large corporations and doing things for themselves.

Social media has seen the rejection of Twitter, for reasons I really don’t want to hash out again here, and while some ran directly to Threads or Bluesky, a good number realized it was eventually just going to happen all over again, and that helped to increase the update of open source, federated work-alike Mastodon.

Another piece of this narrative vase that we might be able to fit into place, with creative thinking and a whole lot of glue, is the downfall of Unity and how it helped the effort to create the free open source gamedev replacement Godot. And lo, after a fairly recent release of 4.0, yesterday they already released 4.2. The changelog is here. Here is GDQuest’s rundown of the changes (22 minutes), and here are Lukky’s five favorite new features (3m), which are:

  • FSR 2.0 support (upscaling higher resolution output from lower resolution rendering)
  • Color-coding of folders in the file hierarchy within Godot’s UI
  • The ability to “bake 2D navmeshes”
  • When resizing 3D objects, the UI no longer resizes symmetrically around the object’s origin by default, but instead only the side you’re changing is modified
  • And, within the code editor, you can now create special comments to define a code region, which can be independently collapsed to reduce clutter, and expanded when you need access to its contents. And the Ctrl-K Comment Out feature works better now.

To get back to talking about software philosophy…. There are unique problems with using fully open tools to create games. Console manufacturer devtools are still locked in a mode where the maker hands you proprietary libraries, which they are unwilling to make freely available because of their economic desire to preserve trade secrets and control their platform. Most developers get around this by going through a third party, who has independently created a system of working between the open development framework and the publisher’s libraries, and then licenses it to a studio so they can get their project working on consumer hardware.

Godot is subject to this limitation, with 4.2 being no exception. But there is a sense, with it, that it’s the brightest hope for free and open game development going right now. They don’t ask for any license fees, they don’t try to count how many installs you have and they don’t track user behavior. But because they don’t try to claw in income through direct means, fair or foul, they must survive off of contributions. If you find Godot useful to your work, please consider using their donation link and signing up for an entirely voluntary plan.

Pixelfont

Pixelfont is a neat web tool that will take an image you provide, laid out in the proper format (which you have some control over, like character width and height) and will turn it into a pixel TrueType font for you to use! The gamedev applications of this should be obvious.

This isn’t the first free online font-building tool of this nature. The classic in the field is Fontstruct, which can also produce pixels that aren’t square, and can even extend outside of their cells, but also shows ads (although unobtrusive ones) and doesn’t let you import an image. Still, both are rather of use, or at least are fun to play with!

PixelfontFontstruct

New Super Mario Bros. Wii’s Exception Handler Code

Codes are largely a forgotten element of video gaming. They started out as debug features that didn’t get removed before release, then they became easter eggs to reveal to favored players, ways to dispense unlockables, ways to provide extra difficulty balancing, and even publicity tools, before the age of DLC gave developers a way to profit off of bonus features. Why have players enter up-up-down-down-left-right-left-right when you could just sell them play advantages outright. I’m simplifying the situation a bit, sure, but I’m not simplifying by much.

Codes still exist, once in a while, but it seems like they’ve gone back to being development aids. One of them crept into New Super Mario Bros. Wii, but only becomes usable if the game crashes. The code is: Home, Minus, Plus, Minus, Plus, 1, 2, 1, 2, A. It brings up a scrollable register dump and stack trace, and other assorted information. It doesn’t let you continue playing. For players, it’s just a curiosity, but it’s a thing that is interesting.

This video shows it off:

New Super Mario Bros. Wii Exception Handler (Youtube, two minutes)

A Forum Post About the Dithering in Return of the Obra Dinn

Dithering is a method (actually, several methods) of simulating more shades or colors than the hardware is capable of, by producing an array of dots that generally match the colors. One of the qualities of the classic, original Macintosh platform, which used a black-and-white monitor, was the way that it used dithering to give the impression of grayscale shading.

Nowadays most display devices are capable of, in Mac terminology, “millions of colors.” Macs are far from the only devices to have used dithering, but it’s a quality particularly distinctive to them.

There is an excellent article, here, written for developers but clear enough that many non-coders can understand it, that explains how its done, and demonstrates many styles of dithering. Interested readers may also enjoy this article, also on dithering. These pieces, all by themselves, are enough reason to make this post, but they’re not really the things that I want to draw attention to today.

The indie hit Return of the Obra Dinn, from five years ago, is notable because it’s a 3D game, but it uses black-and-white dithering, applied in real time, to do its shading as an aesthetic choice, and the effect is striking. Not just for the dithering, but because the dithering is stable; its dots don’t jump around in a randomish manner, but tends to look like an applied texture, even though it’s generated by an algorithm. You can see for yourself in this trailer:

The cool thing is (and I think it’s linked from one of the articles I presented above), the creator of Return of the Obra Dinn, Lucas Pope, wrote about dithering in a post on TIGsource while the game was in development, and he explains the experiments he ran to get the shading to work and be stable. I recommend graphics programmers to it without hesitation, and others might find it interesting to. I know I do! Have a look!

One of Lucas Pope’s dithering experiments

Forum post describing dither experiments done for Return of the Obra Dinn (TIGsource)

The Lost Sound Code of Sinistar

Sinistar was a game that had quite an impressive sound design. It borrowed a bunch of its sound effects from earlier Williams games, with which it shared common hardware that was originally design for pinball machines. A cockpit version of Sinistar, of which only around 200 units were made, was the first arcade game to have stereo sound. And of course all versions of the game have the Sinistar’s famous digitized threats and taunts.

While Sinistar’s main program source code was found and made available on Github, the source of the code that drove its sound hardware has long been lost. Youtube user SynaMax has done the best he could at recreating that code, and has made a video talking about the process, the sound design of Sinistar and other early Williams games, and even found unused sounds in the code.

Contained within the code is the revelation that the sound chip that drove the rear speakers in the cockpit version ran slightly different code than contained within the main sound ROM. The data from that version of the game was only dumped this year, meaning that the game running in MAME was somewhat incorrect.

Now that the right version of the chip has been dumped, the cockpit version of Sinistar now sounds properly in MAME. Although this does mean that users running up-to-date MAME have to refresh their romset for this version of the game. Such are the tradeoffs of MAME emulation.

Another revelation of the video was that the parametric sound generators used by Williams arcade games from that time often produced interesting noises if it was fed with random data. Sound programmers sought out different sets of numbers to give them, including by asking passers-by for numbers off the top of their heads and garbage values found in RAM when dev systems were powered up, in order to produce strange sound effects.

Devs using more recent parametric generators like bfxr, LabChrip, ChipTone, sfxia, rFXGen, wafxr and jfxr can produce noises by similar means using those programs’ Mutate or Randomize buttons!

I feel like I should warn however, near the end of the video is mention of a bit of drama concerning the MAME developers, in getting code supporting the change integrated into the software. I’m not weighing in on this, not the least reason being I don’t know enough about it. But I feel like you should know it’s coming, ahead of time, before embarking on the 51-minute journey.

Rescuing the Lost Code and Stereo Sound to Sinistar (Youtube, 51 minutes)

More on the Terribleness of NES Strider’s Programming

A while ago Displaced Gamers, as part of their great Behind The Code series, did a video about how awful NES Strider’s sprite updating was. Arcade Strider was huge hit and outright masterpiece, a great arcade platformer released right before fighting games took over game rooms around the world, but NES Strider was a wretched thing, full of big ideas but with code woefully unable to live up to them. Imagine a puppy trying to do your taxes. It might put up an adorable effort, but it’s just not going to get the job done.

We linked to their last video examining its malformed construction. Well, Strider is the well of crap that keeps on gushing, and so Displaced Gamers has another video on the subject of the flaws in its programming, this time about its player physics. Walking into walls causes Strider Hiryu to shudder in place; jumping beneath a low ceiling causes him to bump his head repeatedly as his jump continues even though there’s no room to ascent; and his infamous “triangle” wall jump is so wonky that it literally requires a frame-perfect input to pull off, and not even the right frame. You have to jump the frame before you contact the wall!

Here is the new video, which explicates the entire cruddy system. It goes into exquisite/excruciating detail, including tracing the code and examining Hiryu’s X and Y coordinates on a frame-by-frame basis. It’s the kind of deep geekery that I just know you love/hate! Enjoy/despair!

The Physics Nightmare and Bizarre Jumping of Strider (NES) – Behind The Code (19 minutes)

OpenGameArt

It’s just a pointer to a useful site today. OpenGameArt has been around since at least 2009, a place where people can upload game assets they’ve created and make them available to developers, with a variety of licenses. Back in 2013 I used music from it for my own Gamemaker game Octropolis, properly credited of course.

Games made with freely-available resources sometimes get a bad rep, but they can be invaluable for small-team and single developer projects, or anyone trying to get their project off the ground.

OpenGameArt

Kaze Emanuar’s Adventures in Mario 64 Optimization: Calculating Sine

I’ve mentioned Kaze Emanuar’s efforts to make the best Mario 64 there can possibly be on its native hardware. He’s compiled it with optimization flags turned on, made its platforming engine much more efficient, and worked hard to minimize cache misses, which was a major source of slowdowns in the game’s code. Under his efforts, he’s gotten the engine running at 60fps (although not yet in a playable version of the original). While these optimizations are not the kind of thing that can keep being found indefinitely, he’s bound to run out of ways to tune up the code, currently he’s still finding new ways to speed it up.

I hope you’re ready for some F-U-N (approximation FUNctions)

He made a Youtube video detailing his most recent optimization find: getting the game’s trigonometric functions executing at their speediest. What is interesting is that the Mario 64 code already uses a couple of tricks to get sine and cosine results in a rapid manner: the game only uses 4096 discrete angles of movement direction, and contains a lookup table that covers each of those angles. But it turns out that this optimization is actually a mis-optimization, because the RAM bus hits incurred to read the values into the cache are actually more expensive than just figuring out the values in code on the N64’s hardware!

The video starts out decently comprehensible, but eventually descends into the process of figuring out sine and cosine on the fly, and the virtues of the various ways this can be done, so you can’t be faulted for bailing before the end, possibly at the moment the dreaded words “Taylor series” are mentioned. But it’s a fairly interesting watch until then!

Youtube Dev’s Experiences Making New Dual-Stick Shooter Roguelite

Helper Wesley on Youtube is making a Binding Of Isaac-style randomized twin stick shooter called Spent Shells, and published it on Newgrounds. It’s on itch.io too. It got about 35,000 plays and an award from the site, which is nice. It also got ripped off and put on a bunch of other sites, which wasn’t. But things seem to be going well with it.

Wesley put up a video with his experiences with its popularity and his attempts to monetize it. It’s only ten minutes, and it’s got a lot of useful information for things to do that might help out your own project, if that’s the kind of thing you do, or just an interesting look at an experience most of us won’t even have.

I Published My Roguelike Game – Dealing With The Aftermath (Youtube, 10 minutes)