Caves of Qud with Brian Bucklew

5 Feb 2025 · 47 min

Ask about this episode

Ask anything about it. ChatGPT or Claude reads this page and answers with the times it was said.

Connect VO and ask about every podcast you hear, including the moments you saved. Add to ChatGPT · Add to Claude

In short

Podcast Notes: Caves of Qud with Brian Bucklew

Episode Overview

  • Podcast Title: Software Engineering Daily
  • Episode Title: Caves of Qud with Brian Bucklew
  • Release Date: February 5, 2025
  • Description:
  • Caves of Qud is a roguelike game set in a richly detailed, post-apocalyptic world blending science fiction and fantasy. Known for deep lore, emergent gameplay, and creative character customization, it has recently hit a major milestone with the release of version 1.0 after 15 years of development.

Key Participants

  • Brian Bucklew: Co-founder of Freehold Games, developer of Caves of Qud.
  • Joe Nash: Host and developer, educator with experience in various tech companies.

Brian Bucklew’s Journey into Game Development

  • Started coding in the 80s on an Apple IIc.
  • Early inspirations from playing games, typing in code from magazines to create simple games.
  • Self-taught programmer with no formal game design education available at the time.
  • A lifelong passion for roguelike games, heavily influenced by titles like Rogue.

Game Overview

Caves of Qud

  • Description:
  • A blend of science fiction and fantasy set in a post-apocalyptic world.
  • Features deep lore, emergent gameplay, and innovative character customization.
  • Development Journey:
  • Inspired by games like Dwarf Fortress and various RPGs.
  • Joined by co-founder Jason to develop a rich, lore-filled universe based on years of personal interest in science fiction and history.

Inspirations and Influences

  • Literary:
  • Notably influenced by Gene Wolfe's "Book of the New Sun".
  • Incorporation of themes from deep history and religion.
  • Game Mechanics:
  • Combination of handcrafted elements and procedural generation.
  • The game evolves in design sophistication as development progressed over the years.

Procedural Generation in Caves of Qud

  • Core Mechanics:
  • Emergent design through a combination of handcrafted and procedurally generated content.
  • Character customization allows for diverse play styles.
  • World and History Generation:
  • Unique approach recognizes that history is subjective and often retold through the lens of victors.
  • Uses narrative-driven design to create immersive experiences.
  • Terrain Generation:
  • Techniques such as the Wave Function Collapse algorithm are employed to generate engaging and varied environments.

Game Design Challenges

  • Managing a large codebase over a long development time.
  • Transitioning from a console application to using Unity for graphical representation.
  • Balancing the handcrafted and procedural elements to ensure a cohesive player experience.

Future Developments

  • Ongoing development of Caves of Qud, including potential expansions.
  • Plans to explore new game ideas while continuing to refine the existing title.
  • Consideration for mobile porting to adapt gameplay for a wider audience.

Key Takeaways

  • Game Development Philosophy:
  • Emphasis on blending narrative depth with innovative gameplay mechanics.
  • Recognition that procedural generation can be enhanced through careful design rather than relying solely on randomness.
  • Ongoing Evolution:
  • The game reflects the growth of its developers as they continue to learn and apply new technologies and design principles.
  • Community Engagement:
  • Open to feedback from players, which helps shape future updates and expansions.

Conclusion

Brian Bucklew's insights into the long and intricate development process of Caves of Qud provide remarkable perspectives on game design, procedural generation, and community engagement. The episode emphasizes the significance of blending narrative and mechanics while navigating the complexities of long-term game development.

Written by AI. May contain mistakes. Listen to the episode to check what was said.

Hear the part that matters, and keep it.Open this episode in VO. Double tap your headphones to save a moment as you listen.
Get VO free

Transcript

Automatic transcript. May contain errors.

0:00Caves of Kud is a roguelike game set in a richly detailed, post-apocalyptic world, blending science fiction and fantasy. The game is known for its deep lore, emergent gameplay, and wildly creative character customization. It is a massive indie success and recently hit a major milestone with the release of version 1.0 after 15 years of development. Brian Bucklew is the co-founder of Freehold Games, which develops Caves of Cud. Brian joins the show to talk about his engineering background and the development of his game. Joe Nash is a developer, educator, and award-winning community builder who has worked at companies including GitHub, Twilio, Unity, and PayPal.

0:41Joe got his start in software development by creating mods and running servers for Garry's Mod, and game development remains his favorite way to experience and explore new technologies and concepts.

1:04Brian, welcome to the show. How are you doing today? Hey, I'm doing fine. Nice to be here. Awesome. So before we get into Card, which as we mentioned covers a lot of time, what was your journey into game development? What led up to the entry into the caves? Oh boy, I guess I got started in the 80s. My father was in a software engineering class, ended up in nursing, but at the time was in college. And for that class had an Apple IIc in the house. And so I got started on Apple IIc Basic, just really wanting to play games, right? We had like an Atari 2600 in the house and we had an Apple IIc in the house.

1:43And I was, you know, seven or eight years old. And at the time you had like bite and nibble magazines. So I got, I got started just printing stuff like everybody did at the time, right? Like you could print little text-based games. So my first games were real simple text-based games, right? You know, whatever, choose your number stuff and little terribly engineered adventure games. And in Bite and Nibble magazine at the time, you can go in the back and they would have whole video game programs just in text that you could type in, right? Like that, you couldn't download anything from anywhere unless you were really advanced at the time.

