Hello everyone, and welcome to this fortnight’s entry. Here we consider several things. Firstly, we’ll take another look at the frontispieces of books. By this, I don’t mean the covers of books, but the first page you see when you open the book. As with the covers themselves, I really want these to be very varied, very distinctive, and stand out, to give the player the sense that each book is its own distinct self-contained thing. These have taken a ton of effort because there are just so many religious possibilities that I’d like to have reflected on these pages, but they’re now looking really cool, and I’m ready to show them off. I’ll then move onto exploring more variations for what images and things of that sort can appear in books – specifically, map fragments. This was a complex one to add, but a really rewarding one, and this’ll be a really essential addition to books and their integration into the rest of the game world and the player’s objectives. So, let’s get on with it:

Religious and Cult Books

First, let’s talk about the title pages in books. Readers will remember that a few entries ago I focused on the cover pages for most genres of books, whether they be biographies, histories, novels, research books, or anything else, really. I’m really happy with how those are looking, but there were two categories that I hadn’t yet got to – one being combat books, since I need a better sense of how acquiring skills and moves will work before we can think about the covers for those books – but also religious books, whether for religions as in most nations, or cults in very rare nations. These are certainly the most complex, but as they’re important books, I did want to really put in the time to make these ones particularly shine. One key thing I quickly developed quite differently here was a change from the standard intensification from low, to medium, to high, quality books evidenced in the other cover pages. The default there was for low quality books to have some kind of pattern in the upper-left and bottom-right corners of their front pages, then medium quality books would be the same but with the designs also in the other corners, and then high quality would be the same as that with some extra design added on. For example, as a recap, here’s what one might see in biographies:

This was a successful way of doing things – and not too hard to code, either! – but I wanted to add some more permutations here. I settled on the idea that some religious book covers will stick with this design, or perhaps a modified version of it, while others would do something different. So to address the first group first, I set to work adding new code for implementing coloured variations, all kinds of new shapes, and also new kinds of “banners” (the flourishes above and below the titles in the example shown above, which relate to the shape preference of the civilization that made the book). For some of the religion types it was clear that I would want to create a special pattern for each subcategory, while for others there’s just so many permutations that such a thing would be impossible (i.e. the catch-all “normal” god type, when the game runs out of more “interesting” ones, has thousands of possible manifestations). In the first case though, the “animal” religion archetype was a good one with only about twenty options that can appear in a given world (octopus, eagle, wolf, etc), which meant only about 20 sets of designs too create myself. This was the very first I did, I started off with the octopus god option, after a little bit of work, I had something that looked like this:

(All 3 from one religion would of course be the same colour – just noting here the colour variation)

And something like this will work well for most of the animal gods! And, indeed, most of the gods in general (it can of course also go in both corners instead of just boosting one corner, but I tried tentacles in both, and hated how it looked). With that said though, some of them will certainly prove trickier than others, because it’s much more obvious what to use to represent a crab and octopus then perhaps a wolf or cat within the same kind of context. Some of these then will probably require a little bit of cleverness from me, and indeed I might have to create a few generic options for the animal gods to use instead if I just can’t find something that looks visually pleasing for each creature in turn. However, I also then developed a bit of code to do an alternatives, which is to say having whatever the designs might be instead appearing directly above and below the main body of text, rather than at the top and bottom of the page. There’s a surprising amount of code which goes into tracking how the things on the lead or cover page should look, but it didn’t take too long to find a way to make this work smoothly and consistently. I suspect we’ll end up with roughly two thirds of the religious book front pages having the top of page or corner layout, and roughly one third having the other layout. But with that bit of code then done, I then implemented a test example of what one of these might look like, and I really do like how these came out:

Really like these! (Eagle-eyed readers will remember a sketch of this from several months ago). Then, just to make sure everything is working fine, I tried an example for a demonic god, this time for a god whose name contains the “bladed” keyword, and the “bladed” front page design hasn’t already been assigned to another god:

With these done and looking nice, and all of the required code in place for me to come back to and fill out every possible variation within these categories, I then went on to dealing with the pantheon gods. These have always been the trickiest in everything, whether religious clothes, staves, rings, keys, or basically anything else, because they use a range of different colours for a single religion, the full nature of their range isn’t wholly predictable, there might be four or five or six or seven gods within the pantheon, and it’s just far more complex and far more awkward than the others. However, I’m pleased to say that I found a number of different methods to put these into the holy book front pages. There can only be one of these pantheon style gods in each world, but I’m still creating about a half dozen different styles for these front covers, so that it will be quite a few games until a player ever sees one repeating, at least most of the time. Here are two examples:

