Hello everyone – welcome back! I’m pleased to say these past fourteen days have been closer to the usual level of productivity for a fortnight, although still a little bit disrupted by work stuff (though the life stuff seems to have improved a lot!). Last fortnight was 20% coding capacity, this fortnight has been something like 60%, and next time I hope to get back to 80% or more. I’m putting the final touches to a major grant application at the moment which is always a very demanding thing – and my first time really playing the big grant game (as opposed to, I guess, the small grant game?) in essentially around seven years, so there’s a lot that I’m having to really ease myself back into and get used to again. But, the good news is that the application is both flying along, and looking incredibly strong, so I have been able to find spare hours here and there on many days to advance the 0.11 development. Specifically, my focus this time has been on bringing the four main categories of riddle poem stanza generation – civilization, location in civilization (e.g. town), location in that location (e.g. a certain shop), and final instructions (e.g. chat to the owner about a certain bird), into the game proper and out of the (now incredibly large) testing file I have in Python which I used to rapidly iterate on stuff before integrating it into the game itself. I’m pleased to say the first two are now fully implemented into the game and can take any civilization data, any location data, and produce a logical, but cryptic, and rhyming, two-line stanza, about that place, whatever it might be. This is awesome, and gets me incredibly close to quest thread generation within the game itself – and it’s always worth remembering that the riddle poems are going to be the most complex type of riddle to generate, and while I do slightly regret starting with them instead of something else, it’s so reassuring to see even these incredibly complex ones coming properly into being.

First came the civilization riddles. A new function was created to house these, including a new integration which is the ability to rank how difficulty the outcome should be. I realised in the process that there are essentially three levels of information one might have about a civilization (or a place, or anything else that a riddle wants to reference) – stuff which is very easily accessible and visible, stuff which is accessible and visible but comparatively obscure, and stuff which actively requires searching out to uncover. The first type would be something like what kind of religious policy a nation has – have they got religious buildings in every city district? Have they got monasteries? Do they house a dozen religions? And so forth. The second type would be something like the specific type of throwing weapon they use in combat – there’s a lot of ways to find that out, but it wouldn’t be as obvious, and might require a bit of looking around, or some combat experience with people in that nation, or glancing at one of many books or other resources that would give that information. The third type would be something to do with a specific historical event in a specific place, for instance, which might only appear in a single book, or maybe only one class of NPC in that civilization is going to be able to tell you anything about it (e.g. maybe we’re talking about a famous religious heretic who died somewhere, and this is a monastic nation, and it’s only going to be the monks who might have that information to give you). Two of these layers both function within the civilization riddle function as it currently stands, which is to say, the two “easier” layers. The function can now be told to use the simplest possible data on a civilization, which is certainly what we’d want for the early-game riddles, or the slightly more obscure stuff, e.g. what throwing weapons they use, or things of that sort. This turned out to be far less onerous than I expected – well done to past Mark for writing the code in a sensible way here… – and so now the game can correctly take any civilization, with any combination of policies, politics, religions, coinage, weaponry, anything at all, and create sensible riddle stanzas to describe that civilization. Fabulous!

However, it also turned out that even more work needed to be done here before these were polished. In going through them, as described last time, and adding loads more variations to the generator, I realised that there were a whole bunch of places where ambiguity could potentially exist and players could come up with interpretations or explanations that seem entirely valid, but aren’t what the game is looking for. This is a problem in cryptic riddle games in general – since it is intensely frustrating to find a totally valid answer for a puzzle and have it not be the right answer, e.g. as noted in my review of the wonderful but frustrating Alchemia from last year – but even more so in a permadeath game where you can’t reload. If you use up a bunch of resources testing a hypothesis that turns out to be false in a normal cryptic riddle game, you can reload; here, you can’t, and thus we need to cut ambiguity down to its lowest possible level to reduce the risk of player frustration from a valid, but incorrect, riddle solution. There were many levels of this. Firstly, I went through and checked all riddle generations for the “bee” coin image, and the “moth” coin image, are unambiguous (since both are flying, small, insects), and then had to do the same for the “fish” and “shell” coin designs for an equivalent reason (i.e. both underwater things), and making sure I hadn’t accidentally used the “tome” and “temple” coin images incorrectly, as I caught myself doing that once and became worried I’d accidentally done it twice. With those done, I double-checked that the use of throwing weapons (shuriken, etc) and the use of throwing grenades, were correctly disambiguated in the code, and then made sure none of the original code here, with catch-all options for rhymes, still existed (as that was outdated). Then I also needed to remove some more outdated code in which it was deciding what rhyme to create based on whether certain things were in the list of possible rhyming traits, rather than the one rhyming trait which had been selected, and then I went through and double-checked that all the language around coin designs and coin materials was correct (many many dozens of places), and removed the placeholder information for things like religious or national titles. I even, in this process, added the generation data for a ton of new rhyming words like crusades or hurls or char, all of which will just add extra variety to what players see. With all of that done (the complexity of these things is really bananas, but the end result is just so cool), I think the civilization riddle poetry generator is, actually, done (and I have tested it over 10,000 times, and not yet produced a crash or even a bug, as far as I can tell – so that’s rather good).

Second came the single-map-tile location stanzas – i.e. those discussing a single town, or a fortress, or a district in a city, or a mine, monastery, university, or whatever else. These will sometimes give you a two-part description about the tile being discussed; sometimes will give you one bit of information about that tile and sometimes a piece of information about another tile that has some geographical relationship to the tile we’re talking about (e.g. it is to the north); and sometimes will give you the location via two geographical relationship bits of information (e.g. where X is to the north and Y is to the east, and only one location fits those two requirements). In my previous creation of this aspect of the generator I was incredibly happy with how it turned out, and it really exciting to get this one into the game as well. I tested it by attaching it to the looking at the world map function where you can move a little crosshair around the world map to look at things, and by having the game generate a sensible riddle for whatever area I happened to move the crosshair over. This worked extremely well and it was incredibly satisfying to see this coming into being instantly, and always working no matter what I glanced at. I might, for example, check on a random location in the middle of a desert, and get this…

