EPISODE 1666 [INTRODUCTION] [0:00:00.0] ANNOUNCER: Kaze Emanuar is a ROM hacker who is famous for the array of mods he’s made for Super Mario 64. He has implemented remarkable optimization to the decompiled game code, even pushing Super Mario 64 to run at 60 frames per second. Kaze joins the show to talk about his interest in Super Mario 64. ROM hacking, the N64 architecture, coding and Assembly, and more. Be sure to check out Kaze’s YouTube channel to see his work, including breakdowns of how he accomplished his optimizations. Joe Nash is a developer, educator, and award-winning community builder, who has worked at companies including GitHub, Twilio, Unity, and PayPal. Joe got a start in software development by creating mods and running servers for Garry’s Mod, and game development remains his favorite way to experience and explore new technologies and concepts. [INTERVIEW] [0:01:03.9] JN: Welcome to the showcase, how are you doing? [0:01:06.0] KE: Hello, I’m doing very well. [0:01:07.5] JN: Awesome. Well, thank you for joining me today. This has been a long-anticipated episode by many folks here on the team. So, I guess to kick everything off for listeners who are not familiar, what is a ROM hack? Can you explain briefly, you know, what that is fundamentally for folks who haven’t heard of it before? [0:01:23.7] KE: Right. So, if you release a game, like on a console, you’re going to have your game on a cartridge or on a CD. And a ROM hack is basically, you dump the cartridge onto your computer, you modify the contents of it and then you put it back into the console and then you get to play it. [0:01:38.7] JN: Awesome. So, in the context of you know, Nintendo 64, that you know, we’re talking the big beefy cartridges and what is it that’s coming off that when you dump those? [0:01:47.3] KE: Well, it’s just a huge file of just binary data and you have got to somehow make sense out of it. [0:01:53.4] JN: Awesome. So, I mean, that is a pretty esoteric way to go about programming. How did you get started doing this? [0:02:00.9] KE: So, I think this was 2012, I randomly saw another mod someone made and I’ve always liked making games. So, I saw it, I was like, “Dude, this is possible, I want to make some too.” [0:02:11.5] JN: Awesome. Okay, so when I was first introduced to your content, I was, you know, doing lots of mods for Super Mario 64, and then I was looking for those mods and was like, “Oh, these are increasingly intricate. Wait a minute, these are just like, straight-up other games.” And so, I’m kind of getting this idea that like, you have made Super Mario 64 like your personal game engine at this point, would you say that’s an accurate description of what you’re doing with it? [0:02:35.6] KE: Yeah, pretty much, it’s really just like using the visuals of Mario 64 and like the physics at this point. Although, even those have changed a lot. The underlying engine at this point, I basically reprogrammed the whole thing because I wanted it to run well on the real N64. So, I did use it for – as like a game engine for like the longest time but slowly, I’m starting to replace the entire engine to like, my own thing. [0:02:58.8] JN: Just like hollowing out and living inside it. [0:03:01.1] KE: Yeah. [0:03:00.9] JN: So, why SM64? Like, where did that start? Why that game in particular? [0:03:06.1] KE: It was always the game during my childhood that I was involved with. I didn’t have the game when I was a little kid, I could only play it at the cousin’s house. So, it was a game that was in my mind for like, years because I just couldn’t, never play through it because I didn’t have the game. So, it stuck in my mind and then it just – the interest grew. [0:03:23.6] JN: Interesting. So, you’ve said you’ve got, like loads and loads and loads of live things built on top of Super Mario 64. Do any of them, you know, for viewers who haven’t seen them before, is anything sticking out with like, your favorite that you’d recommend they’d check? [0:03:34.9] KE: My favorite mod is usually always the last one I made. I think one that is very, very underrated that a lot of people should play that’s actually not a Mario 64 mod is Missing Link, which is an integral between Ocarina of Time and Majora’s Mask. Like, tells a story between those two games and it’s a very polished experience that I think is very fun. [0:03:55.1] JN: Awesome. Yeah, I would love to play that one. Similar to your story about playing Super Mario 64 as a kid, I had Ocarina of Time but never got to play Majora’s Mask and so, it’s kind of stuck there as like a game that I might one day, I will go back and I own that game, so that sounds awesome as an interstitial between them. So, could you walk us through a little bit on the process of like, how you're doing these ROM hacks, like what that looks like as a development process? And also, I imagine, we’ll get into some of it later, I guess but that process has changed for you over the years as well, right? [0:04:23.0] KE: Yeah, of course, especially with the decomp, everything changed. [0:04:25.6] JN: Right, awesome. So, like where did it start? So, back into ROM hacking days, I guess. [0:04:29.4] KE: Yeah, back in the ROM hacking days, we would kind of make assets with the hacks editor, like little scripts that could convert OVJ files into microcode data, which is you know, the model format that Mario 64 uses. We would use an Assembly editor called NASM, which would just have the Assembly code of the entire ROM listed, like, top to bottom and you had to enter lines one by one. We didn’t even have like, anything to put the lines in. It was very, very painful to do. Every time you enter the line, your computer would make the Windows error sounds. I get used to hearing that like a thousand times a day. That’s it. [0:05:04.3] JN: Yeah. So, did you have any experience with Assembly before you started doing this? So, is this like, where you learned about Assembly? [0:05:11.1] KE: No, Assembly was basically my first programming language. [0:05:13.9] JN: Incredible. I think, like to a lot of developers, especially, you know, people with my development background, you know, web development and that kind of stuff, which a lot of you know, I think a lot of our audience live in that space, the idea of just like, writing raw Assembly to make something as complicated as a game happen. It’s probably like, absolutely nightmare-inducing but how do you even begin to – is it just a case of like, change it off and see what happens to like, get to grips with it? [0:05:37.7] KE: Okay, Assembly is actually one of the easier things to learn I think. Not because like, it’s easy to program in it but because the N64 uses a MIPS architecture, which means there's just like 50 or 60 instructions you will ever need. You can just look through them and learn them in just a few hours. The difficult part is putting them together but that’s like the fun part, right? That’s like solving a puzzle, that’s like, yeah, there’s things about that. The barrier to entry for Assembly I think is a lot lower because when you program with CEF to deal with compilers, you have to Google so many errors and figure out how it all works. Assembly, it just works. [0:06:11.7] JN: It makes a lot of sense actually, yeah. I guess that kind of reminds me of like, I got obsessed with a fourth dialect during the lockdown, just because there was like so little to it that it just felt like a really freeing environment and I guess that kind of applies same to Assembly. So, you mentioned the N64’s architecture there. I don’t want to make you just repeat your YouTube videos, which are excellent but you’ve got – you do a really great job of like, describing the memory architecture and how it interacts with the CPU and the GPU in rendering. Can you briefly tell us like, how the Nintendo, I guess, like, how the N64 works as a console? [0:06:41.2] KE: Yeah. So, the N64 has the shared memory so the CPU and the GPU, which you know, in the N64 it’s not called GPU, it’s called the RCP, the Reality Co-Processor, something like that, they share the same memory. So, whenever you use the CPU, you also slow down the rendering, which makes this a very weird situation because like, every time you optimize, you also optimize your rendering even if it’s completely unrelated. [0:07:04.1] JN: Right, and so, that’s been – as far as I understand it, that’s been a focus quite a lot of your optimization at first at SM64. Can you, I guess, first of all, explain like, why did you have to start optimizing SM64? Like, what were you trying to achieve? [0:07:20.2] KE: Yeah, so while I was working on my mod, Return to Yoshi’s Island and while I was working on it, I think I was in like the fourth level and I noticed a spot ran at like nine frames a second and it wasn’t really – like, I didn’t really think it should run that poorly. So, I looked under the hood, it’s like, what’s going on in the engine and I know this is like truly, truly terrible, what’s going on nowadays with my optimizations that sport run like 60 FPS. [0:07:45.5] JN: Do you actually like, on the hardware, the max is 30, right? So like, your – [0:07:49.2] KE: No, on the hardware, the max is 60. [0:07:51.1] JN: Oh, okay, cool, awesome, nice. So, we’ve mentioned the hardware and the rendering thing, I know you did some things to get around that. What are some of the like, most interesting optimizations you’ve run into? I know there’s a lot so I don't know if that’s an easy question to answer but. [0:08:05.8] KE: It depends on who you are, what you find interesting, it’s kind of difficult answer. I guess, the interesting part is like, that every time you optimize the CPU with the GPU, it gets faster. So, a lot of my optimizations is like making sure that stuff is like better aligned to cache lines, making sure that like, an entire thread on the CPU, like the render, like if it’s into just one block of cache or like sound print as well that way, you never have to like, use the RAM and the GPU goes very fast. [0:08:29.9] JN: Awesome. Yeah, that makes a lot of sense. Actually, I think James mentioned something similar where he was doing something to make sure it will all fill in the cache and wasn’t hitting the RAM. So, you mentioned earlier, this like, decomp effort. So, originally, you’re working from like the ROM dom but now, you have access to you know, the Super Mario 64 code or a version of the code. How did that come about? [0:08:51.5] KE: So, there was a guy called Revo. He found out which compiler Nintendo originally used to make Mario 64 and if you have the execs and compiler, you can just take a function and if you write a Sync code that’s equivalent, it will compile to the exact same binary. And they use this to make the compilation that compiles one to one to the exact same byte codes. [0:09:11.6] JN: Wow, fascinating. So, they decompiled it and they’re more able to determine if it was direct implementation of each match by code, is that, have I – [0:09:22.9] KE: Yeah, exactly. [0:09:23.1] JN: Yeah, awesome. Wow, okay, that’s very cool, and I imagine that opened up a lot of doors for you in terms of like, what you were then able to do in the ease of what you’d be able to do. Was that like, were there some things that that enabled that you weren’t quite able to do before, I guess, optimization is one of them. [0:09:36.8] KE: Yeah, it’s been a lot, a lot easier to work on Sync code than Assembly code, you can make much more powerful changes very easily. [0:09:43.2] JN: Absolutely, that makes a lot of sense. So, along the way now, you’ve got access to that Sync code, you meant to do some optimizations like, what are some of the – I guess, gameplay features you’ve been able to do that you weren’t able to do before? [0:09:54.3] KE: One thing that was very easy also, the multiplayer mode and binary, I never really gave a try. There was a multiplayer mode but it shared the camera between both players but with the decomp and this was my first week of even learning C and within one week, it was very easy to just add multiplayer and it literally just worked. [0:10:11.4] JN: That’s crazy. That’s the first time I’ve heard of the multiplayer, how did that work? Was there a server, like, managing the multiplayer, was it peer-to-peer? [0:10:18.5] KE: No, it was on a cartridge. Right, it was just the ROM, you could just play it on N64, it was like, two screens. [0:10:24.4] JN: Oh, interesting. Okay. Huh, fascinating. So, you just plug two screens into the N64 and then just play? [0:10:30.7] KE: You just play it on the TV and it’s a split screen, like the old N64 games. [0:10:34.7] JN: Okay, so, it’s like the local multiplayer, awesome. Sorry, I thought it was a [inaudible 0:10:36] multiplayer for a minute. That shows you where games have gone where I'm just like, so – the world of split-screen multiplayer has been so eviscerated, it didn’t even occur to my brain as an option. [0:10:48.2] KE: There is an online multiplayer that I made in I think, 2017 or 2018. That was a lot easier to do because all you have to do like send the player position to each other. This was also in Assembly, which you know, much less powerful. [0:11:01.4] JN: Yeah, absolutely, awesome. So, I want to talk a little bit about you know, some of the – I guess, less on the technical – well, less on like the coding side and more I guess on like the implementation of the games and design side. Because I was watching one of your videos recently. It was, I think a video, you’re showing off a little bit of a new mod you are working on, the underwater domes one. You said something really interesting where you were describing your level of design, eFAST. So, wanting everything to have a sense of placeness. Can you tell us a little bit about that? [0:11:27.7] KE: Yeah, placeness is just a random word that I made up and it’s kind of a meme that I make bad variable names like “far awayness” instead of distance but it makes sense in this scenario because it wasn’t distance. Yeah, so placeness is basically how much the level feels like an actual place you’re in, right? The Dome is a good example because it’s – you are like the deep in the sea and it’s like a reverse aquarium, you’re like in these glass domes. It really feels like a place you can imagine yourself being in and that’s something I like in my levels. [0:11:53.8] JN: What are some things that you think, really like, make those sense of place in terms of like, features you add to the game? [0:11:59.1] KE: I guess it’s important that it’s like an interesting fantasy, right? Something where you play the game and then you go to bed and you're like, “Man, wouldn’t it be cool, to like, explore this?” I think what you need in your game is like, you need like decent platforming. It doesn’t need to be anything super special, and then cool ideas on top of that, and you already got a good game. So, that’s the idea here. [0:12:20.3] JN: Yeah, that’s awesome, that makes a lot of sense. Yeah, I guess like another one of your levels, which like, I always think kind of like gives me that feeling like, just from watching the videos, it’s like the theme park level, I think, particularly, when there is like the Whomp being like posing for the photo, is like one where everyone is just like, “Oh, that just makes it feel like…” When there were like generic enemy NPCs that are like doing people stuff, you’re just always like, “Oh, this is a living world, it’s very cool, it’s very interesting.” [0:12:45.3] KE: Yup, exactly like that. [0:12:46.7] JN: So, one of the things that I saw very recently actually, was that your mods are very popular for speed runners. Whenever we get a game dev on whose got speed-running community, I always like to ask, have there been any runs of your content that have surprised you? [0:13:01.8] KE: Oh, I’m not actually sure if it’s that popular with speed runners. I feel like the Mario 64 speed runners, what they value is just the platforming part. Without any of the ideas, they just want, like, raw platforming. There are some content creators for like, mods that are super popular for speed runners but they have basically zero casual audience, and I think it’s like [inaudible 0:13:21.4]. I think, like 80 or 90% of Mario 64 on speed runs are his games. [0:13:26.6] JN: Right. [0:13:27.2] KE: But he has just like a thousand subscribers on YouTube because it’s not accessible to like a casual audience. [0:13:33.1] JN: Of course, yeah. As like most, pushing games to their absolute limit, it just becomes nonsense pretty quick. [0:13:41.4] KE: Yeah. [0:13:42.9] JN: I feel like Super Mario 64 speed running has really become a surprisingly large content category, especially on Twitch that I just – [0:13:50.1] KE: Oh yeah, in Twitch. [0:13:51.9] JN: Awesome. So, I guess, kind of wrapping up, one of the questions that you know, being very new to this space and not you know, being familiar with you and being familiar with James, are there any other N64 or Super Mario 64 in particular, ROM hackers or content creators that you’re excited about and you’d recommend to the audience? [0:14:12.6] KE: So, there is two very talented Mario 64 modders I can think of. The first is [Inaudible: Biomac 0:14:17.2]. He’s actually helping me with Return to Yoshi’s Island. He’s like, insanely good at 3D modeling. He has super cool ideas and the other one is Dan from [Inaudible: Gong Play TV 0:14:25.8]. He like, what he does, dude, it looks so good. He’s like very, very good at 3D modeling and also very creative. [0:14:35.5] JN: Awesome, cool. That’s just some great recommendations, thank you so much, and thank you so much for joining us on the show today. [0:14:40.7] KE: No problem. I enjoyed it. [END]