2:20And so you could type in these kind of pretty cool little like asteroid clones and Space Invader clones and I got started from there I sort of self-taught up through today I right like there's no real I guess nowadays there are places you can go to learn video games but at the time when I grew up there was not right there was eventually like game developer magazine but it was just a thing you figured out on your own or not at all and so that's sort of what I did that's awesome Yeah, it's especially funny to hear, I don't know, I think you play in a genre of video games where there is like things that are, I don't want to say harder to learn, but like there's a lot of like, as we'll get into with some of your proc gen algorithms, there's some like esoterica there that I don't think I've seen covered elsewhere.

3:06So I think you definitely a lot of forging your own path there, which is very cool. so obviously we're talking about caves occurred which i've been having a lot of fun with in this holiday break i have a little bit of trouble telling people what this game is about coming from like the dwarf fortress fandom that's very much my lens but how would you describe the game sure i think i mean someone from a dwarf fortress fandom is coming from a place where we were at when we were working on the game dwarf fortress released sort of in the time when we were very early in working on the game and it was a big inspiration but again my history with video games goes pretty far back, not as far back as it goes, but, you know, Apple IIc, TRS-80 games that were often really simple games.

3:47I grew up in a Seventh-day Adventist household, like on church grounds. And so the only video game I could play was, I wish I could find it now. Maybe somebody on the podcast can tell me what it is, but it was basically a roguelike exploration game about Bible trivia, where you were Moses, you know, like traveling from Egypt to Canaan through like a really simple text-based terrain of carrots and ASCII signs, right? But it was clearly Rogue-inspired even at that time. And so I would play that all Saturday, this little Moses Roguelike. And of course, I played Rogue growing up out in the hills in West Virginia, where the only thing was like an 8086 that could only play Rogue back in the days where you would pick up software at like cam radio conventions, right?

4:32Like we got Rogue. I remember my uncle, I must have been 11. We went to a ham radio convention and bought a bunch of like bootleg software on floppy disks from a ham radio guy that had them in a cardboard box beside the ham radio, right? And got some stuff that could play on the computer. One of those games was Rogue. And of course, I was completely infatuated having never heard of it and stumbling into Rogue at like 11 years old. And so Jason and I have played these games sort of our whole life. We've known each other since we were 13 or 14 and been playing these games. And so we've played roguelikes like Ragnarok.

5:08I really liked Omega. Jason was big into like a PVP text-paced mud in the 90s called Rites of Passage. So this was like the preliminary multiplayer MMO ganking, but sort of in text, you would type really fast because you would have to fight in real time with a text-paced terminal. And so we've had kind of a strange non-modern route through video games, though of course we You play the modern stuff, too. And you see those influences in Caves of Cut, right? Like Rogue. And you'll see like the ASCII coloring is all stuff pulled from muds more than Roguelikes. And so those a lot of what Caves of Cut is, I think, is sort of a hauntological experiment in video games that it feels like what I thought a video game would be like in 40 years rather than what they actually ended up being in like 1988.

5:56Right. Like, what could a video game be in 40 years? Oh, like this, like Caves of Cut. Of course, video games are like this. now, right? But they could be. So it's not trying to recapitulate the experience. Games weren't like this in 1980, right? There are aspects of them. But what would happen if you kept trying to make games like this, right, from 1983 in the same kind of format, but took some of the modern cues in terms of UI design, you don't lose the density, you know, you don't try to go into 3D representational graphics you sit in the space of really using the player's imagination a lot but you can still play it with gamepad right what would that look like and caves of cut is sort of that experiment i think that's an incredible description of it yeah hontological exploration of gameplay is amazing also i'm not going to be able to get over moses roguelike if you are listening and you know what that is please write i really don't know what it was i would love to know exactly what the title of that game is i've tried to find it and i just can't it was obviously like somebody probably my step-grandfather found it in some church exchange and got it on my so it's probably like 80 people played it and it was programmed by somebody in the church right what an incredible fact that would be we need to get our hands on it yeah i think that's a very vivid description of it you mentioned some inspirations left on the video game side i think this was actually something i only found out today immediately before this interview is that it's also inspired by well i mean you've got lots of literary inspirations but one of them being the work of gene wolf and to the book of the new sun, which is possibly one of my favorite series of books.

7:26So I was like literally squirmed with joy. And I was like, oh, now so much makes sense. This is obviously a reason why I love this work. Can you talk a little bit about, I guess, like the world building and the law side of it? Oh, sure. That's a huge question. And a lot of that question is for Jason too, right? Jason does all of the amazing writing, right? Like my contribution to the literary side is like a couple of bare puns, though I appreciate it deeply, right? Like I'm very glad to be part of this team that includes the literary writer. Both of us are sort of broad-ranging nerds and always have been, and Cut is an expression of that.

7:57Gene Wolfe is kind of a post-launch inspiration. We were pretty deep into building Cut when Jason discovered Book of the New Sun. I was like, you have to read this book. And it turns out when you go at sci-fantasy with a particular set of influences and interests, right, like religious interests and interests in deep history I think we shared with Gene Wolfe, you kind of end up tumbling down some of the same caves, right? And so it looks a lot like Gene Wolfe, though we weren't trying to duplicate it. He just had long before, you know, spelunked these caves and we were like stumbling on his old campfires going deeper into this particular earth.