I was very happy with all these, and I think they’re looking super fun (I hope you’ll also appreciate the little sentence after the book’s name, which is of course itself also selected from a large number of permutations for each one). With these done, I then turned my attention to the front pages for cult religious books. Readers might recall that the holy books for religions and cults look quite distinct…

…and cults currently in the game worship a range of things, but I’m going to be making changes to these, so that cults can either worship the unique thing that their civilization has (e.g. stone faces, pyramids, etc), or they can worship particular locations on the map – a certain bioregion, a certain mountain, a certain river, etc. I think this is pretty interesting and will really distinguish them from the rest of the game’s religions. Anyway, with that in mind I was looking for something to put together something a little distinct here, so I decided to develop a set of symbols for the different sorts of things cults might worship, and then develop suitable range of low quality, medium quality, and high quality variants, for each of these options. My goal was to show what they worship a bit more literally than the religion ones, but still be recognisable and within the same vein. To illustrate what I mean, here’s a trio of possible frontispieces for a cult who worships pyramids. I really love these, and I would challenge anyone to see this book frontispiece, to read it and get a sense of what it means, to understand that what lies within is entirely novel to your generated world and will be entirely meaningful and actionable (i.e. not gibberish), and then not be excited to read it. I challenge anyone!

As with the other religious books, I again don’t mind including colour here even in the low quality versions, because these aren’t mass produced books. As with the religious ones again, I’ve just implemented a few here to show off the style and get all the required code in place – I’ll come back to these later when the time comes to ensure that a full and large database of them exists to fulfil any possible cultist interest.

As a final point, I should stress that not all of the permutations for each religion category are currently in the game’s code. This is because I needed the system to be implemented so that I don’t have to come back to it later and re-decipher how book code works, but we don’t need the full database of these to be present until 0.12 and beyond. As such, I’ve done about a half-dozen to test the system (and to show here in this entry), but there are many dozens still to do, which I’ll do next year or thereabouts (i.e. when they are actually needed). Nevertheless, I’m really happy with how this looks, and I think these frontispieces for religious books and cult books will be something very distinct and different for all the others on offer in the game, and just a cool and interesting visual as well. I’m always striving to ensure as many compelling or interesting things for the player to find, as rapidly as possible, especially as the transition into gameplay gathers speed – with such a big and complex world, and unusual core gameplay, anything I can do to keep people interested and engaged until they “get it” can only be for the best. It’s even possible the player might start with the holy book of their home religion in their inventory, but that takes us to questions about how the player starts the game, and I’m very busy pondering those at the moment, so let’s call it a day there for now, and come back to them in a later update…

Maps in Books

I’ve also recently expanded the possibility of what can be printed in a page in a book, aside from a classic 7-by-7 image for something, such as a mysterious sign, or a more representational symbol, a character from an ancient and hard to decipher language, or whatever it might be. Specifically, I wanted to enable the possibility of little map fragments showing up in books, as these will make an obvious useful addition to the sort of things that the player can do with books, and how books will be functioning more broadly. Going back to how the world map notes generate, and also how the local map notes generate as well, they each use sets of 3×3 ANSI characters to denote a certain thing, so for instance in the picture below you can see how the note is made up of many grids of that size, with each one showing that a river is going in a certain direction, or there’s a forest or some other kind of land, or a settlement, or a lake, or whatever might be:

Having created all of these for all the different things we can find on both world and local maps (this one is a world map), I want to reuse these into books. Turns out – easier than I thought! The first thing was to add the possibility of having a page where these are going to appear be comfortable taking out nine or twelve lines (i.e. for three 3×3 tiles in a column, or four of them) instead of seven lines (the default size of symbols). this didn’t take long, and with this implemented, I quickly had book pages generating with sufficient space to fit in either one column, two columns, or three columns, of map data. Naturally one column would be far harder to identify on the world map than two columns, which will in turn be harder than three columns, so there’s also very easy and very obvious way to scale and adapt difficulty here as well. The next step was to create a pretty simple data structure for keeping track of these, which didn’t take long, and then to return to the code which is used in notes to print both world maps and local maps. I quickly abstracted this out from just the note context, so that I could use in this book context – and maybe others in the future, who knows! – and then was quickly able to get these printing successfully on a book page just as they had been printing on a note page. I really dig how these look, at all sizes, I think there’s some really interesting potential here, as with the symbols that can appear on book pages, to add visual data to books for the player to assess as well as purely written data. They also give us an excuse to add some colour to books, which is no bad thing. I also had the nice idea that only the highest quality books will have these in colour, while lower quality books will have them in black and white, thus giving a clear advantage to spending money on the higher quality book in terms of working out where on the world map a particular location might be. We’ll have to experiment with and balance this later on, but I do like the concept in its essence. So, here are some examples:

