Amaranth, an Open Source Roguelike in C#

June 11, 2010c-sharp, code, game-dev, roguelike

Tonight I get to do something I’ve wanted to do for a really long time: I’m open-sourcing the roguelike I’ve been working on for several years. Amaranth is an old-school terminal-based roguelike written in C#. It looks like this:

Screenshot of Amaranth

Because I’m crazy about decoupling, it’s actually split into three separate projects:

Bramble is a very small low-level library containing utility classes. It doesn’t rely on anything beyond core .NET collections and provides more useful 2D vector and rectangle classes, along with some other handy stuff. Even if you aren’t working on a game, there may be something in here you can use, which is why it’s its own project.

Malison is the terminal library Amaranth uses for its user interface. Like many roguelikes, Amaranth doesn’t have graphics. Instead, it draws the game world in ASCII like an old computer terminal. Malison is a generic library for drawing to a virtual terminal. Even if you don’t care about Amaranth, Malison should be exactly what you need if you’re going to write your own roguelike or other terminal-style app in C#.

One nice feature it has is that it decouples a logical terminal from a specific renderer. It provides a renderer using WinForms, but it should be simple to implement other renderers on top of XNA, WPF, or Silverlight. Code that writes to a terminal only knows about the abstract terminal API, which means you could have a single game engine that supports rendering to a bunch of different terminal implementations.

Amaranth is the actual game, or the beginnings of one. I have lots of work left to do here, but a lot is also done. I’ll be writing more about interesting bits of the engine I hope. In the meantime you’ll just have to dig around in the code if you’re curious. Some fun stuff it supports:

It’s all up on bitbucket: bramble, malison, amaranth. Feel free to try it out, branch it, or whatever. In the meantime, I’ll try to find time to start writing some documentation on more interesting parts of what’s in there.