8:36Both of us have long histories of being interested in like physics and human history human you know like just the deep history of the world and literature in general sort of both bored rovers of information and rather than just playing video games right we took a pretty broad sort of like add inspired exploration of human history and stuck it in the game yeah i mean you mentioned some of the caves i guess like i think one of the big things that really rung true to me about that and the path you trod before is like you know going through certain in-game locations and just trying to think like okay what was the purpose of this place like before the collapse like the rust wells i think about a lot and like that's like it was a big thing and a big like reveal moment in the new suns i could definitely see those casewell tron so i guess into the game and it's the tech part and into the mechanics of it so you know broadly plays out as an rpg but has these really deep simulation elements or at least that's some of the things that stick out to me as coming from your fortress.

9:39But obviously also a mix of handcrafted, not everything is procedurally generated. Can you talk about the mix of what is handcrafted, what is simulation in the game, and where those two things overlap? Yeah, so a couple of the games that were big inspirations, one of the things about layering in Caves of Kud is that you're playing through not only a designed set of layering with respect to the world generation, but also a sort of layering of our sensibilities as game designers, because the earliest parts of CUD that you play through, we built in our mid-20s. And the latest piece, when you go up to the final endgame, we built in our 40s.

10:18And that's a huge amount of time as human beings to develop our sensibilities and our capabilities. And so when you play through the layering, we did eventually go back and redo Red Rock and redo Rust Wells with a modern sensibility because they were just so early if you go back a couple years in game versions and play that it didn't feel like the same game, basically. So at the very beginning of this journey, right, we're really building intuitively. We do not know why we're designing a game the way it is. We only know that these games are games that we enjoy. And some of those games were games like Omega and games like Adam, and they had some handcrafted elements and they had some procedural elements.

11:01I think intuitively we were also big fans of games like Morrowind and Skyrim and the Elder Scrolls one and that set of games, Elder Scrolls one, Daggerfall, right? Like those games had explored a procedural space as well. Elder Scrolls one, if you haven't played it, is a really, really interesting game that's built out of volumetric blocks that you can actually just fully destroy. You can go into these dungeons that are procedurally generated and just like blow through the walls in a way that they never really returned to, but it had heavy procedural elements. And so I think we had in the cauldron of intuitions, these games that were successfully pairing these handwritten pieces and these procedural elements.

11:45And we just kind of jumped in and said, well, we're going to do a similar thing. We have this world. We had been building a big sci-fantasy world, me and Jason, the background for it, for different kind of game, for like a web game, for like a tabletop RPG. And at the same time, since the 90s, I had been building these roguelike engines, like just full of vim and hubris thinking I could do a big contiguous open world. Why was that going to be fun to play? I wasn't thinking that at the time. I was just thinking, oh, I like, look at Adam. It's just like, it's chunked up into pages. And I bet I could just do a paginated world that's infinitely big and you'll be able to explore it and I can do that.

12:23And so I've been trying to do that in like C++ for years and kind of failing. I have a talk out there about the data-driven engines, which is good to watch if you want to watch a little bit deeper into that history of failure. But like classic object hierarchies just don't really work when you're trying to, you know, like it's fine if you want to make a sword and a shield. But as soon as you want to make like a sword shield, well, you're like classic inheritance hierarchy just fails. Right. And this is a big problem in like 1997 when, you know, everyone was like very firmly attached to object hierarchies and object oriented programming.

13:02And it was the stuff that's pretty common now with respect to compositional programming just didn't exist. So I had been struggling with this for a few years, and the Dungeon Siege team, in particular Scott Billis, released some papers about a tool called Fubi and the engineering behind Dungeon Siege. And they took an approach, which they called ECS. And this is a point of confusion because there's a modern programming technique that's basically an optimization technique called ECS, which is not what I'm talking about when I talk about ECS. And there isn't really a good term for what I'm talking about.

13:39But what I'm talking about is that they used a compositional pattern for creating these game objects instead of an inheritance pattern. So you could have an empty game object that did nothing, right? And you could say, well, it's a liquid volume. Oh, it's a shield. It's a sword. It's a piece of armor. And you could composite those behaviors together, and they would relate to one another with an event-based structure, right? Rather than a functional hierarchy, a virtual call hierarchy. and that really blew open the gates. I was like, oh, this is cool. I'm going to try this and I'm going to try this and I'm going to learn.NET.

14:16I was working as an enterprise software architect and I was like, well, I have to learn.NET for what this is,.NET 2.0, like.NET Framework 2.0 is coming out in 2005, 2006. I'm like, let me try this. And so I was experimenting with this. Frankly, at the same time, the Unity is experimenting with it. If you look inside of CUD and inside of Unity, they take a compositional approach which I think was driven by the same papers because I was building the cut engine at the exact same time the unity was being built using.NET, using this compositional system. It ended up being very effective. Of course, cut still runs on it.

