Hello everyone, welcome back! I do hope you all continue to enjoy the new fortnightly update schedule. After a few blog entries away from discussing the poetry riddle generation – this being the only type of riddle I’m promising to have released in 0.11, with the possibility of more if time allows – it’s time to get back to them. They remain a huge task with so many different layers and logics, and although progress has been swift so far, there’s still a ton to do – so let’s get into it.

Civilization Riddles

Firstly, I’ve been doing a lot more work on the civilization aspect of the “location” category of riddles – as in, for 0.11, the first stanza or two that one would expect to find in a clue, letting you know which of the game’s civilizations you should be looking towards in order to solve the riddle. As noted in a recent blog post, these riddles can already draw on many aspects of a civilization, such as its eight key policies – leadership, foreign, religious, economic, military, cultural, intellectual, justice – as well as what sorts of weapons they use, whether they have any unique physical cultural traits such as wearing turbans or facial tattooing, and it can also engage with the material that coins are made from if it’s a civilization with a rare coin material, such as jade or something like that. I have also already implemented here the ability for riddles to mention the unique building or item type that each nation will be given in 0.12, such as this being a country who build giant stone heads, or put a lot of tapestries on their walls, or construct great pyramids, and so on. Although these aren’t in the game just yet (it’s a 0.12 objective), it’s far more efficient for me to integrate those into the riddle generation system now rather than coming back to it later. This week, however, I’ve been expanding this further to include a lot more potential rhyming pairs, and lots of extra potential information which can be reflected in these, as well as giving us a greater possibility for having difficulty ramp up within a given clue type (i.e. rhyming riddles), as well as ramping up more generally across multiple types, with later game riddles of the poetry type generally drawing on much more obscure clues for the information.

So, I have now enabled the poetry rhyming riddle generator to include comments about what sorts of throwing weapons a civilization uses – these might be physical throwing weapons such as shuriken, mambele, needles and chakrams, but can also be grenades as well (which I’m going to rework soon, but that’s a side issue). They can also now mention different kinds of armour – right now the only kind of armour in the game is heavy plate armour, but when we get to combat I’ll be implementing medium and light armour as well, and so the riddles can now reference what style of armour a nation happens to use. I would see both of these as being somewhat trickier to identify compared to the basic policy level (is this nation a monarchy, or a democracy?), because this information would require one to ask people, read a book, look at some soldiers in a local city’s military district, or other things of this sort. Again, poetry riddles are most often going to be early game puzzles – although they will will be able to ramp up to being far more difficult – and so we need a range of levels of information for different difficulty settings in a given thread. On a more mundane level, this also just increases the sheer variety of the poetry riddle clues, as the system can already create vast numbers of logical and rhyming stanzas, so a few more in the mix certainly won’t hurt.

With those done, I’ve also now added three other things into the poetry riddle clue generation mix (the “PRCGM”, if you will). The first of these is the ability for the generator to refer to a nation’s flag. The most obvious way this happens is according to the flag’s colours, so I have now chosen words to define each of the potential colours which can appear in the flag generator, and figured out which of those colours can be paired with other things, adding new rhymes for those colours which didn’t have working rhymes, and creating a system where the game can track which of those colours is is listed last in a rhyme in order to ensure that it knows what should be pairing that colour’s description with. The rhyme generator can also now take account of images in flags, which is relevant for nomadic and ancient / tribal civilizations. As with the above, this is just a slightly trickier one than looking at a basic policy for nation, but also adds adds a lot more variety, other things to pay attention to, and so on. As well as the coin materials which I mentioned can very rarely show up in the poetry riddle generator, I’ve also now added in references to the symbols on coins. In all the sedentary nations a coin bears one key symbol – such as a portcullis, or catapult, or snowflake, or some animal, or things of this sort – and those are now again added extensively to the database of potential rhymes and potential references within the poetry riddles. Finally – and this one is substantially tougher for the player than the others – the name and nature of the throne of a nation is also now included. Thrones can be of various materials, and have various kinds of symbolism on them, and her various kinds of gems embedded in them, and these can also be included. These are certainly the hardest civilization markers I’ve so far implemented thus far – by no means the hardest I intend to get to in this clue archetype, but the hardest so far, and I can see these potentially showing up at the end of the proof of concept riddle thread that players will be able to go through and 0.11.

With that, the civilization riddles are, for now, essentially done in the generator. Potential stanzas which connect to other in game information, such as a historical person or event, are not implemented, as those will not be appearing until the relevant pieces of data actually show up in the game world. What this means is that for now the civilization location parts of these riddles can have “easy” elements (a major national policy) or “medium” elements (weapon preferences, unique facial traits, flag colours, coins, etc), or a “hard” element (nature of the throne). I need to add a few more hard elements in later on, I think, such as perhaps the numbers of things (towns, monasteries) and anything else I can think of, but the truly hard ones – e.g. identifying a civ via the name of an ancient ruler – won’t be finding their way into 0.11, since those are contingent on generating histories and events and all that, and ensuring that there are resources (e.g. generated books) which yield the required data. But we’ll get there! For now though, the civilization-level poetry generator is working a treat, by my estimation can produce around a million different possible pairings so far (though this number will be shooting up soon as I add further variation to them, so watch this space), and here are some examples of stanzas I really liked:

