Hello everyone! Welcome back to the continuing, and new-and-improved, fortnightly Ultima Ratio Regum development blog update. As regular readers will know, we’ve really been cracking along in the last few months, with the development of an in-game tutorial, the development of a tutorial system, the removal of the in-game guidebook since was no longer required, major progress on generating books – useful for the journal in 0.11, and more broadly in 0.12 and beyond – as well as generating civilization-specific aspects of poetic riddles, and starting to work on specific location aspects of poetic riddles, as well as doing a lot of other work besides on various of other functions and aspects of the game. Overall, I would say I’m in fact on track (!) to get a 0.11 released by the end of the year, and this is an incredibly exciting period. This week I will, again, be reporting some big progress on various 0.11 aspects and 0.12 and beyond aspects, specifically in terms of book generation. So, let’s get started:
Book Generation

As I mentioned previously, it makes sense to do all of the generic book code in my testing file before then moving it fully over and integrating it into the game’s main file. What this means is that I’ve spent a few days in the last few weeks – while mostly working on riddle generation, of course – developing generators for the inside front pages of books. All books of course have generated covers, with symbols which denote what kind of book it is, maybe some information about the nation of origin, and also variations which reflect whether the book counts as low quality, medium quality, or high quality, in terms of its binding – and thus also its costs and its sale price. I’m very happy with all these look and these all look completely fine at present, but I did want the inside front pages to also present something distinctive and striking to the reader. My first idea was to have borders going around the front page, but an issue quickly came up here when I considered that I have nine potential sizes of book, since there are three page widths, and three page heights. And then thought about how I might create a generator for these borders, but quickly realised that such a generator would both be surprisingly complex to write, and also surprisingly frustrating to write, having a large chance to take a lot of time and yield stuff that I could otherwise have done in a comparatively handmade way. Handling a lot of border generation which is perhaps specific to book type would also still be difficult when there’s nine potential sizes I need to take account off. However, I’m pleased to say that after some thought I found a solution in which both has some logical and immediate gameplay use, and also significantly reduces the job, while still allowing me to to produce complex and rich generators for these things. So the first realization here is that book page height is dependent on the number on the number of pages, i.e. longer books have vertically shorter pages in order to fit it into the graphical style…

…but I’ve now made a change so that book quality determines the width of pages, so high quality books will always be wide, medium quality books have pages of a medium width, and low quality books will always have the most narrow pages. This also has a very small game play effect as well, by helping one recognise different book qualities, and gives a kind of logical consistency, since one would expect a swankier book to probably be printed on larger paper. More importantly for now, though, it also helps with generating the front pages for books as well, because now I only have to handle this across a variation of width, rather than across a variation of height. This is wildly easier for the sorts of borders I have in mind, and a big advantage and step forward. So, each book type will have three different kinds of front pages (low quality, medium quality, high quality). All will have the book title and maybe a subtitle and the author’s name and things of this sort, but the other stuff on the front page will depend on the book’s quality. A high quality book will have a full and detailed design; a medium quality book will have some design, but a little less rich and detailed; and a low quality book will have something quite minor in two corners, but still distinct to what category of book it belongs to. Again, I’m looking for consistency here to always transmit quickly to the player what the quality level of this book is, and just adding a large amount of rich aesthetic variation to these should reinforce to the player that books are intriguing and hopefully compelling items to engage with.
So, this then brings us to front page generation (as an aside, googling “front page” of book just brings up covers, which is strange, and frustrating, when looking for inspiration). The current book types are ‘Biography’, ‘Deaths’, ‘History’, ‘Philosophy’, ‘Novel’, ‘Language’, ‘Religious’ and ‘Cult’, with two new book types – ‘Combat’ and ‘Research’ – which will appear in stores etc in 0.12. Naturally each of these has to have its own front page style, and naturally each of these styles needs to have a huge volume of variation so they don’t repeat, so I decided (arbitrarily) to start off with biographies. I had a clear idea for how these might look, so here are three examples, going left to right in quality of the book (low, medium, high):