Where a shrouded steeple yet climbs so proud, much higher,

And water runs past a fishing bird yet crying, east, by no fire…

…telling us that to the north (“higher”) is a mountain called Dark Spire, and to the east (not near a volcano) is a stream called Weeping Heron River. Or I look at a settlement and I’m given precise instructions, via something like…

Where sweltering tendrils and clever birds are there in space,

And some live by dark grey slate with much of bright cerulean, at this place…

…to a town called Sapphirerock within a bioregion called the Dense Parrot Jungle. And I can do this for anything! Any tile on the entire map! No matter the map layout, or the names of anything, it can always find a rhyming couplet to describe that location in cryptic, but unambigious, terms. It’ll either give me two lines telling me the exact location, one line telling me the exact spot and one giving me a reference in a compass direction, or two giving me references in a compass direction and asking me to find where they intersect. I think this is, to put it mildly, insanely cool.

There were also other complexities in this aspect of the generator which I only saw once I actually integrated it into the game properly, however. These took me quite a bit of time to work on and fix. One of the first ones was simply that not all the tracking of plurals and singulars was correct here; I know some PCG games essentially abandon all hope at sentences having perfect grammatical correctness, but that’s not my way of thinking! I took quite a bit of time ensuring – I think – that these are always right, and now they should be good to go. Another major thing I had to add now that I’m integrating is some of the riddle rhyme suffixes which can only be used in certain contexts. For example, the “pier” ending can, unsurprisingly, only be used if the location is actually next to a dock in city. This was also true for endings like “wood” or “fire” (referring in this case to volcanoes) and so on, of which I discovered I’d actually implemented rather a lot of. These then necessitated new code to always ensure that such an ending is actually logical when being used, and isn’t just weird gibberish chucked in there simply to create a rhyme. Other interesting complexities arose when I continued play testing, and realised that some sorts of lines have to have preference over other sorts of lines. For example, we might have a town positioned on a road, and so a clue about the road is in fact not particularly helpful – it has to be a clue about the town. This in turn transitioned into a wider realisation that certain sorts of rhymes here are not acceptable for large multi-tile things. Imagine we are talking about a map tile within a bioregion, and the first line of a stanza hints at the name of the bioregion, and the second line hints at a mountain to the north – all that does is give you a column of potential tiles within the bioregion, rather than a specific map tile within the bioregion. As such, this also applies to multi-tile mountains, and chasms, and roads and rivers, where we need to be zeroing in on a single tile but the mountain (or whatever) might consist of several. This meant adding in some new code to keep track of and acknowledge multi-tile references, and only use them when their larger size does not generate ambiguity. This, again, took a while.

Yet with that done, they work, and they work well. They generate logical sentences is which aren’t too long, they always rhyme, and they always as far as I can do indeed yield unambiguous but cryptic directions towards a specific tile on the map. As I mentioned above, it’s incredibly cool to be playtesting this now, having now created a system that can just infinitely pick random tiles on the world map and create intelligent rhymes to describe that exact tile. I hope the reader will forgive me for tooting my own horn for just a moment here, but I’ve honestly never seen something quite like this, and it’s incredibly cool and interesting and novel. And even though in many ways it remains early days in quest generation as a whole, I do start to see this world of riddles upon riddles, mysteries upon mysteries, secrets upon secrets, coming into being. As an aside, all of this is also another reminder, yet again, of why the combination of “cryptic riddle game” and “roguelike” is both such a creatively and technically compelling and exciting one to explore, but also one that is bloody tricky – there are so many things one doesn’t need to ordinarily think about in either of the parent genres, but which are required when trying to combine them. The lack of a hand-made world and the lack of hand-made riddles requires all kinds of new code and new systems to ensure that whatever riddles get created in whatever world, they meet the sorts of requirements we’re actually looking for in terms of gameplay, how they can be understood, their difficulty level (which is very abstract and challenging to think about in these ways, although I think I’m making progress), and so forth. Regardless though: 50% of the rhyming riddles are now fully integrated into the game, as far as I can tell, and working fantastically.

What’s next?

Well, that’s everything for this fortnight. I’m sorry we haven’t had much – er, anything – in the way of screenshots this update and last, but I know they’ve been lighter updates because I’ve been overwhelmed a bit by other things, and because I’m really deep in the code here – but proper progress is being made, even if it’s not quite as speedy right now as I would like. Reaching the 50% mark on integrating the riddle rhyme generators into the game is a great milestone already, especially since (as above) no other riddle generator will ever be as difficult as this one (or even close to it, honestly), and I think a fortnight from now I should have the other two levels – rhymes for within a specific location (e.g. where in a town should you go?) and rhymes for the final command once you get there (do I wait ten turns? Drop a certain kind of item? Look at a certain object?). With that done I hope to have screenshots in the next post of the game organically generating full four-stanza fully-rhyming riddles on any possible generated world, and then it’ll be a matter of integrating that, with keys and chests, which is another gigantic task involving the wrangling of goodness-knows-how-many millions of permutations to ensure that both always and logically align. Still – I’ll get it done. Thanks as ever for reading, everyone, and please do leave any thoughts in the comments below!

Leave a Reply

Your email address will not be published. Required fields are marked *