Aren’t these awesome?! I bloody love them. And, for interest, the full sets of rhyming words for civilization rhymes, with the words in green, and the nature of the rhyme commented out in blue:

And every single word in that list, every single word, then leads to something as complex as this, which notes every possible trait with a valid sentence for that rhyming word, which the game picks randomly from and inserts other information where required:

Which will itself be made hugely more varied soon by adding large databases of synonyms, so that every single rhyming sentence above ^ should have dozens or even hundreds of permutations each time that exact sentence, for that exact rhyming word, for that exact rhyming couplet, is summoned up. Whew. What a task.

(“Other” means “anything more complex” – we’ll be coming back to these later, beyond 0.11, for integrating with things like history, people, events, etc…)

Also, as part of this the very eagle-eyed reader might notice that the first sentence in each of these has been changed, compared to what it was when I last showed off the poetry riddles. A lot of testing and writing of the poetry generator, as well as some issues with the generator and ensuring that each line in a pair has roughly the same number of syllables, all showed that I didn’t really like how those first lines started, they were very hard to generate for very little reward, and they were honestly probably giving it too much information anyway. As such, each line is now giving you a single piece of information rather than several, but when used with others, there will still be plenty of data here even for a very new player to decipher what civilization they should be looking at. Indeed, to make this easier, I think the very first riddle in a playthrough will always be pointing to your home civilization. That might get changed or become more complex and later versions, but with 0.11 being a proof of concept version for the procedurally-generated riddle thread, that will do nicely for now. So, with all that done, let’s take a look at the proof-of-concept poetry riddle I posted a few weeks ago:

Here are first two stanzas are fully generated, telling you what civilization to look at… but what about the other two? The third and fourth stanza need to point you towards a map tile – a graveyard, a city district, a town, and so on – and then to point you at a specific spot on that map tile, and give you an interaction for that location! That’s actually quite a lot to fit into four more sentences, so it’s getting tricky, and this required me to take a step back and assess how to implement this next part of the poetry riddle generator. This was very tricky, because looking at the above example, the one line in the third stanza which tells you about the town is not actually all that specific – while if this is a nation with conscription, the second line in the third stanza would apply to every such town! It thus quickly became apparent that this mockup was certainly nothing beyond a mockup, and serious thought would be required for the sentences which could generate to point you toward specific parts of the world map once you’ve got them narrowed down to a certain civ (or to a bioregion – but we’ll come back to that later). Basically, one day when I went out for a long walk, I set myself the task of going over all this in my head and thinking through every step of the coding challenges involved while walking, and returning to my flat with a solution done…

Specific Location Riddles

…and I’m pleased to say this technique worked. Essentially what I realised is that we need a full stanza, two lines, to address what specific map tile the player should be looking at. This is partly because some places will have potentially the same clues as of the places (e.g. many towns could be near snow!), and much like civilizations, we need enough information so that the player doesn’t have to guess if they are in fact able to work it out from the information they have. Then, the final stanza would involve two lines, with one describing a place within that map grid, and one explaining what you should do there. We will get to that when we get to it, but for now and looking at the map-tile-specific descriptions, I realised that there are essentially two ways to describe places. Describe something specific to a specific map tile, or describe something about another map tile which is directly north, south, east, or west of the map tile we’re trying to talk about (or perhaps “nearby” but in a non-cardinal direction), and mention the relevant direction somehow in the clue.

After a bit of thought, then, this meant that for single map tile locations we have four options of rhyming pairs to form a stanza. These are location-location, orientation-location, location-orientation, or orientation-orientation, where “location” means “here is information about this exact map tile”, and “orientation” means “here is information about another map tile which perfectly lines up with this map tile, and what direction they are relative to each other”. Here are mockups of what I would like each of these to potentially look like:

Location-location

In a locale where the Silver Prophet was borne to the skies,

And three nations once signed the Three-Blade’s Compromise…

Orientation-location

In a place where sunken coins might be close to the west,

And here the Screaming Knight met his last fatal test…

Location-orientation

Where the Killer of the Blue Thorns set out to horrify,

And a road on which the Xunii marched is still found nearby

Orientation-orientation

In a spot where a dread bird roosts very far to the east,

And four leagues south Thirran the Red was deceased…