14:48And you can see how far it's gotten and you're able to build complex structures with a sort of linear growth of complexity for maintenance rather than exponential growth. So that now you can have 100 ,000 objects and it's in instead of, you know, 100 billion. in, right? Which I think a lot of these traditional roguelikes like NetHack run into problems with long-term maintenance because they're in old styles that have the exponential complexity growth. And so I'd been building these engines. I didn't know what game I was making. I was an engineer. I'm like, I'm just making this engine and it's going to be cool.

15:19And I'm going to do like, I guess the most basic fantasy roguelike of all time on it for whatever reason. But at the same time, Jason and I were building this sci-fantasy world. And at some point we were like literally sitting in my garage and said, what if we try taking some of these tabletop influences? Because we were big tabletop gamers, like Rifts and Gamma World. And this fantasy world, which is much bigger than Kud, right? This Psy Fantasy World, Kud was a little corner of it. We said, well, let's find a place in the Psy Fantasy World that fits the sort of genre of Rifts and Gamma World and see what happens when you put it in this roguelike.

15:55And so we came in with a bunch of hand-built content from this world that we wanted to get in there right and a roguelike engine that was trying to be random and said well what happens when we ball it up be fun like what happens when you try to play a rifts or a gamber world roguelike no one knows right we think it could be fun but you know whatever 20 years later it's pretty good yeah yeah absolutely it is definitely pretty good the whole emergent like the length of time of development of this game is like and you know obviously how that has boiled out into how it was built and the layers of it is really interesting i definitely want to talk about you know how you kept the code base manager with that time with all the shifting you know stopping things from bit rotting is an endless struggle on year timescales let alone decade timescales i definitely want to get to that but still the simulation stuff for a moment so one of the i guess there's a bunch of systems that are very clearly simulated in the game i think are really interesting and one of which you wrote an ACM paper on with your co-founder, which delighted me.

16:52Particularly some of the quotes in the abstract are already incredible. So I want to talk a little bit about history, because that's a big part of Cudd. I think one of your lines about it in the press kit is, it plays a chisel through the layer cake of a form of civilization, which is fantastic. But in particular, I think one of the things you mentioned in your... The first thing that gripped me about your description of how you're approaching history generation, was that you're approaching it with the recognition that history is written by the victor and like you know you've also got to deal with okay it's not just a retelling of these facts we're not just generating facts we're generating the telling so can you talk a little bit about that and how you approach that problem well i think people treat history like objective non-fiction and in fact the way a lot of games generate their worlds and this is i'm not knocking anyone for this i'm just trying to explore the space is that the way a lot of games that use a procedural volume of world building is an objective one where you say, oh, I'm really going to simulate sort of at the atomic level, the objective history that happens.

17:55And the fact is that the history that you engage in every day isn't like that. It's a completely subjective retelling that's much, much closer to fiction than any kind of objective telling. And you can realize this when you think about like, try to tell me what happened to you and your closest circle of 20 friends over the last year. You could never do it, right? Like it's impossible. You just start pulling out these symbolic themes about how people act, right? And when you try to do that over 2000 years for all people, it's just made up, right? And so one of the things, again, I think intuitively at first, but later very deliberately that we wanted to do was not simulate an objective atomic clockwork behind the scenes, but rather simulate the kind of subjective contextualization that happens.

18:52And this makes people very angry, right? This really like gets at people at the core. They're like, oh, there's nothing going on here. This is just, you know, Markov chain garbage, right? This isn't like a real generator or a real history. And I think they're reacting to the kind of facade of truth that history gets for us, that this is the way things really happened, right? We can put a hundred years of history in this 500 page textbook and you'll totally get what all these people were doing, right? When in fact, what happens is like almost immediately, everything that happens, it's done by a thousand people is collapsed to a single person, right?

19:27Even in this conversation, right? Like the work done by me and Jason is collapsed to talking to me, right? Very quickly, right? Like, oh, well, which of this was done by Jason? Which of this thinking was done by me? Well, it's a media collapse to you're talking to Brian and all the viewers are like, oh, Brian, the creator of Caves of Cud, right? And there's just nothing you can do about it. It's the way the human brain parses the world, right? And so we engineered a bit of that context collapse to say, well, we know we have some things that are happening in history. Why did this like cat sultan invade this city?

20:00Well, there's probably, if you really got down and tried to simulate it at the molecular level, there's probably a lot of reasons, including like she just didn't like the way the hills looked, right? But those are never recorded in history. So you might as well just pick a reason, right? Which fits the sultan. Because, well, we know that she didn't like frogs, right? And there was a frog person in the city. So probably she had destroyed the city because there was a frog king in it, right? And so what we do is we do a lot of the kind of reverse psychology of historical actors that real historians do in trying to figure out why people, each person is like as complex as the universe.

20:39Why are they taking these actions? Well, it's probably because of some like very obvious reason that had nothing to do with their actual actions. And that's what's happening here. When we generate the history, we say, okay, well, we have a concrete action that happened here. We know that a city was sacked. What are historians going to say about the rationale? And it frankly doesn't matter why they did this, right? Either way, the city is destroyed. And so we thread that rationale back into some context that we have from that sultan. And that's actually true both engineering-wise, as it is sort of like when you're reading it, we build these contexts for the sultans that say, well, the sultan hates this person and loves this person and is married to this.

