I entered 7DRL for the first time this year, but without a strong library base and enough time dedicated to it (I slacked!) unfortunately my game didn’t come to fruition. However, the interesting part of the roguelike – the tech behind it – did get finished, which means it might be helpful to you – yes, you! – in developing experimental roguelikes in the future. Here’s how my entry, A Rogue Dream, was going to work, and how you can use the code that made it up.
First of all, here’s the code dump in Github
The game doesn’t work well on anything other than my machine, but that’s besides the point. The premise was as follows: upon starting the game, the phrase Last night, I dreamt I was a… appears on the screen, and the player enters a noun. From that noun, A Rogue Dream generates an entire roguelike. Sort of. Here are the two bits of cool tech at work inside A Rogue Dream’s codebase:
Mining Google Autocomplete For Facts
University College Dublin’s Tony Veale noticed that if you ask Google a question, the autocomplete results often give you factual (or at least, interesting/common knowledge) information. You can read more about the technique in his ICCC paper here:http://computationalcreativity.net/iccc2012/wp-content/uploads/2012/05/001-Veale.pdf
This means that if you put into Google “why do doctors”, the autocomplete results tell you that doctors wear white coats, say stat andprescribe steroids, among other things. I used this technique in A Rogue Dream, with modifications, to extract information that might help one design a roguelike. This includes asking extended questions such as “why do ‘noun’s wear” or “why do ‘noun’s hate” to get information on clothing and enemies respectively.
You can find the code relating to this in net.cutgar.ard.coldread. I use the Google GSON library I believe, along with evo-inflector (https://github.com/atteo/evo-inflector) to pluralise words.
Automatically Generating Sprites From The Web
A Rogue Dream generates its own game icons and sprites automatically. It does this using Spritely, a tool I’m building that can mine the web for images and process them into a particular size and format, including recolouring according to a theme.
Spritely is bundled here somewhere as a jar, and you can see the code that calls Spritely in the package net.cutgar.ard.concurrent. Spritely is used in a separate thread so that the sprite generation can be done online in realtime. Of course you can also use spritely during development to generate placeholder art for your games while fast prototyping.
More on Spritely later when I release it as a standalone tool. It’s really only included here because it’s part of the game – I’m not going to great lengths to explain much about it right now.
I may explore this idea in the future (probably in the context of my research into automated game design) but you should absolutely have a crack at it too if you’re interested. Take a look at my code, and keep an eye on my Twitter feed for announcements about Spritely’s release within the next month. Spritely is a tool for generating placeholder art, but I hope roguelike devs might find inventive uses for it too, perhaps inspired by A Rogue Dream’s attempts to make an entire game procedurally.
If you want to know more, please get in touch! This is a brief post unfortunately, and the release isn’t as clean as I’d like, but hopefully it might spark an idea or two with someone better at roguelike development than I!
Thanks to all for arranging the 7DRL. I had a lot of fun!