About this episodeThis show covers Unity: A Toolchain and set of three scripting languages primarily for making games. Tools of the show: Jason: Meld…
This show covers Unity: A Toolchain and set of three scripting languages primarily for making games. Tools of the show: Jason: Meld http://meldmerge.org/ Patrick: Space Marshals http://www.pixelbite.se/pbsite3/?page_id=7675
★ Support this podcast on Patreon ★Transcript
From the publisherThis transcript comes from the podcast’s own feed, shown as the publisher wrote it.
Unity
So I'll start off with a little bit of a rant: pre versus post increment. So I got into a discussion with people at work, and for a long time, I have always just done... So the biggest example is in a for loop, in the final variable change parameter. The normal one you do is an increment, plus plus. And so I do I++ or whatever. So for i equals zero, i is less than 10, i++. I've just always done it this way. And if I put an increment on a line by itself, I do the plus plus. Like, it just reads more naturally to me. Like, this variable... Yeah,
So, and then, of course, if you put it in line with other stuff, I actually tend to try to avoid that. Like, in a statement, because I actually find... Like, I will do it occasionally, but I find it to be a more cognitive load. So I'd rather either have it be a post increment so that it just happens at the end and it's like I put it on another line or do it on a separate line all by itself. And so someone pointed out to me in one of my code reviews that I was doing post increment and that the quote unquote standard we were using was pre increment. And I said, 'Nah, that's not true.' And so then I went through all of it. Like, I, you know, wrote a grep command to grep through all of our code. And sure enough, except for just a couple small other cases from other people, every one of the team had been doing pre increment except me. And all the code checked in that was post increment, every single one of them except those like two other cases was me. And it was like, ah. It was like one of those sinking moments where like I was hoping to be triumphant because like, 'Ah, see, everyone's using post increment sometimes. There's no standard.' And then it was like, 'Yeah, I'm wrong.' And I don't know where it came from.
The worst is when like, yeah, like it's too late at that point. You know, like when the project starts, you can try to fight for what you believe in. But if it's been going on for six months and you've been doing it one way and everyone's team's been doing another way, then you just have to bite the bullet, man. So
Yeah, I feel the same way. I mean, like compilers now are so smart that the difference is kind of negligible, if anything. Like, I don't even know if the instructions end up different at the end. You know, because like if one really was better than the other, the compiler—I mean, you know, there's no way to, there's no way that I know of. Actually, I guess maybe if you used a comma, right? Like if you had I++ comma and then like some more logic here versus the like, that's the only way where putting the prefix versus post fix, you know, and this other logic also had an I like print I. That's the only way where you could end up with different behavior by swapping them. And nobody does that, right?
No, the C programming book by Kerningham. Oh, man, I always always mess up the name. Anyways, in that one, I think it is where Brian Kerningham and Dennis Ritchie. I was combining the two. Okay, brain fart. In this book, they do the post increment like I did. And so like, I guess maybe it's being from the States and going to college here in the United States, like the de facto way is writing it this way. But I guess people from other places don't. They use the pre-increment. And so that's just what they're used to. And then it's defensible to them, I guess. I don't know. Gotcha. But everyone I've ever seen until that day had always done like, and then like everyone on the team was doing pre-increment. I'm just like, 'What? How am I the only one out here? I've never been fussed at for this before.'
last team who was really into the pre-increment. And that person was from like Suriname, like former or post British Guyana, like South America. And so maybe it is like an American verse. Like maybe people like Europeans and South Americans learned pre-increment, and we learned post-increment somehow. I don't really know how that happened.
I have, yeah, I have no idea. Yeah. All right. Anyways, that's my, that's my rant. So onto an interesting topic. I was talking to someone about cooking. And so I actually enjoy cooking. And I don't do it as much as I should. I'm pretty busy at work. But I do enjoy when I do it and baking. I've been baking bread recently. I have like a, not a New Year's resolution, but like kind of a goal this year to.
I think part of it is you have to fail. Like for example, the first time I learned how to cook, I was just completely on my own. And, you know, they told me to like put the rice in. I just was making rice, like the simplest thing. They told me to put the rice in, put the water in and then boil it or like simmer it for, I don't remember how many minutes. Right? But I left it on hot. And I guess, you know, when you're supposed to simmer, you're supposed to put it on low. And it didn't—it didn't say 'simmer on low.' It just said 'simmer.' So I don't know what that meant. And, I came back and like, even the pan itself was ruined. Like the
kind of like destroyed the enamel, like the Teflon on the pan. But the point is like, you know, you either get formal training or you just make mistakes like that and destroy things. And I think what you're talking about is actually a metaphor for a lot of things. Like there are people who are just afraid to take kind of chances and the ambiguity. I don't—I don't know if it's afraid, probably is too strong language, but it's more just like, 'Oh, this is really ambiguous. This is really hard.' I'm not going to try this versus I'm going to fill in all the ambiguity, you know, by chance and then see what happens. Right.
Yeah. And I guess it's somewhat like people who—so you can make mistakes like what you're saying or where there's ambiguity in the instructions, but let me all sorts of people who it's like, 'Well, I've never made this dish before,' but, you know, I feel like I can do better than what this person is saying. Like, 'Oh, they call for a cup of milk.' I don't have any milk. I'll just use a cup of butter instead. That'll be the same.' That's kind of egregious. But people I talk to do this kind of stuff like, 'Oh, I'll substitute.' You know, it says like, you know, X amount of flour. Well, the only flour I have is like almond flour. So like, it'll be okay.' Yeah. And some of it's like not knowing, but it's just people don't like, the more I don't know, the more I try to follow some guideposts, like the instructions or a YouTube video or something. I don't pretend I know better, but yeah.
Yeah. I mean, I think, yeah, you have to follow it closely and then you'll still probably make mistakes. But then over time, like I've gotten to the point now where, for example, this morning I was making scrambled eggs and I just kind of put in enough milk when I was mixing the eggs so that it just kind of looked right. And I was like, 'I've made so many scrambled eggs at this point. I don't have to really measure anything.'
rub. It was a burger recipe, and this was a rub, and I was following the recipe kind of line by line. And then the thing is it didn't tell me how much of the rub to put on the meat. Like it didn't say, it didn't have like how much rub I made, how many pounds of meat I could season with it. And I was just like, Oh no, like what if I overseason it? And that's where you have to just bite the bullet and just hope you get it right. You know?
I like cooking. Yeah. So anyways, cooking, programming, cooking. All right. On to, on to actual technical topics. Oh, I guess we didn't do the ordering very well for the show. So I'm up first again. So you just hear a lot of me so far. This is an article about why at Stack Exchange they still believe in private offices. So a lot of press has come out around several big companies talking about open offices where there aren't many people kind of essentially sit in a large room and there may be like desk divisions in rows or pods, but essentially everyone's in an open room where you can just hear people shouting. This used to be called a bullpen. Yeah.
But now people call it more politely open office plan, and it's supposed to be like a perk, and it's deliberate, and it's great. And that's like the new wave. But increasingly people are like, wait a second, this doesn't make sense for anyone except for like cost savings. They try to, so the pros from the people who say open offices are good is that you get dynamic interaction between people, right? So you're all at work. The purpose of being at work instead of just working at home is to be around other people. And so when you have an open office plan, you're hearing conversations that you might not have otherwise; you interact with them. And this leads to big productivity boosts in the long term, but the cons are you hear everyone and people are loud or talking about stuff you're not interested. You can't—it's very hard to focus because anyone can just come up to you and start talking to you, even if you're in the middle of something important. And so, these are kind of cons, and this article Stack Exchange company is saying why they believe in private offices. You can read this article. And from my standpoint, I think there's somewhere in between. So some places have offices with only one to two people in them. That to me is a little lonely and maybe not good. So the best I've had is I was in a room with like four to five people who were in a very team that was, you know, very specific part of a sub-team. And so these people, I was people I worked together with a lot. And so I needed to have a lot of interaction with, and we had a door we could close. So if we needed to have like a meeting, we didn't go somewhere. We just closed our door and had our meeting. Also, the chance of me interrupting someone who doesn't care about what I'm talking about is really low because these are people I work with day in and day out. So we all understand each other, and we're more comfortable saying like, 'Hey, not right now,' or 'I'm busy,' or whatever. And so I found that four to six people in a quote unquote office closed space. That was like for me some of the best work environment I've had.
Yeah. I was thinking the same thing. I mean, I had, I've worked in places that had the huge bullpen. Actually we worked together at a bullpen environment. And actually in that case it worked where we worked because it was very quiet. It was just naturally very quiet. So that was an anomaly. I don't think that's normal. But generally, yeah, I've worked in bullpen environments where there's like there's like an air hockey table behind you and there's like people playing ping pong next to you, and somebody else, like there's always someone coming back or going to something, and it's just very distracting. It's hard to focus. But then the office environment, it can feel a little lonely. I mean, the situation I have now, there's two of us in an office and then there's just like rows of offices. And so most people just have their doors open. So it's kind of like having the bullpen kind of style where you can just yell at somebody like through your doors, and it kind of works. It looks like from this article that they, the walls are made of glass. That probably makes a tremendous difference, you know? Cause I mean, that way it's like, you don't have the noise, but you can just easily get somebody's attention too. But yeah, this is very hard. There's no clear answer. They all seem to have their ups and downs. Which one's your favorite? You
said your favorite was the office? Yeah. Having an office with like four to six people. More than six just gets too many. That's not a normal. I mean, it's a bit, it's just, I mean, a room, right? Like offices. Oh, I see. It's like, I can have up to six people. I think when you get under, if you just have like one or two, I think there is a, like you're saying for now, people might have their door open, but if the it's very hard to control, right? Suddenly the culture could just become everyone has their door closed and then you lose all of that. Right. Versus having your immediate team, which you it's really hard to work with a team of more than six people. Like it's not hard, but like you begin to end up with naturally some sort of sub-teaming happening. Yeah. Right. And so I think to me that, that is the thing when you have the big open spaces, people it's like, 'Oh, put on headphones.' It's like, well, you can still come up and talk to me, and if I have headphones all the time, why am I not just at home? Like, yeah, exactly. I can't hear these dynamic conversations.
The thing about the office is like when you really need to focus, you can close the door, and that's just kind of like the universal sign for like, I'm in the zone right now, you know? And like provided that like sort of you manage your door, like, you know, responsibly, then that's like, that adds a tremendous benefit.
Yeah. So the next article is React Native. This is so freaking exciting because I've been wanting something like this forever. So I'll tell you a little bit of history. Well, first, React Native is the React JS kind of paradigm, but applied to native. And so I'll tell you what that means. You know, we were talking before the show a little bit about web and just how HTML and JavaScript and CSS—these things have come such a long way, and there's just so much infrastructure around them. The browsers themselves are so complex and so efficient that laying out, you know, laying out divs and, you know, getting good spacing and things like that, putting images in the right space, loading pages fast, et cetera, right? It's just such a beautiful piece of infrastructure. And making things for the web, especially, you know, things where you just want to display a lot of data or things where you want some kind of interactive form or something like that, it's just—it's just nothing can really beat it. On top of that, if you make a website, you make it for everybody, right? I mean, with a little bit of good CSS, you can make a website and it can work on mobile and on desktop, and it just kind of magically works everywhere. And with respect to desktop, it actually like looks and feels good on everyone's desktop. Mobile, not so much, right? So, you know, originally Facebook tried to do the whole HTML5 app where they basically just took the Facebook website and, you know, just from a tech standpoint, like crushed it into an app where, you know, when you started Facebook, it looked like you're going to some native app, but it's really just taking you to a web page where, you know, the address bar and other things are hidden. And so it just—it feels like an app, but you're really on the internet. And the thing about it is on native, you know, and we could just argue this to death, like, why whether this is a good idea or whether this can change if it's fundamental or not. But the reality is the web experience on native sucks, right? Like the Android browser, the Chrome on iOS and on Android, and WebKit—all of it is kind of terrible. And that's why Facebook bailed on the web app. I
Did I make too many apps in a row? Yeah. So, like Gmail—my Gmail app, it is a website, but it's really an app. And to use that on those browsers is not a good experience for me, but going to a blog, for instance, I think the normal ones are fine. I actually don't like the apps that are like forum readers. They just don't work well for me. Yeah. That's a
good point. So maybe what it is, I think actually to be more specific, I think that web app apps are in the uncanny valley where, you know, they respond pretty well and everything. But when you say flip a switch and it's really just some kind of JavaScript mock of what a native switch would look and feel like, it behaves just slightly different. And, and it's different enough that it makes you hate yourself. It's in that uncanny valley. It's almost like if you get a completely different experience on the web, you're much better off than trying to make it feel like a native app, you know? Anyways, you don't have to do any of that nonsense because there's React Native now. It just came out. And so the idea is, similar to how React JS is this JavaScript library that lets you build a bunch of widgets programmatically. And as the name suggests, all the widgets are reactive. So if I wanted to make say a chat program, all I do is I say, 'Hey, here's a chat widget. It's backed by this array.' Hey, here's a button widget. It's, you know, when you press it, this function gets called. And then whenever you press the button, the function gets called. That's pretty clear. But also whenever that array changes, it re-renders your chat window. So you don't have to say something like, 'You know, listen for new chat messages. When you get them, you know, clear out the window and redraw it.' Like you just say, 'Hey, look, this window is this chat array,' and it's just magically done. So React Native is the same thing for native, and it's cross-platform. So what these guys have done is they've defined like a, you know, like a button in this React JavaScript language. And they've kept it very similar to the web. There are some differences of things which just didn't translate well, but some things like buttons are almost exactly the same. So you define some button in React JS and then on Android, you get a native Android button. Then on iOS, you get, you know, the iOS button. And if you define some widget like map, for example, you'll get the native Apple Maps on iOS and you'll get the native Google Maps on Android. So they try their best to do the right thing there. And it's all reactive, like I said. So, you could have a map widget and you can say, 'Okay, I have this location variable.' And whenever this location variable changes, recenter my map, and it just magically works. So it's pretty cool. I don't know if it's actually—I don't think it's out yet. So just read some articles on it. They have Facebook videos, and be ready. Yeah, that's right.
So our next article is Windows 10. And the exciting thing everyone wants to talk about regarding Windows 10 is the fact that Microsoft is moving to a free for consumers—all sorts of caveats, potentially people, whether that's true or not. But the long story short is that it appears that Windows, instead of—or Microsoft, sorry, instead of trying to gain a lot of money from selling new versions of Windows and waiting for people to upgrade to try to make sure everyone's upgraded onto something vaguely resembling the latest version, as opposed to tons of people still running Windows XP, is to offer Windows 10 free as an upgrade to people who have, I think at least Windows 7, if I read correctly. That's right. So if you have a Windows 7 or later license, you can upgrade to Windows 10 for free. And then it looks like they're moving towards updating again for free. So instead of having very long-lasting OSs, it sounds like their intention is to move to kind of a more frequent cycle. Right? And that way that they can again push features and keep people on something for actually akin to what you get on Android or iOS, right? Instead of your computer just coming with an OS and just sticking with it. If OS X does something similar, right? Like they update what is it about once a year or once every other year?
Yeah, it's pretty cool. I mean, there's a chicken and egg problem that this solves, right? Which is, developers are sitting on Windows XP or Windows 7. They're making apps using that. So of course they're really interested in backwards compatibility. And then, you know, you end up with no one having any reason to update. Like, as soon as a program, like if tomorrow Steam told me, 'Hey, you know, to run Steam, you need to have Windows 10.' Well, then shoot, I'm going on Windows 10. I mean, I have no choice. And so, that's sort of, I think the environment that they want to cultivate—one where there's no reason for people who already have Windows to not be on the latest. And then once, say 90% of people running Windows are running 10, then developers can start saying, 'Well, why am I going to support seven? If you could just go to 10 for free and everyone's done it.' So then, you know, you'll see developers dropping support for older versions of Windows. And that will, you know, force more people to upgrade and so on and so forth. So, and I think it's, the other strategic thing for Microsoft is they want to start getting into this cloud business. Like they want to compete with Dropbox on, you know, cloud sharing and things like that. And so, you know, let's say something else comes out that's like Dropbox, but different. Like it's a service. You know, it's like some kind of desktop app you download. But instead of sharing, synchronizing your files, it synchronizes your contacts. Okay? So it's contact box. Then like, if Microsoft sees, oh, that's a pretty cool desktop app, they could bake it into Windows 11. They can come up with Microsoft Contact Box and it's part of the OS and they can kind of run these people out, which is something they haven't been able to do in the past. So strategically, it's a really good decision. It probably should have been made like 20 years ago, but I guess we'll let it slide. So then the next article, this is pretty cool. I never knew this existed, but so if you're writing JavaScript right now on the web, you're writing ECMA Script five. And so the deal is, ECMA Script is like the formal definition of JavaScript, like the formal name of that language. And most people are writing five. Now they're coming out with the JavaScript version six—actually it's already out. But the problem is, again, you have this adoption problem. Like if I write it in six, 90% of the people aren't going to be able to use my website. And so that's a problem. So they wrote this transpiler. So basically you can write your code as if everyone's running the latest bleeding edge, like Chrome or Firefox. And for people who aren't, they can run the JavaScript five version of your code. And maybe it's a little slower or something like that, but functionally it should do exactly the same thing. And it allows you to sort of make that transition and start writing JavaScript six now. It's pretty cool.
book of the show. My book of the show, it's kind of a little different than usual, but I actually found out that there's this magazine called Game Developer Magazine and they stopped printing issues, I think like five, six years ago. And you can actually get all of the issues for free. So it's pretty cool. I mean, you can just flip through literally any issue of this magazine. You can just download it and flip through a PDF of it. So, if you're into game development or you're into sort of the history of game development, things like that, this is a pretty cool resource to check out.
Uh, that's a topic for another time. My book of the week is a book of the show is Missborn: The Final Empire by Brandon Sanderson, which I've recommended, I think at least one other book of his before. And this is a book I just finished. It was really good. I really enjoyed it. I guess it's considered fantasy, but it was very suspenseful. It's a little long, but not the longest way, but it, it just, for what reason, it was like very action-packed, on my edge of my seat. And I was like really enjoying it. Is
So, but I very, very much enjoyed this book and I just started on the second one. Like I went to start listening to another book. So I listened to a lot of my books on audio during my commute. And so, I went to start like, you know, reading, listening to another book, and I was just like, no, I want to go find out what happens. I like started this book, the second one of this series. So it was that good.
Yeah. I totally do that. So the library also is a good source of audiobooks, even online. So they have books on CD, which of course you can or they have a lot of them. There's, I think it's called OverDrive, which is like essentially Audible, but like for the library. And so you should check that out. I read a lot of specifically like science fiction. And so they tend not to have the books I'm really interested in, but I do browse every so often and there are good books on there. So
So basically just take whatever you know about diff tools and throw it out the window because Meld just makes it so much easier. It's so Meld is a diff tool. So, you know, it compares two or three files and it will show you the differences either between the two or among the three files. So, you can hook Meld into Git. So if you ever do like a Git diff or a Git merge, Meld will just automatically come up and take over. It's pretty awesome. If you do like a Git merge and there's a merge conflict, Meld will pop up and the left panel will show what you have. The right panel will show what is on the remote and the middle will show what Git tried to do automatically, which will be like somewhere in the middle. But it's pretty cool. You can also, if you are in a Git repository, you can just type Meld and it will automatically diff what you have, like your working copy against the repository, like against HEAD. So if you want to do like, instead of doing like a Git diff, you get like a graphical Git diff kind of for free. It's pretty awesome. It has a couple of issues on Mac. It's kind of—there's some problems there. Actually I want to put together like a Meld Mac package. The issue is right now Meld uses the XQuartz, which is like X11 kind of rendering interface, but it can use regular Quartz. It just has to be recompiled. So, I'll probably put together like a package for that or something, maybe try and like put it in Homebrew or something like that. But even the X11 is like pretty decent. And if you're on, you know, OS 10 or I'm sorry, if you're on a Linux or a Windows, it just—it just magically works. So, yep.
My tool of the show is not nearly as useful, but it is guaranteed to—no, it is not guaranteed to anything. It will waste time. This is an iOS game. I think they said they're coming out for Android as well. I should be more diligent about looking that up. I do most of my quote-unquote video gaming on my iPad in the evenings. And so, this is called Space Marshals. And this is a game for the iPad. And I think iPhone too, but I know definitely on the iPad. That's where I play on iOS and it is a tactical shooter. So, a dual stick tactical shooter. Rather than running around and trying to shoot lots of things, you're—it's kind of almost like Metal Gear Solid, and like that you're trying to crouch and hide. And then you're trying to avoid the attention of the guards, and you can do things like throw rocks that make noises. And then the guards will walk over to see what's happening, and then you can ambush them from behind. But if you shoot them with a loud gun, it'll alert the other guards. So then you may want to choose like a quiet gun that does less damage, but it's quiet. And so there's all sorts of interesting trades and mechanisms for encouraging you to replay the level and do better, and you get a score, and based on how good you do, you get rewards. And so they just announced, and I'm very excited that they're coming out. The first one is only, I think 10 or 14 levels. Doesn't take terribly long. And it was kind of like, Oh, this is a little bit short, but they're going to come out with the second set of levels as a free update to the game. And so it'll get more gameplay, which will be awesome.
No, I've gotten to the point now where if there's in-app purchases, I'll almost never install it. Like it has to be something where it's like content, you know, like buy another level or something. Then I'll think about it. But if I go to the in-app purchases and it's like any kind of BS currency, like if there's, if, if it's like
I really enjoyed this game. This game is a lot of fun. And it's good too, because the dual-stick shooter thing, a lot of, a lot of games, I don't feel like go well on the tablets just because like precision nature, but due to the pacing of this one, I feel like it works really well. So definitely check it out.
Unity. Yeah. So first to talk about Unity, we have to talk about game engines, of which Unity is one. What? I know. So a lot of people, you know, when they first try to make a game—I know I did this. You probably did this too, Patrick. You, you, you try to, you don't use a game engine. Like when I, my first game that I made, I used, um, um, just like, I guess like Visual Basic or something, or I think it was like C++, but it was like the, uh, GDI, that's what it was called. Like it's where like the Windows, you actually like, it was like a desktop application where I was like drawing circles and stuff on like an actual, you know, desktop window.
So what I learned is that it just—there was constant flickering because the circles weren't being drawn and erased at the same rate as the monitor was refreshing. So, you know, you'd have a circle erased, and before you could redraw it, the monitor would refresh. And so sometimes the circle was there; sometimes it wasn't. And so you just end up with all these weird issues that, you know, you don't really think about—you know, when you're designing a website or something like that, you don't think about weird things like flickering and frames per second and things like that because the browser is kind of doing all that for you. And because things aren't really moving around that fast. And if they are, you're using Flash or something like that. But when you deal with a game engine or when dealing with a game, there's a lot of objects moving all over the place. Maybe there's a camera and the camera, you know, is moving; you know, your eyes are effectively moving, which means the whole universe is going in the other direction. That's where you end up with all these weird artifacts and slowness and things like that. And so game engines are these sort of low-level, you know, drawing music playing, you know, physics engines that can run very quickly and can give people sort of immediate feedback in a world where things are constantly changing.
Yeah. I think the difference is like when you're writing, you know, a Windows application or a Mac application, you have a UI, but it's just basically a bunch of event handlers that fire when the user does something versus in a game. Yeah. There's stuff going on all the time, right? Like creatures are moving around. The enemies are doing something; like stuff is always happening.
Right. Yeah, that's right. So typically games are designed to run at 60 FPS. I know that like when they do backporting. So, you know, if you try and run Grand Theft Auto IV on Xbox 360, it runs at 30 FPS, but for the most part, things run at 60 FPS. And what that means is that 60 frames per second. So you have one sixtieth of a second to do everything. Like, you know, everything Patrick was talking about—like all those people, they have to move; like take a little bit of a step forward. All the cars, they have to move a little bit forward. They all have to make noise. The camera, if you're moving forward, that means the whole world has to move backwards to give you the feeling of going forward. And all that has to happen and get pushed to the graphics card, the sound card, and all those other peripherals in 16 milliseconds, which is—which is—which is no time at all. So this would be really hard for you to do by, you know, by scratch. It would be, it would be pretty, it'd be pretty much impossible.
Well, I know you can't do it, but what you end up doing is recreating most of what a game engine provides. Yeah. You end up writing it yourself, right? Like, this is what happened to me. I wrote this game and I was like, oh, I need to handle the death sequence of like the character. And I was like, oh, this is something later I've realized like, oh, game engines just have like these kinds of things thought out. Like there's a level start and a level end, or a game start and a game end versus me. Like I had to write like, oh, I'm in a splash screen. Now I'm in the game.
Yeah, absolutely. I mean, I think that, um, you know, if you actually, I don't think it's even possible. Like if you just, if you wanted to make a game and you want it to be like very interactive 3D things like that and run in real time, but not use like OpenGL or DirectX, it's pretty much impossible because those are the ways, those are the APIs that give you access to the graphics card, and OpenGL or DirectSound. That's how you get access to the sound card. Otherwise, you just—you're not able to use, you know, all of the hardware on the machine, and you can't, you know, you can't run fast enough. So yeah, so you need very special APIs which give you a ton of like control, an incredible amount of control so that you can do things very quickly, but they also will allow you to do very bad things. If you know, and OpenGL is a lot better now. But actually there was a time where I gave Patrick, remember? I gave you a version of MAME. This is—we were traveling for work.
he closed the program, his laptop screen—like he had to turn his head to read everything until he shut down. So, I mean, that's the kind of control you get, but it comes at a big price. The other thing that a game engine is really known for is, which Patrick alluded to earlier, is the content creation pipeline. So, you know, you might have an artist or a game designer, and he's not a programmer, right? I mean, he's just somebody who knows a lot about games and sort of how to, you know, where to reward the player for exploring and how to create like nice niches, how to create.
Yeah. How to buy like an extra hundred twiddly bits. Like where to create kind of funnels where you can create a lot of action and force people to have to experience that action. So there's not like large parts of the game that people aren't experiencing. So they know a lot about sort of the game design and the storytelling, but they know nothing about coding. And so there needs to be a way for those people to take the scripts that you write for them and inject them into the game using some kind of nice graphical environment. And there has to be a way for, you know, the artists to take, you know, pictures of backdrops, take like little 3D models that they're making in some completely separate third-party program. And you know, and feed that into your game engine. Like someone might make a death animation in Blender and then go to 3ds Max to make like a dialogue animation. And somehow these things need to flow into your game engine. So, you know, commercial or popular, you know, open-source game engines will have a content creation pipeline.
Yeah. Even how to take a model and like get the polygon drawing that OpenGL needs to do, right? Like this is something that you have to code by yourself when you're writing an OpenGL or find an individual library for every aspect of it. This is one of the pains for us was like, how do we, what is the tool that we can integrate? Well, that allows us to use any 3D modeling program to create a model of a, you know, boat and put it in the game and not have to like draw every individual polygon.
Yeah, exactly. And then, you know, you get into texturing and there's just, there's a whole world full of content-related tools and things like that that a game engine has to support. There's some other kind of more modular parts of a game engine, you know, AI, pathfinding or some kind of state machine. There's physics engines, you know, like Angry Birds where, you know, you launch the bird and it goes kind of flying through the air and crashes, and reacts kind of like a ping pong, or sorry, like a pool table, like a billiards table. So all of these are kind of, you know, a game engine will typically have, you know, modules for all of these other tasks. So Now we've kind of described game engines. So let's kind of walk through sort of a history of game engines. Um, well, maybe
Yeah, that's true. History is boring. It won't be like a chronological. Yeah. There's a ton of game engines that came out in the past. Like, I mean, The ID Soft, like ID One, ID Two, ID Three, the games like, you know, Duke Nukem and all of those, there's engines behind all of those, but, um, it would, it would take us all day to cover. The first
game engine I ever used, and this is a pretty high level, uh, game engine, engine was called like RPG Maker. And this is, I think still like, they still make versions of it to today. And that's basically if there are a lot of RPG games, which are really similar, like Japanese RPGs of a certain era, think like Final Fantasy III, IV or V, like that, that time range. Um, or what would that be like Dragon Quest IV, uh, three,
maybe six. So like before kind of, well, at least the ones I was using before 3D and they're all very similar. You've got some guy on a world map and he kind of wanders around and occasionally he gets a random fight and then occasionally he like goes into some town and then there's like a more detailed Zelda-esque, like detailed city map. And typically there aren't random fights there or there may be or whatever. Um, and so what it does is, is it created a very generic kind of game like this, but then allowed you to make the sprite for your hero and the sprite for your party. And how many people would you allow in your party? And when you go into the town, here's a character, what do they look like? What script do they follow? And you would type out the script and you know, here's what tiles do you want to use for the city? Um, and they had like a lot of, I guess, template games, which you could start with and then kind of like modify. And it was almost like a choose your own adventure to build an RPG, make RPG. And then at the end of it, like you could start with an example project and just change the name of the characters or, you know,
So I mean, I'm trying to remember now correctly, but at a minimum, like you could specify kind of like how you wanted, like this monster gives this many experience points. So of course, like the first thing you do, cause you want to be awesome is like this monster has like one health and like a million experience points. Right. That doesn't make for like a fun game, but that's what you do because it's fun. Um, and so stuff like that. But then, you know, ultimately at the time, like I wasn't really into programming. Uh, so this is like pretty early on. And so I didn't get into the whole like scripting part of it as much, but that's a big aspect as well. Like how do you do leveling? Like, well, here's your generic leveling system, but if you want to write your own, you can too. Um,
Yeah, right. I played this, I had this one called Unlimited Adventures, which is very similar to RPG Maker, but it was from the Forgotten Realms people. So it was all like the Dungeons and Dragons rule base. And the first thing I did, I made this, um, thing where like you, you walk to the town and when you entered the town, there was a huge battle between these like 400 city guards versus like 120 dragons. And, uh, and the battle took like three hours. And I was like, and I was like, this is totally awesome. And I gave it to a friend of mine and he's like, yeah, I let that run overnight. And I came back and it was, you know, like my computer had crashed. So it was like, I realized it was like actually really hard to make a good game. Like one that's true. Like as a game developer, you get caught up in like the mechanics and things like that. And then you end up like kind of self-absorbed. Then you give it to somebody who, you know, isn't like, hasn't been like walking through the development process and they're like, yeah, this is crap. Yeah.
Yeah. Um, and so similar to the description of RPG Maker, I guess in a way is I remember playing all the LucasArts point and click adventures. Um, and these all run on a similar, that's called Scum. Oh, the name just escaped me. It's like scripting for script, script creation utility for Maniac Mansion. I looked it up. I cheated. Um,
And so these were, uh, if you remember like the Indiana Jones and the Fate of Atlantis, I remember playing this game and it was so hard. I had to like barely just got internet and like go on the internet and look up like, how do you get past this level? Uh, Grim Fandango, um, what are those like the Monkey Island, uh, games. These were all games that were written in this, uh, Scum language. And you would be able to provide like, here's the verbs I want to use. Here's the nouns I want to use. Uh, and here's the picture of the town that I want this adventure to take place and where the special areas are.
Yeah, seriously. So these don't ever do that. Okay? Low-level game engine. We talked about high-level, you know, RPG Maker, ScummVM, things like that. And we'll talk about Unity, but a lot of these, like they don't give you kind of raw access. Right? So, you know, in say they're not generic, you can't
Yeah, exactly. You know, it doesn't make sense. So, I mean, at the low level, like what is every game doing nowadays, right? It's doing one of two things: either drawing triangles in 3D that are getting kind of crushed into 2D by the GPU getting rasterized, or they're drawing sprites in 2D, which are just kind of pictures that they're drawing in 2D, or some combination of the two. Right? Same thing with audio. What are you doing? You're taking a variety of audio signals that are positioned in either 2D or 3D, and then you are muxing them together, or mixing them together into one signal and then sending that to like an audio processor. Right? So, what these low-level engines do is they try to abstract as much as possible while still giving you the freedom to do what we just described, like to make any game you could ever want. The most common one is SDL. So, SDL has things like add audio track or draw 2D box, draw sprite, move sprite, things like that. And then under the hood, they've written what that means in a hundred different platforms. So, if you draw a box on Windows or if you draw a box on Linux or on the iPhone or on the Android phone or whatever, there's a line of code that handles that. So, SDL, just think of it as like the same draw box function implemented like 30 different ways so that when you call it, you don't have to think about it. OpenGL is similar. It's a little bit more modern, but it's the same idea. There's also this combination of three libraries: OGRE, OIS, and OpenAL. OGRE does graphics, OIS does input, and OpenAL does sound. And when you put the three of them together, you have kind of the same thing. There's Hacks, which is very similar. And then something that's becoming much more popular now is the whole HTML5 canvas thing, which is pretty cool. So, in Canvas, you can say like raw things like draw a circle, move a circle, things like that. And then it will sort of do the right thing. So, on the iPhone, the HTML5 canvas will call whatever the low-level draw circle function is for the iPhone. So, yeah, the low-level ones are cool. I mean, it's pretty clear. Like if you use a low-level, as the name suggests, you're going to be writing a lot more code. Talking about like the content creation stuff we mentioned earlier, you're going to be doing all of that from scratch. And it's going to take months and months.
Yeah, it's true. But if you want to make something like say Minecraft, which is just very, very different, like, uh, you know, Minecraft, it's, it's, the world is made up of like a billion of those little cubes. And you can't just draw a billion cubes in 16 milliseconds. It just doesn't work. So you have to be really clever about which cubes I draw and stuff like that. And so whenever you need that much kind of precise control, then you have to use a low-level engine. Um, and that's why you don't see a lot of like really fancy artwork and things like that in Minecraft because they, um, you can't just take some model that you made in like Blender with the animations and everything and just put it in Minecraft and it magically works. Um,
I totally believe it, but, uh, that's pretty wild. I mean, there's, I think there's the other day I was talking to a friend of mine who worked at EA, and he said there was, there's like a handful of people who work on the Madden football, and all they do is the grass. Like they try and make the grass look as realistic as possible, but there's like an army of people just for the grass. So it happens.
Yeah. So, okay. Unity. So Unity is, you know, a high-level game engine. So it's doing a lot of work for you. The basic premise behind Unity is that you have this thing called prefabs. And the idea is this: let's say you're making some Grand Theft Auto level, right? So you have a bunch of streets and at the end of every street, you have a traffic light. Well, you don't want to have to create, you know, 10 billion traffic lights, and then, oh, you know, I don't really like the way the traffic light looks. So I have to go and change all of them, and it would take forever. So this idea called a prefab where you sort of design one traffic light that, you know, kind of looks really well and captures as much of the essence of all the traffic lights as you can capture. And then you just instantiate that prefab all over the place. And so then if later on, if your boss comes to you and says, 'Hey, I really want the traffic lights to be orange instead of yellow,' you could change the prefab, and then all of the objects in your world magically get corrected. So that's kind of the premise behind Unity. So you have prefabs, you have game objects, which are instances of prefabs, and then you can assign scripts to either. So you can say, you know, all traffic lights will use this script. And so in a way it's very functional because you don't really—there's no guarantees on the order of the scripts and things like that, especially if you're creating objects dynamically. And so, you know, there's some like update function that captures how traffic lights interact with things around them.
So when you move to one of these game engines, but specifically Unity, one of the things that Jason was talking about before is that you gain cross-platform NIS to say that way. And so that is that if you are running on desktop and you decide you want to move to iOS because you heard that was the hotness or to Android, you can take your game that's mostly developed with very little work, just run it on the others because you're working at a higher level. And so those abstractions handle moving to the other platforms. That's
Right. That's right. And even, you can even write in three different languages. And it all just kind of gets compiled down to the same thing. So Unity as Unity Script, which is kind of like JavaScript, but you know, it doesn't have all the same functions, all the same features of JavaScript and the syntax is a little different. There's Unity C# which is, you know, exactly C# in terms of syntax, but you know, not all the libraries from C# are there. It's kind of like a subset of C#. And then there's Boo, which is this language is inspired by Python as a syntax that's similar to Python. But again, it's only for Unity. And so it's pretty cool. You can, you know, you can have a team of people and they don't necessarily all have to be writing in the same language, although it'd probably be better if everyone is consistent, but you can have a, you know, a Unity Script script for your traffic light that calls a Unity C# script to say, 'Is there anyone around me? Like, is there anyone within a hundred meters?' And if there is, then the traffic light yells at them or something. So I thought, you know, it was pretty cool how like you can kind of design all of these scripts independently and then see sort of—I think this is called emergent behavior where it's sort of like the sum is greater than, you know, or the whole is greater than the sum of the parts. And so it's like you design this traffic light and it kind of tries to react to anything that comes near it. And then, you know, you design cars, you design people, and eventually you end up with this thing that feels very lifelike. And you end up with these kind of very complex behaviors that you could have never really scripted. Another thing about Unity, it's pretty cool. It has all of those things we talked about. It has the content creation. You can easily take models from Blender, Maya, 3D Studio, and import them into Unity. And also a lot of people have written plugins for Unity. Some of them cost money. Some of them are free, but you know, someone even wrote like a Minecraft kind of plugin. Somebody else wrote a plugin for doing like toon shading. So if you're on your game to look like it's a cartoon. And so, you know, the plugins are really what's going to get you closer to one of these low-level game engines. Like when you need to do something that Unity can't handle, then you can rely on one of these plugins. So you're not—you're not just totally lost.
All of those plugins and the framework to handle plugins and the cross-compatibility do give you a productivity boost. So instead of spending time creating them all from your own and essentially creating your own version of those things, you are able to offload that to people who have already done it. And that saves you time and gets you down to the cool part about figuring out your awesome AI or your witty story or your amazing animations.
That's right. All those people who made all of those low-level things want to get paid. And so, you can use the base Unity for free, but it's pretty limiting. I mean, you can't really use plugins. So, you know, even if someone else made a plugin that fixes your problem or that add some functionality to Unity that you need, you can't use it because you only have the basic to use plugins or to make your own plugins. You have to get Unity Pro, which, it's $1,500 base. And then if you want to do Android, it's another 1,500. If you want to do iOS, it's another 1,500. So to publish a game on Android, iOS and desktop with Unity Pro, you have to spend $4,500, which is just pretty steep. I mean,
Yeah, you definitely could do it. I think you might even be able to use Unity. So the Unity Pro for iOS costs money, but you can use the Unity Basic on any of the platforms for free. So you can even make an Android game and charge for it. The only thing is other than not getting the plugins and a bunch of other features like skeletal animation, some things like that, or like this inverse kinematics. But other than that, you have a Unity splash screen. So, when someone launches your app, the first thing they'll see is like 'Powered by Unity' for a few seconds, which, you know, that's not too bad.
Yeah. Yeah. I mean, if you can get away with Unity Basic, then yeah, you can always push the game out and then retroactively pay them. I'm sure they wouldn't mind. But one thing about Unity is that for what you get, it's actually remarkably cheap. Like the Unreal Engine, I think is like a hundred thousand or something ridiculous. Unreal Engine pricing. So if you want Unreal Engine 4, it is, it doesn't even say.
So I know that the GitHub Student Developer Pack—did we talk about that last time? If you're a student and you register with the .edu address, you can go to like GitHub and they have all these free services and trial things. I thought we talked about it, but if we didn't, you should check it out. I think we talked about
Yeah. So I'm looking at it now on Get. If you're a student, which presumably probably means you have a .edu email address—that's typically how they do that. The GitHub Student Pack includes a subscription to Unreal Engine Four. Gotcha. So you don't have to pay the $20 a month. I don't know what happens if you make like a billion dollars. I don't know.
Wow. That's amazing. Actually, with Unreal Engine, you get the entire source code for the engine, which is something you don't get with Unity, even with the Pro version. Which is pretty cool. I mean, if you ever wanted to know how like a game engine works, you could just get this subscription for a month and then cancel it. And for 20 bucks—I mean, even if you're not a student—then for 20 bucks, you get the source code for UE4, and you can check out how it works. That's pretty amazing. Cool.
It didn't feel natural to me. I kind of wanted like—I'm like, oh, well, how am I going to design this like crazy particle engine? And then I realized like, this is really meant for like building a gigantic level and having a bunch of experiences. And I was thinking about more in terms of like, like I was thinking about like a board game engine that would like play any board game and like kind of encode the rules in a script. And it's just like, I was trying to like put a square peg in a round hole, but for people who are like designing a real game and have kind of a background in game design, I think this is an amazing tool. Very nice. So cool.