21:23And then we have systems that will take, for instance, a quest, like a dynamic quest for a city that's like, oh, you have to go get an object for a reason, right? And those are kind of blank. We don't fill those in purely randomly. We take a village context. And the village context has a bunch of information that says like, oh, they really love these kind of objects, and they hate these kind of objects, and they love this village and they hate this village and they have immigrants from this other village, right? So it's a little box of context. And what we do when we generate these quests is we have a template and it has a bunch of blanks and we attach that context to it, right?

22:00And we sort of suck the blanks out of the context. So it always makes sense in the context of the village, right? But we've sort of built the template completely devoid of the context of the village. They just, they want something from somewhere for some reason, right? And those come out of the, sometimes you can't find a match And then you do make up something completely at random. But that then becomes part of the context. Oh, they don't have an object they love. Well, we need one. Now the village loves rats or whatever, right? Like magic flutes or very comfortable beds, right? Oh, well, that's cool.

22:29That now go sleep in the very comfortable bed. But now we have a new piece of context. The village loves very comfortable beds. That didn't come from a simulation, right? There wasn't like some immigrant that really loved comfortable beds. But the truth is that there's no real difference in the plate experience, right? And often history is like that. We're like, well, why does your town have like a leopard mascot? Oh, well, we love leopards, right? Like nobody knows anymore. And it doesn't matter. It doesn't matter that it was like Jim in 1890 that like, I don't know, had a leopard like stuffed toy from somewhere.

23:05It just that's lost. It's deleted almost immediately from history, the true atomic reasons for actions. Oh, that's awesome. It's such a, yeah, I mean, very real. It's a very cool system. I think, yeah, particularly the difference in, and you explained this better in the paper than I'm going to quote now, or you explained it better just now than I'm going to quote now, but like the not bothering to generate the logic behind why the event happened and just focusing on the post rationale effort was really fantastic. So you touched on it a little bit there. But the other thing that, you know, upon reading about how you generate history and seeing a little bit of, I want to say Jason's GDC talk about village generation.

23:43When I first read the history paper, I was straight away like, well, how on earth do they then generate everything else? Because you've got these histories and these events. How do you go about layering these generation systems so that things are congruent and make sense? Again, you touched on a bit there about when you come to generate the village, you draw on the elements of history that exist and fit in with its properties. But can you talk a little bit more about that? There is a good GDC talk on this where we talk just for a whole hour on the layered process of generating just villages. And the truth is that this is very artisanal, depending on what exactly we're building and why we're trying to build it and what purpose it's serving for the game.

24:24Villages are a particularly interesting one, but the overall approach is sort of to start at a level of very high abstraction and reduce that abstraction by steps. So that we start with a very abstract village that just has some context, like we said. Oh, well, it's in the marshes. It was founded at a particular time and it like with a particular sultanate or whatever it is. the same thing for like a sultan historic dungeon it's from this sultan it has a particular set of cult members right we then fabricate the layout of the dungeon at a slightly less or city at a slightly less abstract level we say well it's part of these nine pair of sayings right like these nine screens worth of content and then next level abstraction is maybe well let's assign some flavored each square okay well maybe this one is agricultural content outskirts and this one is the village center right then we for the villages we run terrain generation algorithms which is a whole you know 10 hour aside how do you do each of these we're coming to wave function collapse don't worry yeah like they're mostly like layered noise and then we do some terrain analysis so i do I do a lot of like Dijkstra mapping where I just drop a bunch of individual seeds across the map and do basically which seed is each cell closest to, right?

25:54You get a nice compartmentalization there that you can control roughly the size. And then we say, okay, well, we got eight of these little cell grids. Maybe I can place those randomly, or maybe I can place those in an ordered way if I want the village to look a little more ordered. And I know each of these has at least, you know, 200 cells in them. So I'm going to put a little building in each of them. And now you look like you have a nice little building. Then between them, well, they need to walk. Well, okay, well, let's find the center of each building and let's path to some town square, right?

26:23Okay, well, now I've got footpaths. Let's find the edges where a road has come into the village and let's connect those to the center. Let's run a river through it and put a bridge if it passed through the road. Let's try to avoid the buildings when we do that. And so each of these steps is sort of increasing the concrete reality of the thing and reducing the level of abstraction where at the top, we don't know anything about where it is. In the middle, we know, oh, it's kind of in the center here. And we know there's a river passing from east to west. But we know exactly where that is. And by the end, you've got an object in every cell and you've got like people smoking hucas at the side of the village and whatever.

27:02But it's basically just an iterative process where each step is solving a little problem you have to get from abstract to concrete. I would say one way to think about it if you've never done procedural generation is that often like pixel shaders for complicated things work in the same kind of piecewise way. If you're a lot more people have built 3D renderer than they have a procedural generator, it's a very similar process where you have some output buffer that's going to, you know, like look like a sword. But how do you render that? It's often 20 or 30 passes, each one doing a particular thing that gets it a little closer to a concrete reality, right?

27:38where you're doing, okay, let's clear the background. Okay, let's do the Z-buffer for it, whatever that happens to be. But you're doing those kind of incremental passes that build up the result. Right, right, that makes total sense. That makes sense to the procedure generation. I guess one element that I was interested in, and this may turn out to not be that interesting, but is how that then interacts with the handcraft elements. So I think this first occurred to me, I had, and I know this is a fairly common experience, Argive getting sight of the mechanist in Joppa and just going crazy and murdering him.

