My last post, about Well Court, ended on a nice number: the heaviest view of the square drew in 47 ms, just under what the Nintendo 64 needs to show 20 frames per second. Then I ran the game on my own console, and it didn't agree at all.
Most of this past week went into that. I also spent my evenings playing on the N64 and writing down everything that felt off, and most of those notes have been dealt with. And the game has a new opening film. Here's how it went.
What the console said
On 15 November the real console measured Well Court at 15.45 frames per second on average. Out of 428 seconds spent walking around the square, 372 were under 19. The 47 ms was right for the square alone. It just left out Link and the interface, the people walking about and the 146 small props (barrels, crates, carts and the like). With all of that on screen, a heavy view of the court took about 57 ms.
A version of the game that plays itself
To stop guessing, there is now a special measuring version of the game that plays on its own. It goes through 22 chapters of the adventure, about two hours over 96 zones, with the walks, the doors, the fights and the films, and it writes how long every single frame took into the save file. I start it on the console, leave it alone, then bring the save back to the PC to read it.
The first full run gave a very clear rule. As long as a frame takes less than about 47 ms to draw, the console keeps its 20 frames per second. Between 46 and 48 ms it starts to slip, and past 48 every second is slow. Out of 1,940 slow seconds, only 5 came from the processor. All the rest was drawing.
The same run, replayed without characters and then without scenery, also split the bill. Link and the interface alone take 12.6 ms, and in Well Court the characters and props cost about as much as the buildings.
Erethgar and Hargrete on their way to the well, early on the first morning. The opening film looks down on the court a lot, because a level view across it costs too much for the console.
What worked
Cellar. Its torchlight is now painted into the walls once instead of being worked out again every frame, and the Key Knight is fought in half-darkness, so part of the hall is never drawn. In that fight the game went from 11 to 16 frames per second in the first phase, and from 12 to 19 in the second.
Doors. Each door now only draws what you can see through it. It's a small gain on average, one or two milliseconds, but up to 9 at a few doors.
Sound. On the N64, the music and sound effects are mixed by the same chip that prepares the graphics. Every torch in a room used to crackle on its own; now they share one sound, and the number of voices is capped during fights. The busiest fight went from 14.8 ms of sound to 10.5.
Collisions. Finding the floor under Link's feet in Well Court used to mean checking 53 surfaces. It's 21 now.
The second full run, on 16 November, came back with 964 slow seconds out of 6,139, where the first had 1,940 out of 6,424. That's 15.7 % instead of 30 %, and 40 of the 96 zones no longer have a single slow second.
The haze I turned down
One of the ideas tested was a haze that comes closer when the console struggles, so that less of the town has to be drawn. I saw it on my N64 and found it far too thick, visible much too close. So it's gone, and the town got lighter instead. In Well Court the props went from 146 to 81, and the thin timber framing on the house fronts of the quarters was cut back, about 1,600 triangles fewer in the Military Quarter alone. A few objects that had ended up cut in half came back whole, or left along with their collision.
Lussandre on the Wash House quay, in the opening film.
A bug only the console shows
While playing on the real hardware, I kept seeing holes in the walls above some arches, and ladders that looked scrambled. None of that showed in the emulator I usually play on. The N64's graphics chip only draws a decal over a surface that matches it exactly, and a few of mine were slightly off, which the emulator forgives. They're fixed, and a check now catches the problem before it ever reaches the console.
A new opening
The other big piece of the week is the opening film, the one that plays before you choose a save file. Like in Majora's Mask, there are now two films that take turns, following the town as it wakes up on the first morning, and they end on the new logo you can see at the top of this site. Every shot was checked against the console's limit before anything else. The music is a slow piano version of the Well Court theme, and you can listen to it on the soundtrack page.
The end of the first film: the new logo comes in over Pauper's Alley.
Next up is another full run on the console with all of this in it, and then the parts of town that are still too heavy.

Comments