[HN Gopher] Overhauling Mario 64's code to reach 30 FPS and rend... ___________________________________________________________________ Overhauling Mario 64's code to reach 30 FPS and render 6x faster on N64 [video] Author : kibwen Score : 135 points Date : 2022-04-18 19:54 UTC (2 days ago) (HTM) web link (www.youtube.com) (TXT) w3m dump (www.youtube.com) | vmception wrote: | is there any part of this video that is a side by side | comparison? didn't see any obvious marks in the description or | comments | vmception wrote: | pretty amazing what you can do when you push the release deadline | back by 26 years. | iforgotpassword wrote: | Heh, but even then, 6x is still impressive. I doubt in 26 years | you could optimize a tripe A title from today to the same | extent. It seems that the vast majority of optimizations is | actually achieved manually and not through Compiler magic and | other modern tools. But then again maybe in 26 years we will | have magic tools that will get the job done. ;) | [deleted] | ydnaclementine wrote: | At some point, these older games should be open source. They can | follow the doom/quake model where textures/art aren't included, | and Nintendo can also still sell the games on newer consoles for | convenience because not everyone will want to compile it | themselves | | I guess you could argue a mario 64 custom levels mod competes | directly with a new mario game. But halo and cod sell fine. Maybe | I have a bias that thinks Nintendo is fearful that custom mods | for old games will be more popular than anything new and official | makotech221 wrote: | Only under an economic system that abolishes private property. | Won't ever happen under capitalist governments, unfortunately. | flatearth22 wrote: | tenebrisalietum wrote: | Intellectual property is imaginary property, private or not. | it's not a real thing until committed to a medium. | | Upkeep of the _fiction_ that intellectual property is real | property has societal benefits _for a limited time_ insofar | as works of art - and the original idea of copyright was | reasonably limited. Over 100 years is inhumane. | ajsnigrutin wrote: | My controversial opinion is, that everything that cannot be | bought for reasonable amount of money, also cannot be "pirated" | (the act of copying should not be considered as illegal | piracy). | | The main reason why piracy is illegal is, that | studios/producers/writers lose money, because people pirate | instead of buy. If I cannot buy eg. Super Mario 64 from | nintendo in my country, and if I copy the game (and emulate it | or whatever), I never actually caused any monetary loss for | Nintendo by doing that. | bricemo wrote: | You can still buy Super Mario 64. It's part of the paid | subscription virtual console service on Nintendo Switch | ajsnigrutin wrote: | So, no copying SuperMario64 then. | | But my opinion stands for things that are not available | this way. | bottled_poe wrote: | For a long time Super Mario 64 was not available this | way, but now is. How to handle this case? It's a hell of | a lot easier to just have a time duration of copyright | expiry. | flatearth22 wrote: | TazeTSchnitzel wrote: | Copyright terms should be limited to 20 years. Open source or | not, this project would be legal in that case. | noobermin wrote: | I think about my fundamentalist feelings about copyright | (between complete abolition and say 20 years like you | suggest) and the practical reality of how that would | fundamentally change content industries today. For example, | I'm thinking of anime franchises, also Disney, etc, who | essentially create whole industries out of remakes and | repackaging their old IP. Essentially, millions of workers | hired to maintain the less creative recreation/maintenance of | these IPs would be reshuffled and or lost. Btw, this isn't | just creative workers like writers, animators, and the like, | but things like merchandise creation, manufacturing, live | events, and so on, they'd all be much less of an incentive to | maintain a _franchise_ over the mere creation of works that | might be separate from each other. | | Apart from the business/worker side, the ability for an IP | holder to release continuing sequels to works (like manga, | movie installments, etc) and the legal force against fan | works essentially gives more power essentially to the | original creator to shape what is "canon" in their work. | Perhaps fans could still decide the original creator's later | installments are canon, but the extra legal force sort of | makes this defacto, while a world of limited copyright the | power of the original creator is less so. Thus, the way fans | consume media and experience it will change completely as | well. | | It would just be a completely different world, one where a | lot of these ills are addressed (like the ones mentioned by | GP), and things will be very different. It's hard to say from | my vantage point whether the differences would also be "ills" | or not (and that might be my bias), but it would certainly be | a different world with different rules and different | expectations from fans and audiences. | noobermin wrote: | I'm not sure what Nintendo "thinks" but they've always been | protective since the NES days, which arguably allowed them to | pick the video game industry out of the funk that befell all | the other 8-bit consoles. I'm not sure if there is any | philosophy around why they do it vs. it just seems like a | corporate culture to them to be controlling of their consoles | and their IP. I think a while back, the switch removed a game | from the nintendo store that had an interpreter in it, even | this with sanctioned basic interpreters around there. They've | always been control freaks to the point where it doesn't really | even make much dollar sense for it. | astrange wrote: | Btw, that video game crash was limited to the US - it didn't | happen in Japan or European markets. I remember complaints | that other language Wikipedias covered it as a global thing | anyway because they were translated from English. | noobermin wrote: | Interesting piece of history! I am too young to have | experienced it, I mostly just know about it from reading | video game history, and yes the only cited makers were | atari, commodore, and other American companies. | foolfoolz wrote: | nintendo games have much higher replay value than the others | you mentioned. they are mostly off line. they have different | mechanics beyond graphics. people will buy them on multiple | consoles happily. they are not rotting, these are active | revenue streams. | | nintendo isn't afraid of mods, they would rather just sell you | mario maker and create an experience. | | quake and cod are mostly online, and there's no community | anymore. there's over 30 cod games, no scarcity on the | experience since they're so similar. the one mostly offline | game series you mentioned, halo, is closed source and still | sold today. it is far less likely quake 3 is going to be bought | and played today vs mario64. those games are not active revenue | streams and don't have a good path to become one again | Lerc wrote: | This is a good lesson about the benefit of time when it comes to | software development. Mario 64 could have been a much much better | game on the same hardware, but the time cost would have resulted | in a release late enough that the entire game might have been | considered irrelevant. | | Game consoles have had the benefit of the platform freezing for a | few years allowing improvements to accumulate and later titles | utilizing knowledge gained from the earlier titles. | | Much of the software we use every day could benefit from this | level of scrutiny but the pressure to deliver on time means we | won't get to see such benefits unless it becomes a crazy persons | labour of love. | noobermin wrote: | Small thing but I hate how a lot of the modding community (and | retro gaming) has turned to videos and youtube, I just don't have | time to watch a 20 minute video on these things. I'm often | searching high and low for basic documentation and descriptions | of things and google always recommends some 20 minute video, it's | infuriating. | dendriti wrote: | You get infuriated that talented modders and hackers perform | research and entertain you for free? | vmception wrote: | Given how much competition there is in "the scene" for clout | alone, there is no need to dismiss any criticism with "but | its free". consumers/end users/spectators can absolutely | complain and don't have to put up with anything and the | production value increases. | RicoElectrico wrote: | Yeah, being to the point is crucial in these days of abundant | content. Sometimes I wish they reinstated the 10-minute limit. | [deleted] | tiborsaas wrote: | - Speeding up the video saves you time | | - Listen to the audio only, occasionally take a peek, don't | tell me you are being productive 16 hours a day | | - _Video_ Games are visual so it's a natural to present them | with video, hardly a blame for the authors | blamazon wrote: | What I do is skip relentlessly through videos (using left/right | keys on PC or tap-tap on mobile) and adjust the playback speed | to be as fast as can be intelligible, I can get the gist of a | 20 minute video in 2-3 minutes this way. Then, if something | catches my attention, I go back and watch that at normal speed. | iforgotpassword wrote: | Idk, for content that doesn't teach me anything important I | prefer video over text, as I can play it on the side while | doing something else (that doesn't require too much focusing) | and if something sounds interesting/important I might pay | attention for a while. | CrazedGeek wrote: | At least for Super Mario 64, Ukikipedia is a good text-based | resource: https://ukikipedia.net/wiki/Main_Page | noobermin wrote: | Just a note, these wiki's are great. nesdev really saved me | for example. I am thankful for people who put things out | there like this. | pasmat wrote: | The good thing is that a platform like YouTube can support | creators like him spending so much time on thing that wouldn't | otherwise perhaps be financially feasible, even if his | contributions to the modding community aren't as easily | digestible. | pupppet wrote: | I always wonder if the original devs ever find these videos and | are like oh shit we should've done that. | MBCook wrote: | It would certainly be interesting to see their reaction. | | Mario 64 is a bit of a worst case as the game was being | developed at the same time as the hardware and had to get out | on day one no matter what. Between the Japanese and US releases | I believe they even fixed some bugs. | | Some of the things he did seem quite obvious, like cutting down | the repeated calculations for every single coin on the screen. | You have to think they would've thought of that if they have | the time. | | It would be interesting to see a series like this on a number | of games over the console's lifetime. Especially if it | highlighted the tips and tricks the developers started to learn | to get more out of the hardware over time. | orblivion wrote: | > You have to think they would've thought of that if they | have the time. | | Stuck forever in the issue tracker as "priority: low" | ehsankia wrote: | Can't even imagine being a dev back when you only had one | shot at your game going gold and couldn't update it after the | fact to patch bugs. | munk-a wrote: | Speedrunners famously need to hunt down first press | cartridges on the US release because the Shindou release | fixed the bug that allows BLJs (backwards long jumps). | giantrobot wrote: | One thing mentioned in the video is his memory tricks _require_ | the RAM expansion module. Mario 64 being a launch title couldn | 't have used the RAM expansion. The RAM module came out two | years after the console launched if I remember right. | Gravyness wrote: | Its absolutely amazing the level of expertise and dedication a | single person can have on the inner workings of something. | BolexNOLA wrote: | Mario 64 has to be one of the most dissected games ever. It's | kind of wild what speed runners, modders, etc. have uncovered. | IntelMiner wrote: | I know they don't "owe" anyone anything. But it is disappointing | they've apparently declined to release their code changes | | It's also apparently unclear if the overhauled version will run | on a real N64 or if it only runs in an emulator | Quillbert182 wrote: | He is planning to release the source code at a later date. He | is waiting because the source code is intertwined with a ROM | Hack he made, and he is unable to release the improvements | without releasing the ROM Hack in an unfinished state. | | The overhauled version will run on a real N64 as long as it has | the RAM expansion pack. | phillipcarter wrote: | "roll those loops back up and don't compile in debug mode to | achieve significant performance gains" is not the takeaway I | thought I'd have going in, heh. | astrange wrote: | It was common belief in that era that you made code faster by | making it longer and more complicated. The opposite is true now | (because of cache size and deep OoO) - simple predictable loops | are great - but even then people tended to overdo it. | | Of course, it's a way worse problem that they compiled at -O0. | AussieWog93 wrote: | >Of course, it's a way worse problem that they compiled at | -O0. | | There was a Modern Vintage Gamer video going into this. | Apparently it wasn't a mistake or misunderstanding, but a bug | that existed in the original version of the compiler that | caused issues when compiled with optimisation. Even then, the | main library that did most of the heavy lifting was compiled | with o2. | | Super Mario 64 was a launch title, and they simply didn't | have the time to work out the kinks in the compiler to get | those few extra fps in Dire Dire Docks. | infogulch wrote: | Unrolled loops trade instruction cache for cycles. Whether it's | good depends on what your bottleneck is, in this case ram | access is a bigger bottleneck than cpu due to being shared with | the rendering coprocessor. I wonder if we'll hit this crossover | point again in the future. | monocasa wrote: | And the code N64 was particularly unrolled for whatever | reason. IIRC, there was one game that bit me when writing a | JIT N64 emulator because there was a single code stream with | no branches that was larger than multiple MMU pages. My JIT | kind of assumed that actual code in practice wouldn't be | larger than the actual N64 I$ without branching. Womp womp. | | But hey, I guess I don't want to be judged on my mid-90s code | either. | amatecha wrote: | Wow, this is amazing! Plus he's adding split-screen co-op mode??! | Mind blown. Impressive work, seriously. | arriu wrote: | This is a serious amount of effort for what I imagine is little | payout. I really enjoy work like this and hope that he is able to | make a living off it. | | Anyone have thoughts on how to make projects like this more | sustainable? | eigenvalue wrote: | This seems to clearly be a passion project. The author is being | paid in the satisfaction that he gets in improving this famous | game way beyond what the original creators managed to do, all | while being bound by the same technical limitations. He also | gets to show off his skills to a fairly large (in absolute | numbers at least) global audience of people who are also really | into this particular game. I doubt you would see someone going | to such great lengths for an obscure title that few other | people would appreciate or care about. | tantalor wrote: | Art doesn't need to have a payout or be sustainable. ___________________________________________________________________ (page generated 2022-04-20 23:00 UTC)