Read the full transcript

28:07And then thinking about how that must be a, well, nightmare might not be the right word, but like how the generated politics interact with like locations where there are static quest people that like, you know, the things that don't change. Is that a problem? Like what are the boundaries between your handcrafted content and generated content and how do you manage those? It's on a location by location basis. So a lot of it's just about what kind of explicit second by second play experience we want in each place. We have very few explicitly handcrafted areas. They're often sort of chapter milestones, cities that you reach, or real climax set pieces that don't change from time to time.

28:53But everything in between sort of at the it's kind of a waveform, right, where you start very high in Joppa, right, which is completely handcrafted. We know everything that happens there and what's what's sort of where every box is going to be. Right. And by the time you're in between Joppa and trying to get to Gritgate, the next one, you're just out in the jungle somewhere and you're kind of at the bottom of the of the handcrafted. Any character is going to be having a different experience, having been lost in a canyon and stumbled under some ruins or lost in the jungle or exploring for some particular injector they need.

29:29And then you get to the sort of the next checkpoint and you've reached another high in Grit Gate where this is completely handcrafted. It's something you can look forward to that gives some structure to your experience for any character. but you don't really know for any character exactly what the route from Red Rock to Gritgate is going to be because there is that kind of nadir of generated material that we've still thought a lot about, right? Like we have an idea of the breadth of encounters you're going to have, but there's so much of it and they can intersect in so many ways that we are still often surprised at the kind of encounters that people have in that kind of low point of handcraftiness between the chapter set points.

30:10Yeah, that makes sense. Yeah, I mean, I'm often surprised. I feel like I've done a lot of runs now and then sometimes I'll do a run and I'm just like, that made absolutely no sense. That was wild. Okay, so we've already touched on this a bit and I know you said it could be 10 hours, so I don't want to push you on it too much. But when we're talking about terrain generation and particularly generation of, you know, given region, you mentioned, again, in one of the GDC talks, you mentioned a lot of techniques. So I was just like, okay, some of these are familiar to me. Wave function collapse was not familiar to me and seems to be a quantum thing but of course you then got to define it can you talk a little bit about wave function collapse and where this where this idea comes from and how you use it yeah wave function collapse isn't a technique invented by a developer maxim guman brilliant guy a brilliant mathematician it's basically a constraint solver it's a sort of very straightforward sort of i mean compared to like feeding the thing into a neural net or whatever, right?

31:04It's a pretty straightforward constraint solver that you give it a little pattern and it will take all the possible combinations of sort of input relationships in the pattern for a given subsquare and then sort of regurgitate that pattern at any scale and you can seed it. It's basically a texture synthesis algorithm. And there are quite a lot of texture synthesis algorithms. It's a particular one that has some really nice properties. It's fairly quick. It has fairly low memory overhead for if your input window is small. If you try to synthesize 20 by 20 blocks or whatever, it's not going to work.

31:40But at the time, it was a real leap forward because there weren't any commonly used procedural systems. There was a lot of use of noise, and there was a lot of use of tools like long tiles, which allow you to build little pieces that have matching edges and sort of put the blue edge versus the blue edge, and it fits. But there weren't any great commonly used mechanisms outside of like a few really smart people for saying, well, I want a dungeon that kind of has this character, but still, but at this scale and be able to have a designer be able to do that rather than a coder. just you can write the input mspaint for for wfc and so it's a really cool tool and it opened the world for me at least to the wider world of sort of texture synthesis and constraint constraint solvers that you can use to do this kind of development where you give it some kind of input that maybe someone who isn't technical can design right like you can go into mspaint and scribble a little dungeon say i kind of want this a bunch of narrow corridors with you know these little shapes and it'll generate a bigger replica of that.

32:45That isn't the same every time, but it's sort of locally the same. If you look at the little subunits of the output, they'll all be locally identical to a subunit of the input. But the broader output is not the same because it's just those subunits shuffled up. It's a neat technique. We use it a lot to generate ruin interiors, non-ordered ruin interiors, or cool structures inside of larger areas. It's not very good at non-symmetrical areas over large distances, right? If you say do this for the whole screen for a particular input, it'll kind of be samey across the whole screen because it's only, right, on the order of the input will be the order which feels samey even though it's not exactly the same.

33:31And so what we do is we generate higher level structures via other algorithms, space partitioning or whatever it is, laying down a bunch of random boxes, whatever, however you want to do it. we fill those in with wfc to give them each interior complexity and interests awesome so talking about the local units being similar i guess kind of brings me to the topic of perception of proc gen games and proc gen elements by by players and you know especially in the last god what's the timeline here i don't know two three years there's been some titles that have you know gotten put on the much they said it's kind of sine wave of like proc gen in favor progen out of favor but like the one of the perceptions i guess at the moment is swung back the other way in that you know these games tend to be very broad and very shallow in what they generate or how the how they're used how do you avoid you know some of the common pitfalls of these approaches in your work is it is it through combining those mechanisms like you said or i mean i'm not sure we do avoid them i think part of the way we like quote unquote avoid it is just by having worked on it for 20 years and so there's a lot there's a lot of stuff right so well yeah Yeah, the desert, each desert canyon is a little samey.

