When working on any software project, the developers have to balance releasing on time with optimizations. As long as you are hitting your desired time constraints, why not just ship it earlier? It’s no secret that Super Mario 64, a hotly anticipated launch title for the Nintendo 64 console in 1996, had a lot of optimizations left on the table in order to get it out the door on time. In that spirit, [Kaze Emanuar] has been plumbing the depths of the code, refactoring and tweaking until he had a version with serious performance gains.
Why would anyone spend time improving the code for an old game that only runs on hardware released over two decades ago? There exists a healthy modding community for the game, and many of the newer levels that people are creating are more ambitious than what the original game could handle. But with the performance improvements that [Kaze] has been working on, your budget for larger and more complex levels suddenly becomes much more significant. In addition, it’s rumored that a multi-player mode was originally planned for the game, but Nintendo had to scrap the feature when it was found that the frame rate while rendering two cameras wasn’t up to snuff. With these optimizations, the game can now handle two players easily.
[Kaze] has a multi-step plan for improving the performance involving RAM alignment, compiler optimizations, rendering improvements, physics optimizations, and generally reducing “jankiness.” To be fair to the developers at Nintendo, back then they were working with brand new hardware and pushing the boundaries of what home consoles were capable of. Modeling software, toolchains, compilers, and other supporting infrastructure have vastly improved over the last 20+ years. Along the way, we’ve picked up many tricks around rendering that just weren’t as common back then.
The central theme of [Kaze]’s work is optimizing Rambus usage. As the RCP and the CPU have to share it, the goal is to have as little contention as possible. This means laying out items to improve cachability and asking the compiler to generate smaller code rather than faster code (no loop unrolling here). In addition, certain data structures can be put into particular regions of memory that are write-only or read-only to improve resource contention. Logic bugs are fixed and rendering techniques were improved. The initial results are quite impressive, and while he isn’t done, we’re very much looking forward to playing with the final product.
With the Nintendo 64 on its way to becoming a mainline-supported Linux platform, the old console is certainly seeing a lot of love these days.
Thoughts,
First his ram alignment and optimizations require the ram expansion pack.
Second I am quite curious whether any of the optimizations would translate to the PC port.
He is doing this to make his custom mod possible on native hardware. Amazing
Last his re-build of the wall collision was amazing, apparently fixing larger characters physics, wall jumping and even making for a massive speedup
Ha! almost forgot, I think the original designers were seriously under the gun getting the game out. And with carts there is no updating it after it leaves. Dude is amazing, they should just hire him
This is indeed super impressive. We do have to remember that we have much better tools now. Not just compilers, but also emulators that provide a lot more information and debugging tools then where available back then. We also understand the hardware most likely a lot better then back then.
I’m hacking in Links Awakening DX for the Gameboy color. (Made a randomizer for it: https://daid.github.io/LADXR/ ) And having a really good debugger available just makes it so much easier, as well as full in-depth understanding of the hardware and limitations.
improve textures
Yes, they rushed at the end and didn’t set the optimize flags in the C-Compiler.
Modern Vintage Gamer made a Video about it.
https://www.youtube.com/watch?v=NKlbE2eROC0
Wonderful results, and a really enjoying video without going into the real gory details, which I’d also like to see :)
O Schedule, how many crimes have been committed in your name?
“The real culprit is the cloaked figure behind me named Mammon.”–Schedule
They didn’t want it good, they wanted it Wednesday.
Nice work here though.
TLDR: Rambus sucked balls. N64 was starved for memory bandwidth.
I mean this is nothing short of amazing. But Nintendo totally didn’t deserve this at all.
One does wonder what could be done, performance and/or quality wise on for example 8th gen consoles, if someone really went boners and optimized _everything_. I’d wager that would a far crazier endeavor than doing the same on 90s era software.
At the end of the day, optimizations costs a lot of money, which most studios don’t want to pay.
Super Mario 64 was only 8 megabytes in size. The cartridge limit is 64 megabytes. Technically there’s a ton of headroom for content improvements too like more levels or better textures and sounds.