While writing the last chapter of my book about programming games for Lua, I decided to go on a side quest to build a polished roguelike dungeon crawler for Playdate. My hope was that it'd get me excited and help me work out some of the technical aspects in my head. I was having so much fun making it that I decided to turn it into a full game and share my progress along the way. I'm happy and excited to introduce Enigmata: Cursed Dungeon, a roguelike game inspired by the Mystery Dungeon games like Shiren the Wanderer!
You can download the early access builds of the game for free on itch.io and sideload it on your Playdate:
Be careful. Survive. Each step counts!
Latest version: v0.2.
See posts that follow for updates and progress. I'll keep this initial post up to date as I release new versions.
Today I made the initial public release of the game: v0.1. It features the foundations in a playable state. You descend six floors of the dungeon, seeking the Ring to reclaim your humanity. There are nine enemies and some basic items. You level up as you gain experience, getting stronger. The game isn't particularly balanced yet. It's not worth it while all the systems are in flux.
I thought it'd be a good learning experience (and motivating) to build the game in the open and release it early and often. I've got lots of plans for future releases: equipment, traps, more enemies, NPCs. I'm looking forward to seeing how it evolves and sharing that here in this devlog.
I've worked on the game for about a week and half so far for this v0.1 release. Lots of setting up technical foundations. But once I had a gameplay loop, I found myself losing track of time and having fun . So I thought, why not share it for others to check out?
I'm coding the game in C, as I've always been intimidated by C and wanted to conquer that fear. Once I got the hang of the syntax and some of the tricky bits, I'm feeling really productive and having fun. I really like having structured data and a compiler. Combined with some Clang linting and formatting tools, it feels very modern, like using TypeScript or Rust.
One thing that C makes easier over using Lua is that the game is a lot more portable. Pretty early on in the game's life, I decided to abstract away all calls to the PlaydateAPI into a Platform Abstraction Layer (PAL). So drawing text is a call to drawText. When the game is compiled for Playdate, it calls out to playdate->graphics->drawText but on PC with Raylib, it calls a Raylib-specific function. This lets me test on PC and eventually share a PC build, web build, port to PSP or something like that. That's important to me for preservation and access purposes.
While I'm not focused on the PC version and Playdate is the lead platform, a nice benefit of this approach is that I can quickly build dev tools that share the same C code to support the game development. I've built some dev tools with Raylib + Raygui so far to help me out:
mapgen
I can tweak the map generation algorithm and press Space to see what the map looks like zoomed out:
Enigmata uses the Kenney 1-Bit tileset, which is such an amazing public domain resource. I wanted the ability to preview what the tiles look like filling the map, as well as quickly get the tile index. tilepicker lets me pan around the tileset, click an image to get its index, and quickly find what I need.
A lot of what I've been coding would be useful for all sorts of grid-based top-down games, like turn-based RPGs, strategy games, etc. My intent is that when I'm done with Enigmata is that I'll extract out a cross-platform 2D C game template that targets Playdate and PC. Let me know if you're interested in that! Happy to share the source so far.
I just shipped v0.2, which properly implements the Stamina system and adds a new rare item called Super Bean. I fixed some bugs and tweaked the gameplay balance a bit. It's been neat seeing some interest in the game.
After about a day and a half of being live on itch, the game has 207 views and 22 downloads.
I released v0.3 today, which added Spell Scrolls (three so far: Fire, Ice, and Curse).
Here's the fire one in action:
It feels like the various systems (and the fun) are starting to come together. It's been fun working on gameplay aspects like items and spells after spending about a week setting up the core foundations. Feels a lot faster now to try out ideas. Still enjoying C.
Someone on the PlaydateConsole Subreddit was asking about the map gen algorithm. Here's the code from the latest version if anyone's interested:
It essentially breaks up the map into sectors, possibly carves out a room in the sector, and then connects with L corridors.