Latest / Talk Python To Me / #78: How I built an entire game and toolchain 100% in Python
Transcript
- 0:00What kind of applications can you build with Python?
- 0:02You hear me featuring many people on this show that build websites,
- 0:06web services, or some data science-driven application.
- 0:09Of course, all of those are wonderful, but I know many of you have dreamed of building a game.
- 0:13In this episode, I'm interviewing Joseph Charlin.
- 0:16He created the game Epicos and the entire toolchain to build it in Python.
- 0:21He has a great story about how he came across Python,
- 0:24why he decided to use it in his game,
- 0:26and advice he has for anyone out there taking on a large project like this.
- 0:30This is Talk Python To Me, episode 78, recorded September 24th, 2016.
- 0:53Welcome to Talk Python To Me, a weekly podcast on Python,
- 1:04the language, the libraries, the ecosystem, and the personalities.
- 1:07This is your host, Michael Kennedy.
- 1:09Follow me on Twitter, where I'm @mkennedy.
- 1:11Keep up with the show and listen to past episodes at talkpython.fm,
- 1:15and follow the show on Twitter via at Talk Python.
- 1:19Hey, everyone.
- 1:20As always, thank you so much for listening.
- 1:22I think we have an interesting look inside a really cool project by Joseph this week,
- 1:26so I hope you enjoy the episode.
- 1:28He talks about the game that he built and the whole toolchain and how he used Python to do it.
- 1:33And he and I talked after the show and decided it would be really great to give away some copies of his game.
- 1:39As always, if you want to win something from the show, you have to be a friend of the show.
- 1:44Super easy.
- 1:45Just visit talkpython.fm, click on friends of the show in the nav bar, enter your email address, boom, we're friends.
- 1:51Well, we're already friends.
- 1:53You're listening to the show, right?
- 1:54So thank you so much.
- 1:54But officially, to win, you've got to be a friend of the show, so give me an email address so I can hopefully pull it out and send you one of the games.
- 2:02Hope you enjoy the episode.
- 2:03Let's hear from Joseph.
- 2:04Joseph, welcome to the show.
- 2:08I'm super excited to talk about how you built your game in Python.
- 2:11And not just your game, but your entire toolchain.
- 2:14And the story of how you did this and your journey is super interesting, and I'm looking forward to sharing with everyone.
- 2:20Yeah, it was really fun.
- 2:22And thanks for having me on the show.
- 2:24I think it'll be fun to talk about it.
- 2:26Yeah, I definitely will.
- 2:27And you're welcome.
- 2:27So before we get into the story of Epicos and your game and things like that, let's talk about your history.
- 2:35Like, how did you get into programming?
- 2:36So strangely, I didn't actually have a computer to program on growing up, like a lot of my friends who are also programmers.
- 2:44But when I started going to college, actually, my dad bought me a computer.
- 2:49And as a kind of random thing, I took intro to computer programming course in college.
- 2:58It was totally random.
- 2:59I was supposed to be, you know, I was in pre-architecture major, right?
- 3:03So I wasn't doing anything related to programming.
- 3:06And I took this programming course, and I was like, this is what I want to do for the rest of my life.
- 3:12All I want to do is program.
- 3:14This is it.
- 3:16And I had to switch to computer science.
- 3:20And I knew, you know, there were a lot of math prerequisites that were going to be new.
- 3:24And I was like, I'll just do it.
- 3:25I don't care.
- 3:26I'm going to study hard.
- 3:27I'm going to learn everything.
- 3:28I'm not one of these guys who's been programming their whole life or whatever.
- 3:32That's great if, you know, if you have that.
- 3:35That's awesome.
- 3:36But not me.
- 3:38I learned in college.
- 3:39And my express goal was always to program video games.
- 3:42I love video games.
- 3:44Had a NES growing up.
- 3:45Most of my favorite games are NES games, I would say.
- 3:48But that got me into the games.
- 3:51And when I was programming in college, I always wanted to make games out of my programs.
- 3:56So I was learning stuff like DirectX.
- 4:01I was trying to learn stuff for game programming.
- 4:04I was making little games all the time in college.
- 4:07That's really cool.
- 4:08That's kind of how I got into programming.
- 4:10I think a lot of us can relate to this feeling of like, once you discover programming, you're like, this is what I want to do.
- 4:16I still remember one of my very first paid outside of university jobs was working on 3D visualization software doing C++ and OpenGL.
- 4:29And I was just thinking, you know, my first day, first week at work, I'm like, this is it.
- 4:33Like, my life is perfect.
- 4:35I'm sitting here doing like OpenGL and programming.
- 4:38And oh my gosh, this is so amazing.
- 4:40I was just thrilled.
- 4:42So you've done a lot of C++ programming as DirectX and probably OpenGL as well and all the major game engines.
- 4:49That's kind of what you do for your day job, right?
- 4:52Yeah.
- 4:52I mean, I'm not an indie dev during the day.
- 4:55I'm a programmer.
- 4:57I do game stuff.
- 4:59So I've been in the games industry about 10 years.
- 5:02I've shipped three or four titles.
- 5:05If you count expansion packs, I don't know.
- 5:07Three or four.
- 5:08Any major ones that we probably played if we're into games?
- 5:11I shipped a few mediocre console titles.
- 5:15I mean, they weren't bad.
- 5:16I liked them, but probably nothing too big.
- 5:19Okay.
- 5:20And then I went and I started working at ArenaNet, which makes Guild Wars.
- 5:25So Guild Wars 2, I worked on.
- 5:27I would love to take credit for a lot of the things in Guild Wars 2, but I can't.
- 5:31I only joined a year before they shipped.
- 5:33You know, I tried to help out before shipping, but like, obviously, the lion's share of the credit for this game doesn't go to me.
- 5:41And there's a lot of programmers here.
- 5:43The major games have an incredible number of developers and artists and team members.
- 5:48It's not a one-person deal to ship games these days, is it?
- 5:52It's really huge.
- 5:53ArenaNet isn't super big like EA or anything, which makes it nice, actually.
- 5:58But there's a lot of people you're working with.
- 6:01And the key thing ArenaNet actually let me do was, in most games industry jobs, you're working like, it's not a 9-to-5 thing, right?
- 6:09You're working 12, 14 hours a day.
- 6:11You can't make a side project, right?
- 6:14You have to go home and sleep, right?
- 6:16Or go home and drink so that you can get over working 14 hours and then go to sleep.
- 6:21And that's it.
- 6:23You can't do that.
- 6:23Once I started working at this new job at a more responsible company, plug for Internet, basically, it is.
- 6:31They actually make sure that there's no real overtime there.
- 6:35So I came home, and I was like, wow, I should be programming.
- 6:38And that's kind of how the game started getting made.
- 6:41That's great.
- 6:43That's great.
- 6:44So we'll talk about how you're using Python in your game in a moment.
- 6:48But why don't you tell the story of how you got into Python and why you thought it might be interesting for a game in the first place?
- 6:55You know, I don't know if I'm exactly 100% Python programmer.
- 7:00I like Python.
- 7:00I'm really a C programmer.
- 7:02Most of my work is in C++, but I prefer C-style stuff with a little C++ thrown in.
- 7:10I'm not, you know, going off the deep end with all the C++ features.
- 7:15It's a good language.
- 7:17I like it a lot.
- 7:18It's my first language to see.
- 7:19So obviously, it's like your first language always has a special place in your heart, no matter who you are, I think.
- 7:26At work, I had to fix a bug, which happened to be in Python.
- 7:32I think an artist had made a script in Python.
- 7:35And it was a good script.
- 7:36It had a bug in it.
- 7:38And I fixed it.
- 7:39And I fixed it.
- 7:40After learning a little bit of Python, like, think about maybe like a couple hours, Python gave me enough ammo to kind of fix a rudimentary bug.
- 7:50So if you're getting into Python, it's not too bad if you're a C programmer already.
- 7:54But then I was looking at this language.
- 7:57I was like, huh, I wonder what you can do with this thing.
- 7:59Because I'm thinking about it as a C programmer, really.
- 8:02I'm thinking about Python as a C guy.
- 8:04Like, oh, this looks like it'll save me some time.
- 8:07Maybe I don't have to declare things.
- 8:10You know, I don't have to put together all the nuts and bolts of the program as much.
- 8:15And I took it home.
- 8:16And I wrote a C program.
- 8:19You know, I wrote a program in C.
- 8:21I can't remember what it was.
- 8:23I think I had to automate some process I was working on.
- 8:26And then as a challenge, I wrote it in Python.
- 8:29So in C, it was 300 lines of code.
- 8:33And I'm making up the lines.
- 8:34I don't remember exactly how many lines it was.
- 8:36Let's say it was 300 lines of code.
- 8:38In Python, it was like 100 lines of code.
- 8:43My first Python program, you know, 100 lines of code instead of 300.
- 8:47And I'm thinking, wow, this is pretty great.
- 8:50I had to write.
- 8:52That's a nice improvement.
- 8:53A third the amount of code.
- 8:55That's cool.
- 8:56And then I was looking at it more.
- 8:58Like, okay, let me learn more Python.
- 8:59So this is, you know, learning almost no Python.
- 9:02I got a third out.
- 9:03That's great.
- 9:04Because less code, you know, if you know as a coder, less code means less bugs, right?
- 9:10You don't want to write things in as long way as possible.
- 9:13That's it.
- 9:14So less code, less bugs, great.
- 9:17And then I started learning more Python.
- 9:18I was like, wow, I can get this down to 50 lines.
- 9:21And I learned more.
- 9:22It's like, I can get this down to 25 lines.
- 9:24Learn more Python.
- 9:26Learn about how the sorting works, the data structures, all the stuff that I just normally
- 9:30manually code or use some library for, which tends to be verbose in C++.
- 9:36And then, oh, wait, it's 20 lines of code.
- 9:39Wait, it's 10 lines of code.
- 9:41And I'm sitting here with 10 lines of code instead of 300 lines of code.
- 9:4410 lines of expressive code instead of 300 lines of nuts and bolts and a little bit of
- 9:50expressivity somewhere in there.
- 9:52And I'm like, I could probably write this thing in a couple lines, but it would be really
- 9:57ugly code.
- 9:58So I'm going to leave it at whatever it was, 25 or 15 lines of code.
- 10:02That experience was the one which convinced me, wow, Python, there's something to this
- 10:08language.
- 10:09Granted, I haven't done a lot with scripting languages.
- 10:12I'm a C person.
- 10:13So people tell me, well, you can do this.
- 10:16So with this, you can do this.
- 10:18Okay, maybe they're right.
- 10:19But for me, I learned at Python, this exact experience was what got me into Python.
- 10:25And that totally convinced me there's something to this language.
- 10:29That is a really cool story.
- 10:30I wish you had kept all the versions of code.
- 10:33We could put them up as like GitHub gists or something like that.
- 10:36But still, the story is great.
- 10:39And I think a lot of times you'll hear people say, well, I like this language because it's
- 10:44dynamic and it doesn't have types.
- 10:46Or I like this language because it doesn't require compiling like C does or something.
- 10:50But I think what was really cool about your story is it really highlights what's truly
- 10:55cool about languages like Python and especially Python is that whether or not you compile those
- 11:0225 lines, it is a much better experience.
- 11:05What you can do and the way you put these, the standard library together and the packages
- 11:11and all sorts of stuff.
- 11:12It's great.
- 11:12Yeah, I totally agree.
- 11:14I don't want to put words in the mouth of the devs of Python.
- 11:17But I think the point of the language is just to be expressive.
- 11:21So you'll write, normally you'll write code and there's a lot of boilerplate code.
- 11:26There's a little bit of code that carries the intent of what you actually wanted to do.
- 11:32And in Python, it's like the code that expresses what you wanted to do is the code, more or less.
- 11:37Yeah, you had a cool thing where you said, you're talking about an algorithm, the A-star
- 11:42path navigation algorithm in a Reddit post that we'll get to talking about.
- 11:46And you said, here, look, Wikipedia is describing the algorithm in words and basically pseudocode.
- 11:52Drop this into Python.
- 11:53How much work would it be to just make it execute, basically?
- 11:56Which is really nice, I think.
- 11:58It's amazing.
- 11:58Like, I copy-pasted some pseudocode into the Python editor.
- 12:02I changed, I think, the equals signs, right?
- 12:04And the pseudocode is different than the equals signs of Python.
- 12:07And then it worked.
- 12:08And I was like, I don't have to write A-star now.
- 12:10That's awesome.
- 12:11Cool.
- 12:13So let's talk about your...
- 12:13It is like, I can't even believe it worked.
- 12:15Yeah.
- 12:16That's really, really cool.
- 12:18So let's talk about your game.
- 12:20What's it called?
- 12:20Oh, sure.
- 12:21Epicos is the game.
- 12:22E-P-I-K-O-S.
- 12:25It's the Greek word for epic.
- 12:27Oh, nice.
- 12:28And it's a game I wanted to make for a number of years.
- 12:33Even in college, I wanted to make this game.
- 12:37But once I started working in the games industry, of course, I didn't have time because of the hours.
- 12:43But then I eventually had time.
- 12:45I got to a more responsible company.
- 12:50The game is pretty retro.
- 12:55It's hard to say that in a world where pretty much every game claims to be retro these days.
- 13:02Yeah.
- 13:03It definitely has a retro feel.
- 13:05I'll vouch for you.
- 13:06It does have a retro feel.
- 13:07And it's a visual RPG where it's...
- 13:11I don't know.
- 13:11I feel kind of like it's a simplified Legends of Zelda type game maybe a little bit.
- 13:17Like it has that kind of feel of playing.
- 13:19It might feel that way.
- 13:20I feel actually it's a combo of Ultima and Final Fantasy, probably four.
- 13:26Probably a combo of Ultima four and Final Fantasy four.
- 13:31So like Ultima, you have interesting property that the more...
- 13:36The faster you input on your keyboard, the faster the game runs.
- 13:40No games, even if they claim to be retro, no games have this property anymore.
- 13:44But in the 80s, a lot of games had this property.
- 13:46If you type fast, the game went fast.
- 13:49And if you type slow, the game went slow.
- 13:50And if you left, the game didn't do anything at all.
- 13:53And whereas nowadays, even the turn-based games, it doesn't matter how fast you go.
- 13:57So they're very slow because you have to wait for the AI to think.
- 14:01And you have to wait for all these stupid animations you don't even care about to finish playing.
- 14:05And all these sound effects you get over with.
- 14:08And you just want to play the game.
- 14:09But the game is so enamored with its own wonderful effects, it won't even let you play it.
- 14:15And plus the AI is typically not written efficiently.
- 14:18Which my AI isn't any...
- 14:21You know, it does stuff.
- 14:23But think about it.
- 14:24It's in Python.
- 14:24I mean, that's like 500 times slower than C.
- 14:27And the game runs that frame, right?
- 14:29So it's possible to do.
- 14:31That's awesome.
- 14:32And it's all about designing it in the right way, right?
- 14:35I mean, it's the trade-offs you make.
- 14:36Like you said...
- 14:37Yeah, absolutely.
- 14:37Stay away from the crazy animations.
- 14:39And guess what?
- 14:40You can go through the steps faster.
- 14:42That's cool.
- 14:43Yeah, everything runs really fast.
- 14:44On your website, you have a place where you say...
- 14:48You talk about the outstanding features of the game.
- 14:51Can you maybe highlight some of those?
- 14:52It has a very original mythology.
- 14:55There's a website called Indie Overlook.
- 14:58I want to plug.
- 14:59They did a review of my game.
- 15:01They got the idea of the feeling of mythology and lore is a key part to the game.
- 15:07And also, they were critical of some aspects of the game, which I totally agree with.
- 15:11Like, I agree with what they liked about it and what they didn't like about it.
- 15:15So Indie Overlook.
- 15:16Check them out.
- 15:17And the original world and story is one of the main things.
- 15:22So basically, everything you see in the game has a lot of backstory and thought behind it.
- 15:27And I'm thinking about Lord of the Rings, right?
- 15:29Because if you read Tolkien, he won't say, oh, and they passed a hill.
- 15:33He'll say, well, this hill, you know, once upon a time, there was a kingdom on the hill.
- 15:37And before that, there was this other kingdom on the hill.
- 15:40And before that, the elves were on the hill.
- 15:41And before that, this happened.
- 15:42And the hill, you know, he's thinking about not the world in terms of the static thing,
- 15:47but all these layers of history that happened.
- 15:49Mythology, really.
- 15:51I tried to kind of, like, put that feeling into everything.
- 15:54Everything had ancient roots in my world.
- 15:57Ancient roots.
- 15:58And you can find out about it via conversation, but you also can find ancient tablets that you can get translated by bards.
- 16:07You can read more about it.
- 16:09You can also skip this part of the game if you're not a lore guy, if you just like tactical RPG and story.
- 16:14That's cool.
- 16:15That part's optional.
- 16:17But it's a pretty original world.
- 16:18The characters are pretty original.
- 16:20The story's totally new.
- 16:21So that was the idea with the first bullet there.
- 16:25Nice.
- 16:26Turn-based combat was another goal of mine.
- 16:29I like turn-based combat.
- 16:30I feel like in the U.S., not many games are made with turn-based combat.
- 16:35Definitely not a lot of big games.
- 16:38Would you say it's more of, like, a Japanese style?
- 16:40I would definitely say Japan has us on this one, right?
- 16:45And I happen to like the turn-based stuff.
- 16:48Maybe it's subjective.
- 16:49I feel like it's a little more thoughtful.
- 16:51But I like real-time sometimes, too.
- 16:54So I think they're both valid game systems.
- 16:57I just happen to like turn-based better.
- 16:59And it's pretty unrepresented these days.
- 17:02Although, if you go back to the 80s, real-time is pretty unrepresented.
- 17:05Because real-time was just harder to do, I imagine.
- 17:08Yeah.
- 17:09Absolutely.
- 17:10I think it started out as a requirement, right?
- 17:12I mean, in the early games.
- 17:14Yeah, pretty much.
- 17:15You didn't have the same environment.
- 17:17Okay.
- 17:17Pretty much.
- 17:18And the idea of the turn-based-ness of this game is that it'll run as fast as you need it to.
- 17:23And if you go back and you play Ultima IV, which you should, it's great.
- 17:26If you get good at that game, you can start inputting commands as fast as your fingers can type.
- 17:30And the game will just go.
- 17:31And that's the idea of my game.
- 17:33Like, if you can think and you know what all the moves in the strategic combat are,
- 17:38you can just play it and it'll be fast and it'll be fun because you're doing it so fast.
- 17:42That's a fun feeling.
- 17:43That's a good, it's kind of a natural high to be doing things fast.
- 17:47I think StarCraft players can tell you, you know, it's a lot of fun to move your pieces around fast.
- 17:54Or if you want to be more thoughtful, just slow down.
- 17:56And the game runs as fast basically as you need it to.
- 18:01And another thing that's fun about the combat is that A-Star algorithm that we mentioned earlier
- 18:06controls how, of course, all the monsters pass and stuff.
- 18:11What I wanted to do was have A-Star control their decisions, but I never got that done.
- 18:16So you can use A-Star not only to pass spatially, but you can pass through decisions.
- 18:22Like, they could say, what's my goal?
- 18:23To kill the player.
- 18:24Okay.
- 18:25What different actions can I do?
- 18:27And almost use those as spatial locations in A-Star.
- 18:31But I didn't do that.
- 18:31Oh, wow.
- 18:32I see.
- 18:32I hadn't really considered applying the algorithm that way.
- 18:34But if you've got, like, a decision tree that has different outcomes, you can use it.
- 18:39Yeah.
- 18:39To sort of put that together.
- 18:40Okay.
- 18:40Interesting.
- 18:41It's super cool.
- 18:42It's called planning, I believe.
- 18:44I had a friend who told me about it.
- 18:46I didn't come up with it.
- 18:47Yeah, that's cool.
- 18:48And I get to implement that.
- 18:50But that would be a future work for you guys at home.
- 18:54Each character, of course, has unique abilities in this game.
- 18:58So I wanted to avoid some of the common pitfalls of RPGs.
- 19:02Like, you have to level up and stuff like that.
- 19:04And you have to grind and all that stuff.
- 19:06Yeah.
- 19:07And then combat's impossible to balance, right?
- 19:10Because now you got to level 10.
- 19:12Well, the enemies are balanced for level 3.
- 19:14Well, how did you know that?
- 19:15Or maybe you're level 2 and the enemies are too hard.
- 19:17Well, how fun?
- 19:18That's not fun.
- 19:19So basically, if you think of a game like Advance Wars.
- 19:22Have you played Advance Wars?
- 19:25I haven't played it.
- 19:26No, sorry.
- 19:26How about Fire Emblem?
- 19:28No, I haven't played games for a little while.
- 19:31I used to play tons, but I haven't played them for a while.
- 19:33Oh, my God.
- 19:34Oh, my God.
- 19:35This guy works too hard.
- 19:36Okay.
- 19:37There's these great turn-based games, Fire Emblem and Advance Wars.
- 19:41And they're all Game Boy Advance games, I think.
- 19:44They're still making them now, some of them.
- 19:46They're all perfectly balanced because there's no levels or XP.
- 19:50And basically, they just lay out a scenario and you have to fight through it.
- 19:54And they all work.
- 19:56That's kind of the goal with the different characters and their different abilities with me.
- 19:59So there's no XP, but I can balance encounters perfectly because, or as hard as I wanted to make them, at least.
- 20:08Basically, I set down the characters and I set down all the monsters and I know their stats exactly and all their abilities.
- 20:14And each of the characters have different ways to solve problems.
- 20:17Like, you got your tank guy who can deal damage and receive damage.
- 20:23And you have characters with really different AOEs.
- 20:26And you have a character who can set traps.
- 20:28Yeah, nice.
- 20:29A character who has more, like, utility stuff.
- 20:31So different abilities have to complement each other.
- 20:35Sure.
- 20:35And I like the way that you balanced it because that is one of the hardest parts of creating a game.
- 20:40It's creating it in a way that is challenging but not frustrating.
- 20:44And I think that's really, really, really cool.
- 20:46I totally agree.
- 20:48This portion of Talk Python Deme is brought to you by Hired.
- 21:02Hired is the platform for top Python developer jobs.
- 21:05Create your profile and instantly get access to 3,500 companies who will work to compete with you.
- 21:10Take it from one of Hired's users who recently got a job and said,
- 21:12I had my first offer on Thursday after going live on Monday and I ended up getting eight offers in total.
- 21:18I've worked with recruiters in the past, but they've always been pretty hit and miss.
- 21:21I tried LinkedIn, but I found Hired to be the best.
- 21:24I really like knowing the salary up front.
- 21:26Privacy was also a huge seller for me.
- 21:29Sounds awesome, doesn't it?
- 21:30Well, wait until you hear about the sign-in bonus.
- 21:32Everyone who accepts a job from Hired gets $1,000 sign-in bonus.
- 21:36And as Talk Python listeners, it gets way sweeter.
- 21:38Use the link Hired.com slash Talk Python To Me and Hired will double the signing bonus to $2,000.
- 21:44Opportunities knocking.
- 21:45Visit Hired.com slash Talk Python To Me and answer the door.
- 21:49Let's talk about your Reddit post.
- 21:57So you wrote a post on Reddit that was super popular.
- 22:01You wrote it and the title was,
- 22:03How I Built an Entire Game and Tool Chain 100% in Python Using Pygame.
- 22:10And it got 894, more than that, over 894 upvotes.
- 22:14I know.
- 22:15I was so excited.
- 22:16People love their Python.
- 22:18What can I say?
- 22:19I love it too.
- 22:21Well, you know what I think is interesting is, like, if you said, if you wrote a post that said,
- 22:25how I created an entire game world in C++ or how I did it all in Objective-C and I put it on the iPad,
- 22:33it's like, well, okay, yeah, that's what people do.
- 22:36Yeah, that's very normal.
- 22:40It's that people love Python and experiences like you're having are just pushing it just a little bit out of its comfort zone of building data-driven web apps and data science tooling and things like that.
- 22:51And I think it really unleashes the creativity and, you know, the idea is like, oh, I could do that too in Python.
- 22:58How cool.
- 22:59You're absolutely right.
- 23:00And you absolutely can do that.
- 23:02Like, Python is, as long as you keep the scope of your game down, something simple like I did, it is totally very well-equipped to help you write your game.
- 23:11And it feels like an act of expression rather than an act of hooking boilerplate, you know, layers of code together.
- 23:19Yeah.
- 23:20You're actually, you feel like you're writing a game again.
- 23:23You write less so that the joy is more apparent, maybe?
- 23:26Yeah, you write less and you write the stuff that has the logic bits that are game bits.
- 23:32Basically.
- 23:32And it's quite a good experience.
- 23:35I recommend picking up Pygame.
- 23:37And even if you want to make Pong, you know, just make something.
- 23:40It can be fun.
- 23:40Okay.
- 23:41Interesting.
- 23:41So we talked about why you got interested in Python and why you thought it was really cool.
- 23:46But what made you say, okay, I can actually use Python to write this game before you had the experience of doing it?
- 23:53Well, I didn't know.
- 23:54I didn't know.
- 23:55So I wrote, first I wrote that little program.
- 23:58I can't even remember what I did.
- 23:59I need to automate some process.
- 24:01And I wrote it in Python.
- 24:02I was like, oh, that's really impressive.
- 24:03I wrote it in so few lines of code.
- 24:05Next, I said, well, you know, I love 16 color graphics.
- 24:09You know, real 80s style stuff.
- 24:11Most people, it's like they're trying to be retro, but they kind of push it past what retro actually would have done, which is fine.
- 24:17But I actually wanted true, like, 16 color stuff.
- 24:21So I wrote a paint program in Python.
- 24:23And this paint program could only paint 16 colors.
- 24:27And it would also allow you to animate your sprites and stuff like that.
- 24:31And after I wrote this paint program, it was an experiment.
- 24:33I didn't know I was going to write the whole game.
- 24:35It's like, you know, I'll start.
- 24:36I'll write a paint program.
- 24:37And after I wrote the paint program, I was like, you know what?
- 24:41I'm going to write a map editor.
- 24:43And I think I'm going to probably write a whole game.
- 24:45So kind of a long way of answering your question.
- 24:49Yeah, I know.
- 24:49It's like you just said, well, maybe it's possible.
- 24:52Let's see.
- 24:52And let's get started.
- 24:53Yeah.
- 24:54Yeah.
- 24:54That's what it was.
- 24:55So the first thing that you said, well, if I'm going to create this world that we described
- 24:58in the beginning, and it's going to be this retro world with 16-bit and this kind of music
- 25:05and so on, you said, all right, the first thing I'm going to need to be able to do is
- 25:09basically issue commands to the game engine or the tool chain and so on.
- 25:15So you built basically a command line interface or almost like a REPL, like a console for your
- 25:24set of tools and your game, right?
- 25:26Yes.
- 25:27And I would recommend doing so for anyone, any hobbyist.
- 25:30Basically, even before the paint program, you know, I knew if I was going to write any tools,
- 25:35I would need to be able to issue commands for it.
- 25:38And there's UI toolkits out there and you can use whatever you want.
- 25:43But I wanted real fast iteration.
- 25:45And there's really nothing as fast as typing.
- 25:48I mean, mousing around, picking stuff off menus, not really that fast and not really that flexible.
- 25:54And every time you want to add something to your menu, you have to deal with all that UI work.
- 26:00Whereas the old school style typing, you can add a new command to your program pretty easily.
- 26:05I wrote this little console in Pygame that all that you do was type into the console and you
- 26:11could hit enter or, you know, delete, you know, whatever you want in terms of that.
- 26:15And that was it.
- 26:16It didn't do anything in and of itself.
- 26:18But every other tool I made and the game itself, if you play it, will use it.
- 26:23So if you play the game, on the very bottom of the game screen, you see things printing out like,
- 26:27oh, you move north or, oh, you talk to this guy and it'll print out.
- 26:30That's all the console.
- 26:31It's working.
- 26:32It asks you, do you want to save?
- 26:34Yes or no?
- 26:35You know?
- 26:35Yeah.
- 26:36Oh, that's cool.
- 26:36It's still doing its job.
- 26:37It's a hard worker.
- 26:38Oh, that's, yeah.
- 26:40That's really cool that you get to, you reuse it even into the gameplay.
- 26:43That's great.
- 26:44So you have this paint program.
- 26:45Yeah, you have the paint program.
- 26:46And because it's really 16-bit, there's like 16 choices for colors.
- 26:51So you click on the color you want and then you've got kind of a square.
- 26:54And it's almost like building icons, I felt like.
- 26:58It kind of felt like an icon editor because the size and resolution of things.
- 27:03You also had a map editor.
- 27:05And I thought the map editor was pretty cool.
- 27:06That was also in Pi Game, right?
- 27:08Yeah, I have that open right here.
- 27:10So the paint program was 16 colors.
- 27:13So more like 4-bit, even before 16.
- 27:15Yeah, right.
- 27:17Of course, yeah.
- 27:1816-bit.
- 27:1816-color 4-bit, yeah.
- 27:20I think the graphics are about the year 1984 with this game.
- 27:23So quite a bit before Super NES and those things.
- 27:27Pretty retro.
- 27:27The map editor was next.
- 27:30And of course, now that I had the ability to paint tiles, basically, laying out the tiles gives you a map.
- 27:38And at the bottom of my map editor was our friend the console.
- 27:41And at the side, I made a palette of different tiles you could choose from.
- 27:46Of course, I ended up writing, painting quite a lot of tiles for the game.
- 27:51It ended up being kind of my hobby.
- 27:53I don't know exactly how many, but I'm going to open the folder of game assets.
- 27:58And I'll tell you how many things I made with this paint program.
- 28:01Sure.
- 28:01Okay, 826 items were made with this paint program.
- 28:06Like little wolves and brick walls and stone walls and water.
- 28:10And by the way, this is kind of a visual thing that we're doing over audio, which is tough.
- 28:15But in the Reddit post as well as in the show notes, you can link to the screenshots for all these tools that Joseph built and so on.
- 28:23So you'll be able to pull them up.
- 28:24Yeah, please go ahead and check out that Reddit post.
- 28:27It has a screenshot of this map editor.
- 28:30Although it's a pretty basic map editor.
- 28:32It's definitely something you can consider writing yourself.
- 28:35Even if it's just for educational purposes, it's fun to write a map editor, right?
- 28:40Yeah, for sure.
- 28:40And to save load, I used Pickle.
- 28:43So it's just, I mean, Pickle, you know, obviously it's not 100% secure.
- 28:47If someone gives you a Pickle file and you open it, it might blow your computer up.
- 28:51But, you know, don't do that.
- 28:52And you're okay.
- 28:53Yeah.
- 28:54I didn't write any saving and loading code at all for this program.
- 28:58I just used Pickle.
- 28:59I was just like, whatever.
- 29:00Yeah, just basically take the memory structure of the Python objects and just stash them binary to disk and then pull them back up, right?
- 29:08That's more or less the idea.
- 29:09Yeah, it's perfectly fast for a game like this, right?
- 29:12It's perfectly fine.
- 29:14And if you write a lot of games, you know saving and loading is a thing.
- 29:18I mean, you have to deal with it.
- 29:19And I just pickled a bunch of Python dictionaries.
- 29:22And the first thing in the dictionary was the version, right?
- 29:24Okay, this is version 1.0 of my save.
- 29:27And the reason versioning is important is because, say, I passed the game and I did patch the game.
- 29:32You want to up version everyone's save files.
- 29:35You don't want to have people have to start over because you decided to drop a new version.
- 29:41And even for me, when I'm debbing it, I mean, there's probably like seven or eight versions of the saves.
- 29:45I don't want to have to remake all my saves.
- 29:49So it's important that your save loader be able to filter up old versions of saves, even from the very beginning.
- 29:54So I can take a, you know, three-year-old version of Epicos and just load up the characters from it and play the game.
- 30:01And that's just all using Python dictionaries.
- 30:03First thing in the dictionary is a version.
- 30:05And then everything else is, you know, what characters you talk to, what items you had, where you are in the world.
- 30:10Yeah, okay.
- 30:11And the map editor uses the same tech as the game, so pickling and unpickling.
- 30:15And I think I did some light compression because the map's got a little too big for pickle to handle.
- 30:19So I compressed before I pickled.
- 30:22But it's all in the realm of Python.
- 30:24No C stuff is going on here at all.
- 30:28And the map editor, basically, it lets you choose what category of object you want.
- 30:33So I grouped things, like you can work on natural objects or things in doors or things in caves or monsters or whatever you want to work.
- 30:42And you just paint them out with the mouse.
- 30:44This tool does use the mouse.
- 30:45I feel like for painting, the mouse is a great tool.
- 30:48And it lets you zoom in and out with the wheel and all that stuff.
- 30:52Yeah, it makes a lot of sense.
- 30:52So this world is pretty immense and you can walk around from place to place.
- 30:57Did you, like, sketch this out on paper?
- 31:01Like, how did you go to designing, like, the larger world and then connecting it to what you actually do in the tools, like in the editor?
- 31:08I did sketch the world out on paper.
- 31:10But for the tools, first I sort of, like, I still wasn't totally convinced.
- 31:14Like, oh, can I build this whole game?
- 31:16So I just made a little house in the map editor, right?
- 31:19A little house with some windows.
- 31:21So I have a little fireplace and some candles.
- 31:24And if you play the game, this is where the game starts.
- 31:27So the first scene you'll see is this house.
- 31:29But interestingly, that's the first map I made.
- 31:33And I just made a little house for fun.
- 31:38And after I made that, I was pretty convinced I could make a big world.
- 31:42You know, I made some other medium-sized things first.
- 31:45I didn't go for the overworld.
- 31:46I made some towns, which are, like, you know, bigger than the house, but not really huge.
- 31:53And then I decided to make the game world.
- 31:56And as you said, I sketched it out on paper.
- 31:58I planned the whole game out.
- 32:00So if you can imagine, I wrote a plot.
- 32:02So I knew where everything had to be roughly.
- 32:07This is impossible in a game with multiple people programming it or designing it because, you know, different people come up with different things, which is fine.
- 32:15But if you're doing a one-man show like I did, you can plan stuff out and you can stick to your plan if you force yourself hard enough.
- 32:22And then it's all planned out.
- 32:23So you can kind of almost sketch it on a paper and stick with that sketch.
- 32:28And I think I still have the paper around here, but I'm not going to look for it.
- 32:31Yeah, sure.
- 32:31That's really cool.
- 32:32You know, for the whole time.
- 32:33Nice.
- 32:33So we talked a little bit about some of the things in the game in terms of the algorithms and what it took to build, like how you save and load, the A-star algorithm for Path and AI.
- 32:45But can we maybe talk about in general, like, what's it like to write a game for Pygame?
- 32:51I've looked at Pygame a little bit.
- 32:52I haven't really written too many games.
- 32:54The last time I wrote something, it was 3D and then OpenGL.
- 32:57And it was more of a simulation than a game for something I was actually working on at a job.
- 33:03Oh, wow.
- 33:04Yeah.
- 33:05So I remember what it's like to write those types of things in, say, C++ and OpenGL or DirectX.
- 33:12You know, you've got kind of like an animation loop.
- 33:14You run your AI step.
- 33:15You run a rendering step.
- 33:18You do very, you know, process input.
- 33:20Like, what does it look like to write in Pygame?
- 33:22Like, how does that compare?
- 33:24It's very simple, actually.
- 33:26It's good or bad, depending on how you use it.
- 33:29So Pygame is simple.
- 33:31It doesn't give you much.
- 33:33So scope your project to playing to Pygame's strength, and you'll be very happy.
- 33:38If you scope your project to trying to do things Pygame can't do, don't use Pygame.
- 33:43You'll be less happy.
- 33:45Basically, it gives you, yeah, you have to, you know, you have to use, you know, I wanted to use Pygame because it was pure Python.
- 33:52What the code looks like is you're pretty much normal game loop controls everything.
- 33:57So in most 3D games or other games I've worked at, you know, at some point in the program, there's a loop, and the loop does something on the, something like, take input from, you know, first part of the loop.
- 34:09Take input from the keyboard or from the mouse or controller.
- 34:12Second part of the loop.
- 34:14Draw the screen.
- 34:15Third part of the loop.
- 34:17Run all the AI for all the characters.
- 34:20And then you're done, and then it loops again, and it draws the next frame of the game.
- 34:24And this is more or less how a lot of games are written.
- 34:28Of course, you could say, oh, what about networking and all these other features?
- 34:32Yeah, sure.
- 34:33I mean, that could be in the loop or probably not.
- 34:36It's probably interrupt-driven or some other messaging system.
- 34:39But for me, it was basically a very simple game loop.
- 34:43Take input.
- 34:44Draw the screen.
- 34:46Run the AI.
- 34:47That's it.
- 34:48And drawing the screen, of course, I'm not sure if any of those bits you want me to elaborate on,
- 34:53but that's generally what the game loop should look like for Pygame, I would say.
- 34:57Yeah, I think that's, I mean, we don't want to go too deep in code on audio, but at the same time,
- 35:03I want to give people a sense for what does it look like?
- 35:06What pieces do you put in there, and what pieces does the framework itself, what does Pygame itself support, you know?
- 35:13So, yeah, that's really cool.
- 35:15You know, you talked about making a plan.
- 35:18It lets you draw sprites, and that's it.
- 35:20That's all it does.
- 35:21Sprite goes here, sprite goes there.
- 35:23Awesome.
- 35:23Yeah, so one thing that I thought was interesting that you talked about.
- 35:27Yeah, that's all it does, literally.
- 35:28Yeah, one thing you talked about I thought was interesting and really a powerful message was how long it took you
- 35:35and sort of your process for getting the game done, right?
- 35:39I mean, this is a lot of stuff.
- 35:40You're building a lot of apps.
- 35:41You're building a console system.
- 35:42You're building a paint program, a map editor, file format, AI.
- 35:46I mean, there's a lot of things to do just to have the game, and then you've got to, like, build websites and market it.
- 35:52So why don't you tell us about how long it took and kind of, like, how you stayed on track?
- 35:57It took, I think, about two years to make the game.
- 36:00I was also working a full-time job during this.
- 36:04Yeah, that's a lot of work.
- 36:05No excuses.
- 36:06I'm working.
- 36:06I can't do it.
- 36:07You can do it.
- 36:07I don't know.
- 36:07You just can't do it.
- 36:08Yeah, I mean, if you come home, like, on any project, if...
- 36:11Well, I'm working, but it's work.
- 36:12Yeah, absolutely.
- 36:13On a project like that, if you say, look, I'm going to take and just dedicate an hour a day.
- 36:18Maybe not every single day will that work, but if your plan is, I'm just going to do a little bit every day, you know, you can do it, I think,
- 36:26is maybe one of the messages that you were carrying there.
- 36:29Yeah, yeah, absolutely.
- 36:30You can totally do it.
- 36:31Do what I did.
- 36:31Say, I'm going to program my Python for 15 minutes today.
- 36:35Just 15 minutes.
- 36:36Then you can probably do that.
- 36:38And then even if you're scared or you're having creative block, just do that.
- 36:42And then next day you have to say, well, now I have to do 20 minutes.
- 36:46And eventually you can see where this is going.
- 36:49Pretty soon you're doing it for an hour a week.
- 36:52You can just do it for an hour for a couple weeks and then two hours.
- 36:55Once you're at two hours, you're done.
- 36:56Just do it two hours a day.
- 36:58And if you're in that habit of doing two hours a day, you'll want to do it more because you'll be in such a good habit
- 37:04that over the weekends you'll do six or seven hours, right?
- 37:07If you have whatever D&D with your friends, you go over to your friend's house and play D&D.
- 37:11Don't just lock yourself in your room and only program Python.
- 37:15But you'll want to program a lot if you're in a good habit because it'll just be normal for you.
- 37:21It won't be weird.
- 37:21You have to get over it not being normal.
- 37:23Yeah, you do have to make a habit out of it.
- 37:25I think that's important.
- 37:27Whether it's a game or a website you're trying to launch or an app or anything, right?
- 37:31But if you're going to create something that is long-term like this, you definitely have to make it a habit.
- 37:35And I also think seeing success encourages you to keep going because you're excited.
- 37:40You're like, look what I did last week.
- 37:42I'm going to totally do this.
- 37:43Think how far it'll be next week, right?
- 37:45And you just keep going.
- 37:45Yeah, absolutely.
- 37:46If you don't see any fun stuff coming out of it, it can feel really burdensome.
- 37:51So start with something small.
- 37:53Start with your paint program.
- 37:54Don't start with the whole game.
- 37:55And then at least you can say, well, I made a paint program.
- 37:58Even if that's all you do and that's as far as you get before giving up, at least you have that.
- 38:03Yeah, that's really cool.
- 38:05You also talked a little bit about running into bottlenecks and helping yourself get over those.
- 38:10What are some of the bottlenecks that you hit trying to go through this project?
- 38:14Well, none of it really had to do with Python, luckily.
- 38:17So there's that.
- 38:18And the Python code never got complicated.
- 38:21Never got boilerplate-y.
- 38:23It was always small and trim.
- 38:25The main bottleneck for Epicos specifically was I never wrote a tool for the cinematics.
- 38:32So for the non-interactive conversations.
- 38:36So if you've ever played Final Fantasy, one of the early ones, like four or five, people talk to each other.
- 38:43And it's totally scripted.
- 38:44And it's fun to watch.
- 38:46I wanted a real bit of that experience in my game.
- 38:49And I thought, oh, there's only going to be a few of these conversations in the game.
- 38:53And then there ended up being like, you know, hundreds.
- 38:56And basically, like, probably, like, if you imagine the game took two years, like, a fourth of that is probably writing these cinematic scripts.
- 39:08And they just got more and more and more complicated because I would always try to do better, right?
- 39:12I would say, well, I did that before.
- 39:14I have to do better.
- 39:15This script has to have an earthquake in it.
- 39:16Or it has to have a new font show up magically.
- 39:19You never saw this font before.
- 39:21And it's going to look really magical.
- 39:22Or this, you know, this one has to start playing sounds.
- 39:26And then I have scripts that are playing sound.
- 39:28I'm like, well, now I have to add sounds to all my previous ones.
- 39:31Or they sound dumb.
- 39:32You know, they feel dumb because I'm like, where is the sound?
- 39:34So I basically ended up writing this scripting language that sits on top of Python to do all my cinematics.
- 39:40And it worked.
- 39:42Like, it chipped.
- 39:44But it was just not ideal.
- 39:45And what I should have done was write something like almost a movie editor.
- 39:50Or you can imagine, like, a tool where you would scrub through a scene.
- 39:55Right.
- 39:55It was almost a multi-track thing.
- 39:57Kind of like animating it mild.
- 39:59Yeah.
- 39:59Yeah, absolutely.
- 40:00Exactly.
- 40:01Like track editing.
- 40:02And I should have done that.
- 40:04And I didn't.
- 40:05So I think the lesson is make sure you have the tools before you dive in too deeply.
- 40:10Right.
- 40:11I did that mostly.
- 40:12And I didn't do it enough.
- 40:13Yeah.
- 40:14So one thing that I think is interesting, shifting gears a little bit, you built your game and you want to get it to people.
- 40:20Yeah.
- 40:21One thing I think is interesting that is more difficult than it should be in Python.
- 40:26And there's interesting projects working on it.
- 40:28You use some that we're talking about and we will.
- 40:30There's as well as some others.
- 40:33Is getting your Python code in your application sent to somebody who can run it like an application rather than like, here's a bunch of scripts.
- 40:44Make sure you have these packages installed.
- 40:45Yeah.
- 40:46Right.
- 40:46So how do you go about shipping and packaging up the game?
- 40:49So I tried everything.
- 40:51And the answer was this was a pretty technically challenging thing.
- 40:55It wasn't just your typical happy Python coding.
- 40:58It was just like, oh, how am I going to do this?
- 41:00I tried kind of everything.
- 41:01And what I ended up using was I couldn't get Py2EXU to work, which is people's normal route.
- 41:09You know, let me open up my little script.
- 41:11Yeah.
- 41:11One of the other projects that comes to mind that I think is interesting is the Beware project.
- 41:17And they're working on ways to package up apps that work good for OS X, for Linux, for Windows, things like that.
- 41:26And so, but this is a new project coming along.
- 41:29I think we'll get there.
- 41:30But it's definitely a place where it's more challenging to, you know, create a thing that you deliver with no assumption of Python or anything.
- 41:38It's hard.
- 41:39I had to use something called PyInstaller.
- 41:41So, go, if you grab that, I'm telling you right here, it will work with PyGame.
- 41:46I believe Python 2.exe either doesn't work with PyGame or you have to spend, you know, days and days to get it to work and it's not really worth your time.
- 41:57So, I would say PyInstaller.
- 41:59Now, if you read that Reddit post, people will make better suggestions than PyInstaller, which is some of the beauty of Reddit, right?
- 42:06So, there's even better options out there if you read the post.
- 42:09But if you don't read the post, PyInstaller will work for you.
- 42:13And running that, basically, I was able to make my Python scripts into an .exe and then it was simply a matter of packing up the art assets with those.
- 42:24So, I have a distribution script, which I recommend everyone make.
- 42:29And basically, when you double-click on this script, it takes all your code and it builds in .exe and it builds in even an installer.
- 42:36So, basically, then you can give that to your friends rather than giving them a bunch of source code.
- 42:42That's right.
- 42:42I mean, on one hand, you've got to package up the Python game so it runs.
- 42:46But then you also have to package up that plus the assets into like an installer.
- 42:50So, an MSI on Windows, a PKG on OS X or something like this, right?
- 42:56So, it's not just one layer.
- 42:58It's several layers.
- 42:59Yeah, that takes time.
- 42:59Yeah, definitely.
- 43:00That's work.
- 43:01It's frustrating work as well, I think, because you have the thing you're trying to give to people finished.
- 43:07But you can't give it to them until you go through like this other step of like polishing this delivery.
- 43:12Exactly that.
- 43:13And it's different on every platform, of course.
- 43:16The good news on Linux is you assume people can unzip, you know, a TAR file.
- 43:21So, I just give a TAR file.
- 43:22Because I don't think Linux guys want an installer.
- 43:25Say, I want it in this directory here.
- 43:27It's like, okay, here you go.
- 43:28But I think Windows is a little bit more like different barrier of entry.
- 43:33So, you want to double click on it and it installs somewhere.
- 43:37You can say where that is or not, you know.
- 43:40Yeah, exactly.
- 43:40And I recommend not doing any tricks like with the registry like most programs do you install.
- 43:46Like in my program, if you delete it, it's gone.
- 43:49It's off your computer.
- 43:50If you move it, it'll still work.
- 43:52It doesn't need to know where it was installed to.
- 43:53Very old school.
- 43:54Yeah, yeah.
- 43:55Definitely no registry and none of that stuff in Windows, which just makes your life hard.
- 43:59So, it runs on Windows and it runs on Linux according to your website.
- 44:05But if I recall correctly, I played your game on OS X.
- 44:08So, is it also supported on OS X?
- 44:10Or did I get the Linux version somehow?
- 44:14Some people have figured out to run it on OS X.
- 44:18And they've done it via like a Linux emulator or Windows emulator.
- 44:23They've tried, you know, different things.
- 44:26And this is not officially supported.
- 44:28So, one guy sent in a crash report.
- 44:31I was like, oh, I'll look at it.
- 44:32But I don't have a Mac.
- 44:33I don't know if I can do this for that system.
- 44:37So, you might be able to get it to run on OS.
- 44:41But there's no guarantees.
- 44:42Okay.
- 44:42Interesting.
- 44:43So, I would say Linux and Windows are the most main platforms.
- 44:47And if sales pick up and it makes sense for me to do a Mac, I'll go out and buy a Mac.
- 44:52I can't run it in VirtualBox.
- 44:54I don't think it's supported in VirtualBox.
- 44:57Right.
- 44:58So, I can't just emulate a Mac.
- 45:00You know, it's possible that I ran it on Windows 10 in parallels on my Mac.
- 45:05It's possible.
- 45:06It will work on Windows 10.
- 45:07Yeah, yeah.
- 45:07Okay.
- 45:07Interesting.
- 45:08It will definitely work, guys.
- 45:10Cool.
- 45:11Cool.
- 45:11And the Linux port took only a day.
- 45:14So, if you think about like Python, one of its strengths is it pretty much will run anywhere.
- 45:20So, you know, Linux port, I had some capitalizations in some of my file names I had to fix.
- 45:25And, of course, you have to totally redo the distribution and, you know, the thing that makes an EXE.
- 45:31That doesn't work at all the same way on Linux.
- 45:34But besides that stuff, the game should run really easy.
- 45:37And one thing to keep in mind with Pygame is most 3D applications don't work through a VirtualBox.
- 45:43But Pygame does.
- 45:44So, you can even be having your Windows system open and open a VirtualBox with Pygame in it.
- 45:51And it will work fine.
- 45:52So, you can dev for Linux and Windows at the same time.
- 45:55It would be quite nice.
- 45:56Oh, that is nice.
- 45:57Yeah, you don't have to dual boot or anything crazy like that.
- 45:59Yep.
- 46:13We all want to ship our software faster, respond to user requests quicker, and build an edge on the competition.
- 46:19But the faster you go, the more likely a bug or issue will slip by and cause your users grief.
- 46:24I have the same trade-offs with my Talk Python websites and infrastructure.
- 46:27That's why I use SnapCI.
- 46:29Every time I check in at GitHub, SnapCI springs into action.
- 46:33A clean copy of code is pulled from GitHub.
- 46:35A Python 3 virtual environment is created.
- 46:37All the packages and dependencies are installed.
- 46:39The unit tests are run.
- 46:40Finally, I'm notified in Slack and a menu bar on my Mac about the outcome.
- 46:44That way, I know it's safe to ship a shiny new version of my web app.
- 46:48Ship your software faster with a 30-day free trial at snap.ci slash talkpython.
- 47:01Could you build a 3D game, a Pi game?
- 47:04Nope.
- 47:04It's all about 2D sprites.
- 47:063D, it's all about 2D.
- 47:08If you want, you're going to have to go into the Pi GL stuff, which is fine.
- 47:11Don't forget, you know, devs at home here, like, 99% of games' problems arise because they're in 3D.
- 47:20Everything is just much more complicated than 3D.
- 47:23And I love 3D.
- 47:24I do it at work.
- 47:25But for a side project, be careful about 3D.
- 47:29Unless you want something that looks like Minecraft, very simple.
- 47:32You know, be very careful about 3D.
- 47:34Pi game avoids a lot of these problems by being 2D.
- 47:37Yeah, that's great.
- 47:38Yeah, I've done a few major things in 3D.
- 47:40And there's so, so many little catch-ups and hang-ups you can get caught on.
- 47:46It's like, why don't I see this?
- 47:48Well, I drew it, you know, clockwise versus counterclockwise.
- 47:51Now, it's invisible because from the wrong direction.
- 47:54It's just like, ah, gosh.
- 47:56It's really complicated and it's really a career.
- 48:00You know, doing 3D is really a total career and there's specialists who deal with that.
- 48:04It's really, it's really a lot of work.
- 48:07It's amazing.
- 48:07But my game, no.
- 48:08Yeah, to make it look, yeah, to make it look professional, it's really, really hard.
- 48:13Okay, that's interesting.
- 48:14Yeah.
- 48:15You know, one thing I wanted to give a shout-out about, have you seen the movie, Indie Game?
- 48:20Indie Game, the movie?
- 48:21No, I haven't.
- 48:22People should check out Indie Game, the movie.
- 48:24It's really interesting.
- 48:25It's not quite the same story as your story because you had a full-time job and you're doing this sort of as a side project, which is, I think, a really cool thing to do.
- 48:35These guys, they spent like two years working on these indie retro games and it kind of takes you through their journey.
- 48:41But it's also more similar than it is different to this.
- 48:44So if you're looking for a good documentary about this kind of stuff, check out Indie Game, the movie.
- 48:48That one's a good one.
- 48:49That sounds pretty rad.
- 48:50Yeah.
- 48:50Most indie game guys still have studios with, you know, five, six people in them.
- 48:55What's weird about my project is I just did it myself because my game is just so retro and so unique.
- 49:02Because I tried for years to convince artists to help me and programmers to help me.
- 49:08And they're like, what?
- 49:08You want to write a game that's like actually using 80s era technology?
- 49:13You must be nuts.
- 49:14Nobody would help me write this game.
- 49:17So eventually I said, look, I have to write it myself.
- 49:19And at that time, Python came along.
- 49:21I was like, this is how I'm writing this game.
- 49:24Python is the way to go.
- 49:25That's really cool they lined up that way.
- 49:27Great.
- 49:28Yeah, I think we should probably leave it there.
- 49:29We're kind of getting long on time.
- 49:31But before I let you go, let me ask you two questions.
- 49:33I always ask them, I guess.
- 49:34You must have come across some interesting PyPI packages that you could use to make your game work.
- 49:41I mean, PyGame among them probably, right?
- 49:43What one's your favorite that you feel like you want to tell people about they maybe don't know about?
- 49:48I want to plug PyGame and Pickle.
- 49:50Those are super cool.
- 49:51PyGame and Pickle.
- 49:53Check them out if you're new to Python.
- 49:54They're really cool.
- 49:55Okay.
- 49:56Excellent.
- 49:57Excellent.
- 49:58And when you write Python code, what editor did you use?
- 50:00I used Notepad.
- 50:02Wow.
- 50:03Okay.
- 50:03Awesome.
- 50:04You were being serious about the retro.
- 50:08Notepad++ to be exact.
- 50:09Yeah, yeah.
- 50:09Because you got to have some.
- 50:10I'm serious.
- 50:11I'm a serious guy.
- 50:12Notepad++, by the way.
- 50:13Not just Notepad.
- 50:14Yeah, yeah, yeah.
- 50:15Cool.
- 50:15It's a little bit better.
- 50:16Yeah, I know.
- 50:17Of course.
- 50:17It has to understand, you know, tabs don't.
- 50:19Tabs mean spaces.
- 50:19Things like that, right?
- 50:20Okay.
- 50:22Yeah, yeah, yeah.
- 50:23Awesome.
- 50:23All right.
- 50:24Well, Joseph, this was a really fun story.
- 50:26And thank you for giving us a look inside.
- 50:28What you built and how you built it.
- 50:30How about a final call to action?
- 50:32If people are excited about your project, how do they check it out?
- 50:35What do they do?
- 50:35So you can go to epicosrpg.com.
- 50:38And there's links to how you can buy it at itch.io.
- 50:42If you want to buy it too there, you can follow me on Twitter.
- 50:46I'm JJC Coder.
- 50:47I'm JJC Coder.
- 50:47And I would love to hear from everyone whether or not you played the game.
- 50:51Even if you didn't like the game.
- 50:52I'd like to hear what you didn't like about the game.
- 50:55And if you liked the game, I would like to hear what you liked about the game.
- 50:58Game is moddable.
- 50:59So I want to see people's...
- 51:01It's a little bit moddable.
- 51:02So I want to see people's alternative tile sets.
- 51:04I saw quite a few good ones already.
- 51:06So I want you guys to make tiles, make the game look like you want it to make.
- 51:11Maybe you don't want it to be 16 colors.
- 51:12Maybe you want 128 colors.
- 51:15Go for it.
- 51:16You know, I want to see what you make.
- 51:17Awesome.
- 51:17All right.
- 51:19Well, thank you so much for being on the show.
- 51:20It was a fun conversation.
- 51:21Thanks.
- 51:22This was really great.
- 51:23Yeah, you bet.
- 51:23Good luck.
- 51:23Thanks.
- 51:24Bye-bye.
- 51:24This has been another episode of Talk Python To Me.
- 51:28Hired wants to help you find your next big thing.
- 51:31Visit Hired.com slash Talk Python To Me to get five or more offers with salary and equity
- 51:36presented right up front and a special listener signing bonus of $2,000.
- 51:40SnapCI is modern, continuous integration and delivery.
- 51:44Build, test, and deploy your code directly from GitHub.
- 51:47All in your browser with debugging, Docker, and parallels included.
- 51:50Try them for free at snap.ci slash Talk Python.
- 51:53Are you or a colleague trying to learn Python?
- 51:56Have you tried books and videos that just left you bored by covering topics point by point?
- 52:01Well, check out my online course, Python Jumpstart by Building 10 Apps at
- 52:05talkpython.fm/course to experience a more engaging way to learn Python.
- 52:09And if you're looking for something a little more advanced,
- 52:12try my Write Pythonic Code course at talkpython.fm/pythonic.
- 52:16You can find the link from this episode at talkpython.fm/episodes slash show slash 78.
- 52:23Be sure to subscribe to the show.
- 52:25Open your favorite podcatcher and search for Python.
- 52:28We should be right at the top.
- 52:29You can also find the iTunes feed at /itunes, Google Play feed at /play,
- 52:34and direct RSS feed at /rss on talkpython.fm.
- 52:39Our theme music is Developers, Developers, Developers by Corey Smith, who goes by Smix.
- 52:43Corey just recently started selling his tracks on iTunes, so I recommend you check it out at
- 52:48talkpython.fm/music.
- 52:50You can browse his tracks he has for sale on iTunes and listen to the full length version of the theme song.
- 52:55This is your host, Michael Kennedy.
- 52:57Thanks so much for listening.
- 52:59I really appreciate it.
- 53:00Smix, let's get out of here.
- 53:02Stay tuned.
- 53:24you
- 53:24you
- 53:25Thank you.