Hello friends, welcome back! Over the past couple of months we’ve been looking at the creation and implementation of the local map clue types, i.e. clues that show you something on the human scale (doors, furniture, trees, etc) – rather than the world scale (towns, cities, mountains, etc) – which the player might want to investigate. I’m incredibly happy with how these are coming together, including some of the quite significant technical and data infrastructure stuff that has been required to make them work… but a lot of this code is not only useful for them. When considering what else I could use it for, I was really taken in particular by the draft of the “picture” archetype that I’d explored before, i.e. taking the world that the player sees from the top-down perspective, presenting an area of that world in a side-on perspective (e.g. if one were actually a person, physically in the world, looking at something), and then challenging the player to successfully match one to the other. Visually this was a clue type just so different from both of the other currently implemented, and it would also give me a good reason (excuse?) to start integrating into the game the gigantic database (many hundreds!) of 7×7 ASCII / ANSI character designs I’ve built into the game for the coming years, which can represent anything from animals, to religious altars, to statues, to relics, to trees and fungi, to almost anything else. Much like when I got started on the local map clues, I therefore decided I was going to spend one full day, i.e. dawn to midnight excluding time for eating and working out, exploring the generation of this clue type. If I made huge progress in that day, I’d implement them for 0.11 – if I didn’t, I’d still have learned a lot for the future, I would hopefully have made some useful progress, and only one day would be spent.

This ^ is the style I’m talking about (the above example being just a placeholder or proof-of-concept of a very basic generator version, rather than a full generator that can use anything from the generated world to construct a picture from). I just think this is so very cool, with so much potential. Anyway, much like last time, I’m pleased to say that after just one day of work I was able to go from “there is no code that does anything for this clue type” to “I can now get this to generate for real buildings that exist in-game, for hypothetical buildings which don’t yet exist, and I have a good sense of how I’ll do it for the outside as well” – and, wow, that’s a ton to get done in one day! By the end of the first day, therefore, I did have the ability to take either the abstracted data from a generator about something which will be generated in the future (e.g. the information about how a particular guild building might be generated, for example, with its walls, doors, furniture, etc), or take the “real” data about an actual local map which exists within the game (e.g. the university campus where you start the game, or its great hall, its library, a classroom, etc), and have the game figure out what a particular spot inside that building would look like from the side, rather than from above (assuming all objects block vision of objects further back). This was a really exciting and interesting process to think about since although there’s a small bit of code overlap with the local map clues, i.e. the use of the grids and the translator that tells the game what each character means regardless of which grid is being used, it’s essentially completely novel. In this case the game needs to be able to take a slice of five tiles – as viewed from a particular perspective, e.g. viewing them as a line from left to right, rather than a line from front to back – and track what’s in those tiles, and potentially including what’s behind them as well (more on this in a minute), and then present those from left to right to show us a human-eye view (rather than a bird’s-eye view) of what that place would look like. That means looking at the map that is the local map or the “map” of the inside of a building, and then note down terrain, features like tables or vases or whatever, the heights of things, whether there are any doors and windows and so forth, and integrate that into the final picture. So, to do this, let’s imagine this grid, which is the generator foundation for one of the parliament indoor variants:

Here the “-” character and “R” character both refer to the abyss / nothingness outside of the map, the “#” character is a wall, the “c” character is for chairs, the “t” is for tables, the “B” character is sometimes tables but sometimes not, the “D” characters are doors leading outside, the “d” characters are for internal doors, the “v” characters are currently just normal floors, and the “1”, “2”, “3” and “4” characters denote the inner and outer bounds of another area of terrain which is later pasted into the parliament building after the main thing has spawned, and the “x” characters register for the local map or picture clue generator as invalid, since it doesn’t know what’s going to be placed there later on (so those tiles and anything within cannot be used for generate a clue of either type). In generating picture clues, then, the function for this takes a map and selects a tile. It then picks a random direction the character might have been looking when they drew the picture of whatever they were seeing – i.e. north, south, east or west – and then creates a line going at right angles. What I mean is that if they’re looking to the left from a position, say, then the game imagines a line of tiles they’re seeing from top to bottom, ranging from two above where they are to two below where they are, and then begins the clever part. Moving one x or y coordinate at a time, the game tracks across the map grid and takes note of various things as it does, such as the first object on the ground that the person would be seeing from this position – a chair or a table, for example – and the last object in that sequence which would appear behind all others, which is generally going to be a wall (or if outside, well, we’ll handle that later). It also takes note of larger objects that would appear behind smaller objects, such as an obelisk rising up behind a plant, for example, and like the local map clues from the past few weeks, it uses information from the dictionary of grid-translating dictionaries to know what each character is it’s encountering, and thus whether it would appear in front, appear behind, or end their line of vision. I think it’s reasonably clear what I’m talking about here, but using the above example and a random generation I had the game spit out for the sake of this entry, here’s some more elaboration:

So imagine a person standing at the white dot on the grid, looking to the right, and with a look “width” of five (as that’s how wide the clues can be, though we can absolutely have narrower ones as well in the future). They’re then looking down that path, as far as they can look, and seeing the first thing they can see in each row. The first row, of course, they’re seeing a table first (assuming the “B” character is indeed a table in this permutation) and then a wall behind that (the “#” at the end of that sequence). There’s nothing else between them so that records that there’s a wall and a table on the left end of their vision. The second row is nothing, and then brick. The third row has a chair, and a bunch of stuff behind it, then terminates in a door (within a wall). Right now doors do not appear “larger” than other things, but I’ll be adding that in, though for now the doors register as having a height of “1” rather than a height of “2”. The fourth plays out just as the third does. The fifth plays out just as the second does. I’ve tried to show this on the left-hand side, underlining the first thing seen by the person standing there in each row (or column). Once the game has that information, it then plugs that into a reasonably complex function I’ve written which looks over the data and extracts what the background in each line ought to be, how high up it should be if relevant, whether there should be anything on it (e.g. a painting, a mural, a sign, a window, etc), and then what should be at the front, and whether anything should be behind it or not. It then also does a clever little thing and looks for rows in the final 5×5 product which maybe don’t have many interesting things to show, and it selects one of them to sometimes use as a aplace for a hint abotu what direction the viewer was facing when they drew this picture, and also tries to place important things – such as the “?”, signalling “look here!” – in a location that will again add to the visual variation and interest of the clue. Once this system is complete, it then spits out a grid of 25 pictures (these 7×7 pictures I’ve been working on in the background for months now, and have a gigantic database of at this point) and once we put those into the clue printing system, we get something like this:

Now, I know this one looks pretty basic – but you can see the idea we’re going for here! Match that up to the physical world you’re walking around, and thus discover where you should look to find something (e.g. something secret scrawled on a wall). Now, I did actually debate having a “floor” level so that the walls look a bit less empty, but when I tried it out with an ornate flooring pattern, I really didn’t like how it looked. I felt it really took away from the sense that you were viewing something sideways and added an unfortunate degree of ambiguity about the actual visual perspective being used here, as I think is evident here:

I, at least, think the second obvious looks better, even if we need more stuff to fill up the walls. Now, windows at some point are going to be doing some of that job, although they aren’t in the game yet and won’t be appearing until 0.11, but they’ll also take up part of the wall for some of these inside pictures and should make these areas look a lot more distinct on this kind of clue (you’ll also note that the windows, naturally, reflect the shape preference of the civilization in quest, as do things like chests, doors, and so forth, when appearing in this format). Regardless, the important thing is that I can have it generate these sorts of clues for, once again, basically any possible generative grid! Readers might remember that I recently discovered (to my mixed awe and horror) that there are other 2,000 generative grids in the game, i.e. grids of strings of characters which the game can parse in various ways to construct buildings or outdoor areas (think somewhat like “vaults” in Dungeon Crawl Stone Soup in terms of how the functionality works), and any of these – when used in tandem with the dictionary that translates them all – can now, indeed, produce these sorts of clues. This isn’t to say they are integrated with the game itself yet, as that’ll come later, but the point is that I’ve produced the system which can take any kind of input, figure out what it would look like if you were standing in it and looking in a particular direction, and then generate a clue which looks like a sensible depiction of what that perspective would look like – even if a few final tweaks, like the relative heights of certain things, still remain to be implemented. Once this is more fully developed I’ll be able to add these into 0.11 without too much difficulty, I think, asking players to visualise the game spaces from a human’s-eye view as well as the top-down view they ordinarily see, and I think that’ll make for a really interesting challenge which, like all the others, can be scaled down in difficulty (lots of hints, very unambiguous features on the hint) and scaled up in difficulty (lots of damage, very generic features, only the slightest clues relating to where it might be pointing you to). Add more variety, add more information to give you a hint about where to go, and these should be good to go – at least for the inside of buildings. The outside has its own complexities, but I’ll come to that soon!
New graphics
In the process of all this I also added quite a few new graphics to what is now the huge list of these which can appear in these sorts of clues (and also in other clues, in books, on statues, in all kinds of places – always good to find as many ways to reuse this kind of work as possible). Specifically, there are already graphics in the normal 7×7 character size for things which are “tall”, i.e. heads on spikes, grandfather clocks (not yet present but they’ll be one of the “civ specific” traits like pyramids or stone faces or tapestries or whatever), gas lamps (ditto), obelisks (ditto), fountains, flags, and cacti. These will be fine for plenty of clues, but since these clues are somewhat more on the “realistic” side of things rather than the “abstract” side of things, some of these would end up being unrealistically small on some of these images, e.g. an obelisk might look as tall as, say, a plant. A bit of artistic license is fine, but I think there is a limit, and I felt that these tall structures ultimately just exceeded it, so I went back to the huge list of graphical 7×7 blocks I’ve constructed (multiple hundreds here, and haven’t really shown most of them off, since I’d rather they be seen in game!) and added in a few set of seven pairs for taller structures which might appear on these clues – i.e. the seven I just listed above. I’m really, really happy with how all seven of these look. I also added in four graphics, one for each of the cardinal directions, which I’ll also work into the generator to sometimes appear on these kind of clues in order to give the player a little bit more information (i.e. these would appear on lower-difficulty clues of this type rather than higher-difficulty clues of this type). There are also definitely other opportunities for symbols to appear in these to give the player other hints, or two add information other ways – for example, if the picture is showing you somewhere in a nation with a red, green, and white flag, well, we can just have one of the symbols in the clue appear in each of these colours. Then for higher-difficulty ones, we can of course again deploy damage as a way to obscure what’s actually on the sheet and make it trickier to identify what kind of location is being depicted. Anyway, we’ll get to that later, but for now – I really like these:

Abstract Clue Elements
Finally, I came to realise that a risk here when we have only two colours to play with (or in a sense, one colour, since the other is the background) is that a lot of buildings are going to look very similar. For the outside is shouldn’t be as tricky as I’ll be able to bias the generator towards more interesting exteriors, e.g. those with statues or nation-specific cultural items around them, but for the inside, a lot of buildings when you look side-on are, of course, variations of bricks, windows, chairs, tables, beds, the usual. In general the local maps for the same buildings will have a lot more potential for variation since they show the flooring and a larger number of things, since in a sense these maps are showing you five things in a row (and the stuff behind them, at least, to some extent) while a local map clue might be showing you 81 different things (i.e. stuff on a 9×9 grid). So, I realised that we need something more in these clues to help distinguishing one building from another. Now, par of this will be the context you find them in – e.g. you might find one alongside a rhyming clue, for instance, where the rhyming clue is telling you a hint about the building, and then this clue is the second step once the building in question has been successfully located – but I definitely felt I could do more here. The idea I came up with was adding figurative aspects which aren’t literally there, but which point the player towards the sort of building that perhaps they should be looking for. I think these will add a ton of interesting variety alongside the actual gameplay use in boosting identifiability. So as a proof of concept (I stress that this is NOT implemented yet), perhaps you’re given a clue which is going to be in the holy building of a religion that worships an octopus-god, so perhaps the game can take the clue – assuming you haven’t been given other information alongside that clue to direct you to said type of holy building – and add something like this into it:

I think this is incredibly rad (and imagine, say, a hundred such additional generators which can appear on these clues to give figurative elements that hint usefully to the player). Perhaps for particularly elite buildings some of the bricks might have stars in them (as if they’re gleaming), or a religion of a fire god might have a few fires around the layout, or a courtroom might have gavels on top of the tables, and so forth. We can also slip in a few things relevant to the biome the building is in, too, so vines might appear in the clues for buildings in tropical regions. Of course, in order to convey that this is not literal to players, I think a tutorial prompt along the lines of “Some clues may exhibit artistic license” will be required to get the point across, but I don’t think anything more than that is required. Now I’ve settled on this idea I can see so many cool ways to denote what kind of building is being shown here, or what nation its in, or all manner of other hints. That kind of information is actually much easier on the outside since you can show climate or weather and so forth there, but inside, we’re definitely going with a bit of the artistic license here. While this wasn’t in any way planned as part of this clue type, I really do like how the above looks, and I can always see in my brain how some of the others are going to end up looking – they’re definitely bring a ton of cool variation into And this is alongside, of course, using colours on some tiles to show a national flag…

…as well as having you find the clue alongside another clue which gives you a bit more of the required information you’d need in order to usefully place the picture clue. On this final point, this is emerging as one of the most interesting and challenging aspects of the quest generator which is going to be coming in very soon indeed – having the game know “how much information is needed for the player to usefully use this information we’ve just given them?”. This is a very challenging and abstract question, and I’m honestly not completely sure how I’m going to handle it just yet. Information is such an incredibly abstract concept, and it’s already tough in non-procedurally-generated riddle games where often one winds up with something where far too much information is given (rendering the “riddle” or puzzle pretty trivial) or the opposite is even true, where there’s honestly just not enough for you to connect the dots and figure out what to do (this is rare, but there’s probably one in La-Mulana that stands out here, and one or two others from around the cryptic riddle game verse). This is therefore a real complexity I’m still working on – how does the game know how much information is required to solve X? And how does the game then figure out how to distribute that information across the clue(s) the player is given to find and solve X? – but we’ll be coming back to this in the future, of course. For now all the groundwork for these has been put in place; I have a good sense of how to add loads of variation and higher or lower difficulties; and even though it didn’t take much effort, it looks like we’re going to have a fourth clue type in 0.11! I am, genuinely, going to stop there – the rhyming riddles, the world map clues, the local map clues, and now picture clues, are already so much more than I anticipated, and that’ll be a fantastic and varied set for a proof-of-concept release designed to test the generation, and solving, of these clues in a complicated and huge world. I’m really happy with this progress, again, and it’s so gratifying to see how all these new data structures I’ve put into place over the past month or two are continuing to yield benefits.
Soundtrack News
Additionally, readers might recall in a recent entry I noted that the soundtrack hadn’t made a tremendous amount of progress in the first half of the year for several reasons (nobody’s fault!) but that now it looked like things were getting back to it? Well, I’m very pleased to say that in the last week I’ve received the first drafts for three of the remainin tracks which don’t have any first drafts yet. Specifically, they’re the track for combat (which, remember, will be rare, duel-focused, and very dangerous), late-game areas such as islands and ruins, and also [redacted]. It’s with great pleasure that I can say all three of these I really like, especially the middle one, which is already in its very first iteration pretty close to what I’d consider a finished track. We were really looking for something suitable to rare-ish locations in mid-to-late game, which are strange and potentially scary locations, demanding to tackle, requiring a lot of attention, planning, existing in-game knowledge, and posing serious dangers as well (while keeping the discovery, exploration, mystery notes, of course), and I couldn’t be happier with how that one’s sounding. The duel / combat track is really interesting and not what I had planned at all, but I really like this first draft Nik has sent along, and I think – the first time you’ve annoyed a person or a faction enough for them to draw a sword – the change in the music will really signal that this is something very different now and your character is in genuine and significant danger. It stands apart, but also fits really well into the rest of the soundtrack as it’s coming together. The other one I don’t want to say too much about now in terms of its actual nature and purpose, but it’s a really solid foundation as well for a track that needs to be very ambient and just ever-so-slightly spooky or otherworldly, and it’s hitting those notes fantastically well. With this, nine of the eleven tracks have a first version – some of which are already very close to a final version – and that’s a huge step forward with the soundtrack. We now have first drafts or beyond for the general walking around in settlements track, the “major place” track (cathedrals, catles), the “holy place” track (religious buildings), the “secret place” track (hidden locations), the travel on the world map track, the duel track, the underground track, the underwater track, the [redacted] track, and the end-game locations track. I’m really looking forward to continuing to work closely with Nik on this in the coming couple of months and getting those final drafts in there, then refining them all for the 0.11 release! I really do like the soundscape that’s coming into being here, though, and I think you all will as well :).
What next?
Well, there we have it, friends. We now have a fourth clue type that can generate intelligently from either real or abstract in-game material, presenting you with a human’s-eye view of something (rather than the bird’s-eye view of the world map clues and the local map clues) and in doing so giving a really interesting and different challenge that should fit in incredibly well with the other three clue types I’ve already got going. With this in place – not quite finished, but heavily developed – I am, honestly, over the moon. I intended to have one clue type viable for the 0.11 release, and we now already have four! And after only a month or so of total work, as well! I knew the rhyming riddles were the most complex I’d ever do, but I hadn’t quite appreciated the scale and degree of the difference in time and labour and intellectual commitment there; one year of work for one clue type, one month of work for three clue types. And the thing is as well, as I’ve mentioned before, it’s not that these other clue types are any less challenging or interesting to the player – it’s just that their generation is wildly, wildly simpler (still solidly demanding and requiring of work, of course, but nothing even remotely to the same degree as the rhyming ones). There are a few next steps to really finish these off, but with the world map clues 100% finished, the rhyming riddle clues 95% finished, local map clues 100% finished, and these well on their way, I’m really pleased by how things are moving now. In the very, very, very near future, I will be moving onto generating the first trial quests using all these materials and all these new data structures, and that will be a very exciting milestone indeed. For now though, as ever, please do think about sharing this around with other roguelikers on the web if you think they’d find it interesting, and please do let me know your thoughts in the comments below! Thanks again for reading, friends, and I’ll see you all again in two weeks from now :).
