Hello everyone, and welcome back. This week we’re going to be talking about generating the poetry riddles for instructions in terms of what the player should do when they get to the right map tile where a secret can be found. The headline – I’m very pleased to say, after the challenges and frankly the semi-drudgery of working on the single-map-tile riddle clue generator – is that this generator has both been a great deal faster, and a great deal more enjoyable and rewarding, both on a technical level and an artistic and creative level as well. The other one was intensely satisfying once it was done, and I was able to lean back in my chair and see how impressive a thing had been crafted, but by the gods, it was hard work. Indeed, I actually started working on this while finishing off the previous set of riddles, simply because I needed something a bit more rewarding and a bit more exciting to help get me through all that grunt-work. As such, these have absolutely flown past, and thus now not just can we generate sensible stanzas for a civilization, and sensible stanzas for a specific location on the world map within that civilization, we can now also generate sensible stanzas with sensible instructions for what you would actually do at that location once you get there! You might note one middle thing is missing – i.e. which tile on the local map you need to get to – and I am working on that, but that’s another slightly more complex one, so I did this one first, and having finished it, I’m now working on that one. Regardless, this is a huge leap forward, and another massive part of the remaining 0.11 work done, and I’m excited to write about it.
Prompt Sentences
So, the first thing to do was to identify what sorts of actions the player can take, having arrived at the exactly correct location on the local map grid and on the world map grid, in order to activate or switch on secret. After a little bit of thought, I reasoned that there are basically eight options. They can use a shovel to dig into the ground; they can drop an item on the ground; they can hold an item up high, using the functionality whereby you show an item to people around you; they could pour something out of a canteen, whether it be water, blood (though why would you ever have blood in your canteen? That’s just weird), or some other strange and presently unknown liquid; you could wear a specific thing, such as a piece of armour or piece of clothing; you could wield a weapon or shield; you could play a particular tune on a particular instrument (these do not generate in-game yet, but will soon); or you could use the wait function to wait face specific length of time, or until a specific event (e.g. for two days, or until the next waning crescent moon). Having interpreted this instruction correctly, something with that happen – an NPC would meet you, or a hidden staircase would be revealed, or a hidden door would be revealed, or something of this sort. I recognise that given the setting of the game, it’s hard to conceive of precisely how some of these mechanisms would work, but let’s not think too much about that. I try to be very exact and specific in terms of these real-world aspects, but in this particular regard a tiny bit of game mechanic handwaving is entirely reasonable.
So, with these established I decided that a stanza of instructions would give one sentence which ends by telling you what action to take, and then one action which tells you what the reward is. To begin with, I naturally didn’t want every sentence encouraging the player to dig to simply end with the word dig, so instead each of these eight actions has a range of different potential ending words (which of course will need to find rhymes for, which is the second half of this generator I’ll talk about in a moment). For the dig action, for example, the sentence might end with the words dig, down, below, shovel, sift, and pierce. The specific sentence is then generated a little differently depending on which of those words it decides to finish off with, since each of them is used in natural language just a little bit differently. With a suitable database created for each of the eight actions, I then created the generators for each potential end word within those actions, and found a number of places where I need to put in placeholders before full integration with the rest of the game. This was the case when it came to things like descriptions of particular melodies, particular liquids or strange substances that might be unique and generated to a particular world, and so on. Nevertheless, with those done and a few placeholders implemented to slot into the generator for the time being, it didn’t take long to get a lot of the first sentences of these stanzas generating correctly. I’ve typed eight of them up here in Word to illustrate, via square brackets, the components being varied in each one. I think these are pretty great!

And without the square brackets, for how they’d actually read in-game:

One interesting thing which became apparent working on this first sentence, and indeed proved to be very useful for the second sentence, was that we also now needed a way to have the game be able to describe any item in a somewhat obscure or poetic manner. Systems of this sort are already implanted for civilizations, religions, gods, certain buildings, animals, plants, and all manner of things. Nevertheless, I would need a way to describe either the item you were doing something within the first sentence in order to activate the trigger, a way to describe the item or items the player was being rewarded with in the second sentence (see below), or for some stanzas, a way to do both. I therefore spent quite a bit of time creating this large database of ways to talk about items which properly expresses their qualities but does so in a slightly obscure or cryptic manner, and with that done we could then integrate this into creating these first sentences when such an item needs to be specifically talked about. It turns out that there’s, er, quite a lot of items in the game, and quite a large number of subsets of items within that item list, so this did take a while to come up with. In the end I wound up with a pretty extensive system which can generate a very short description of an item, or longer one, without explicitly saying what the item is. These different lengths of descriptions could be useful in different contexts, and indeed will be required in the second sentence of these stanzas, as I’ll describe below.

