Score Keeping on the NES

Sometimes I feel like I should put a content warning here when the technical level of a post is higher than usual. This one would probably be a five out of five for geekery. It’s a video from NESHacker on counting score on the Nintendo Entertainment System. But I don’t want to discourage you from watching it! It’s nine minutes long, and it contains a definition of the term double dabble.

Human-readable numbers are tracked by computers in a number of different ways. Nowadays we basically just do a printf or some version of it, but on a 1 megahertz platform, optimization really matters. It’s easy to think of computers as being impossibly fast, but in truth speed only ever counts relative to the efficiency of the algorithm you use. Computers are fast, but they aren’t all that fast.

One of the big tradeoffs in processor design is, fewer complex instructions that do a lot but take a lot of cycles, and processor complexity, to execute, or many simple instructions, each doing little and being relatively simple, and not needing a complex processor design to implement.

The 6502 microprocessor generally follows the latter design philosophy. It made some important tradeoffs to keep costs down. For example, it doesn’t have hardware that can multiply arbitrary numbers together. It relies on the programmer, or else a library author, to use the instructions given to code their own multiplication algorithm, if they need one. The result is going to be slower, probably, that if the chip had the circuits to do this automatically in silicon, but it reduced the cost of the chip, basically allowing more to be made, or else increasing the profits for the manufacturer.

Personally I’m a fan of just storing the score as a series of digits that match up to their positions in the character set. Gain 1,000 points? Just bump the 1000s-place up by one, and if it goes past 9, subtract 10 and bump the 10,000s place. That’s a tried-and-true system that many games use, and works well if all you ever have to do is add numbers. Comparing values, like for detecting extra life award levels, make things slightly more complex, but not by much. There’s sometimes other factors involved though, and that may explain why Super Mario Bros. uses different systems for its counters, as explained by NESHacker.

The End of Masahiro Sakurai on Creating Games

He mentions that it’s possible that he might dust off the channel from time to time, but that he feels it has accomplished its mission. Here it is (46 minutes):

To remind everyone: Sakurai is the famed creator of Kirby, Meteos and Smash Bros. In the video, he relates the surprising fact that no only did he write out nearly every script, 256 in all, before the first episode even aired, but he also filmed them all in advance too! That’s why he looks older in this video: it’s the first time he’s been before the camera, with just three exceptions, since it started. The video, in fact, is mostly about how the series itself was made, which as it turns out was done without a camera crew, and in a residence of his too, outside of a recording studio and without soundproofing, so production had to pause if am ambulance drove by outside, and couldn’t happen at all if it was raining.

I have no doubt that these videos will be an important document in the coming years, not just as a guide to making video games, but also preserving the processes of current-day game development, and the words and thoughts off one of the foremost game designers of our age. BTW, note the split second of Rogue at 18:58!

The video has always had a feel like maybe Nintendo was helping out with it, but as it turns out, other than approving the use of their game footage, they weren’t greatly involved. The similar feel may be due to the use to HIKE, a.k.a. QBIST, a production company that Nintendo also uses for some of their videos.

To close this out, I’ll link a short bit from earlier on, at a mere 2 1/2 minutes, the video about Sakurai’s cat, Fukurashi. Meow, or perhaps, nya!

Roguelike Celebration 2024

Starting this Saturday at noon US Eastern time (9 AM Pacific, 5 PM Greenwich, 7 PM CEST) is Roguelike Celebration 2024! I’m presenting half an hour on the Mystery Dungeon games this year, at 3:15 PM Pacific/6:15 Eastern/11:15 Greenwich/1:15 AM Sunday CEST. Whew, the roundness of the Earth makes it difficult to express times!

It’s being held entirely online again this year, and offers a fun social space to explore that’s kind of like a MUD! Roguelike Celebration’s schedule is here, and you can get tickets for $30 for the whole event here. They usually set aside some free tickets for people who can’t afford the fee, although you might have to check around to find them.

Roguelike Celebration is nominally about roguelikes and procedural generation, but I think it’s interesting from a wide variety of gaming perspectives, and every year I find several talks that are incredibly interesting. Past years have offered presentations from people who worked on games as diverse as Kingdom of Loathing and Blaseball. Here are the talks being offered this year:

Saturday

  • Harry Solomons: Trampling on Ghosts: Hauntology and Permadeath
  • Cezar Capacle: Enhancing Narrative Through Randomness and Complications
  • Max Bottega: Keeping Art Direction interesting in a procedurally generated world
  • Stanley W. Baxton: Bringing Real-World Occultism into Your Games Without Accidentally Being Racist
  • Jeff Emtman and Martin Austwick: Neutrinowatch – the podcast that plays itself
  • Nic: Braided Narratives: Or How I Learned to Stop Worrying and Love Linear Stories
  • Pandamander: “Out of Book,” The Psychology of Why Roguelikes Keep Us Playing
  • ?: Inverse Terrain Solver
  • Adrian: Probably Impossible – NecroDancer’s network code
  • John Harris: A Trip Through The Mystery Dungeons (psst: this is mine)
  • Marlowe Dobbe: A Swarm of Monsters is Hard To Build: Generating Visual Concepts for Enemies in Roguelikes
  • John Bond: Doors or no Doors: How Roguelike games take you places
  • Dan Norder: Chase, The BASIC Language Proto-Roguelike