34:39We just have built so much garbage for the game that it's easy to stumble around seeing new garbage for a very long time on any practical human timescale, right? I think it's a really interesting time for procedural systems because kind of procedural systems have gone from a curiosity to kind of like one of the apex problems of human civilization right now as procedural generative systems kind of just rip apart the static reality that we have on the internet and start like just pumping it full of generative garbage, right? I'm not a huge AI proponent in the context of generative AI. And so we've done some things recently.

35:21We had our random books used to just be Markov chains, which are sort of very, very simple versions of attentional transformers, right? But they produce kind of locally coherent, but not globally coherent text output that's funny to read sometimes. But in the modern era, very quickly within the last two years, the vibe of those books changed a lot because it's like really that kind of text gibberish is like directly damaging our everyday experience as human beings and so we were like we kind of like don't like these as much anymore and so we pulled that back a little bit so that now when you read those books you get like one sentence snippet which is still random but at least like doesn't feel like you're you're just slamming directly into an LLM's output because you have fairly unsophisticated people going like oh why don't you just generate these with llms right and it's like really really painful to feel those comments right yeah i think there's still this is not an original thought at all but there's definitely still a charm to like older methods of text generation lms like markov chain output especially gets like often gets a giggle out of me that i don't know way in a way that like lms sometimes feel quite soulless yeah yeah no i mean that's like all these generative ai right yeah Yeah, exactly.

36:35Speaking of the timescale, and so this was something that fascinates me about whenever we have a guest who's worked on something, especially in a smallish team for a long time, I'm always fascinated about how you keep the project workable because I feel like I would be rebasing everything every other year. How has the game changed in the 20 or 15 years technologically and how have you kept it as a workable project? The short answer is at this point, we're all very old, very experienced engineers. Everybody on the team is just ancient and extremely good, which helps a lot. And essentially everybody that's contributing to the code has a lot of experience building projects, big projects.

37:18So Jason was a technical writer at Salesforce before coming on, I was a principal engineer at Dell, having previously founded a tech startup, ScriptLogic, in like 1998. Maybe somebody on the... I live in a world where nobody in my entire sphere in games would know what ScriptLogic is, right? But somebody on the podcast might be like, oh, this is the place. I made Desktop Authority and Caves of Cud. So there will be one person on this podcast that's like, whoa, I love Desktop Authority and Caves of Cud. And so I have a lot of experience running Teams, having been the technical co-founder of ScriptLogic and having grown that company from me and the co-founder to Dell.

38:04Jason has a lot of experience in Teams. Our other developers are also experienced software developers. So we don't have to train anybody to sit down and scrum and put together stories and write design specs. And we do all that. And we have done all that by the time I started. I started Caves of Kud in the year that I sold the first startup to Quest. So by the time Caves of Kud was started, I was already a relatively mature engineering manager and had lived through the development of Agile and everyone loving Agile and hating Agile and realizing, oh, it's cool. It just means to plan what you're going to do.

38:47And so we've been doing that since the beginning. In that context, CUD grew from a raw.NET 2.0 console app. So it was a true console app. I had to learn.NET, but I just, I really didn't like enterprise software engineering. It was something I did because you have to live in capitalism. It was fine, but it was never really a passion. So I was like, well, what can I do to really learn.NET? It's like, well, what if I try this roguelike engine that I've been trying to make and failing in C++ for like a decade. I'm going to do it in.NET and have it be a console output. That's fun. That'll get me to sit down and actually learn.NET.

39:23And so I did that in the evenings. And eventually it was like, well, the console isn't working for a few reasons and we want to give it a bitmap font. So it was a.NET. I have a 3.5 app with OpenGL rendered bitmap fonts. and then Jason and I were like well we kind of want to do games for a living and so we did and I took the engine and I guess what we did is we made a Sproggywood which is a little mobile roguelike and it was successful enough to have Steam say yeah you can put CUD on Steam without going through Greenlight which was the process at that point we were like oh cool we'll sell like 100 copies and it'll fund like some music for it or something and so I said well let me try porting this into Unity.

40:09And so what I did is I took this raw.net app that was still running in a console. I said, let me try. I don't know if this is going to work, but I'm going to run it in a second thread. The whole game, this game was maybe 500 ,000 lines of code at this point. I'm going to put that on a thread and I'm going to have Unity do the UI. And it still runs like that. This was very painful at the start of the journey because is Unity couldn't profile across several threads. I was one of the main drivers, me just complaining to their performance team that I couldn't profile Caves of Cut. I had to write separate tools because their profiler couldn't see non-app threads.

40:46At first, their garbage collector wouldn't collect garbage generated on separate.NET threads. And so it was a whole journey in Unity, though it works quite well now. But basically, my threads, or the game still runs on the second thread, waiting on getches, like waiting on on shimmed keyboard input, emitting console output, which is now quite a bit different than it used to be. But it's still essentially just writing like emitting these screen buffers and saying this is your frame for the console. And it ends up being really nice recently. Like Unity had a big flare up and I said, well, that really irritated me.