Nevertheless, with these done, and some placeholders in place for things we can’t generate yet – such as information about a specific tune – the first sentences of the stanzas were ready to go. These will turn out to be a lot easier than the second, so let’s go into those now in some detail.
Reward Sentences
So we have our first sentence – what you should do to trigger the response. The second sentence, however, before I even started coding it, sent me down some interesting game design thinking. I realised while doing these that we needed a range of possible options in terms of what information the player would have about the reward at the end of a riddle. As noted previously, I imagine the poetry riddles which I’m working on now to be primarily early or mid game riddles, and so they both have more capacity to specifically tell the player what they’re going to find – because they’re verbal riddles rather than visual ones – but also because earlier in the game I want to give the player a greater and more immediate sense of what kinds of rewards now comes they’ll get, was later in the game any player who gets there is going to be sufficiently committed to the whole idea, and following the harder threads, that being so explicit on what each step will entail becomes less important. So the idea came up with here is that the second sentence in this stanza will give the player a sense of they’re going to find. If it’s a single item it could be quite specific, enabling the player to make to make strategic choices about whether this particular one is worth their time pursuing at the moment or not. By contrast, if it’s two items, it’ll give a little bit less info about both, but the tradeoff is that you get two things rather than one. If it’s many items, then I think it’s fine for the riddle to just tell you that you’ll get quite a range of items, the logic being that the potential value of those items both in their number and in their trade value outweighs the fact that you might not know exactly what you’re going to get.
This works for one step side quests – i.e. you find a note, pointing to a single location, and that’s the entire quest. It’s essentially a side quest that will give you something that will help you out, whether it’s money, or a combat item, or some books with important information, or whatever it might be. However, many quests will have multiple steps, or might reveal more ambiguous or less explicit things, such as a secret chamber or secret room, or notes or keys which lead you on to the next part of the quest. So the generator also had to be able to explain and describe these as potential rewards, making it clear when the player is getting an item and the (short) quest comes to an end, or when the player is gaining new information to then continue that quest thread on to the next step. Starting with the item outcomes – i.e. this is the end of the quest – the game can give a detailed description of one item, or a less detailed description of two items, or just note the number of items you will get and something about them. As above, by thinking is that the side quests I want to make sure the player has the information they need to decide which side quest should be pursued and which should not – is this going to give me a resource that I require, or is it not? And even if it isn’t, is there something worth getting to sell later, or not? The nice thing about these also, of course, is that there’s no time pressure on these – although as previously discussed ones later in game actions might base certain areas of the map controlled by certain nations or religions more challenging to get to – And so a side quest giving you a certain sort of thing might not be of used when you first get that note, but perhaps later on you get a quest specifically asking for that exact item, and you remember that you have an unsolved note which will deliver exactly that item into your possession. Alternatively, the second sentence does, as I say, also need to point towards the accessing of stairs, or doors, or hidden areas, rather than specific items, as well as referencing the advancing of a quest and the completion of a quest.
So: what do we rhyme with those ending words? Well, we would of course want to begin by creating a super large database of options for finding a rhyme with each word. A little bit of work later, and we come up with a dictionary that looks something like this:

(Not a complete list)
The next stage, then, is to create sentence endings for many of these as I can – some of those shown in the above picture in fact got removed in the end because I just couldn’t find a good sentence ending for them for any of the potential item or reward types – which will be logical, and which fit into the general flow of these poetry riddles more generally. After that, the next stage would be to go through the full range of different potential items and rewards…

(Again, not the complete list)
…and assign, for every single rhyming word in the above list, a full list of potential item type where that ending can be viably used. You might be thinking “hang on Mark, you’re basically talking about cross-referencing hundreds of words with over a hundred items?” and my response is yes, friend, you are entirely correct. This took a while. But, this was the only way that the objective could really be achieved in order to maintain the level of quality and precision and detail I’m trying to get into everything in URR, and more broadly within these riddle generators, and also the only way to really do it without resorting to the revolting technology that is LLMs / Gen AI (which URR will never, never, unto my dying breath, NEVER, use). One of the biggest challenges was trying to make sure I didn’t accidentally miss or overlook potentially good matches, while also ensuring that some words have matches for multiple different kinds of items which would yield different sorts of connections. This was the case for lots of words which multiple potential meanings, or words which have meanings that would have a general import for most rewards, but could have a special much more specific, and thus feeling far more handmade, connection to another kind of item or another kind of reward. The process also includes a number of new items which aren’t currently in the game, but which I know will be appearing in the future, and it seemed like a good idea to incorporate these now rather than having to come back – and having to remember to come back! – some point further down the line. Anyway, with all this done, here are some examples of the outcome sentences which can be produced here:

I think these are pretty great. Some of them are able to be extremely specific, thereby – as I mentioned – achieving the objective in one-off riddles of letting the player make an informed choice for whether this thing is worth pursuing or not, or whether it’s something to just keep in one’s backpack until some later data, or something to just not spend time pursuing at all. Others are little more general, giving you a hint about the sort of things that you might find, while also in some cases the rhyming sequence gives the player a sense of what these things might be used for. These are pretty obvious in most cases (yes, a weapon is indeed for fighting), but especially for the new player, I don’t think that that does any harm in being a little explicit about some of the purposes of some items as part of the riddles (and it also just helps me achieve the required rhymes anyway). Others, then, I think make it clear that you’re moving on to the next step in and a longer quest, or make it clear that you’re going to gain access to some kind of secret area or chamber which might contain unknown things. I don’t mind the ends of these clues not always telling you exactly what you’re going to find – I don’t think all quests need to tell you exactly what you’re going to find, and one of the great things about roguelikes is that intriguing decision-making process between things you know, things you don’t know, “making do” with what you find, and so on. Do you go after something which you know will be of middling use, or take a gambling on something else with an unknown, but potentially greater, reward? As such, I think these have a really good balance between giving specific information and not giving specific information about the rewards / outcomes in question. So, with that said, here are some examples of finished stanzas for telling you what to do at a specific location, and what the reward will be:

Overall, I am really happy with how these have come out :).
Riddle Generation for 0.11
So, this is where all this leaves us on poetry riddle generation for 0.11 proof-of-concept quest generation, which as mentioned previously, I expected to take me the full year to do:
What civilization? DONE
What world map tile within that civilization? DONE
What place within the local map of that world map tile? 70% PROGRESS
What do you do once in that precise spot? DONE
I know I haven’t mentioned the third of those in much detail yet (that’ll be for a future entry once they’re done), but it should be clear that things are really cracking along – especially when we include the book generation work, the padlock generation work, and all the other stuff has shown off in some of the entries this year. Are we going to get 0.11 out by the end of this year? I don’t know, but it’s looking somewhat realistic, and I’m working flat out to get it done (and is all still super enjoyable, don’t worry!). There are a few other minor things which need to be implemented and integrated, but once that’s all done, it will be time to properly sit down and start thinking about the systems for generating quest threads, and correctly inserting the triggers required into the game so that the game can detect when the player has solved the procedurally generated riddle. Long-term readers will recall that I did some of this work last year, so it’ll be time to return to that, enhance it and flesh it out into a full generator rather than a proof of concept, integrate it with these other generators, and hopefully yield something which does, indeed, produce procedurally generated riddles which can be solved, and of course, rhyme. I’m obviously someone who has no issue with thinking and planning in the long term, having spent 14 years on a game and anticipating a good 40 more to come, but even for me, this last six months has been sometimes a little bit challenging on the mental side. This has been because so much of what I’ve been doing has been quite abstract, quite theoretical or technical, and there hasn’t been that much really appearing in the game itself just yet. Or, to put it another way, the game’s code hasn’t changed a great deal in six months, even while the code in my testing files has changed immensely, massively, tremendously, with all these new features that now require combining into the game itself. In this second half of the year, therefore, I’m really excited to finally integrate the latter into the former, and finally – I sincerely hope – see all these things come to life, and all the work truly pay off.
What next?
Thanks as ever for reading, everyone! As I know I’ve said before (and above), a lot of the updates at the moment are very wordy, they focused on programming, and don’t have too many screenshots to really show off, but that’s just the nature of the deep technical and creative work being done at the moment. With that said though, as soon as the “specific spot on local map tile” riddles are done, that aspect should pretty much come to an end. For the second half of this year I therefore expect the blog posts to gradually become more screenshot-heavy, and to properly give us a real sense of how all all these pieces are being implemented and integrated into the game. Nevertheless, I’m incredibly happy with this fortnight’s work, both in terms of how enjoyable and satisfying was to work on, how cool the outcome is, and how quickly and well it moves us towards 0.11’s objectives. As ever, please do leave a comment with any thoughts, and please do think about sharing this post around on the web in other roguelikey or PCG-friendly places if you can think of people who might be interested in it.
Thanks so much everyone, and see you in a fortnight!