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.
I wonder if the submarine collision was just an oversight by the dev team, or if they actually had a reason for it being dynamic. Perhaps time constraints and cut content?
@@scottmjohnson1980 What a hilarious and witty comment. Thank you, Scott Johnson, the artist famous for his promotional art made for Marvel comics, specifically his drawings of Spider-Man that could be found on all sorts of merchandise throughout the 2000s and early 2010s.
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
@@Poever It was safety against an unplayable mess of a game. Whilst the game may run better with further optimisation, it may cause unintended stress on the hardware over time, or have other unknown effects on the game itself, that preliminary testing didn't find. So for safety, they used a less Intrusive optimisation, trading a few frames for a more stable experience.
@@ABVW92 Well, it may just need more cooling, likened to using AVX on recent PC processors. Like when Intel reportedly has a lower frequency, when AVX instructions are being used. Still not noticeably slow like Goldeneye is in spots on a real Nintendo 64.
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.
First off I appreciate your hard work and it is truly fascinating, however this comment sort of makes you come off as a dick. Just as you took the information given and interpreted it he did the same thing. Instead of accusing him of not diving deep.enough or comparing him to that other asshat help him understand and get the correct info out.
I think anything involving explosions can be excused for dropping frames as long as the damage done is appropriately powerful. It gives the grenade launcher a feeling of "ah crap, that is a lot of hurt, give the machine a moment"
You can feel when there's not enough frames, it feels worse. The multiplayer modes of those games weren't intended to be the most common mode, so it's better to just have it than remove it. Same thing happens in for example, Mario kart Wii, on 3 and 4 player mode, it locks to 30fps instead of 60.
From what I remember, it has a memory leak and will eventually crash due to running out of RAM, they made the expansion pak required to increase the amount of time before the crash to 8 hours by basically just give it more RAM to leak to, it didn’t actually need that memory for anything else
The problem with DK64 is a memory leak and it was "fixed" with the expansion pak because more memory meant the leak took more time to crash the console.
I was livid when I found out about that. I was so convinced that the expansion pak was some magical thing that made the n64 more powerful. Damn marketing 😂
@@KuroAno I know that but this was never really well documented on any channel on UA-cam whatsoever, the memory leak problem has never been explained properly here, just the "it's a memory leak lol".
@@ShaunDreclin I mean, technically it did, but not by much. It doubled the RAM from 4mb to 8mb. It just wasn't something that would affect games not designed around it.
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
My assumption was similar: a codegen issue that only occurred with optimization enabled so they hand-optimized during development, and then not wanting to risk "breaking the build" even after the issue was fixed.
I think the better question is why they never put out an revision built with -O2 for USA. I mean, they had to print new cartridges at some point; why not toss in an optimized ROM now that you know it doesn't break anything? Perhaps I'm just unfamiliar with the logistics of cartridge manufacturing.
Maybe something to do with PAL versions only getting 25 FPS instead of 30 to begin with. It's pretty strange to get variable framerates on a console actually. Usually at the end of a frame a console game waits for the next frame, so if it takes longer than one frame to process one frame, when it waits for the frame to end it's actually waiting for the next one, and it ends up taking whole 2 frames total, therefore (assuming it started at 30 FPS) getting 20 FPS (3 frames per frame) or 15 (4 frames per frame) instead of 30 (2). IDK how you can get 27 FPS that way.
@@thewhitefalcon8539 would the drop in frame rate be because it didn’t process the information soon enough? And by information I mean both gameplay variables and graphics rendering. My biggest question is how does it ensure that the tv still drawls “perfect” images with variable frame rates. My best guess is that it will hold a frame until the next screen reset. But I have yet heard anyone mention that before. Also there the issue, which I think you were trying to get at, of frame buffering stacking. But eh
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 :)
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!
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
Sort of reminds me of FF7's development: basically they toyed with the release candidate for a while until it finally ran from beginning to end, then they were too afraid to make adjustments.
FF7 is held together with duct tape and prayers. :D I am in the FF6 modding scene, and even that game had 180+ separate bugs when the first battle system disassembly was made. Like the fact that evasion is never checked, or that the Genji Glove doesn't reduce your attack stat to 80% like it should. Ah, the things we didn't notice as kids....
Yup I remember playing it either in a Best Buy or a blockbuster or something and fighting King Bobomb. I’d only seen it in a commercial to that point and just never wanted to leave the store 😂
Same thing when I first played Zelda BOTW a few years ago, I became a fan boy after that and brought 3DS WiiU Switch Switch Lite to enrich my collection over the years.
What an amazing gem. Still have my N64 and a copy of SM64. I think I remember having access to a family PC back then, and early 3D games. Many 3D games were really quite poor in execution compared to SM64.
@@bigstar66 Nothing to do with hate, just normal language change. Consonants tend to weaken over time, especially at the end of words. What you're noticing are just dialects where the "R" sound has weakened or disappeared more than usual.
James Jensen yes, but they don’t usually this much this quickly. I think the British and African American spurned the letter r for the same reasons - they didn’t want to sound like white Americans.
Man I love modern strongly typed languages! However, a few years ago when we had a client crazy enough to want us to use Swift Beta 1 for their project, we would frequently run into issues where compiler optimization would optimize away entire classes that were being used. So in the early days we had to turn it off.
I actually remember liking slowdown in many games... it often coincided with explosions and action and felt epic and was occasionally helpful lol; heck, I’d try to make it happen as much as possible in Goldeneye
yeah, i actually thought that the slowdowns were intended, like a bullet time mechanic to give you a little wiggle room to operate in case of overwhelming odds
I immediately thought of Goldeneye too, when explosions were happening, it could slow down to like 1 FPS lol! I had no idea what was happening as a kid.
I'm a bit surprised this flag wasn't added and recompiled in a later release of the game, such as for the Player's Choice version. It looks like it would have been worth revisiting with the newer tools available!
Shane holy shit I’ve never considered the fact that he sounds more Australian than Australians I am Australian He has the perfect “radio” or “TV” voice
B10K PlaysGames 23 years later: is people that never worked on an released a AAA title themselves still arrogant to use their spare time to draw quick assumptions without thinking before claiming “I could have done it better”
Actually yes, the homebrew community has already figured that It seems to be a problem with the engine Grezzo made for loading stuff in, rerouting the game to load files off the SD card significantly speeds up the game
There may be another reason: I've seen some games written to work reasonably well on NTSC and then put through optimization to run at comparable speed on PAL.
MattKC has been making great videos. He has just recently getting into vintage videogames but worth a view.... Just don't go back to far or there is a bunch of cringy eye liner videos lol.
@@joshsadowski8869 everyone starts somewhere Besides, one poorly-researched video (which was more a failure of his knowledge of consoles, and knowing where to look in order to verify the actual tools used for development) isn't going to wipe away his work on preserving Lego Island for modern systems. Figuring out how the game handles audio *by himself* and releasing a free tool to update the game with the uncovered full-quality audio tapes is still commendable.
I love that your channel is both comprehensible to just listen to because you break it down so easily, but also provides screenshots and references to c code if you want to know more.
The correct answer is: "They did not forget but have actually written code so sloppily that it relied on undefined behaviour left and right and the compiler - rightfully - would screw that up"
"Redefine the platforming genre." As a clip shows mario falling from a platform while trying to simply walk across a short bridge. I'm joking of course, it was just a funny juxtaposition.
This is indeed an interesting little bit of gaming history. Granted, it doesn't change my view of one of my favorite childhood games, it does bring to light some little things I'm slowly learning as I start entering more and more into the programming world. Thanks for taking the time to do this, MVG.
As a fellow developer and retro gamer yours has to be one of my favourite channels on UA-cam. Really thorough explanation of the situation as always. Keep up the good work!
As always, thank you so much on your work on these videos! You provide a very unique perspective and recorded history of vintage games that can't be seen anywhere else. This was a really interesting video and was well done.
@@surrodox it doesn't really. if you're using latest gcc and on x86 it will work fine %90 of time. Its suprised me that -03 made it crash. Also it do make sense that nintendo didn't push optimisation to everything since compiler are came a long way too. in early 2000's maybe the compiler wasn't as good as of today.
@@user-ro1cc8tz6ddon't the -03 optimisations all have some kind of space/speed tradeoff and thus tend to increase memory usage/size of the resulting binary? If you're already running at redline for memory at points I could see it pushing you over and crashing the system due to running out of memory. I doubt the developers were leaving much memory on the table for a dedicated device like a games console not designed for multitasking, and rather to run one application at a time. Today, on a modern multitasking operating system memory is by necessity comparatively more available and that's less of an issue
My initial thought when I saw that video was that it was probably because Mario 64 was made using early sdk and there were probably very good reasons Nintendo didn't use the 02 optimization. Thank you for digging into this further.
Wow. As a Gentoo Linux user this is like... SUPER triggering. -O2 is like... THE MOST BASIC optimization option. This isn't -funroll-loops we're talking about here.
Amazing.. these guys are wizards wasting their talent on meaningless things like this. Like saints of the programming world utilising their talents so youtubers can make bank with clickbait videos for a week
Yes, this was my main reaction upon seeing this video. Claiming that Ghidra did most of the work is really selling the decompilation team short -- tools like that are nice in general, but are close to useless if you're aiming for perfect byte-for-byte accuracy. This project was mostly done manually, which no doubt took _tons_ of time and effort.
Victoria Meets World those people did it for fun because they love video games. It’s their passion for their community and also most UA-camr like these guys make very little bucks unlike those who cash in millions, also, how is this clickbait. These you tubers are like those guys who did it, they love gaming and want to help it.
@@pian-0g445 it's click Bait because of U watch the video he rushed or our and didn't do he research and on turn disrespected the talents and the assumptions of those who put in the hard work. He was in a rush to make money while the topic was hot and he substitute d his opinion as facts rather then just going over and looking at the project and ppl that worked on it
What's with all these young UA-camrs always saying how Super Mario 64 was criticised for it's camera back in the day? No it wasn't. Mario 64 seemed like a gift from the creator Himself and was flawless in every way back then. I think these guys are trying to think of things that a naysayer would have said back then but although it's hard to imagine, if you were actually a kid growing up with the N64, you'd remember there wasn't a single game anywhere near the level of 3D perfection as Mario 64. The camera wasn't "bad" because it was the only 3D camera we'd ever experienced.
I’m pretty sure I remember the release version of Croc: Legend of the Gobbos was without C compiler optimisation. I don’t think there was anything intentional about this, but as mentioned, a lot of code back then was hand optimised in assembler, so the gains to be had with C optimisation is less drastic. And I certainly remember bugs being introduced by optimisation back at that time period. Tools are much more stable now... :)
@@MattGodbolt This was PS. I have memory of Tony discovering this while getting stuck into Croc2. It may be a false memory, of course, it was a while ago... ;)
@@RetroHQ hahaha cool! It's entirely feasible it was fixed up pre PC! By the time we got it (ahem) when porting I'm pretty sure the nmake file had O2 hardcoded
Nintendo has always aimed to go for stable frame rate. This is also the reason, why small rooms on Zelda:OOT run at the same frame rate as Hyrule field. Even though the N64 would be able run smaller arear easily 60fps. Nintendo just wants balance. Perhaps if they found that Mario 64 would have some slowdown, while still running 60fps most of the time, they would reject the idea. I have European PAL and USA & Japan NTSC - -versions of Mario 64. European version has worst framerate (still stable, though) and it does not have rumble pack support even on players choice version. USA/JAP versions run equally stable when compared each other, and faster than PAL.
@@Unit_00 Most N64 games were 240 progressive scan. Very few games (without Expansion Pack) were above. But it's worth to mention that N64 could change resolution during gameplay. Those games have problems with current flatcreen TV's that have poor response time (gray to gray).
Why do people criticise SM64 Camera? From memory if you double tapped - z Trigger it went back over the shouldee instantly. It was a good camera system, it was quick and fluid and when you got good, you could push your skills and get really good and precise withe analog stick.
I would never hire a guy telling me that in such a context (there exist compiler bugs - of course, even more so in proprietary compilers - but programmers declaring to have run into numerous of them - relative to themselves writing code with UB - is usually a big red warning sign indicating incompetence and dunning-kruger. I am not implying this here - that would be ridiculous from a one-line comment on youtube). However, it is rather clear that the compiler was not really to blame in the case of SM64 but its input was crap.
steefant GCC was notorious for bugs in optimisation in the 90s when mario 64 game out. so much so that you could only compile linux kernel with specific gcc versions that had the “right combination of known bugs” the source code had taken into account. it was ages before anything newer than GCC 2.7.x was supported
Loved me some Pilotwings... The terrible blood-curdling screams of Robin when she crashes and burns still gives me chills... but... infinite rockets, the birdman suit, and the amazing soundtrack kinda made up for that in the end. Go Pilotwings!!
I commented on the original video to point out the main flaw / mistake in its thesis. Mario 64 was developed in '94-'96 on the SGI Onyx (circa 1993). Its ASM/C/C++ compiler with MIPS R3000 support did not support the level of -O2 that a modern day GCC install has. Many of the compiling optimizations performed now take advantage of techniques that have been developed and progressed over 20 years. So Nintendo did not "forget" to optimize the game, it was the best compiled binary at the time with the given tools. Edit: finished the video and I think MVG hit nearly every point. Great job.
Can we all just stop and appreciate MVG for a moment for the high quality content, knowledge, professional approach, all his contributions to all the various projects he has taken part in, and - last but not least - extremely quick response time combined with ability to give credit where credit is due. I'm speechless.
I don't think I could have worded that any better than you did if I tried. I don't think anyone on UA-cam can make quailty and interesting content like MVG about these niche subjects.
GoldenEye uses older drawing methods. no depth buffer, etc. all triangles had to be z sorted which has a good bit of overhead and more or less totally screws optimized display lists, where triangles can share vertices, flat surfaces could be quads, etc. the 64 is really kinda based around being given optimized display lists (they have a limited vertex cache, between 32 and 128 depending on the microcode) since the rsp only has a 4k data cache (think ram) for any 3d data to be passed through, any time it has to stop and change out its data it's gotta throw an exception/interrupt and have the cpu send it another chunk of data. all in all it also saves ram as there's no depth buffer, so another 320x240(or whatever the game runs at)*2 bytes freed up. the pixel fill rate is also increased substantially because it's not having to constantly check the depth buffer when it's drawing. tldr GoldenEye used old styles of rendering that would have fit the psx but don't work out so well on the 64.
Goldeneye has been optimized by minimizing the explosions among other things you can also just play it on PC to have a faster game on PC normal speed is turbo mode and turbo mode is even faster.
@@Jombo23MC it doesn't remove the explosions entirely only minimizes them because too many explosions lag it hard just check out Goldeneye NGPA edition you will see what I mean it feels nice.
You do realize that if you were to make a coding tutorial for the basics, people would absolutely eat that up. You speak with such conviction its incredible.
I saw the other UA-cam video a few days ago, I really appreciate your follow up. Thanks for the extra details on the SDK, it’s a lot more believable that Nintendo choose not to enable optimizations given the cost/ benefits.
In the initial makefile, there's a conditional that specifies 02 optimization if a version condition is met. I assume this is part of the reverse engineering and not something from Nintendo's original code?
The EU version wasn't released at the same time as the US and JP ones, so somewhere in between the releases, Nintendo enabled O2. The condition in the Makefile is the reverse engineering team's way of replicating that.
Up to a certain level - the speed differences often aren't that groundbreaking & limited to a couple of percent points. Beyond that thinking about using different algorithms & data structures as well as different game logic is more fruitful.
Vyor and again yout forgot to read “real world scenario” so sorry no it’s not that easy. Technically it’s that easy. Nintendo is not that stupid. Risk wise it’s not that easy all. So Nintendo took the right decision and not go for the optimizations. Nintendo are not stupid. Nintendo have of course more skill, experience and resources than this reverse engineering team. Also what indeed IS easy is to conclude this about the optimization now many years later with emulators time and more.
@@litjellyfish Nintendo is stuffed to the brim with shit coders, worse leadership, and a terrible track record of technically competent design. Just look at smash ultimate: broken and buggy. BOTW: laggy as shit. Sword and Shield: incomplete rush job. Mario 64: too many bugs to count and horrid optimization.
I saw someone on Reddit post that they were working on a PC port of the game. It had quite a bit of emulation layers going on, but I'm pretty sure that's normal procedure when porting software from one platform to another, you start emulating most of the output and you implement changes to use actual hardware in the end. Man, I'd love to see a port of the game made to run on vintage hardware, like a 3Dfx Voodoo on Windows 95, like how it would have been if Nintendo decided to port their game to the PC back in 1996.
I remember being seriously hyped up through 94-96 while waiting for the N64 to launch. I was a Sega kid at that point but seeing Mario 64 in that bubble-chamber playing at Toys R Us floored me, even after seeing the screenshots in EGM for months, there was just no feeling like that when you finally saw the fabled hardware running the cartridge in person. The lifespan of the N64 to about 2001 is still my most cherished time in console gaming.
Nintendo is a company that will delay just to make sure it is up to standards. I also wouldn't put the word lazy when I think of the game's Nintendo 1st party developers made.
Yay someone else who remembers Pilotwings! Very interesting video. As someone who is not a programmer it is fascinating to learn about the oddities of different languages and compilers.
After seeing MattKC’s video on the topic I felt, as a C programmer myself, that something wasn’t quite right with that narrative. This makes a lot more sense; I’d love to see the code for Dire Dire Docks to be optimized further to avoid even the slightest of drop frames
At the time there was also a lot of doubt. The N64 was a very exotic piece of hardware with a lot of weird quirks and a lot of features developers had never used before. Mario 64 had a lot riding on it as Nintendo relied pretty much on that title alone. So anything that MIGHT break code in any way wasn't done.
You can try compiling the source code yourself. You will just need to provide an original ROM since the source code does not include the game's assets due to copyright reasons.
Surprisingly not much, since the MIPS-specific parts of code generation have changed little due to lack of interest and focus was mostly on stability for use in routers etc. before they switched to ARM. There's no magic gains to be made from auto-vectorization either since the only powerful vector unit is in the GPU, unlike the Playstation you have to go through microcode to make use of it.
The fact that many care about a game from a system from 24 years ago shows how special the N64 is even with the Nintendo Switch and other consoles Nintendo made after the N64.
One of the best things about Super Mario 64 is that unlike most games from the era it doesn't feel old, dated or boxy thanks to it's super dynamic gameplay and cartooney graphics
That’s always it. When a game goes for realism, it dates itself instantly. The next gen makes it look bad. That doesn’t happen as much on cartoony graphics. I can play modern mario games and then go back to a gamecube one or DS one and barely see a difference (resolution and such aside). Its different with sm64 because its marios first 3D game and the design just wasnt... *there* yet.
Personally I don't agree. It looks and feels *OLDER* than it is. I'm all for cartoony graphics over realistic ones, and I can more or less get over the graphics. But the camera makes the game literally fucking unplayable. I want to enjoy the game so much but it's just unfathomably clunky and claustrophobic for most modern gamers. I understand rating it on the time it came out, but rank it by modern standards and the gameplay becomes bottom of the barrel.
I very much disagree.. then again not really because of the graphics just the camera is fucking ass. The first "realistic" 3d titles are now all but unplayable unfortunately :D
@@ThatPianoNoob I'm gonna install Mario 64 again to see what's up cause I don't remember any trouble with the camera. Maybe you guys are not moving the camera?? And just expect it to point to where you want automatically?? Or you expect it to move it using the mouse?
THANK YOU! When I saw the original I thought "No optimisation? No their flagship launch title?" It didn't make sense. As you've pointed out, there are reasons developers would choose not to optimise all of the code to retain control and eliminate problems.
In general, C compiler optimization has improved massively in the past 24 years. I wouldn't be surprised if you could gain performance recompiling previously optimized decompiled code.
Perfect Dark, and Goldeneye could really do with some re-optimization. Great games but I feel like Shaky development lead to them not being to their fullest.
Also: Turok 2 could have so much used more optimization - both algorithmically as well as compilation flags - despite Turok 2 actually having lots of enabled compiler optimizations & even hand-crafted assembly - maybe the wrong kind of optimizations & missing some basic prior faster algorithms to begin with.
I always thought Perfect Dark's problem was more that it pushed the N64 to its limits, rather than just a lack of optimization. I'm willing to bet that GoldenEye could be improved, though.
So basically, only PARTS of the game were left with reduced optimization; but they actually did that intentionally because their tools and compilers at the time were prone to errors that could potentially break the game, and they didn't want to risk it with it bring one of exactly two launch titles - but other more generalised parts that were also used throughout the game were indeed optimised. And the people saying "They didn't optimise the game!" are cherry-picking. "They ran out of time" is a pretty common story in game development, especially back then when you couldn't just patch a game for everyone post-launch.
Please do more videos about these subjects, also very interesting your videos about how emulators work, there is no other channel that provides content like this. Huge fan of your videos.
I like it when someone who actually has experience and even referenced the actual documentation digs in, rather than go with the armchair developer cry of "lazy programmers can't even optimize" Programming is hard.
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.
I wonder if the submarine collision was just an oversight by the dev team, or if they actually had a reason for it being dynamic.
Perhaps time constraints and cut content?
@@ABVW92 They probably thought it needed to be dynamic since the submarine eventually disappears.
@@Kaleidio I genuinely hadn't even thought about that.
Interesting :p
YOU'RE dynamic
@@scottmjohnson1980 What a hilarious and witty comment. Thank you, Scott Johnson, the artist famous for his promotional art made for Marvel comics, specifically his drawings of Spider-Man that could be found on all sorts of merchandise throughout the 2000s and early 2010s.
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
So true so this video turned almost to be just a (f) waste of time,almost.
@@johneymute I wouldn't say it was a waste of time at all, it finally puts to bed any question of Nintendo not optimising sm64
Safety from what?
@@Poever
It was safety against an unplayable mess of a game.
Whilst the game may run better with further optimisation, it may cause unintended stress on the hardware over time, or have other unknown effects on the game itself, that preliminary testing didn't find.
So for safety, they used a less Intrusive optimisation, trading a few frames for a more stable experience.
@@ABVW92 Well, it may just need more cooling, likened to using AVX on recent PC processors. Like when Intel reportedly has a lower frequency, when AVX instructions are being used. Still not noticeably slow like Goldeneye is in spots on a real Nintendo 64.
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.
MVG gotta see this comment.
Hey thanks Revo.
Also hi Pablo c:
I stumbled upon this video and comment by accident and ngl it's like I am reading some ancient alien language.
First off I appreciate your hard work and it is truly fascinating, however this comment sort of makes you come off as a dick. Just as you took the information given and interpreted it he did the same thing. Instead of accusing him of not diving deep.enough or comparing him to that other asshat help him understand and get the correct info out.
so in the end mistakes were made...
Have you seen Kaze Emanuar's recent video where he optimized the game to 60fps?
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.
Even more recently with games like Dark Souls. I don't remember seeing a lot of hate for the console framerates until PTDE came out.
I think anything involving explosions can be excused for dropping frames as long as the damage done is appropriately powerful. It gives the grenade launcher a feeling of "ah crap, that is a lot of hurt, give the machine a moment"
You can feel when there's not enough frames, it feels worse.
The multiplayer modes of those games weren't intended to be the most common mode, so it's better to just have it than remove it. Same thing happens in for example, Mario kart Wii, on 3 and 4 player mode, it locks to 30fps instead of 60.
@@intron9 I'm not talking about 30 fps. I'm talking about 1fps. Those explosions just ate the whole system if they filled the screen.
True. Isn't as easy to notice on a CRT as well.
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.
From what I remember, it has a memory leak and will eventually crash due to running out of RAM, they made the expansion pak required to increase the amount of time before the crash to 8 hours by basically just give it more RAM to leak to, it didn’t actually need that memory for anything else
The problem with DK64 is a memory leak and it was "fixed" with the expansion pak because more memory meant the leak took more time to crash the console.
I was livid when I found out about that. I was so convinced that the expansion pak was some magical thing that made the n64 more powerful. Damn marketing 😂
@@KuroAno I know that but this was never really well documented on any channel on UA-cam whatsoever, the memory leak problem has never been explained properly here, just the "it's a memory leak lol".
@@ShaunDreclin I mean, technically it did, but not by much. It doubled the RAM from 4mb to 8mb. It just wasn't something that would affect games not designed around it.
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
My assumption was similar: a codegen issue that only occurred with optimization enabled so they hand-optimized during development, and then not wanting to risk "breaking the build" even after the issue was fixed.
The real question is why was - O2 enabled on the pal version
Released 5 months later in EU.
I think the better question is why they never put out an revision built with -O2 for USA. I mean, they had to print new cartridges at some point; why not toss in an optimized ROM now that you know it doesn't break anything?
Perhaps I'm just unfamiliar with the logistics of cartridge manufacturing.
@@LonelySpaceDetective Sometimes when you fix one bug you end up creating more
Maybe something to do with PAL versions only getting 25 FPS instead of 30 to begin with.
It's pretty strange to get variable framerates on a console actually. Usually at the end of a frame a console game waits for the next frame, so if it takes longer than one frame to process one frame, when it waits for the frame to end it's actually waiting for the next one, and it ends up taking whole 2 frames total, therefore (assuming it started at 30 FPS) getting 20 FPS (3 frames per frame) or 15 (4 frames per frame) instead of 30 (2). IDK how you can get 27 FPS that way.
@@thewhitefalcon8539 would the drop in frame rate be because it didn’t process the information soon enough? And by information I mean both gameplay variables and graphics rendering.
My biggest question is how does it ensure that the tv still drawls “perfect” images with variable frame rates. My best guess is that it will hold a frame until the next screen reset. But I have yet heard anyone mention that before. Also there the issue, which I think you were trying to get at, of frame buffering stacking. But eh
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 :)
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!
lazy comment
0/10
And when there isn't a "good" reason, there's usually a "shit we only have three days left it works get on to the next task!" reason.
>"mistakes werent made"
>"werent" missing an apostrophe
A mistake was made!
Mistakes were indeed made after all.
the irony...
This phrase has no mistaeks
Thank you. I am glad I didn't have to be the one to point out both the error and the irony.
Profound!
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
But if they did it with eu then that's not right
@@Anon.G I think it released maybe a bit later in EU, so they tested more and started to feel comfortable with it.
@@CounterFlow64 Quite a bit later indeed! US, in September 1996 and in Europe, March 1997. So yeah.
@@Anon.G The EU release came out 6 months later.
Is the shindou version-02 optimized?
Sort of reminds me of FF7's development: basically they toyed with the release candidate for a while until it finally ran from beginning to end, then they were too afraid to make adjustments.
if it ain't broke...
@@TheSwillMan fix it (dont)
Hi from the future FF7 remake is out and it is GLORIOUS
FF7 is held together with duct tape and prayers. :D I am in the FF6 modding scene, and even that game had 180+ separate bugs when the first battle system disassembly was made. Like the fact that evasion is never checked, or that the Genji Glove doesn't reduce your attack stat to 80% like it should. Ah, the things we didn't notice as kids....
Like a jenga tower where you are too afraid to pull that one block because it may fall apart.
Decompilation of Panzer Dragoon Saga for the Sega Saturn would be interesting, considering that the original source code is lost.
This actually amazes me, as Sega generally keeps very good track of it's source code.
@@TheXevNights into Dreams was also lost.
@@PaperBanjo64 most of their Saturn era stuff is gone. But I think Futatsugi has PDS' source code secretly.
"the game was criticized for its camera"
aren't they all though?
Not really I really like Sunshine's and oddiseys camera
joão prudencio I think he’s talking about 3D games of the mid to late 90s.
DanROW All 3d games in that era had some type of camera annoyance
I quite like the Mario 64 camera
@@r-ea hahaha just play Tick Tock Clock and you will """love""" the camera even more
Mistakes WEREN'T made?
My world is shattered. The cake is a lie.
Marco your response is much better than what I had in mind 👍
@@joesshows6793 I appreciate it. Thank you!
But feel free to make your comment anyways! All comments help MVG.
Is it to do with the 60hz/50hz region differences?
@@davkdavk No. Thumbnail.
davkdavk thats what I was thinking but then why would it work in one region and not another?
I remember seeing SM64 for the first time and it was jaw dropping even for me who is no Nintendo fan.
Yup I remember playing it either in a Best Buy or a blockbuster or something and fighting King Bobomb. I’d only seen it in a commercial to that point and just never wanted to leave the store 😂
@Franky Padilla what??? the nintendo 64 was released in 1996
@Sadist Fake Bootleg Tiki Nice bait wee man, try a bit harder next time though:)
@Sadist Fake Bootleg Tiki so how's middle school going?
Same thing when I first played Zelda BOTW a few years ago, I became a fan boy after that and brought 3DS WiiU Switch Switch Lite to enrich my collection over the years.
If ghidra wasn't open source, I'd use ghidra to decompile it and release the source.
Hacking 100
h a c k e r m a n
there wouldnt be any reason to not make it open source. if it wasnt open source, ofc people would decompile it with itself.
@@skrubbed that's what I said
@@deanmoncaster no i was just saying how there would be no point in it not being open source
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.
What an amazing gem. Still have my N64 and a copy of SM64. I think I remember having access to a family PC back then, and early 3D games. Many 3D games were really quite poor in execution compared to SM64.
5:01 "As someone who is a C program" Holy shit I knew it.
I've never understood why black people and the British hate the letter R so much
@@bigstar66 [’prəugræmə] r is ə, no hate at all
except he uses pico
@@bigstar66 Nothing to do with hate, just normal language change. Consonants tend to weaken over time, especially at the end of words. What you're noticing are just dialects where the "R" sound has weakened or disappeared more than usual.
James Jensen yes, but they don’t usually this much this quickly. I think the British and African American spurned the letter r for the same reasons - they didn’t want to sound like white Americans.
That lag while swimming will always be a part of the game for me lol.
One area I think MVG really puts effort in , but is subtle is the audio, the audio and sfx are really well mixed in every vid
Man I love modern strongly typed languages! However, a few years ago when we had a client crazy enough to want us to use Swift Beta 1 for their project, we would frequently run into issues where compiler optimization would optimize away entire classes that were being used. So in the early days we had to turn it off.
What time was this? Around the early 90s?
@@ChristopherGray00 I doubt that Swift, a language released 2014 was worked on 20 years prior.
I actually remember liking slowdown in many games... it often coincided with explosions and action and felt epic and was occasionally helpful lol; heck, I’d try to make it happen as much as possible in Goldeneye
It happens in "real" life also, during important events time can slow down
yeah, i actually thought that the slowdowns were intended, like a bullet time mechanic to give you a little wiggle room to operate in case of overwhelming odds
@@Arigal3 It's evidence that we live in a simulation ; )
I immediately thought of Goldeneye too, when explosions were happening, it could slow down to like 1 FPS lol! I had no idea what was happening as a kid.
I'm a bit surprised this flag wasn't added and recompiled in a later release of the game, such as for the Player's Choice version. It looks like it would have been worth revisiting with the newer tools available!
Probably because Nintendo didn’t give a goddamn.
Poo
@@gibraltar4841 ah yes, another man of "culture"
poo is good
@@gibraltar4841 China's president?
Hey there, thanks for showing my N64 plugin at 1:48 :D
the best Plugin ;)
Cheers WV
mvg is such a brilliant channel:
interesting and relevant topics,
technical but well explained,
aussie accent
Shane holy shit I’ve never considered the fact that he sounds more Australian than Australians
I am Australian
He has the perfect “radio” or “TV” voice
Emphasis on Aussie accent
@@phr33z10 Bye for now
Squish Mastah ?
He fucking copied the material off others... bald bitch...
Loved that you used the File Menu music at the end. I used to just leave that playing as background music in my room when I was a kid.
23 years later:
*_Did Nintendo really forget to Optimize Zelda Link's Awakening for Nintendo Switch?_*
B10K PlaysGames 23 years later:
is people that never worked on an released a AAA title themselves still arrogant to use their spare time to draw quick assumptions without thinking before claiming “I could have done it better”
Haha nice one. Remembering that swamp area in the game.
Actually yes, the homebrew community has already figured that
It seems to be a problem with the engine Grezzo made for loading stuff in, rerouting the game to load files off the SD card significantly speeds up the game
@@akj7 Yeah the swamp had bad frame rate drops!
Minecraft was made in Java and thus was horribly optimized.
There may be another reason: I've seen some games written to work reasonably well on NTSC and then put through optimization to run at comparable speed on PAL.
& then you get the opposite, like Rare on Goldeneye & Perfect Dark. Both written & optimised for PAL, & duly running far worse in the NTSC versions
I was thinking the same thing.
It's so nice of you to credit MattKC instead of stealing the idea.
of course. his video is excellent
MattKC has been making great videos. He has just recently getting into vintage videogames but worth a view.... Just don't go back to far or there is a bunch of cringy eye liner videos lol.
@@joshsadowski8869 everyone starts somewhere
Besides, one poorly-researched video (which was more a failure of his knowledge of consoles, and knowing where to look in order to verify the actual tools used for development) isn't going to wipe away his work on preserving Lego Island for modern systems.
Figuring out how the game handles audio *by himself* and releasing a free tool to update the game with the uncovered full-quality audio tapes is still commendable.
@@VirtuousLiberty me 2
Stealing his idea?
What's next I'm stealing other people who came before me for being alive?
4 player Perfect Dark with all bots enabled. The ultimate lagfest.
Turn hi-res mode on and put it in 16:9 too for """""""""best""""""""" effect.
Luke Hero can’t believe I use to love playing that
Hahahahah
I love that your channel is both comprehensible to just listen to because you break it down so easily, but also provides screenshots and references to c code if you want to know more.
When MVG's thumbnail says Mistakes _weren't_ made:
**Confused Screaming**
Props for getting Dylan Cuthberg on the show! Man started my most favorite Nintendo franchise (Star Fox)
the short answer is basically, "no, they did not" - it was a different time.
the long answer is everything else in the video. haha
I'm amused that, on my account, your comment is beside mine.
@@MarcoGPUtuber sweet irony. we just need one more commenter to make this a "beetlejuice" xD
@@MinisterSandman lmao. Are there any more Marcos in the 300000 or so MVG subscribers? May the real Marcos please stand up!
@@MarcoGPUtuber i second this statement. Lol!!!
The correct answer is:
"They did not forget but have actually written code so sloppily that it relied on undefined behaviour left and right and the compiler - rightfully - would screw that up"
“Piqued my interest” is the proper phrase.
it's not "peaked"? my life is a lie
"Redefine the platforming genre." As a clip shows mario falling from a platform while trying to simply walk across a short bridge.
I'm joking of course, it was just a funny juxtaposition.
This is indeed an interesting little bit of gaming history. Granted, it doesn't change my view of one of my favorite childhood games, it does bring to light some little things I'm slowly learning as I start entering more and more into the programming world. Thanks for taking the time to do this, MVG.
2:59 The dragon logo for Ghidra is freaking awesome.
This was really interesting. This is definitely the type of content I'd expect from this channel. Great work.
5:00 I've just now noticed that canvas with the health/oxygen indicator is supposed to be Mario's profile. It's 2020 and I played this at launch.
I still have my copy bought in November 1996 together with the console. All with their boxes.
Isn't it fascinating how we can see a film, or play a game and miss a detail until revisiting years later?
Lol u must be blind
Better late than never I guess
I noticed it while hacking the game and thought I'd accidentally enabled an Easter egg.
As a fellow developer and retro gamer yours has to be one of my favourite channels on UA-cam. Really thorough explanation of the situation as always. Keep up the good work!
As always, thank you so much on your work on these videos! You provide a very unique perspective and recorded history of vintage games that can't be seen anywhere else. This was a really interesting video and was well done.
MattKC is such an underrated content creator. Glad you mentioned him for others to be made aware of what he does
Edit: just realized y'all both Aussie
Having MVG talk about O2 and Makefiles sure is amazing.. Hope we get more videos like that..
Quick Question: Why not compile it with O3?
I compiled with O3. The game crashes at random
gcc -O3 is pretty unreliable as mattkc says
@@surrodox it doesn't really. if you're using latest gcc and on x86 it will work fine %90 of time. Its suprised me that -03 made it crash.
Also it do make sense that nintendo didn't push optimisation to everything since compiler are came a long way too. in early 2000's maybe the compiler wasn't as good as of today.
@@user-ro1cc8tz6dHe needs to compile using Nintendo's compiler that is really old, he's not using gcc
@@user-ro1cc8tz6ddon't the -03 optimisations all have some kind of space/speed tradeoff and thus tend to increase memory usage/size of the resulting binary? If you're already running at redline for memory at points I could see it pushing you over and crashing the system due to running out of memory.
I doubt the developers were leaving much memory on the table for a dedicated device like a games console not designed for multitasking, and rather to run one application at a time.
Today, on a modern multitasking operating system memory is by necessity comparatively more available and that's less of an issue
I'd like to see how various retail games would run with all the optimizations changed to O3
those that don’t already use it would break. otherwise they would have used it.
My initial thought when I saw that video was that it was probably because Mario 64 was made using early sdk and there were probably very good reasons Nintendo didn't use the 02 optimization.
Thank you for digging into this further.
Wow. As a Gentoo Linux user this is like... SUPER triggering. -O2 is like... THE MOST BASIC optimization option. This isn't -funroll-loops we're talking about here.
Instant click. Very interesting topic for sure.
Cool
Simon Ledoux stfu
As far as I know, Ghidra wasn't used for the decomp project at all. It was mostly done by hand.
This is true, the project started way before ghidra was released to the public
Amazing.. these guys are wizards wasting their talent on meaningless things like this. Like saints of the programming world utilising their talents so youtubers can make bank with clickbait videos for a week
Yes, this was my main reaction upon seeing this video. Claiming that Ghidra did most of the work is really selling the decompilation team short -- tools like that are nice in general, but are close to useless if you're aiming for perfect byte-for-byte accuracy. This project was mostly done manually, which no doubt took _tons_ of time and effort.
Victoria Meets World those people did it for fun because they love video games. It’s their passion for their community and also most UA-camr like these guys make very little bucks unlike those who cash in millions, also, how is this clickbait. These you tubers are like those guys who did it, they love gaming and want to help it.
@@pian-0g445 it's click Bait because of U watch the video he rushed or our and didn't do he research and on turn disrespected the talents and the assumptions of those who put in the hard work. He was in a rush to make money while the topic was hot and he substitute d his opinion as facts rather then just going over and looking at the project and ppl that worked on it
What's with all these young UA-camrs always saying how Super Mario 64 was criticised for it's camera back in the day? No it wasn't. Mario 64 seemed like a gift from the creator Himself and was flawless in every way back then. I think these guys are trying to think of things that a naysayer would have said back then but although it's hard to imagine, if you were actually a kid growing up with the N64, you'd remember there wasn't a single game anywhere near the level of 3D perfection as Mario 64. The camera wasn't "bad" because it was the only 3D camera we'd ever experienced.
Theres another video of a guy that makes mario 64 run at 60 fps on nintendo 64, by just coding it better. Absolute legend.
Celebrating 25 years of Nintendo 64 and Super Mario 64 in this year!
👏🏼👏🏼👏🏼👏🏼👏🏼 🥳🎉🎊🍾 🎮
I’m pretty sure I remember the release version of Croc: Legend of the Gobbos was without C compiler optimisation. I don’t think there was anything intentional about this, but as mentioned, a lot of code back then was hand optimised in assembler, so the gains to be had with C optimisation is less drastic. And I certainly remember bugs being introduced by optimisation back at that time period. Tools are much more stable now... :)
Not the PC version, for sure (I worked on that); and I'd be very surprised on the PS version too
@@MattGodbolt This was PS. I have memory of Tony discovering this while getting stuck into Croc2. It may be a false memory, of course, it was a while ago... ;)
@@RetroHQ hahaha cool! It's entirely feasible it was fixed up pre PC! By the time we got it (ahem) when porting I'm pretty sure the nmake file had O2 hardcoded
*"Mistakes Weren't Made"* hahaha, i love that
aah, quite a different meaning once you've been through the video. great upload 💙 i always learn so much here
@@PaulMeranda *werent, they left out the apostrophe which was a really clever joke.
This is the shit that makes my monday worth waking up for
just got off a 12 hr shift on 3.5 hr's of sleep and it was still worth it lol
Wow. Truly dire times we live in.
Nintendo has always aimed to go for stable frame rate. This is also the reason, why small rooms on Zelda:OOT run at the same frame rate as Hyrule field. Even though the N64 would be able run smaller arear easily 60fps. Nintendo just wants balance. Perhaps if they found that Mario 64 would have some slowdown, while still running 60fps most of the time, they would reject the idea. I have European PAL and USA & Japan NTSC - -versions of Mario 64. European version has worst framerate (still stable, though) and it does not have rumble pack support even on players choice version. USA/JAP versions run equally stable when compared each other, and faster than PAL.
I may be wrong on this but weren't most N64 games 480i resolution? That would mean 30fps is the limit
@@Unit_00 Most N64 games were 240 progressive scan. Very few games (without Expansion Pack) were above. But it's worth to mention that N64 could change resolution during gameplay. Those games have problems with current flatcreen TV's that have poor response time (gray to gray).
Why do people criticise SM64 Camera? From memory if you double tapped - z Trigger it went back over the shouldee instantly. It was a good camera system, it was quick and fluid and when you got good, you could push your skills and get really good and precise withe analog stick.
Compiler bugs - I ran into a bunch of those more times in my career than I'd care to enumerate. Usually they were with proprietary compilers!
I would never hire a guy telling me that in such a context (there exist compiler bugs - of course, even more so in proprietary compilers - but programmers declaring to have run into numerous of them - relative to themselves writing code with UB - is usually a big red warning sign indicating incompetence and dunning-kruger. I am not implying this here - that would be ridiculous from a one-line comment on youtube). However, it is rather clear that the compiler was not really to blame in the case of SM64 but its input was crap.
steefant GCC was notorious for bugs in optimisation in the 90s when mario 64 game out. so much so that you could only compile linux kernel with specific gcc versions that had the “right combination of known bugs” the source code had taken into account. it was ages before anything newer than GCC 2.7.x was supported
This was well written and thoroughly researched. Thank you!
Kaze Emanar would like to have a word on this
Loved me some Pilotwings... The terrible blood-curdling screams of Robin when she crashes and burns still gives me chills... but... infinite rockets, the birdman suit, and the amazing soundtrack kinda made up for that in the end. Go Pilotwings!!
I commented on the original video to point out the main flaw / mistake in its thesis. Mario 64 was developed in '94-'96 on the SGI Onyx (circa 1993). Its ASM/C/C++ compiler with MIPS R3000 support did not support the level of -O2 that a modern day GCC install has. Many of the compiling optimizations performed now take advantage of techniques that have been developed and progressed over 20 years. So Nintendo did not "forget" to optimize the game, it was the best compiled binary at the time with the given tools. Edit: finished the video and I think MVG hit nearly every point. Great job.
Can we all just stop and appreciate MVG for a moment for the high quality content, knowledge, professional approach, all his contributions to all the various projects he has taken part in, and - last but not least - extremely quick response time combined with ability to give credit where credit is due. I'm speechless.
Appreciate the kind words.
I don't think I could have worded that any better than you did if I tried. I don't think anyone on UA-cam can make quailty and interesting content like MVG about these niche subjects.
Golden Eye would be worth a look, although I get the feeling it's probably just a problem with the game code rather than the compiler settings.
Wasn't GoldenEye a first project for a lot of its dev staff? Or just their first project at Rare.
GoldenEye uses older drawing methods. no depth buffer, etc. all triangles had to be z sorted which has a good bit of overhead and more or less totally screws optimized display lists, where triangles can share vertices, flat surfaces could be quads, etc. the 64 is really kinda based around being given optimized display lists (they have a limited vertex cache, between 32 and 128 depending on the microcode) since the rsp only has a 4k data cache (think ram) for any 3d data to be passed through, any time it has to stop and change out its data it's gotta throw an exception/interrupt and have the cpu send it another chunk of data.
all in all it also saves ram as there's no depth buffer, so another 320x240(or whatever the game runs at)*2 bytes freed up. the pixel fill rate is also increased substantially because it's not having to constantly check the depth buffer when it's drawing.
tldr GoldenEye used old styles of rendering that would have fit the psx but don't work out so well on the 64.
Goldeneye has been optimized by minimizing the explosions among other things you can also just play it on PC to have a faster game on PC normal speed is turbo mode and turbo mode is even faster.
@@blahblahbleeeblahh7053 totally irrelevant. getting rid of features is not "optimizing"
@@Jombo23MC it doesn't remove the explosions entirely only minimizes them because too many explosions lag it hard just check out Goldeneye NGPA edition you will see what I mean it feels nice.
You do realize that if you were to make a coding tutorial for the basics, people would absolutely eat that up. You speak with such conviction its incredible.
Well, the optimisation sure didn't fix the camera
I saw the other UA-cam video a few days ago, I really appreciate your follow up. Thanks for the extra details on the SDK, it’s a lot more believable that Nintendo choose not to enable optimizations given the cost/ benefits.
In the initial makefile, there's a conditional that specifies 02 optimization if a version condition is met. I assume this is part of the reverse engineering and not something from Nintendo's original code?
The EU version wasn't released at the same time as the US and JP ones, so somewhere in between the releases, Nintendo enabled O2. The condition in the Makefile is the reverse engineering team's way of replicating that.
I was shocked when I heard there was an "easy fix" improving performance..
Up to a certain level - the speed differences often aren't that groundbreaking & limited to a couple of percent points. Beyond that thinking about using different algorithms & data structures as well as different game logic is more fruitful.
Well usually the “easy” fix is not that easy in a real world scenario.
@@litjellyfish as stated by the reverse engineering team... No, it really is that easy.
Vyor and again yout forgot to read “real world scenario” so sorry no it’s not that easy.
Technically it’s that easy. Nintendo is not that stupid. Risk wise it’s not that easy all. So Nintendo took the right decision and not go for the optimizations. Nintendo are not stupid.
Nintendo have of course more skill, experience and resources than this reverse engineering team. Also what indeed IS easy is to conclude this about the optimization now many years later with emulators time and more.
@@litjellyfish Nintendo is stuffed to the brim with shit coders, worse leadership, and a terrible track record of technically competent design.
Just look at smash ultimate: broken and buggy. BOTW: laggy as shit. Sword and Shield: incomplete rush job. Mario 64: too many bugs to count and horrid optimization.
I'm more interested in this allowing someone to make a native port of Mario 64 to PC.
Demetrius Lolos unfortunately, I imagine a great deal of the code is hardware dependent
@@andrewrusso3871 couldn't you just remove those bits of code?
@@Kira-zf7te Rewriting code to run natively on a completely different architecture is not as easy as that.
The thing is that all the code is tailored to that hardware, and if you wanted to simulate it it could be the same as using an emulator.
I saw someone on Reddit post that they were working on a PC port of the game. It had quite a bit of emulation layers going on, but I'm pretty sure that's normal procedure when porting software from one platform to another, you start emulating most of the output and you implement changes to use actual hardware in the end. Man, I'd love to see a port of the game made to run on vintage hardware, like a 3Dfx Voodoo on Windows 95, like how it would have been if Nintendo decided to port their game to the PC back in 1996.
I remember being seriously hyped up through 94-96 while waiting for the N64 to launch. I was a Sega kid at that point but seeing Mario 64 in that bubble-chamber playing at Toys R Us floored me, even after seeing the screenshots in EGM for months, there was just no feeling like that when you finally saw the fabled hardware running the cartridge in person. The lifespan of the N64 to about 2001 is still my most cherished time in console gaming.
Nintendo is a company that will delay just to make sure it is up to standards. I also wouldn't put the word lazy when I think of the game's Nintendo 1st party developers made.
I love the Nintendo DS version of this game, polished it up so much and added so much, without taking away from the game itself.
This video made me realize I optimized my first child, and then figured the second one would be just fine so I didn’t bother.
Normally its the other way around spending years trying to debug the first child while the second tends to be programed better.
When I saw the original video, my main thought was “this is cool but I need MVG to confirm.”
MVG is like your pastor.
When I saw the original video I came to the same same normal conclusion as this video...
Yay someone else who remembers Pilotwings! Very interesting video. As someone who is not a programmer it is fascinating to learn about the oddities of different languages and compilers.
After seeing MattKC’s video on the topic I felt, as a C programmer myself, that something wasn’t quite right with that narrative.
This makes a lot more sense; I’d love to see the code for Dire Dire Docks to be optimized further to avoid even the slightest of drop frames
At the time there was also a lot of doubt. The N64 was a very exotic piece of hardware with a lot of weird quirks and a lot of features developers had never used before.
Mario 64 had a lot riding on it as Nintendo relied pretty much on that title alone. So anything that MIGHT break code in any way wasn't done.
@@MrMarinus18 this was also before the days of “patching” so any undefined behavior would be pretty detrimental.
It makes a lot of sense
One of the most interesting videos never seen. Thank you!
1:40 Soooo Let's reverse engineer ThemTube and make UA-cam the way it Yoused to be!!!!
You really want to go back to buggy and slow Adobe Flash over HTML5? 😂
Let's build our own Tube though.
...yoused?
would be interesting to see what a modern GCC could do optimising that code.
You can try compiling the source code yourself. You will just need to provide an original ROM since the source code does not include the game's assets due to copyright reasons.
Surprisingly not much, since the MIPS-specific parts of code generation have changed little due to lack of interest and focus was mostly on stability for use in routers etc. before they switched to ARM. There's no magic gains to be made from auto-vectorization either since the only powerful vector unit is in the GPU, unlike the Playstation you have to go through microcode to make use of it.
Can I say its really cute to put sleepytime music over the big brain lesson moment.
Please keep mashing more games and code/development topics!! This video was fantastic!
The fact that many care about a game from a system from 24 years ago shows how special the N64 is even with the Nintendo Switch and other consoles Nintendo made after the N64.
One of the best things about Super Mario 64 is that unlike most games from the era it doesn't feel old, dated or boxy thanks to it's super dynamic gameplay and cartooney graphics
That’s always it. When a game goes for realism, it dates itself instantly. The next gen makes it look bad. That doesn’t happen as much on cartoony graphics. I can play modern mario games and then go back to a gamecube one or DS one and barely see a difference (resolution and such aside). Its different with sm64 because its marios first 3D game and the design just wasnt... *there* yet.
Personally I don't agree. It looks and feels *OLDER* than it is. I'm all for cartoony graphics over realistic ones, and I can more or less get over the graphics. But the camera makes the game literally fucking unplayable. I want to enjoy the game so much but it's just unfathomably clunky and claustrophobic for most modern gamers. I understand rating it on the time it came out, but rank it by modern standards and the gameplay becomes bottom of the barrel.
I very much disagree.. then again not really because of the graphics just the camera is fucking ass. The first "realistic" 3d titles are now all but unplayable unfortunately :D
@@ThatPianoNoob absolutely
@@ThatPianoNoob I'm gonna install Mario 64 again to see what's up cause I don't remember any trouble with the camera.
Maybe you guys are not moving the camera?? And just expect it to point to where you want automatically?? Or you expect it to move it using the mouse?
The tortured soul of Lara Croft appears to be trapped inside the Silver Play Button on your wall
Fitting, considering the first Tomb Raider came out around the same time as Mario 64.
THANK YOU! When I saw the original I thought "No optimisation? No their flagship launch title?" It didn't make sense. As you've pointed out, there are reasons developers would choose not to optimise all of the code to retain control and eliminate problems.
In general, C compiler optimization has improved massively in the past 24 years. I wouldn't be surprised if you could gain performance recompiling previously optimized decompiled code.
I'd love a video giving us a technical overview over the engine. Could be interesting.
...Sooo who's watching this after Kazes rewriting of the source code?
Perfect Dark, and Goldeneye could really do with some re-optimization. Great games but I feel like Shaky development lead to them not being to their fullest.
Also: Turok 2 could have so much used more optimization - both algorithmically as well as compilation flags - despite Turok 2 actually having lots of enabled compiler optimizations & even hand-crafted assembly - maybe the wrong kind of optimizations & missing some basic prior faster algorithms to begin with.
How to fix the almost Star Fox (SNES) framerate of Ocarina of Time and Majora's Mask?
I always thought Perfect Dark's problem was more that it pushed the N64 to its limits, rather than just a lack of optimization.
I'm willing to bet that GoldenEye could be improved, though.
@@LonelySpaceDetective I think it would be better to just remake it in a modern engine. There's a project for dk64 on unreal engine
So basically, only PARTS of the game were left with reduced optimization; but they actually did that intentionally because their tools and compilers at the time were prone to errors that could potentially break the game, and they didn't want to risk it with it bring one of exactly two launch titles - but other more generalised parts that were also used throughout the game were indeed optimised. And the people saying "They didn't optimise the game!" are cherry-picking.
"They ran out of time" is a pretty common story in game development, especially back then when you couldn't just patch a game for everyone post-launch.
Please do more videos about these subjects, also very interesting your videos about how emulators work, there is no other channel that provides content like this. Huge fan of your videos.
I like it when someone who actually has experience and even referenced the actual documentation digs in, rather than go with the armchair developer cry of "lazy programmers can't even optimize"
Programming is hard.
Can’t believe the N64 came out more then 20 years ago...
The PS2 will be 20 next month
“Over 20 years later it still holds up...” - that cant be, I remember playing it as a kid... OMG IT’S 2020
MVG have you seen Kaze's m64 code rewrite project? Some massive progress made on native n64 hardware.
I love your channel. Great photography, editing and commentary.