With these done, there’s now only one thing I need to work into the book generator, before it will then be time to move the generator from the testing file into the game itself, and began to implement the journal mechanics which I discussed a few entries ago. This final thing is to add damage to pages. I don’t think this will be too difficult on a technical level, but it does require quite a bit of conceptual work to think through how this is going to work, particularly in terms of how the game would track whether important data is being obscured or not. I think anyone reading this, giving some consideration to how this would in fact be monitored, will quickly realise that this is a very demanding and complex task, because it’s dealing with information of a qualitative nature, and information which could appear anywhere, on any page, in any book, and in several forms – i.e. written, map, or symbolic. How can we apply damage procedurally, which either doesn’t obscure important information, or does, depending on what we want, and looks organic and realistic at the same time?! This is, as they say, “a biggie”. At the moment I’m still giving it some thought before I sit down to write this code, in order to ensure that I can do it well first time round, and don’t have to go back to it in the future. For notes the code currently prevents damage from obscuring anything vital, and I think I’ll go with the same solution for now, and then return later for the far more advanced damage that can obscure something important. I therefore have a pretty good sense already of how this is going to work, but I just need to be absolutely certain before I (metaphorically speaking) put pen to paper. Nevertheless, with the remaining frontispieces implemented, and with map fragments able to appear in books, we now reach a point where basically everything – except damage – is ready to go for book generation in 0.12 and beyond, and everything is in place for supporting the player’s journal being implemented, at least in an initial and usable state, in 0.11. These are honestly huge milestones, and I couldn’t be more excited about them :).

Secrets in Books

Last but not least for this week, long term readers will remember I had an idea while you’re having secrets not just hidden within q book’s text and pictures, which you can actually see, but also finding a way (that is consistent with the game’s overall / realistic 99% framing) for the books to be slightly altered depending on context. The concept was that you might discover in some other book, or from a character, or from a note, or whatever, that a certain book or note has something extra and secretly hidden within it, but which will only appear under certain environmental conditions – the idea here being for something like invisible ink, but just moving it one step forward into a slightly fictional implementation. So, books now have a system which tracks which pages have something secret on them, what the secret thing should be, and what the specific environmental trigger should be to bring it out. So you might imagine you have a bunch of books (again, as ever, just placeholder text – book generation coming next year) which look entirely ordinary 99.99% of the time…

…and then only under the right conditions (right phase of the moon, right weather, right time of day, or in the right position, e.g. standing next to a fire, standing next to a river, standing atop a volcano, etc, or more likely some combination thereof), you might instead see something like…

…appear on the book’s page, and you’ll get a message in the game’s message log to let you know that this has happened (just in case the player, you know, somehow doesn’t notice the massive blue ink now in the book, or has forgotten that it wasn’t there when they first looked through). For these examples I’m using the idea that the player’s looking at these in moonlight, hence the silvery-blue colour going on here, but we could also extend this to all different kinds of colours and visual styles depending on what’s the required trigger is, and what contacts the player is looking at these in. Aside from handling damage (and you know, er, generating the text of books), this is basically the last thing which still needs doing for book generation – again, I’m not adding in every single variation or every single permutation just yet, but just making sure that all the code is there so that I can come back next year and fill out some massive databases before the game to then use from that point on, without having to refamiliarise myself with how all the book generation stuff actually works. Pretty much every piece is now in place for this major part of the game, and once damage is implemented I’ll be able to integrate all the book code (now finished and prepared for the future) into the game’s main codebase, starting off with letting the player use their journal and see it filling up with information as they explore the world. Oh, and finally, on that note, the player’s journal now has a fifth tab – for noting locks you have found, but haven’t opened. In light of some recent excitement, this like a sensible addition.

What next?

Well, that’s everything for this week, friends. I’m really pleased that I finished off all the frontispiece styles, and made some progress towards filling out those databases as well – and I think the religions and cults have a really rich and fresh and distinct style from the other frontispieces I showed off in the previous entry. Equally, adding the capacity for book pages to show maps is a really important step forward, and it also offers a generalizable system for me to insert other things into book pages in the future, or essentially any size, if or when we think of something else interesting to put in there. I also think the potential to have triggers for books showing you something different is really neat and really novel, as well. If you thought this was a great read, please do think about sharing it with any other roguelike fans on the web you might know, and please do leave a comment with any of your thoughts if you have any comments, critiques, feedback, suggestions, or basically everything else :).

Thanks folks, and I’ll see you all in a fortnight!

One Comment

  • Yes, you challenge anyone in roguelike dev domain. Who ever did such things? Noone. The decorative elements are divine. Will the stories and biographies intersect somehow? Implying underlying basis timeline of events.

Leave a Reply

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