cartoon pic of site's author
Blog  |  D&D Stuff  |  About  |  Other Places  |  rss logo

Snerk the Sneak

Next week I'm taking part in a game jam, the venerable Seven Day Roguelike Challenge. Build a small roguelike in just one week! The real challenge is an exercise in keeping your scope restrained. It's so easy to plan to do too much and software developers are notoriously bad at estimating how long things take. I am absolutely bad at it. But I have a (bad) idea for a game and three days booked off for vacation next week! Basically unstoppable! My game is going to be a sci-fi/cyberpunk roguelike where you have to hack and control robots to infiltrate an underground facility.

I needed a dev stack

My initial instinct was to just gut Delve's code and reuse the UI, display stuff, field-of-view, and pathfnding algorithms I've already written. But I really wanted my game to be easily playable in the browser from the itch.io page. Reduce friction for someone who might want to try it out! When I looked a bit into emscripten and building C#/.net projects for WASM it seemed possible but potentially a little janky. I didn't want to spend precious jam time troubleshooting weird web quirks. Then I remembered a library I'd starred on Github a million years ago called rot.js developed by Ondřej Žára, which is a pure javascript library for building ascii roguelikes that play right in the browser! Perfect for me! What's nice too is that comes with lighting, pathfinding, and turn scheduling built in. Fantastic! Stuff I don't need to write! It also does map generation, but I probably will be rolling my own.

I wanted to try out the stack before the game jam begins, make sure I knew how to deploy it to itch, and maybe have some of the display and UI elements (like pop-ups and menus) already written. Don't come at me: this is well within the rules and the spirit of 7DRL! We're allowed to use existing assets, libraries, and code. You can even hack up an existing project so long as you are building something new. And you can do all of your design in advance. To my mind, the goal is to implement all the new and unique game elements within the the seven days of the challenge.

And I want to spend as much time as possible on the game mechanics and content I have planned. (By planned I mean half-formed ideas scribbled in my notebook)

Snerk

So I decided to do a small project, barely a game at all, to test drive rot.js and get a taste of Typescript. I came up with a silly little game where you are a kobold who has to sneak into a village and retrieve an egg that adventurers stole from your dragon overlord. Figure out where your goal is, evade or distract the guards, and grab the egg!

You can play Snerk the Sneak on itch.io

Screenshot of gameplay from Snerk where the player has been spotted by a guard! The game in action

This was pretty fun to build! And I still trouble with scope creep, having to remind myself this was just a tech demo for the Typescript/rot.js stack. This wasn't the game I am making. But I keep thinking about things I might add. And one of the egg locations is trivially easy to win. I think maybe there's a germ of an actual game in there and I could see it becoming an Untitled Goose Game sort of thing with more complicated interactions with the villagers. And I think it would be cute with some pixel art instead of ascii... But gotta stay focused on my game jam!

I did use Claude to help out a bit with Snerk. This was my first real project in Typescript and with the decay of Stack Overflow and Google search, sometimes the best way to ask code questions is to just do, "Claude, what is the Typescript equivalent of..." or "Is there a Typescript function for...", and having a window in VS Code to ask those questions is awful convenient. I also had Claude translate some of the code I'd written for Delve from C# to Typescript. Stuff like a floodfill function and some finicky code I wrote for word-wrapping text in pop-up windows. Now grant you, I would have learned more Typescript by translating the code by hand, but I didn't want to invest all that much time in a quick prototype. I've posted about my ambiguous feelings about using genAI for coding, especially personal projects, but this is kind of what I want from LLms. "Hey write the tedious parts that I don't want to bother with."

Conclusion

I'd call this a success! I made a teeny tiny micro-game in a couple days, I know how to make a game using rot.js and deploy it to itch.io and Snerk is playable right in your browser. And I have a bit of project infrastructure for my upcoming game. Especially the menus and pop-ups, which is stuff I don't want to waste time on.

I'm not sure if my idea is going to pan out as a game that's fun to play but I'm pretty stoked to get started going!

7DRL takes place over nine days, but you are supposed to pick a seven day window to work on the game. I'll be starting Sunday March 1st and hopefully have my game done before midnight of the following Saturday! Wish me luck! If I am not feeling too much time pressure I might do a mid-week post about how it's going.

Dana's Delve is open source under the Creative Commons CC0 1.0 Universal license and its source code is available on GitHub.