You’ll also note these examples don’t say “town” or “district” or whatever. For easier riddles we can ensure that “spot” becomes “town” or “district” or “mine” or “monastery” or whichever it might be, but in harder riddles, it just becomes “spot” or “point” (“at a point”) or “location” or “place”, meaning it could be a settlement… or it could just be a tile of the wilderness, too! This latter point will be important later on as the poetry riddle type ramps up towards harder, end-game-ish riddles, where giving away that kind of information would be very unwise indeed.

Anyway, if we were going to bring these to life, this meant that the clues have to be able to talk about unique things to do with that location, and also about unique points elsewhere on the map which align with that town – or whatever it might be – in some way. The former of these will be much more challenging before things like histories and events are implemented, and so for now, the clues which point specifically towards the location will be talking about the location’s name. In turn, the orientation clues will be pointing towards things like a river, a lake, a mountain, a volcano, a mesa, another settlement, or things of this sort. This means some new code. Right now the game does generate names for every river and every mountain every road and so on, but it doesn’t store information about, as it were, what each name actually means – there’s nothing to hint at any kind of semantic meaning for those names. There might be a road called “The Path of Six Skulls”, but the game doesn’t know that skulls are in some way being evoked in this road’s name, or there are six of them, or that there will (soon!) be at least some kind of history generated to explain the origin of that name. It’s just a string stored in the game’s files, and nothing else. That has been fine until now, but is sufficient no longer. As such, I’ve now gone back to the code which generates the names for places and I’m currently working in new code which doesn’t just create a name which is then stored as a string and forgotten about, but instead create a name where the game also tracks what aspects of that name could later be evoked. This is a pretty complex process because many of the name generators for locations are themselves pretty complex, but here’s an example of how this works.

When the game is creating the name for a river, say, it picks from range of different archetypes and then picks a name within that archetype. This code previously looked like something like this:

Now, instead, in each archetype each piece – such as the colour and the animal or object in the first archetype – are created separately, and then the game stores in a new database of location information the name type (i.e. colour + thing) and the specific colour, and the specific thing, in the sequence it can always then draw back upon later on to create a reason / explanation for that name, and to incorporate the name into clue generation. Sticking with this example, then, the river name generator now looks something like this…

…where you’ll note that that each part of the name is a separate variable which are now being combined, and so not just do we wind up with the name string, but we can also store the list of variables and bring those back later on in order to create an intriguing, riddle-y, way to talk about it. It is this which I’m working on at the moment, and this is a very very big task as well as quite a creatively challenging one, for reasons that I will explore next time. I think this entry has become plenty long enough for now, so let’s leave it here, particularly since next time I come back to the poetry riddle generator I should have all of these specific-locations ones finished, and then we can talk about those properly in detail. Lastly – I know this is a very wordy / code-focused update, but that’s just the nature of the tasks at the moment, friends. It’s all about creating and using these complicated data structures, so a lot of my time has been spent here recently. Next time I’ll be putting up a much more screenshot-heavy update (while continuing to work on this ^), but a lot of my recent work has been deep in the code and ensuring it can manipulate words and rhymes in these cool ways. Nevertheless, I do hope this was a fun read! It’s so exciting to see such concrete and meaningful progress in each fortnight, and – touch wood – long may it continue.

What next?