Now aren’t these handsome? Each has a very large number of potential pattern types in the database for low-, medium-, and high-quality patterns! I’ll also implement a system so that it keeps picking ones you haven’t seen until it runs out, and only then resumes all the possibilities for a new cycle – but you’d probably be getting at least into the mid-game by then anyway, so this would be taking place over many hours of gameplay. Here, then, I did decide to go for quite an ornate style, something that implies the grandeur or consequence of the person being biographed (?) and also perhaps conveys the sense that some of these books might be, to some extent, full of flattery and overly generous statements, as well as historical fact and truth. One interesting gameplay question I’ve been thinking about a great deal recently is the extent to which the player should be able to find false information – I can see significant advantages to this, and the possibility of puzzles where one needs to figure out the truth or something similar, but I can also see potential gameplay issues here as well, such a significant player frustration in finding something they think is that correct answer and then it yields nothing. There would also be questions of how to convey this potential shift in the truthfulness of data to the player. I’ve made no decision yet, and that’s a side topic, but I’m very very happy with how the biographies are looking in the title pages, and I think these will really stand out from the other book types when the player encounters them.
Next, we come to histories! It was of course important to me that the title pages of these books should be very distinct from the biographies, and syncs from all the other sorts of books as well, and so with this type of book I decided to create title pages that looked like this:

I’m pleased with how all the title pages I’ll be showing off in this entry look, but I have to say I really, really like these. I think they’re very distinct from the biography option, but they evoke a sense of comprehensiveness and formality and truthfulness in a way that the biography cover pages perhaps evoke something a little more emotional, a little bit more prideful, maybe something a little bit more praiseworthy, that type of thing. Again, there’s a large number of variations for the low quality, the medium quality, and high quality options, and again these will only cycle through once the player has seen them all – because the particular designs on the title page are going to be one of the few aspects not connected to riddles, and thus can be generated on the fly when the player opens a book- so it should be a long while until the player encounters any repeats.
Next, I went to the language books! For languages, it (as you might expect) takes some symbols from the language and puts them on the front page, with some low-, medium-, and high-quality variations (again, with many many others including in the potential set beyond the ones I’m demonstrating below). These look like this:

I originally tried having some of the larger versions of the characters also being shown on the page, but I actually found they really clashed with the smaller characters, and the central title stuff, and just didn’t look anywhere near as snazzy as they look on the covers of books. It actually looked very low-quality and quite crudely drawn, and I really wasn’t happy in the slightest with how it ended up looking, although I did spend quite a bit of time experimenting with this model to see whether I could get it looking good. Instead, then, I decided to emphasize the small, one-character-size version of the languages, with the high-quality version of a book also including a few other inked links to help it stand out a bit. Again, we have a large number of variations here, and I think it’s also useful to have a lot of that language within the cover page of these books in order to help the players toward immediate recognition of that language when they see it in the future. Not in 0.11, but in 0.12 or very close thereabouts, I would expect the ancient or tribal civilizations to be reduced from their current number of eight or nine per world generation more like 3 or 4, but also to become significantly larger, hold more territory, and be far more expanded on more complex compared to what they are now. So although there are a total of 16 fonts that I’ve created for the ancient languages in the game’s font maps, only four of them will be found in each game, hopefully giving each one a solid amount of weight and consequence compared to all we have at the moment.
Next, we come to the “death” books. These are books which will be tracking records of deaths and burials, graves, tombs, sarcophagi, even the fallen in battles, and all these sorts of things. Here I experimented with a few styles but in the end decided to go with a generator that, I hope, at least somewhat evokes the sort of grand stone architecture one sees in mausoleums and the like:

Long time readers and players will remember and note the detail put onto both graves and sarcophagi within the in game world – although I have increasingly realised I will need to completely redo the grave generator at some point quite soon, because it’s a very poor piece of code (being over ten yers old), and doesn’t even come close to reflecting the degree of complexity or detail that I want to add to these in the future – and so I felt that the border patterns on these cover page is really reflected both how graves and tombs and sarcophagi and things of this sort can sometimes look in real life, and how they look in the game as well. I don’t mind admitting as well at this point, though, that I was beginning to get a little bit concerned about whether I’d be able to find enough variations and styles to give every single book category something distinct. I’m glad to say I have (phew!), but some of the following ones definitely required some serious thought and consideration to help them stand out from the others already in the database.
Next, we came to novels, which after some considerable contemplation, now enjoy title pages that look like this:

Part of the reason for this look is that I simply needed to find a look which I hadn’t used for the previous books, of course, but I also thought that the diagonals here gave a certain sense of perhaps motion, or perhaps excitement, that wasn’t present in the other covers. Some of the novel types are things like tragedies or works where the goal is not particularly to sort of excite or thrill the reader, but others will be things like horror novels, compelling romances, fairy tales, etc, where the intention is for excitement which would grab a reader. These are sweeping comments and sweeping generalities, of course, but I do feel very happy with this style for the novel cover pages – it’s very distinct from the others, I think it fits in well for what novels and stories are trying to do, and again I’ve put into place a huge database here which can be cycled through before the player ever sees a repeat.
This then brings us to philosophy books, which look like this:

Here, as you can see, I started off with a spiral motif, and then added more lines to the spiral motif in each upgraded version, to suggest a greater complexity. Of course, this isn’t necessarily true because most works in each genre will be published in all three quality levels – although not all, as there will certainly be some books which are only published at the low quality, or only published at medium or high quality – but I liked how this static style played out. Again I felt it gave something quite distinct from the earlier ones. Generating these books’ contents and ensuring that the written outcome is not just weird nonsense is definitely anticipated as being probably the most demanding of the book types, and also the most demanding to fill with content that can truly connect to the game’s riddles and world (the inevitably abstract nature of philosophy poses a distinct challenge here), so I would anticipate the philosophy books perhaps being the last style of book that gets generated within the game. Alternatively of course, given that these will be the most abstract and thus the least connected to the rest of the game world in some sense… they might in fact be the first! Though I doubt it. Regardless though, I’m happy with these title pages.
Next, we come to the ‘Research’ book type. These are not currently in stores in the game and I wouldn’t anticipate that changing for 0.11, but these will give information about deep underground, underwater locations, and the like, as well as plants, fungi, wildlife, and so on. Overall I wound up with nine different categories for these books: caves, fungi, oecans, mines, bioregions / islands, plants, vines, [????], and animals. For each of these subtypes I felt the logical thing was to just take the in game symbol for that particular category of thing and have it appear here on the corners of the cover pages. So for the lower-quality versions it sits in the upper left and bottom right corners, for the medium-quality versions there’s one of those symbols in all four corners, and for the high-quality versions we see all four corners plus a bit of extra ink in the middle of the top, and the middle of the bottom. These books therefore have (by quite a margin) the lowest degree of cover page variation, but given that I would anticipate these being probably comparatively rare books compared to the other book types, especially for things like specific ruins deep in the ocean, or specific caves and things of this sort, I don’t think that’s a huge issue. And also, given how hugely varied all the other types are, it’s not the end of the world for one style to have just slightly less variation (while still having an absolute ton, I feel compelled to stress). I just couldn’t find a way for all of these subtypes to be as rich as the other types I’ve listed here, but I still think that they look great, and they’re perfectly suitable to move forward with:

This then brings us to the ‘Combat’ book type, which will be the main way the player learns moves and abilities, but that’s coming soon, so I’m not going to work on either of these until I have a clearer sense of the implementation of both of those features into the game. That then brings us to the two remaining types, ‘Religious’ and ‘Cult’ – and the cult books, of course, just being the holy books which are used in civilizations with lots of cults (think: Roman-style mystery religions) rather than more overt religions as the other nations might have. The cover pages for these categories are still in development, and are hugely complex – I’d estimate the time these are taking is around 50% the combined time of all the other types above. They’re looking awesome already, but they aren’t finished yet, and due to their complexity and variation, I’m going to write about those in another entry (and, again – they’re not actually done yet!). Nevertheless, I’m incredibly excited by all this progress in the book generation – we’ve had book covers for years, but now we have cover pages, we have mechanics for turning pages, fitting words and pictures into pages, advancing to new lines, new chapters, ensuring the game knows how to do this and can intelligently fit any arbitrary generated text into a book (!), and all these sorts of things. All that now needs to happen is to fill them with stuff to read about – and one of the core development goals for 0.12 is going to be generating at least one type of book, fully and completely. Not sure which it will be yet, but that’s going to be an absolutely essential part of the release after this one – and a really exciting part, too!
What next?
Thanks so much for reading, everyone! As ever – chuck in a comment below with your thoughts, if you please, and do think about sharing the post online with others if you think you know people or communities who might enjoy giving this a read. As for what comes next, it’s hard to say what next fortnight’s entry will be – there’s a lot of 0.11 stuff on the go at the moment, so we’ll just see which comes to dominate my development time in the coming weeks, and that’s the entry we’ll get. It’s all super exciting though and I think all the next few entries will definitely not disappoint.
A final thing
One last thing though, friends. I’m now months into doing the fortnightly blog post, and would love to get some feedback on this. Do you prefer the blog post to be fortnightly, but slightly smaller? Would you prefer a return to the triweekly (but slightly bigger) blog posts? Or even a shift to a monthly blog post, which would be obviously around twice as big as these fortnightly ones, much closer in size to the triweekly ones or a little bigger? I have no particular preference, I don’t think, but I’d love to hear what you all think.
Thanks everyone, and see you all two weeks from now!
Caves of Qud is starting to smoke nervously. 🙂
Excellent work.
Looking forward to 0.12!
PS. About updates, quantification by work volume is better then quantification by time. Not equal portion of time but equal portion of work.
PPS. Book design is so cool!
Ahahaha, thank you dreamer! Thank you also for both of the notes :).