41:24So I wonder how hard it would be to demo Godot. And I know that the main game runs on a second thread. So I wonder if I can showboat a little and just in public port it to GoDot over a weekend. Maybe. I was not certain that it would work. But I was like, if it works, it's going to be epic. So let me try to do it. And I did actually successfully rip that whole, I mean, it's 500 or 600 ,000 lines still. I ripped that whole thread out, tore Unity off of it, and stuck a GoDot on top of it running in.NET and got the core game thread to boot and start emitting console buffers, right? And so it's really like you should probably build it that way, though.

42:02Nobody actually does because it's so much work. But I backed into the complete separation of presentation and game logic there. It's not perfect by any means. It's very, very complicated, but it does work pretty well. And it does give us some portability if Unity ever, ever has a problem. We really can go. We could we could build our own front and forward if we wanted to. Then maybe we will someday, though. Right now, I think Unity is on a relatively good path. It seems like they are compared to where they were, you know, two or three years ago. Yeah, absolutely. We've come a long way since the implosion.

42:33But yeah, watching you port that, you, you know, live tweeted a lot of it. It was incredible to port. And I had a question here about how that was technically feasible because there was obviously some separation going on and lots of observing where like, well, this is happening very quick. How is the engine interaction here? So it's awesome to hear how that worked. So that's kind of getting towards the end of my bulk questions. I guess two more to wrap up. obviously i have to ask when you come to make a new caves of card character what is your favorite starting build i either play a true can tinker so i often just play random characters just because i like that vibe and i'm experienced enough at doing that and that's just how i play games anyway i just sort of like to play with what i'm given but when i pick one i either play a true a really basic true can tinker just because i i don't want to mess around with the systems and i want to like hit things with my club, where I play a mutant with all unstable genomes so that it's like an advanced random character.

43:32Unstable genome is a kind of strange little design. It serves a bunch of purposes, but it lets you, it basically every level you have a chance for one of the unstable genomes to become a mutation and it costs three points, but you might get a four point mutation out of it. So it's a little better than taking those mutations. And it means you have to sort of grow into your character which will be on average a little more powerful than a character that you get the mutations to start with and that really serves serves my my own desire to just sort of play hand i'm dealt yeah and enjoy it maximizing randomness in a positive way and then totally understand if the answer to this is no idea yet but you know now that cut is 1.0 and in fact 1.1 i believe or 1.01 what is next for freehold and or cut and cud or otherwise well launch went pretty well.

44:19I think that that means that CUD will continue to be developed. We do have other games we want to make. We made one of them kind of in the middle of CUD. So I think we have a lot of games we're interested in making. And so one of the things we want to do is sit down and really decide which of those we're really going to pick off and explore. And that probably means some prototyping. But we will be doing that. We will be continuing to develop CUD, which will get expansion releases. We have, I don't know, another 85 years or something of those in buckets now. And we don't know exactly what that'll look like, whether that'll be free or paid and what the timeline will be.

44:57We got to figure that out. And we will be porting, which will be a lot of my actual grunt work over the next probably three years. I don't know how long it'll take. It's still largely me doing the porting. Maybe we'll bring on some porters to help. But we definitely even go to mobile. I've had it running on mobile for years. So technically it works. Yeah, I can pull it up on my phone and have since like 2017. Unity makes that fairly straightforward. I'm fascinated by the UI. Well, the UI is the challenging part, right? It's not a technical problem. It's a UI problem. But you can look at like DCSS has a mobile port that works.

45:33Shattered Pixel Dungeon works quite well. So it'll be a real tricky challenge, probably the hardest UI I've built so far. But on the other hand, people said that about putting it on a gamepad. And I think it works on a gamepad quite well. And so like, I'm pretty optimistic. I have some preliminary designs for mobile that I think it's actually going to work and people are going to be like, wow, I can't believe it works on my phone in portrait mode or whatever, right? Like, so we'll see how it goes. That really encourages me. I've been putting off doing Steam Deck mostly because I like the keyboard drivenness so much.

46:05But hearing your finger bringing the mobile, well, I might have to give Steve Duck a go. We spent quite a lot of time. We moved from basic input to rewired to Unity's new input system. And it was a very painful move to eventually get to where we are. But we do now fully support GamePad. And a lot of people who played keyboard and mouse now say that they play GamePad and can't go back to keyboard and mouse just because it's so nice to sit back with the GamePad. So if you're holding off because Caves of Cut is, Caves of Cut is hard to play, but it doesn't, it's not like, it doesn't have to be physically painful to hunch over your keyboard to play.

46:37It actually doesn't play quite nice on your Steam Deck or like just chilling on your couch, casting your Steam Deck to your TV. Works really good. Awesome. Well, that's going to fill up the rest of my time until the new year. Brian, thank you so much for your time today. It's been wonderful. Thanks. It was a nice chat.

47:05Thank you.

From the publisher

Caves of Qud is a roguelike game set in a richly detailed, post-apocalyptic world blending science fiction and fantasy. The game is known for its deep lore, emergent gameplay, and wildly creative character customization. It is a massive indie success, and recently hit a major milestone with the release of version 1.0 after 15 years

The post Caves of Qud with Brian Bucklew appeared first on Software Engineering Daily.

More from Software Engineering Daily

All 195 episodes
Caves of Qud with Brian BucklewSoftware Engineering Daily · 47 min
Listen in VO