Well, we are making progress on the poetry riddle generation at a good speed! We’ve now got all civilizations able to identified through well over million different stanzas, and I’m working on identifying a single location within a certain nation. This poses its own interesting set of challenges, a few of which are outlined here, but most of which I’ll cover in a future blog post as well (almost certainly 0.11 update #35). I really do hope you all enjoyed this update, and as ever, please do share this update around if you think people will find it interesting, and please do leave a comment! I’m very very keen to hear what everyone thinks on these latest developments. Thanks everybody, and see you all in a fortnight!

One Comment

  • Yes, the stanzas are awesome indeed! Especially about Star-Moon Queen and red-bloodied stone and the abyss. My personal fetishes. Hehe. :))) Great work as always! Religion deserves more attention, in the context of riddles, I suppose. I remember I was reading Ragno Nero’s prophecies (14th century Franciscan monk) and found the words “religion of the great void”. It was clear it’s was about Sunyata in Buddhism without direct naming. If the religion code have reference to archetypes then text replacement may be done for numinous entities, votive objects, etc. As well as attributes of God. Something like “the Most Merciful the Most Gracious” (Al-Rahim & Al-Rahman) in Islam for the name of Allah. The same for “Our Lord and Savior” in Christianity for Jesus. But it would require from the player to pay more attention to the religious text in the game, not just flipping through. Zoroastrians were called “fire worshipers”, although this was not quite correct, they were not actually worshipped the fire, but it was clear indication to their fire rituals. Sometimes the exact combination of words might precise indicate region of interest, e.g. “The Promised Land” is directly points to Levant or specifically to Canaan. The player should at least know the basic ideas or archetypes of Judaism to understand which land is referenced to. Maybe it would be not too hard to implement this logic using the same code that is already in place for political features as shown on the screenshots. Paganists, sectarians, chaosites, occultists usually have specific religious fetishes. E.g. the Black Sun is the highest metaphysical entity for some modern syncretic New Age Chaosites, you may heard of them. Or similarly, if you are hearing the words “New Aeon, Crossing the Abyss, Do What Thou Wilt” it’s highly likely you are in the company of Thelemites. Just like words “Katechon, Eschaton, Primordial Tradition, Archeomodernism, Dark Logos, Third Rome” will point to Russian Eurasianism (Duginism) or branch of Russian Neo-Imperialism Ideology which has now strong cultic traits, sometimes called “Atomic Orthodoxy”. Any religion (or ideology) has specific idee fixe of metaphysical or metahistorical concept. E.g. the phrase “This flawed world was created by Evil Demiurge” would clearly point to Gnosticism, they believed in that. Sometimes important quotes may indicate to religion or cult or sect: “which is below is like that which is above” – this is from Tabula Smaragdina, The Emerald Tablet – indicating an important metaphysical concept from ancient Hermetic magician teaching. Ophites, Cainites, Sethians, all had their own idee fexe and sacred symbols, e.g. Ophites’ Snake of Wisdom. Sometimes hybrid entities like Abraxas: “rooster’s head, dragon’s feet and a whip in his hand”. Ultimately there are always specific text fragments indicating to a concept or some sacred figure. Or specific rituals, e.g. saint blood worshipping among diverse and thriving Russian neo-sectarian movements, described in Mikhail Epstein’s book: “Saint blood worshippers honor their native land not because it has nurtured and given the world great sons but because it has absorbed a lot of blood, and where there is blood, there is holiness. To join a drop of one’s blood to the sea of blood that has been spilled is in itself to breed with the humanity that rests in the graves. The ever thirsty earth, with inflamed, cracked lips. Who will carry his living, boiling cup past the lips of his own mother? Spill it, water the earth that has nourished you!” It would be great to have a religious text generator with bizarre mystic concepts built by rules. Ideally the book should present some cosmology worldview, a set of opposing forces, names of Supreme Entities, and the need to perform some rituals with explanations why it should be done that way, with a set of prescription and taboos as well. Sometimes the idea of human sacrifice is presented in uniquely bizarre way: Immanentization of Eschaton. “Here he is, tyrant, has built a huge altar and, purifying us, offering sacrifice after sacrifice, hecatombs of purifying sacrifices are needed to atone for our sins. He is doing everything to save us. The innocents, who are perishing, will become our intercessors and prayers before the Lord, that is why it is necessary for us, before the world falls behind the Antichrist, to help them to be saved from sin, that is, there is no place for them on earth anyway. The main thing is that they will be spared from the torment of the Last Judgment by accepting suffering here. With our own hands, by killing the righteous, by breeding and producing new martyrs, we are not just preparing the end of Satan, we are saving ourselves. There’s no doubt about it. There is nothing to argue about. Let the innocently killed and go away, lie somewhere in ditches and cemeteries near large and small zones in the tundra, in the swamp – a peg with a crossbar and a number – but the people, as if it is a cup, drop by drop collects their holiness, and soon, very soon, without spilling anything, will fill itself to the brim.” This is a fragment from another Mikhail Epstein’s book who is one of the outstanding researchers of Russian sectarianism. The text generator and rhymes could theoretically be used to write gospels, prayer books, hymns, apocrypha and various kinds of grimoires and biographies of saints. Caves of Qud has partly implemented biographies of sultans which even may open places of interest and quests but these biographies are mostly very funny, too much random. There are bizarre sects and movements all over the world, sometimes one can recognize them by specific horrific details: e.g. eating dead human bodies, sleeping in graves, that is Aghori from Western Bengalia. Also earlier Tibetan Buddhism was know for horrific detail, e.g. Kangling, a flute made of human bones used in various chöd rituals, Kapala, a skull cup in used Tibetan Tantra Vajrayana rituals. One more aspect of the game comes from religion: taboos. Imagine eating pork next to Muslims or eating beef next to Hindus. This may result in unfriendly acceptance. Or on the contrary positive attitude when the player corresponds to high ideals of local religion. I would like to dream of seeing something in games. Caves of Qud has some implementation of this but very limited to clothing and assistance to various factions. Religion-related quests are still sadly very straightforward and unsophisticated. In the real history of religions there have always been land grabs, theft of sacred artifacts, destruction of temples, and assassinations, lots of interesting activities. Even between confessions of one religion, e.g. Massacre of the Latins (1182) and Massacre of Greeks (1204). Religion conflicts should not me missed. Standard disclaimer: this is only in the context of realistic simulation, I condemn any violence in real world, etc.

Leave a Reply

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