Did Nintendo really forget to Optimize Super Mario 64 ? | MVG

preview_player
Показать описание
A recent discovery from the N64 Super Mario 64 De-Compilation Project appears to show that Super Mario 64 USA release for the Nintendo 64 was not optimized and was released as a debug version. However things are not that cut and dry. In this episode we take a deep dive in to what went on with development of Nintendo 64 games in 1996 and how this theory may not be accurate.

N64 Footage was captured with an UltraHDMI and trdrop was used for framerate analysts. Big thanks to SpawnWaveMedia for the N64 captures.

Links:

Social Media Links :

#Nintendo #Mario64 #Optimization
Рекомендации по теме
Комментарии
Автор

There was a reply on the original video about the -02 thing by Kaze Emanuar, who is a very knowledgeable Mario 64 hacker and modder. According to him, most of the slowdown in Dire Dire Dock is from the submarine's collision being dynamic, instead of static like most every other object in the game, and he even fixes it in his SM64 Multiplayer mod.

dsproductions
Автор

So the answer is, they didn't "forget" out of some negligence or incompetence, it was a safety decision. But there is no denial the game runs better with -O2, and not insignificantly! 1 or 2 frame difference is a lot when you are in a <30 FPS environment.

the_kovic
Автор

You're glossing over a lot of facts and several incorrect statements were made in this video.


1. We did not use Ghidra. We only sometimes used our own custom decompiler (mips_to_c) but most of the work was completely handwritten from static analysis. We were able to do this since the unoptimized code basically read literally out directly to C mannerisms with few exceptions.
2. It's not actually certain O2 "caused" issues. We are only certain of the compiler for US/JP: IDO 5.3 (IRIS Development Option) with -g for the main game code. Why Nintendo either left it in or deliberately used it is unknown but we do have a few hypothesizes, some of them match the accidental side and some of them are the on purpose side. What we do know also is that since the collision routine slowed down by -g causes the major DDD sub lab being an indicator of the flag also means the Spaceworld 1995 build is unoptimized. If that ever leaks out, decompiling that would be easy pickings for us. (Please get out!)
3. Compiling US/JP builds with O2 (as-is, no AVOID_UB) they can complete 0 star and 120 star TASes respectively. Since inputs arent accepted on lag frames, they can pass these since it appears the functionality is identical. Hell, I even tried modern gcc, and they *still pass, * but only if we define AVOID_UB. gcc actually makes a ROM that crashes the n64 if we don't. IDO doesn't seem to care.
4. The mulmul bug was patched way before the N64's release, and I believe before SW95's showcasing. This was patched at the assembler level by SGI which that patch is IDO 5.3 only, made default in 7.1 (released in November 1996 after sm64's release) and gcc got its own version of the fix with gcc 2.8.x (2.7.x builds that had it were available by Cygnus and the N64 SDK.)



It is possible though earlier builds with O2 spooked them into not using it, but it either had to have been before or after sw95 [Spaceworld 1995] (which would mean it was originally -g but they tried O2 to see if they could). There's a bug in the Disk Drive version that crashes Wiggler's room which is caused by an out of bounds read for a float value. This crashes real N64 hardware because that value just so happens to be a denorm on the O2 build (but we arent sure if O2 shifted it into place) but not the original US/JP releases which just so happen to read a valid float and dont crash.


This was miles better than the other video, but I do wish it dived deeper into how we actually figured out it was IDO 5.3.

Mobius
Автор

I think they didn't want to risk releasing the game with potential critical bugs caused by -02 optimization since it was a launch title and it was crucial that it was polished to show off the N64

HenrikoMagnifico
Автор

>"mistakes werent made"
>"werent" missing an apostrophe
A mistake was made!

SetnaroX
Автор

This topic makes me wonder about other games like Donkey Kong 64 that crashes randomly on the console and requires a expansion pak to work.

Orbitthemaster
Автор

For real frame rate slowdowns, see Goldeneye 64 or Perfect Dark multiplayer with grenade launchers. We really, REALLY didn't mind as much back then.

LongPeter
Автор

The real question is why was - O2 enabled on the pal version

boris
Автор

"the game was criticized for its camera"
aren't they all though?

vriskaserketontheps
Автор

It's actually kind of funny to see Nintendo intentionally disabled optimizations, as around the same time I was writing completely different software and our team found a compiler bug that forced us to release unoptimized code for a while until Microsoft fixed their bug. I guess it was just a thing to do that year. LOL

justsomeperson
Автор

Mistakes WEREN'T made?
My world is shattered. The cake is a lie.

MarcoGPUtuber
Автор

If ghidra wasn't open source, I'd use ghidra to decompile it and release the source.

deanmoncaster
Автор

5:01 "As someone who is a C program" Holy shit I knew it.

Xilefian
Автор

Decompilation of Panzer Dragoon Saga for the Sega Saturn would be interesting, considering that the original source code is lost.

DeenHoward
Автор

That lag while swimming will always be a part of the game for me lol.

kris-wjwj
Автор

I love that you dive into great detail, while at the same time can explain complex subjects in a manner which is easy to understand.

DaveVoyles
Автор

One thing to add: the sm64 project was started before ghidra was released, and it wasn't the method used, at the very least for most of the development. The reason they got such accuracy that they could produce a byte-for-byte identical ROM was the compiler test-casing that was done. The exact IDO compiler version that was used was found based on testing a set of specific code until the correct patterns were found, until enough version-specific behavior was found to be sure of the exact compiler used. Once that was known, different ways of representing effectively the same algorithm with slightly different tweaks was used in order to figure out the way the original code was likely written, based on the compiler output. Eventually you can do something like making your own pattern matcher which can output likely C-code that was started with originally. Pretty cool details, imo. In any case, nice video, glad someone covered this topic with the proper measured approach :)

metroid
Автор

Usually in almost all game development cases, accusing companies of not doing something out of "laziness" is almost never correct. There's almost ALWAYS more to the story, and laziness should always be the last resort for deciding why something happened the way it did. Good work!

bubby-fimc
Автор

4 player Perfect Dark with all bots enabled. The ultimate lagfest.

lukehero
Автор

Have you seen Kaze Emanuar's recent video where he optimized the game to 60fps?

Abyssoft