How to Make a Roguelike

Oct. 29, 2018
protect

I’ve always wanted to put together a comprehensive primer on how to make a roguelike, something that could hopefully be inspiring while including both general and specific advice. This year’s Roguelike Celebration seemed like the perfect opportunity to force myself to do that after having put it off for so long, so I gave a 30-minute talk on the subject.

I’ve got a fair bit of experience to draw from, having exclusively worked with the genre for the past seven years (Cogmind, Cogmind 7DRL, POLYBOT-7, REXPaint, X@COM), made it my full-time job for the past five, and over these years also helped build r/RoguelikeDev into the largest community of roguelike developers on the net.

The “How to Make a Roguelike” talk is available in video form below, but this article serves as a text version of that same talk for those who’d prefer a readable format, or to just take a closer look at the many images ;)

<iframe title="Embedded content" src="https://www.youtube.com/embed/jviNpRGuCIU?enablejsapi=1&amp;origin=https%3A%2F%2Fwww.gamedeveloper.com" height="315px" width="100%" allowfullscreen="" data-testid="iframe-video" loading="lazy" class="optanon-category-C0004 ot-vscat-C0004 " data-gtm-yt-inspected-91172384_163="true" id="287526216" data-gtm-yt-inspected-91172384_165="true" data-gtm-yt-inspected-113="true"></iframe>

Intro

A couple years ago at the first Roguelike Celebration I did a talk about how I became a developer, but this time I wanted to talk about how anyone can go about making their own roguelike. It’s pretty common for roguelike players to at least dabble in development. We’re inspired by the games we play and want to make something better, something different, or just something of our own. My talk definitely isn’t a tutorial, it’s more about how to get started and general advice to help you along the way.

roguecel2018_how_to_make_a_roguelike_title

"How to Make a Roguelike" - Title Slide


Making a roguelike can be pretty tough, not unlike journeying through a dungeon full of obstacles. In the diagram below, that’s you at the bottom starting out your journey. At the top is your target: a fun playable game.

Making a roguelike can be pretty tough, not unlike journeying through a dungeon full of obstacles. In the diagram below, that’s you at the bottom starting out your journey. At the top is your target: a fun playable game.

mapgen_ready

"How to Make a Roguelike" - Preparing to start...


Ready, set, @!

It’s very easy for your path to end up like this, wildly developing in every which direction as you try to add every system you’re thinking of without a clear overall path:

mapgen_indirect

"How to Make a Roguelike" - Not the way to do it


Indirectly approaching your goal. One day… (This is an animation--open the image separately to see its process from the start.)

Yes you might finish and barely reach your goal, but at what cost? Maybe years of wasted effort and all of your hair :P. On the way it’s more likely you’ll develop yourself into too many difficult corners then get stuck, demoralized, and quit.

What you need to do is make a beeline for your target. With a basic plan and understanding of where to go, you can start with strong fundamentals and then, when you have that fun core game, expand on it all you want!

mapgen_direct

"How to Make a Roguelike" - Make a beeline for your target


Head straight for the goal first and start with strong fundamentals. (This is an animation--open the image separately to see its process from the start.)

In this article I’ll mostly be covering the fundamentals, how to travel through this dungeon with a greater chance of success, especially when you’re just starting out and full of enthusiasm, but also aren’t sure how to proceed.

General table of contents:

  • Language

  • Scope

  • Core Mechanics

  • 7DRL

  • Resources

  • Hooks

  • Tips

Note that although this is an intro on how to start making a roguelike, it does not include how to stop making that roguelike. You’re on your own there ;)

Language

Let’s start by getting what is always the first and most common question out of the way: What language to use.

The answer is easy: Anything.

The slightly longer answer is that it doesn’t really matter a whole lot. If you already have experience with some language then that’s great, go ahead and use it. Language is a means to an end, and people have used just about every language to create a roguelike before.

Now that’s not to say there aren’t some easier options if you’re just starting out, so if you’re not sure then I’ll help you with a suggestion:

python_libtcod_tutorial_sample

"How to Make a Roguelike" - Python sample


Sample python code from the libtcod tutorial.

Python is often recommended for first-time roguelike developers because it’s pretty simple and straightforward to work with. Just look at that code. There’s not a whole lot of weird syntax, and if you don’t even know programming or python you can probably still figure out most of what’s going on here.

But don’t worry about “simple” being a limiting factor, as you can still do great things with python.

python_roguelike_ultima_ratio_regum

"How to Make a Roguelike" - Python game: Ultima Ratio Regum


Ultima Ratio Regum is written in python, and it’s a beautiful and massive open world project which isn’t complete but nonetheless already incredibly impressive.

 

python_roguelike_temple_of_torment

"How to Make a Roguelike" - Python game: Temple of Torment


Temple of Torment is another expansive and complete fantasy roguelike written in python.

There are literally hundreds of python roguelikes out there. All said you’ll have a smoother ride if you start with python, and we’ll come back to how to get started with it later on.

programming_languages_used_in_roguelikes

"How to Make a Roguelike" - Some progamming languages used in roguelike development


A sampling of programming languages used by roguelike developers.

More complex languages like C and C++ are good in that they’ve been popular for ages, meaning you’ll find numerous relevant resources and references out there. C++ is what I use, but that’s only because I was familiar with it to begin with. I wouldn’t recommend it for beginners, especially if your goal is to make a roguelike rather than spend all your time debugging! You’ll find a lot of other devs using python anyway, so you’ll still have access to plenty of resources.

Scope

Another issue that comes up often among new developers is that of building your “dream roguelike.” Should that be your first goal? Almost certainly not!

At first you’ll be learning a lot, making mistakes you don’t even realize yet, so it’s best to build up some experience first. More importantly, the focus of game development really changes from beginning to end, so it’s best to go through the entire process at least once or twice before starting larger serious projects. Keeping your scope small at first is also the best way to ensure you’ll actually have a complete something to show for your efforts.

Taking our dev map from earlier, that main path is what you need to focus on:

mapgen_stages_1

"How to Make a Roguelike" - Fundamentals


Main development path purely covering a sampling of required features (note that I tend to let “combat” carry a question mark because roguelikes do not necessarily involve combat!).

It can be both a complete game and a stable foundation on which to build more. All those other areas out there to explore are tempting, but try not to get drawn too far away from the main path early on. It’s like playing a roguelike: If you start by blindly running around in the unknown doing only what you feel like doing rather than what you probably should be doing, unless the RNG is totally on your side you’re probably going to die out there somewhere. Repeatedly. Sure this can be a fun way to play around, but building a roguelike is a different story and a bigger investment of time, so try to stay focused.

The cool thing is you can build roguelikes piecemeal. They’re basically a conglomeration of systems that can be tacked on if you think they’ll support the main game.

mapgen_stages_2

"How to Make a Roguelike" - Fundamentals w/additional systems added piecemeal


Building onto your roguelike core, piecemeal style.

After that you can just repeatedly expand and iterate, hopefully with player feedback.

mapgen_stages_3

"How to Make a Roguelike" - Fundamentals w/additional systems added piecemeal


JikGuard.com, a high-tech security service provider focusing on game protection and anti-cheat, is committed to helping game companies solve the problem of cheats and hacks, and providing deeply integrated encryption protection solutions for games.

Read More>>