Sunday

  • Yong Zhen Zhou: Who Controls the Controller? Thinking about physical player interactions outside a digital game
  • Tabea Iseli: Animal Crossing meets Roguelite Dungeon Crawler – The surprising genre mixture behind Grimoire Groves
  • Philomena Schwab: 100,000 wishlists in 3 months – Weird roguelikes are taking over the world
  • Kaysa Konopljak: Going legit with DotA: How to transform a thousand authors into four
  • Alexander Birke: Practical procedural world and story generation in Sea Of Rifts, a naval roguelike RPG
  • Robin Mendoza: The Use of Knowledge in the Labyrinth: The price mechanism as a storytelling device
  • Ollie: The Right Variety – Understanding and Visualising the Output Diversity of Your Generators
  • Eiríkr: Uxn – Permacomputing & Roguelikes
  • Brian Cronin: Black Box Sim for Roguelikes
  • Isaac Io Schankler: Orb Pondering Simulator LIVE!
  • ?: 7 Layer Dip, Multi-Layered Narratives For Roguelikes
  • Emily Halina: New Levels from a Single Example via Tree-based Reconstructive Partitioning (TRP)
  • Courtney: Cheating the System (By Design!) for Epic Combos
  • Joe: Magic in Game Design: (Mis)Directing the Player’s Attention
  • Tyler Coleman: Finding your 80/20 Rule with Proc-Gen
  • Nat: Procedurality and the Primes

Masahiro Sakurai on Satoru Iwata

I haven’t posted much from Kirby and Smash Bros. creator’s prolific Youtube channel on game development. There’s a lot of good information in there. The channel is winding down now after a good run, but now, near the end, he’s posted at one of his final videos a remembrance of his old boss, and beloved Nintendo company president, the late Satoru Iwata. (10 minutes)

It’s now been nearly 10 years since Iwata’s passing, and the outpouring of respect, admiration, and even affection, for him over that time has been remarkable. There’s a sense that we lost an amazing figure. Sakurai is brilliant in many ways, but he calls Iwata the smartest man he’s ever known. He strove to be polite, not to take offense in conflict, and to always act with logic instead of emotion. He helped transition Nintendo from being under the sole control of the Yamaguchi family to the more varied and ingenious company they’re known for being today.

In addition to running the company, Mr. Iwata started out as a programmer a HAL Laboratory. Think of how rare that is for a multi-billion-dollar company. They didn’t hire your standard MBA out off a business school, but put their future in the hands of a former coder. I have no illusions that, in many cases, that could have been disastrous, because programming and management require different skill sets, but Mr. Iwata pulled it off.

Sakurai finishes the video with a story of the last time he saw Iwata alive. He calls Iwata the person in the world who understood him the most. When Iwata wanted to see him, he didn’t delegate it to an assistant but always emailed him directly. It seems that Iwata was a good person who many admired and respected, but to Masahiro Sakurai, he meant something more.

The video isn’t very long, and there’s a sense of finality to it, not just in Sakurai’s memories of Iwata, but of the ending of his Youtube channel. Masahirro Sakurai on Creating Games is such an unusual series: an important and brilliant working game creator telling the world personally of his views as a creator. Such an unusual move! But Iwata created both the Iwata Asks series, and the Nintendo Direct promotional videos, which may have inspired Sakurai’s own series. Both men understand the importance, often neglected I think, of clear communication, both between others and the world.

Thank you, Mr. Sakurai, for what you’ve told us. And thank you, Mr. Iwata, for all your hard work.

Ed Logg on Creating Gauntet

Recently I’ve been working on a getting-started guide on what I think is one of the most interesting games in UFO 50, Pilot Quest. (Other games I’ve really enjoyed, though I’ve by no means tried every game in the collection yet: Magic Garden, Waldorf’s Journey, Planet Zoldath, Attactics, Kick Club, Onion Delivery, Porgy, Valbrace, Grimstone and Mini & Max.)

Guides take time, so in the meantime here’s an hour-long talk by Ed Logg on the creation of Gauntlet, from GDC 2012!

A Look At Beta Versions of the Wii Channels

An internal Nintendo metaphor for the Wii’s UI was “more channels for the TV.” It’s a particularly Old Dad idea for the Wii really, as even at that time broadcast TV was beginning to decline in popularity, but it may have made more sense in Nintendo’s home territory.

The experiences of these channels, the Mii Channel, the News Channel, the Weather Channel, the Shop Channel and the like, are receding in memory, although there are fan efforts to revive them and connect them to new information sources. But at the other end of their development life, of their pre-release development very little has ever been known. Early Wiis had stubs in their place, that only directed the user to installing a launch-day update. (I experienced this myself! I drove 140 miles in order to wait in a line for a Wii on its launch day, November 19, 2006. I’m objectively insane.)

Those stubs weren’t the true original versions of the Wii Channels, they had been in development within Nintendo for some time. Those development versions of the Wii software have never been leaked outside the company, but there exists footage of them from various sources. Bjohn on Youtube has compiled what we know about the development Wii Channels into a 21-minute video. Here it is:

There’s a fair amount there, including early versions of the Internet Channel and early evidence of plans to include DVD support. (The Wii has a fully-operational DVD drive, but to avoid playing a license fee to the DVD Consortium it cannot play DVDs without hacks.)

Beta Wii Channels! (Bjohn on Youtube, 21 minutes)

Shmuplations Translates An Interview With An Arcade Donkey Kong Programmer

The name of Ikegami Tsushinki Co. is a bit better known nowadays. For a long while Nintendo was content to just let the world believe they were entirely responsible for their early blockbuster arcade hit Donkey Kong, but eventually word got out that all of its program, and large portions of its design, were the work of a number of uncredited employees of that company. While Nintendo owns the trademarks over the game, the copyright of the arcade game’s code appears to be owned by Ikegami Tsushinki, or perhaps held in joint between them and Nintendo.

One of Shireru Miyamoto’s original notes for the design of Donkey Kong, at that time envisioned as a Popeye game.

Which is it precisely? Look, when you write a daily blog you don’t have time to hunt up Japanese legal records. What is important though is that this is why Nintendo doesn’t have the rights to just rerelease arcade Donkey Kong willy-nilly. To date, they have used it once since the classic arcade era: an inclusion in the N64 Rare title Donkey Kong 64. Mind, there has been an Arcade Archives release from Hamster; I presume they got the rights from both Nintendo and Ikegami Tsushinki. It’s for this reason that Nintendo almost always presents NES Donkey Kong in compilations, which is similar but differs from the arcade game in many important ways.

Hirohisa Komanome was one of the people at that company that worked in concert with Nintendo’s Shigeru Miyamoto, and several other employees of Ikegami Tsushinki, to complete the design and implement Donkey Kong from Miyamoto’s notes, finishing it in only around three months. Donkey Kong came out in July of 1981, meaning it was probably began around the beginning of the year. The quickness of their work would prove to be essential: remember, the American arcade industry collapsed in 1983, when many promising games would be abandoned or released to greatly diminished profits. If Donkey Kong had been released a little later, it may not have become such a fondly remembered hit.

Kate Willaert commissioned the translation by Alex at Shumplations of an article written by Hirohisa Komanome that was published in 1997 in the Japanese publication bit. It’s up on their site here. Given that Nintendo tends to be very tight-lipped when letting their employees talk to the press, it’s probably good for us that Donkey Kong was implemented by an outside company, or else this account of the game’s creation may never have seen print, or our eyes.

Donkey Kong: A Record of a Struggle translated into English (shmuplations.com)

Noneuclidian Doom

Found by cortex over on Metafilter was this 2022 talk where someone noticed that the value of the constant pi in the source code of Doom was slightly incorrect. It’s a very tiny difference, and the results aren’t really visible in the game. So Luke Gotszling got the idea to compile the game with different values, and to see what the results are. They gave a talk about it! It’s 19 minutes long, and may be interesting if you’re of that frame of mind.

Non-Euclidian Doom: what happens to a game when pi is not 3.14159…. (Youtube, 19 minutes)

Indie Interview With Lee Easson and Odd Infinitum

For this perceptive podcast, I interviewed self-taught indie developer Lee Easson about working on his first game Odd Infinitum. We discussed what it’s like to learn game dev today and how that has changed over the years and the challenges it brings to indie developers.

On Super Mario World’s Score Display

Awesome Mario trivia blog Supper Mario Broth noted on Mastodon that Super Mario World is extremely inefficient in displaying Mario’s score.

There is more information on SWMspeedruns.com, but in brief, SMW stores the player’s score as a 24-bit value as hexadecimal digits, and converts that value to decimal when it’s time to display it. There is no good way to do that that doesn’t involve figuring out the entire arithmetic, but Super Mario World does it particularly slowly: it starts with a copy of the score, then sees if it’s over 1,000,000. If it is, it increases the millions digit of the displayed score by 1, subtracts a million from the work value, then repeats. When it runs out of millions it repeats with the hundred-thousands, and repeats until it finishes with the tens. At least it doesn’t try it with the 1s, seeing as how nothing in the game awards single points!

In a worse-case scenario, with a score of 9,999,990, the code goes through this whole process every frame, consuming up to 8% of the time available for game logic.

What could the game have done to accomplish this better? It could have found out how many of each digit there was once instead of looping and incrementing. It could only figure out the score when the value changes. Or it could save the value as the digits themselves in decimal, just increment them by the right values when its needed, and then copy that figure to the screen. That’s largely what 8-bit games would do.

Even worse, if Luigi is the active character, the game does this twice: it figures out and prints Mario’s score, then it does it again for Luigi’s score, placing it onscreen in the same place.

While printing the score is just one thing the game does each frame, the effect is great enough that complex scores can lag the game, enough that speedrunners take the score into account to avoid it.

This adds to the evidence that Super Mario World development was rushed. It’s already known that a lot of the code in SMW is buggy, allowing for some truly heroic exploits like programming a text editor in SRAM purely by manipulating objects in an early level.

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!