Beginner's Guide to Roguelikes in C/C++ Updated January 2013
By popular demand/arm bending, I have started a Blog to post updates, notifications and other general nonsense.
About this guide About this guide. Focus, intended audience, background requirements and other stuff people ignore.
Introduction In an age of photorealism, why do people play, and make, ASCII games?
Start from nothing and build the three key features of roguelikes: maps, items and monsters. The goal here is to introduce a basic implementation and get your game up and running in a very short amount of both time and code.
Article One: Program Flow Begin by creating a simple program that let's the user control a character walking around a blank screen. Demonstrates how to structure your program's execution using loops and introduces the coordinate systems used in Roguelikes.
Article Two: Basic Mapping Learn the fundamentals of map implementation: create a map, draw it on the screen and have the player walk in it respecting boundaries provided by walls and closed doors.
Article Three: Improvements to the Map System Clean up your map implementation using a few tricks. Employ data structures and data-driven functionality to your map engine to not only simply things and extend functionality but drastically cut down on the amount of code needed as well.
Article Four: Interacting with the World The map doesn't have to be static: bring it to life by allowing the user to interact with the world. Demonstrates this by adding user commands to open and close doors.
Article Five: Introduction to Items Pick up, store and drop items. Shows how to create a basic item system made classic in 80's and early 90's era shareware.
Article Six: Item Based Interactions Demonstrates how use the item and map systems together to create item-based user commands, such as opening locked doors.
Article Seven: Actors Implement an NPC in your game, a gentle introduction to OOP.
Article Eight: Storing Multiple Actors Investigate and evaluate different ways to expand our NPC implementation to support multiple actors.
Let's face it, our code is getting ugly and unwieldy. In this section we improve the quality of our code and add much needed structure and organization to our project. Our architecture gets much more abstract, robust and expandable - allowing us to do much more than was previously possible.
Article Nine: Untangling 101 We start improving our code by introducing multiple source files to clean up the Actor implementation
article10 Remove the N from NPC and change the player into another type of actor using inheritance.
article11 Next up, items. But rather than just tweak, we're going to rip out the system and drop in a new OOP-based one.
article12 Leverage the new inventory system to add powerful new gameplay elements.
article13 Improve the mapping system and allow us to save and load levels.
article14 Allow the user to move between levels.
In this section, we focus exclusively on Actors, creating rich new features to your game to really improve the experience. This section deals with common (and uncommon) approaches and techniques used in other roguelikes and commercial games.
article15 What's the point of having NPCs if you can't interact with them?
article16 Extend the basic melee combat engine to support blocking and more.
article17 Implement a skill system within your game actors.
article18 Employ statemachines to have a more intelligent and responsive enemy.
article19 Having enemies that get stuck behind walls doesn't exactly inspire fear and terror in the hearts of players. Here we address the theory and actual implementation of the ubiquitous pathfinding algorithm, A*.
article20 Take advantage of the OOP-based inventory system and employ tree-like structures to afford Castle-of-the-Winds styled inventory systems.
article21 Revise the mapping system to make the world move around the player in a seamless fashion.