Temple of The Roguelike Forums

Players => Early Dev => Topic started by: UltimaRatioRegum on December 13, 2014, 01:49:28 PM

Title: Ultima Ratio Regum (0.8 back in development!)
Post by: UltimaRatioRegum on December 13, 2014, 01:49:28 PM
So, I'm starting a year of full-time development on URR. This means I am working on it as my main occupation for that time and living off my personal savings. As such it seems sensible to add a regular update thread here as well as my blog, Bay12, TIG and the various other places I have such a thread, and to cross-post all my weekly updates to here.

For those who don't know about the game:

Ultima Ratio Regum ("the last argument of kings") is a ten-year project, of which 3.5 years have been finished via coding part time whilst completing my doctoral work. It's a game which aims to integrate thematic content on historiography, philosophical idealism and the rise of modernist grand narratives, with the deep, complex and challenging gameplay one expects from a "classic" roguelike (and, of course, an ANSI display and permadeath). Set approximately around the Scientific Revolution, the objective of this year is to finish all remaining worldbuilding (~2.5 months), and begin to integrate early gameplay focused around strategic choices, NPC interaction, and hopefully combat too. Screenshots:

Loading a game with player information:


Exploring the generated desert fortress of "Redsnake Bastion":


One district among many in the city of Smithvale:


Wandering around a graveyard outside the city of Foolrock Precipice (every grave of which has a name, a date, and is linked to the world's history):


I've just released version 0.6 after seven months of development, which now gives you the ability to walk around farms, towns, vast cities (each able to support a population of ~300,000+), fortresses, slums, graveyards, hunter-gatherer settlements, and more. I'm now working on version 0.7 - having tackled the exterior for every building on the planet, we need to tackle the interiors.

You can download the game at http://www.ultimaratioregum.co.uk/game/downloads/, and my blog there is updated every week with a detailed entry on the week's coding developments, and sometimes more general games crit/design commentary too (though I intend to cross-post them all here from now on).
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: getter77 on December 13, 2014, 09:04:46 PM
Still aiming for semi-seasonal releases with this new schedule for the new year or changing it up somehow or another in consideration of it being quite the change of pace versus the road that has led you to the present release?
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: UltimaRatioRegum on December 13, 2014, 09:07:53 PM
Still aiming for semi-seasonal releases with this new schedule for the new year or changing it up somehow or another in consideration of it being quite the change of pace versus the road that has led you to the present release?

Now I have more time on my hands, I am definitely aiming for one a season - next in March for a smaller release, then July for a slightly larger one, then probably September/December. It has been impossible for me to keep to the seasonal release schedule before, but now - at last - I think I actually have a shot.
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: UltimaRatioRegum on December 20, 2014, 02:49:20 PM
Well, it took longer than expected and ran into a million delays (as these things also do), but I am very pleased to announce that from (roughly) now onwards, I will be working full-time on URR for approximately a year. This means my doctorate is no longer my #1 priority (it is effectively finished, and due to be bound and submitted on Jan 31st) and URR my #2, but they have been reversed – my academic work obviously remains important, but development on the game will take precedence for the coming year.


So, what does this mean in practical terms? Well, it should mean four releases this year. My plan is to release 0.7 (building interiors and major code optimization) in March, followed by 0.8 (NPCs!!) in July, 0.9 (strategy, coinage, travel) in September, and 0.10 (combat!) hopefully in December 2015, or just after the start of 2016 if not. It will mean the weekly blog updates will continue with the usual mix of URR updates (90%?) and general game design/history/criticism posts (10%?), and I’ll simply be able to spend significantly more time on coding the game and get through what I want to get through far, far faster than I have over the last three years.


However, there are some contingencies. There are currently several potential academic positions in the works for me, and if/when one of my applications is successful, and when that research project starts, will obviously influence the full length of this full-time development period. As much as I’d like to “guarantee” a full year, the academic jobs market – especially when one is trying to very suddenly change field! – is not to be trifled with, and I cannot with any degree of sanity consider extending to a full year and sacrificing a promising position I would otherwise had taken, if one comes up. As ever I’ll keep you all posted. The other contingency, of course, is that I cannot devote 100% of my time to URR – a significant portion of my time (roughly what I’ve spent on URR in the past few years) will obviously remain on my academic work, for there are a wealth of papers I intend to publish this year and close to a dozen conferences I hope to present at (including hopefully GDC Europe, if all goes well). Regardless, this is a major increase in the time I can commit, and the speed of development should reflect this!


So there we go. Coding development on 0.7 will begin in the next few days once I’ve finished planning out the technical improvements/optimizations, and March is the target for major coding optimization and the generation and storage of every single interior within the current game world (or at least the overwhelming majority, if some turn out to need other releases in place first before they can be designed). I have a few other end-of-year updates lined up for this blog, then regular updates will resume in a couple of weeks.


Last but not least, I just wanted to put up a brief summary of the last week’s 0.6 release. The download rate has been pleasingly rapid, and thus far I’ve had two very, very rare bugs identified, each only by a single person. Given that we hit 1000 downloads within just a little over the first two days (thank you all!) and they haven’t been reported more than once, I feel confident saying these are highly unusual rare bugs. One is in world generation and appears to take place when the game attempts to give a feudal civilization a hunter-gatherer religion (which should be impossible); and the second was a crash at a particular point of worldgen, but with no more information, so that one is sadly just too vague to pursue unless I can get an error log for it. If the person who reported the crash after the “C” and “F” of the worldgen screen is reading this, I need more information! There are a million different functions going on there and an error log is pretty much essential to hunt that crash down. As such, I’ve decided it’s not worth the effort to release a 0.6.1 (unless some major game-breaking bug appears or many more people report these same issues) and to simply push onto 0.7.0 and fix these bugs in the process.

Next week I’ll be posting an end-of-2014 summary of URR’s development (and a couple of other things), and then the entry afterwards I’ll be posting about where we go from here and the plans for 0.7! See you all then.
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: Krice on December 21, 2014, 03:09:49 PM
What kind of RPG system have you planned for this game? It looks impressive, all that details and the huge size of world, but how about the actual gameplay? By the way, when I have programmed the next version of Teemu I have actually downscaled the size of some level themes. In fact I think it's best keep levels as small as possible to avoid lots of walking from one place to another, but big enough to keep it interesting.
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: mushroom patch on December 21, 2014, 04:31:04 PM
I too would like to know how your game really plays. It's all well and good to talk about details and post screenshots, but how can anyone have any confidence in something you can't even play?

By the way, I also have a new version of a roguelike I released a number of years ago called mold simulator. Previous versions were too much like stuff tryhards like you have released, with all the rooms and levels and stuff. I try to keep it simple. In the new version, the mold spawns next to stairs in a 3x3 room and waits for adventurers to come down -- then the game is afoot!

Anyway, your work is really awesome, except for the ways it differs from my stuff, like being too big and not having the orgasmic gameplay I've planned for mushroom patch simulator (MPS).
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: Aukustus on December 21, 2014, 11:14:09 PM
It's interesting to see what kind of projects come out of the Python tutorial at RogueBasin. This is definitely from the most complex end.
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: UltimaRatioRegum on December 22, 2014, 12:47:47 PM
What kind of RPG system have you planned for this game? It looks impressive, all that details and the huge size of world, but how about the actual gameplay? By the way, when I have programmed the next version of Teemu I have actually downscaled the size of some level themes. In fact I think it's best keep levels as small as possible to avoid lots of walking from one place to another, but big enough to keep it interesting.

One akin to a turn-based Dark Souls; I love the Dark Souls mechanics based around timing and using the distinct "movesets" of different weapons, and that appeals to me much more than bump-to-attack (which is fine, but I think something different is more suitable here). Combat is going to be rare, but consequential - no enemy you encounter should be a "popcorn" enemy. A *lot* of the gameplay mechanics are going to be based around gathering and using information, strategy-layer decisions (coinage, safe/hostile civilizations, travel time), and also, I hope, some fairly dense social/NPC mechanics. Large parts of these three should be coming in 2015 now I have more time to actually work on it. Exploration, also, should be a MECHANIC, not just "moving around a world map", i.e. the movement and choices around the map must be consequential, and discovering new areas has to be meaningful, rather than just a backdrop. It's tricky, but I have some good ideas in mind for this part, which'll be appearing in the coming months.

I too would like to know how your game really plays. It's all well and good to talk about details and post screenshots, but how can anyone have any confidence in something you can't even play?

By the way, I also have a new version of a roguelike I released a number of years ago called mold simulator. Previous versions were too much like stuff tryhards like you have released, with all the rooms and levels and stuff. I try to keep it simple. In the new version, the mold spawns next to stairs in a 3x3 room and waits for adventurers to come down -- then the game is afoot!

Anyway, your work is really awesome, except for the ways it differs from my stuff, like being too big and not having the orgasmic gameplay I've planned for mushroom patch simulator (MPS).

MPS hype! (And thanks :) )

It's interesting to see what kind of projects come out of the Python tutorial at RogueBasin. This is definitely from the most complex end.

Thanks - and I agree, I think the tutorial is really tremendous, but definitely open, flexible and most importantly *clear* enough for people to take that basic code, figure out how it works, then move it in a bunch of different directions. I don't think a single line of the tutorial remains in URR, but I would have seriously struggled without it (and tcod).
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: UltimaRatioRegum on December 27, 2014, 03:44:11 PM
This week's update, cross-posted from my blog (www.ultimaratioregum.co.uk):

And thus, 2014 draws to an end. What did 2014 mean for URR, for my experience of making URR and everything that happened this year, and where does this mean this game and blog and all the rest of it will be going from here?

2014 began immediately after 0.4, my unwise attempt to introduce gameplay before the game was ready for it. Although I was reasonably happy with what you could do in Ziggurats, it lacked any real spark when the world was otherwise so empty, and I realized that it was time to finish off the worldbuilding before actually trying to add any more gameplay (only one release to go!). At this point I turned to fleshing out the detail of the world, and creating a space to interact with that should be every bit as dense, nuanced, and sometimes idiosyncratic, as the real world of a couple of hundred years ago.


From this work I released 0.5 in April, which gave us history generation, a vastly improved world map, religions, coats of arms and families, religion and civilization detail, and was the first release that took place after I finally figured out what the game was actually going to be about! I was very happy with this release, and a lot of people who had previously been sitting on the fence about whether or not I was ‘committed’ to finishing the game were persuaded at this point. Success!


This also pointed the way to the next release: making all these cities, towns, farms, settlements, fortresses and so on actually explorable, rather than just icons on the world map which told you “You can explore these in the next release!”. So, 0.6 began, and ended up being the longest release I’ve ever done, but also by far the largest. The amount of content in 0.6 is probably equal to, if not more than, all the other releases put before it (especially since 0.1/2/3, back in the day, were basically my attempts to figure out how to program a game whilst also programming a game, an approach which may have been a tad unwise). I committed to making every district unique, every fortress generate according to its own algorithm, and basically maximizing as best I could the length of time until players could/would become “used to” what they were seeing. This process isn’t finished yet, and 0.7 and 0.8 will both contribute heavily to this, but it’s a major development along the path of making URR as dense and varied a world as I want it to be.

Released a couple of weeks ago, 0.6 is the first release that I feel stands on its own, even as just a detailed ‘world simulator’ at this point. Although naturally the four planned releases for 2015 should be great and introduce some gameplay, I don’t feel the need right now to keep telling people “but just wait until the next version!” when they look at 0.6. It gives a good impression of the kind of world we’re dealing with, and something about the kind of game that’ll take place within it, and I’m very happy with that.


It was also during this year that I finally realized that Science and Technology Studies (STS), the field of my doctoral research of the last few years, was not where I wanted to be, and that game studies most definitely was. The first thing I ever did in this field was a presentation on the semiotics of roguelikes (which I am currently writing up into a full journal paper) which I gave at the Canadian Game Studies Association Conference, and the response to this (and my overall experience there) cemented for good my shift to game studies. As such, although right now I’m putting the final touches to my doctorate (submission mid-January, at long bloody last), all my other academic work is now on games. I’m incredibly happy that I’ve made this shift, that my early work has got such a positive response, and indeed that a number of people within game studies have shown an interest in URR themselves. I love the possibility of academic/creative crossover in my work, and we’ll have to see where this goes from here.

Lastly, you may notice a NEW BUTTON (www.ultimaratioregum.co.uk/game/support) on the menu at the top of the blog. This is the first step towards redoing/reworking this website over the course of 2015, and is a response to the very generous comments from lots of people who want a way to directly support the game. That contains a link to a donation button, but more importantly, I note on that page that I would actually much prefer that people support the game by ‘spreading the word’ than direct monetary support (though I certainly do appreciate that immensely). So, if you like what’s going on at the moment, and what I’ve got planned for my year (roughly) of full-time development over 2015, please give it a look and see if you’d like to give me a hand spreading the word of this glorious Scientific Revolution world to every corner of the internet.

In the mean time, I hope everyone has a great new year – I’ll be back next weekend with a post about my plans for the coming year and, indeed, the coming five years, and then regular URRpdates and the odd game analysis piece will return to normal the week after that. See you then!
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: Aukustus on December 28, 2014, 04:26:03 AM
Just a minor thing, though it might just be me, but the triangle walls feel somewhat weird. I think a square might look better Otherwise it looks really nice.
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: UltimaRatioRegum on December 28, 2014, 10:52:58 AM
Just a minor thing, though it might just be me, but the triangle walls feel somewhat weird. I think a square might look better Otherwise it looks really nice.

Ah, that's not just walls, it's for all terrain - it shows that the terrain is 2 z levels or more above your current location! If it's only 1 z level, it shows a ^ instead :).
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: UltimaRatioRegum on January 11, 2015, 02:05:07 PM
I've now started work on 0.7, beginning with some of the graphics and new objects. 0.7 is all about building interiors, so this means all the obvious stuff - tables, chairs, beds, etc - and the rather more obscure and intriguing stuff - altars, thrones, etc. To begin with this week I've focused on two components of this, primarily the "mundane" household/building items, and also the floor tiles for the more expensive and up-market buildings (upper class housing, cathedrals, parliaments, etc). I decided to start working on the aesthetics first before moving to too much coding, as I wanted to have a good image in my head of the world (and the variation in the world) that I want reflected throughout building interiors before I thought about their layout. As with everything else in the game, all civilizations should vary - now, admittedly there is only so much you can do to vary a chair, but I think I've done a pretty good job:


As well as these I've also done tables and beds, and various designs on those too, bearing in mind furniture items are not "to scale" (i.e. they are designed to take up the entire size of the lookup window regardless of their actual relative size). The more up-market the location the item spawns, the more elaborate the decoration, and the choice of wood colour is naturally based on the biome the furniture is found in:



I also want to take this entry to point out a certain... hidden aesthetic consistency within cities. I don't know if anyone will have spotted this - and it is becoming more pronounced in the next version - but I rather like this. If you've ever looked at the gatehouses in cities, you might notice that there are several different shapes:


In total there are five - squares, octagons, diamonds, circles (as best as possible with a tiled square grid), and crosses. Each civilization picks one at random. It's a minor additional detail, but then if you look at shop signs, you'll notice that those also have different shapes:


The observant player would then perhaps also notice that the floor tiles in cathedrals, parliaments or castles have a range of different patterns based on various shapes (and also their colouring is dependent on the flag of the nation in question):


Therefore, in each civilization, the shapes throughout the civilization are consistent throughout! In this case, octagonal:


That's just a minor thing, but I think helps with just a little extra distinguishing between civilizations. Now I've done a very good portion of the new graphics for this release already in just the first week of serious coding (perhaps a third of new graphics?), my next task is the challenging technical task of hacking down saving/loading times, and changing the game to saving the map in chunked sections within a folder on one's computer, rather than in chunked sections within a single massive file. It's a hefty change, and one of those which will either be weirdly trivial and only take me a day, or drag on for the week. We'll see. Coupled with this is creating the new infrastructure for building interiors which is going to be handled in the same way, and from 0.7 onwards saving/loading times are going to be reduced to a fraction of what they are now, and  they will no longer rise the more of the world you've saved (which it currently does - a serious oversight). Either way, next week I'll be talking about these technical changes in a (rare) semi-technical blog entry - see you then!

And... some strange altars have been popping up.

Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: UltimaRatioRegum on January 17, 2015, 07:09:58 PM
This week I’ve been working on two things – improving saving and loading, and beginning work on the technical aspects of handling interiors, keys, doors, multiple floors, and a million other things intricately related to interiors and handling all the appropriate amounts of data. Firstly I’ve made a major change to how the game is saved. Until now each work was stored in a single huge file – “World1″, “World2″, etc – which meant that each time a particular chunk had to be saved or loaded, that huge file had to be opened, examined, and shut. So, rather than a single massive monolithic save file which gets larger and larger with each area you explore, and therefore the computational load of opening and closing that file each game gets larger and larger, I instead present you with a new data folder:


Each file is for the coordinates shown (obviously) and contains both the outside map grid, and any buildings that have been generated within that grid. Therefore, that is all that needs loading and saving each time you move between grids, rather than adding something to the massive older file. This has made the initial loading times for the game low, but as more and more areas are generated, it never gets slower! There’s also a code in each of these files to ensure it relates to the correct game instance, to ensure no crafty people switch around the save files to advantage themselves…

This is the first of three stages to the game’s optimization. The second stage involves changing how each individual tile is stored. Currently, every tile has its full set of colours – dawn, dusk, night, in player’s sight, out of player’s sight, etc – stored in every instance. This is horrifyingly inefficient. Instead, it needs changing to numbers that refers to where in the colour database the appropriate colours are found, and which doesn’t save/load them every time. In turn, the third stage is to adapt the rendering code to reflect this. I’ll probably be working on that in the next week alongside more general interior work. As with this first optimization, I expect this to take some time, but if we’re lucky it’ll be just as simple as the file/folder change was! And should hack the size of each save file down by… 40%? Maybe more? We’ll see.

SECONDLY, I’ve started work on interiors. Naturally I want interiors to be as complex and as varied as the external world; you should have to walk around for a long time before you see things “repeating”, and the interiors should be heavily dependent upon civilizations, religions, factions, geography, etc. I decided to start with religious buildings. Just as each one is distinct on the outside and the layout is procedurally generated… so too (as I’m sure you’ve come to expect from me by now) is the inside. The inside is naturally broadly consistent across all religious buildings from a certain religion, but each interior across religions is highly distinct. Some may contain statues, some may not; they’ll have different layouts of things like tables and chairs, *very* different altars (see next week’s update, maybe?), different places for offerings, naturally different NPCs, and also different secrets (if any). So, a religious building from the outside:


And on the inside (early days, don’t be too judgemental!) with some chairs (the backwards ‘t’), tables (the tall ‘pi’ symbols), doors within the building and leading outside, statues (in each of the ‘wings’), an altar (purple in this casee) and a staircase leading to the second floor…


…where we find a corridor running around the outside of the building, and two more stairs leading up to the top floor… but we’ll have to keep that one secret for now.


My intention for the remainder of this week is to finish off all possible variations of religious building interiors, which should yield something in the high tens of thousands of possible interior layouts! I’m also having to plan ahead to think about what kinds of secrets should be potentially spawning in these buildings, and how they should be accessed if so, so that’s also influencing the development process. I might also try to finish off all the altar graphics this week; the variation I have so far is amazing, and I think you guys will love them when I unveil them (either next week, or the week after). And that’s all for now!
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: Aukustus on January 18, 2015, 10:47:40 AM
Will the large images of furnitures be viewable through some sort of looking command?

Just a minor thing, is the "Poi" bar shorter than the other bars?
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: UltimaRatioRegum on January 18, 2015, 09:07:36 PM
Will the large images of furnitures be viewable through some sort of looking command?

Just a minor thing, is the "Poi" bar shorter than the other bars?

They are indeed; pressing 'l' for 'l'ook (or ';') will let you view anything in-game, and everything has a generated image alongside it! It is, yes, though that might get changed in the future when combat mechanics are fully developed later this year...
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: UltimaRatioRegum on January 24, 2015, 02:45:30 PM
This week I’ve been finishing off the first set of interiors for the game – religious buildings. I selected these first because I know they’d be quite complex, and I figured this would be a good way to get down a lot of the appropriate infrastructures for interiors and generating/saving/storing/loading them, and then be able to apply those to other simpler buildings rather than simultaneously creating the data structures and the buildings as I went along. Here’s a nice shot of a religious building with the ground floor – the purple symbol is the altar, the blue symbol is a reliquary! – and the second floor, which has some private quarters for the priest (behind the locked door in the middle) and also a staircase leading upwards behind another locked door (on the bottom-left), which leads to who knows where?


Religious buildings have become highly complex and varied in a huge number of ways, but one of these ways which I’ve focused on this week has been in terms of statues within the religious buildings. Originally statues were going to be a binary either/or – either religious buildings had statues of appropriate important figures/deities, or they didn’t. However, I decided it would be much more interesting to add more possible details to this list as a way to both further enhance the variation of religious buildings, and give NPCs and information in the game more to talk about. Therefore: instead of statues, religious buildings may contain ceremonial gongs, vases, and incense stands. Rather than always hearing “The church with the statues that look like X”, you’ll get “The church with the brass gongs”, “The church with the vases that depict two dragons fighting”, and so on and so forth. These are all, naturally, procedurally generated. I’ve created all the graphics for the gongs and also worked on some more graphics for the rest of the ordinary furniture, and my intention is to next work on the vases and the incense stands whilst I move onto programming other building interiors in the coming days.


I’ve also implemented HERESIES. The average game will have between 3 and 6 of these generated in the game world, and they draw upon the data stored for existing religions to propose heretical notions “logical” (as it were) to the religion in question. Religion worships an animal-headed god? Maybe this sect believes that eating animal flesh insults the god. Religion consists of a pantheon of eight gods? Maybe the sect believes there is a ninth. Religion proposes a kind, benevolent god? Maybe the sect believes this god is actually evil, or at least inimical to human well-being. And so on. Just like all the flags and coats of arms and so forth, heresies have their own algorithm for symbol generation (there’s about 40 or so possible, so it’ll be many games until you see them all) and now show up in the Encyclopedia, where you can read a little information about the nature of that heresy, though this will be added to significantly in the future. Each heresy also has one of three statues – it may be TOLERATED by the dominant religion, SHUNNED, or be the subject of an INQUISITION, in which case that belief will be entirely hidden underground. Inquisitions will be worked on later, maybe this release, maybe next. We’ll see. As you can see, the screenshot below is very much an in-progress screenshot (information is not lined up nicely, there’s no leader data, some of the names don’t fit into the window, there’s an unusually large number of heresies in order to make sure they all generate correctly, etc), but you can see how these are coming along. Once I implement the leader information, there will also be a list on the left side of the information screen showing what settlements this heresy has been found in.


Lastly I’ve also fixed a bunch of smaller issues this week – there were some unusual edge cases with entering/leaving buildings I’ve sorted out, and some residual minor problems with coats of arms and a few tiny other things which nobody except me seems to have noticed (since I know what things should look like!), but those have been fixed. This next week might be a lesser coding week – my intention is to submit my PhD no later than the 30th, and probably on the 27th/28th, so I need to devote time to getting it formatted correctly, having it bound, handing it in, blah blah. Either way, whatever coding does happen will be focused on moving interior generation into other buildings (I think I’ll go for something simple like slum housing next after this religious complexity), and adding in the rest of the graphics for the vases, gongs, etc (statues, being highly complex, might have to wait for now). See you all next week!
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: UltimaRatioRegum on February 07, 2015, 01:52:46 PM
A huge update this week! With my PhD submitted to my university and the paper I’ve been working on the last month submitted to an appropriate journal, I’ve been able to devote the full week to coding. We therefore have some level design, some graphics, some ideas, and some other stuff, so let’s get going.


I’ve been working a lot on many of the building interiors this week that still need doing. First off I’ve finished off religious building interiors, and handled a pretty wide range of strange goings-on and errors with their generation, such as the ability to walk outside them through cracks in the walls, or staircases which don’t correctly match up with their partners on other floors. They can have 1/2/3 floors, and have a massive range of variation in pretty much every way. Here are some examples, drawn from a religious district in one of the world I was recently testing things in (these imagines display the outside, the ground floor, then other higher floors, going left to right):




I’ve also thrown together the generation code for the most basic of houses, those in slums and their slightly-better equivalents in lower-class housing districts. These, naturally, are tremendously simple, and it will be extremely rare for a player to have any need to enter one, but they’re there now, and on the off-chance that one will be housing something secret in a basement, the code is in place to allow that to be the case in the future. It generates an appropriately-sized space, places a bed against a wall, and then places a table against a wall, and some chairs around the table; slum housing, by contrast, will only have a bed (and a very simple bed at that) and sometimes a chair.



I then went to work on taverns, which always spawn in every single lower-class district. There are there basic sizes of tavern (all are a simple rectangular shape, and in keeping with my intention to make buildings broadly understandable from only the outside, no other buildings share this basic shape in the sizes that taverns occupy). There’s several dozen possible interiors, each with various sub-sets of generation and different angles they can be oriented in, tables/chairs which do/don’t spawn, etc, and all contain a staircase up to the bedroom where the innkeeper lives, and a small number contain a down staircase towards a wine/ale cellar, and perhaps something secret down there too? Pretty much all building interiors are being generated with the possibility of secret content – or rather, with areas that the game will use to hide a secret if necessary – so that if you’re told in the future that the innkeep of The Mask and Flagon is hiding something behind a locked door in the basement, it’ll be there.


After that I worked on shops, creating the algorithm by which they decide where to put the ‘stall’ inside the shop (i.e. where the items will be laid out, somewhat akin to how shops work on NetHack), but since these currently lack items or shopkeepers, they aren’t especially fascinating yet, and don’t really merit a screenshot. I then moved onto military hospitals, which contain naturally lots of beds which will, in 0.8, have people in various states of decay/injury in them; chapels and areas where those religiously-involved with the military or with healthcare are stationed; and also naturally stores of healing items, herbs, etc. There aren’t going to be any non-military hospitals in the game: this is one of those gameplay > realism things, and I wanted to really focus the source of health items in one single place, and other districts were sufficiently busy whilst military districts were not, and thus, they ended up there. Hospitals vary in the layouts of their wings, how the beds are positioned along the walls and the quantity of the beds; and also the large stack of tables one can see in the top room of the first image, for example, will all contain various herbs, medical items, etc, in the future, whilst the lower room opposite it will contain quarters for the doctors, and potentially holy books as well if the civilization is particularly religious. There are equivalent rooms in the lower picture, and in other hospitals too.



Lastly, I’ve started on cathedrals. Each religion has one in the city centre of their home nation. These are actually going to be a massive task; I would expect at least two more days of solid work to finish them off, if not three, as they are huge, and require a lot of variation, but also need to appear broadly consistent with the ordinary churches of that same religion. As you can see from the screenshot below they’re pretty big (and that screenshot doesn’t show the entire thing), and very varied, and contain the majority of the relics for a religion, as well as obviously being a central holy place. Additionally, you may notice that the stone on the ground is slightly shaded; that’s because it is tiles rather than stone flooring, and the slight shading is in line with the colours on that nation’s flag, and this will be the case for all important/wealthy buildings (castles, cathedrals, manors, etc). Naturally the pattern for the ‘wings’ of the cathedral is a larger version of the same pattern for churches, and the inside is designed to show a level of consistency with the smaller churches in that variant:



I’ve pushed ahead on a lot of the new graphics for this week, and also done some more “background” work on creating infrastructures to allow these graphics to be used as clues and information that NPCs will give you in the next few months – which is to say, if a particular religion worships at a fiery altar, then written information on that religion might say “those who worship at the altar of flame” rather than “those who worship [God name]”, and so forth. Firstly I did some more work on finishing off the massive variation in religious altars we’re going to see in 0.7 – there are many archetypes, many variations, and something in the range of several tens of thousands of possible different religious altars. I’m working up to producing a detailed blog entry on these altars, maybe next week if they’re all done by then, but in the mean time, here’s another for your perusal:


I’ve also, having finished off gongs last week, been working on some of the other general objects you’re going to find around the place. I spent a little over a day working on generating vases, some of which spawn for certain religions, and some of which will spawn in the castles and upper-class housing for particular civilizations. There’s several dozen designs, several dozen colours and about a dozen different shapes, so (especially once the entire world is no longer pre-explored!) it’ll be a long time until anyone comes close to seeing all the variations. Again, these will in the future be tied to information the player gets, and to my desire to focus gameplay on discovering the world, understanding the world, and figuring out data the player possesses. Say you hear about a chamber in a distant castle which contains “four fragile dragons” – find the room with four vases, and if those all depict a dragon, then you’re in the right place. Here are some examples:



A few other things. Firstly, doors have been simplified down to two types – locked and unlocked (I was previously thinking about adding “closed” and “open” as sub-variables of both, but that was quickly getting too confusing, and distinctly difficult to represent). Locked doors have a “full” door symbol, whilst unlocked doors have an open archway. Some buildings in various civs will of course be unlocked by default, like religious buildings, other public buildings, etc. If you’re trying to go through a locked door, you’ll need the appropriate key, though for this release, all doors will be open. I’ve also been doing some general figuring-stuff-out work on NPCs, NPC schedules, how they should be handled by the game, how they should be abstracted out when you’re far away from them, which NPCs the game should track and how it should track them, etc. Nothing visible to report on that front, but it’ll be important in the future.

Thanks to everyone for reading this monster entry. Next time: something else!
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: UltimaRatioRegum on February 15, 2015, 11:16:57 AM
First off – I’m planning to host this year’s IRDC (International Roguelike Developers Conference), either at the University of Lincoln, or possibly at the National Video Game Arcade in Nottingham (both in the UK), at some time around the end of June. If you’re interested, and if you would attend, please let me know so I can gauge interest/numbers. The conference is an “unconference” and open to everyone from developers to fans, academics to journalists, and whoever else fancies coming along. It’s entirely free. There will probably be one day of talks, one day of demos, and general socializing/eating/other human activities.

In the mean time:


Cathedrals, at last, are finished. They took the best part of the week to make as varied and interesting as I wanted – and to put in place features that will be needed in 0.8, such as quarters for the priests, potential for a cathedral to lead to a crypt, etc – but now they’re done, and I think there’s around 20,000,000 possible variations, give or take. Whereas the smaller religious buildings for each religion have names chosen from a large set, so you might get churches, pagodas, stupas, parsonages, etc, the largest building for each religion is known as a “cathedral” always – this is not out of an attempt to be christian-focused, but simply because there aren’t enough specific words for “a larger than normal religious building” to allow every religion to have its own! Whilst there may be dozens of lesser religious buildings around towns, cities, monasteries, etc, there will only be one cathedral, always positioned (as those who have explored 0.6 may have seen) in the city center of that religion’s home nation.

Here’s the cathedral I unveiled last week (just repeated here for the sake of comparison) and two of the others that have been generated this week, to give some idea of the variety. I spent around two hours just generating cathedrals over and over – it worked through pretty much every archetype and highlighted a small number of bugs, but with those fixed, I’m pretty confident they’re all generating correctly and cathedrals, finally, are DONE.




I’ve finished off the remaining religious altar graphic generation this week, and next week’s blog entry probably is going to be a detailed update about how I went about generating them, the variety across altars, the relationships between altars and the particular kinds of deities they represent (different deities have different archetypes), and so on and so forth. The last set of altars that needed coding were what I (perhaps harshly) call the “standard altars” – these are for the more “ordinary” gods who do not fit into one of the rare archetypes, and are therefore given this set of altars. However, there is still significant variation in this altar archetype – here’s a couple of examples. There are twenty bases, twenty materials the base of the altar can be made from, seven altar shapes, thirty “edge” patterns, thirty “inner” patterns, around fifty possible items that can be placed on top, and twenty colour schemes:


(Just to remind everyone, what you see above is only one of the five current “archetypes” for altar generation; there are four others, and one more planned, though that might have to wait until 0.8 )

Crypts (Planning):

I have begun design work on crypts, and these will be one of the next things I’ll show on the blog. At this point I’ve figured out how I want them to generate, and the differences between the two locations they can appear – crypts can be found in graveyards, in which case it will be a broadly “secular” crypt for important figures from that nation’s leading family, particularly important/noble knights/etc; and they can also be found under cathedrals, in which case it will be a “religious” crypt containing past religious rulers, saints, etc. Of course, some of these bodies might be missing if they died far from the home nation, and if you happen to read in a book somewhere that they died carrying a particular relic…

Anyway. I’ve been planning this out, and also the far less likely things that will generate in each crypt to add variation, and also how the graphics for the specific cadaver tombs and sarcophagi in crypts should be generated, and also just the technical stuff of making sure this ties correctly to figures in world history. This week has only been planning, but in the coming week crypts are one of the things I’ll be working on. Since that might be quite a big task, I’m also aiming to generate a whole bunch of the smaller/lesser buildings out there as well – I’m thinking military barracks, slave quarters, prisons and asylums, and maybe some hunter-gatherer buildings should all be done this week, but we’ll see what takes my fancy.

In Conclusion:

See you all next week for either the detailed examination of religious altars, or a more general update on crypts and other buildings, depending on whether I get Google Analytics sorted out on the blog before then, since the latest update I downloaded completely broke it. Sigh.
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: UltimaRatioRegum on February 22, 2015, 03:06:49 PM
IRDC Stuff

First off: I am organizing the International Roguelike Development Conference (Europe) at either the University of Lincoln, or the National Videogame Arcade in Nottingham (both in the UK), probably at the end of June (27-28). If you are interested in attending, please let me know. I’m also giving the “keynote” talk at the North American IRDC (more information at http://irdc2015usa.tumblr.com/) but the fellow organizing it really needs to know about numbers and those interested as soon as possible. John Harris, writer of the long-running @Play column, is also likely to attend, and I’m in the process of trying to get in touch with some interested North American games academics. Again, if you’re in NA and interested in attending, please get in touch with either me, or the organizer via the Google form on the tumblr link I posted above. It is hugely important that we get some idea of numbers, especially for the NA IRDC, since one has never been successfully hosted in North America before.

Now, onto URR (though I’m afraid the above message will likely pop up every few weeks on this blog, since I want to get as many people attending both as possible!).


My main focus this week has been on generating crypts. These appear below cathedrals and graveyards, and are quite rare – probably around half a dozen or so will be generated in the entire world. Those below a cathedral are home to religious leaders, saints, holy warriors and the like (assuming their bodies were recovered), and may also contain things like altars, religious archives, and various other things you’ll have to seek out for yourself. On the other hand, crypts beneath graveyards are “secular” and focused on the ruling family/house of that nation, so contain past rulers, important figures from that house, and the like, and since that crypt is more public than one directly beneath a cathedral, you may (in 0.8 ) find some other individuals lurking around there as well. The “segments” that make up a crypt are, like so much else, dependent on the shapes preferred by the civilization, so you’ll find crypts with lots of squares, circles, octagons, and various other shapes; they also vary massively in their layouts (I used a modular node-based generation system for these), and their “themes” – for instance, the top crypt of these two has a “desert theme” and sand has begun to flood in; the second crypt has an “overgrown” theme being found in a jungle; and there are several other, rarer, and pretty interesting themes which can affect the entire crypt. I’ll probably have these themes spread into other underground areas as well in the future.



One interesting feature of crypts (and from this point onwards this will apply to all underground areas) is the lighting system. You see those yellow/orange/red symbols in the pictures above? These are candle stands or braziers, and in-game they flicker between the three colours, and provide light, even if you haven’t explored what is between them. This means that you can sometimes spot areas distant in the dungeon which are lit as long as you have a clear line of sight to them, even if you cannot see what lies in-between. Experientially this makes for a very intriguing experience exploring an underground area which is quite distinct from other regions – as you explore you sometimes “catch a glimpse” of a part of the crypt you haven’t yet explored, and it makes it feel more like “discovery” than some above-ground areas. Also, in 0.8 onwards unless you have your own source of light your FOV will be significantly reduced, so other lights in the crypt act as “waypoints” to guide you from location to location. The grey ohm symbols, meanwhile, are sarcophagi/cadaver tombs themselves, and I’ll be working on the generation of the graphics for those (and their connection to family histories) soon.


One of the “small” buildings I worked on this week was the barracks, which spawn in huge numbers in the military districts of feudal nations, and can also spawn in much smaller numbers (but larger buildings) in the rare desert fortresses of nomads. The fortress barracks are on the left, the feudal fortresses on the right. Currently they only spawn beds, but in 0.8 or 0.9 you will also have piles of items for that particularly soldier – armour, weapons, clothing, etc – next to their bed. Doors sometimes spawn and sometimes down; some rare barracks will spawn with chairs or tables in as well as beds; but they’re generally pretty compact, though they do have a decent number of different possible layouts (which are always consistent throughout a civilization). I’ve also (as per an excellent suggestion) made the glyphs for basic floorings (wooden and soil, in this case wooden) much simpler, and darker, to accentuate the contrast with the walls.



Not much to show here. They’re stables, aren’t they? And stables without horses. What is a stable without a horse? Who knows?



I’ve also got to work on parliament buildings for feudal nations that have “Representation” as their leadership policy. In this case they are ruled by a President/Prime Minister/First Minister/etc, and this person exists within structures like the Red Senate, the Wise Congress, etc. In 0.8 this person should therefore have a “schedule” of movement between the castle (which will obviously be different for a Representation nation than, say, a Stratocracy ruled by the military) along with an appropriately protective retinue. There are meanwhile four basic layouts for parliaments, and each one then has a wide range of interiors, which also vary according to a number of other civilizational policies (and just general preferences in other ways). They have several floors, and sometimes a bell tower, and as with everything/everywhere else in the game, I’ve implemented appropriate code to allow them to contain some intriguing hidden secrets. Parliaments will also contain significant histories on the nation in question, lots of important people, and probably also some information on criminals, new laws to be enacted, etc, but we’ll figure that out later! As ever, I’m working hard to make sure every type of building looks distinct – admittedly Parliament buildings are pretty damned table/chair-heavy compared to others, but I still think it works (here are horizontal and vertical parliamentary buildings):




And you see those white diamonds? Those are PAINTINGS. Obviously those will be focused in galleries, but you might also find a couple in upper-class houses, parliaments, castles etc, and once I get around to those they will all be procedurally-generated and yield hints about the world. They will serve the same function as statues, but those are both big procedural jobs, so probably… 0.9? Maybe 0.8, but I doubt it, given that NPCs is a pretty colossal/massive thing to work on for 0.8.

(Also, I am aware the middle image looks like the Parliament of Mordor – was just a fluke from a civilization with a dark brick colour, and it was in the tropics, so dark woods are going to be used for the furniture!)

Next Couple of Weeks

Despite the well-documented folly of attempting to predict future blog posts, I’m going to try it again here. The next two weeks (though I’m not sure which order) will consist of two posts. Firstly, I’ve written a very detailed analysis of how the graphics for religious altars are generated (I have thus far own shown a very small fraction of these on the blog), and that’s one partly written for an audience not yet au fait with URR, so I’ll be advertising that post quite heavily; the other entry is an analysis of the danmaku world record I just got this week (!), which comes with a pretty amazing video (if I do say so myself). So one of these should be next week, and one the week after, but I’m not sure about the order just yet. See you then!
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: Zireael on February 22, 2015, 05:49:15 PM
One interesting feature of crypts (and from this point onwards this will apply to all underground areas) is the lighting system. You see those yellow/orange/red symbols in the pictures above? These are candle stands or braziers, and in-game they flicker between the three colours, and provide light, even if you haven’t explored what is between them. This means that you can sometimes spot areas distant in the dungeon which are lit as long as you have a clear line of sight to them, even if you cannot see what lies in-between. Experientially this makes for a very intriguing experience exploring an underground area which is quite distinct from other regions – as you explore you sometimes “catch a glimpse” of a part of the crypt you haven’t yet explored, and it makes it feel more like “discovery” than some above-ground areas. Also, in 0.8 onwards unless you have your own source of light your FOV will be significantly reduced, so other lights in the crypt act as “waypoints” to guide you from location to location. The grey ohm symbols, meanwhile, are sarcophagi/cadaver tombs themselves, and I’ll be working on the generation of the graphics for those (and their connection to family histories) soon.

I love the use of ASCII (or is it ANSI?) in URR, and this post shows very clearly why it is so!

Also: paintings? Made me salivate :D
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: UltimaRatioRegum on February 25, 2015, 04:59:10 PM
Thanks! And yes, those will be coming very soon, with lots of hidden information tucked away within them :)
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: UltimaRatioRegum on March 08, 2015, 11:50:51 AM
International Roguelike Development Conference (Europe)

I’ve set up the venue, the time, the dates, and the format, of this year’s IRDC! I’m trying something a little different this year and I invite everyone to come along. You can read about it here on my website (http://www.ultimaratioregum.co.uk/game/irdc-2015/), on Reddit (http://www.reddit.com/r/roguelikes/comments/2ybus8/european_irdc_at_the_uk_national_videogame_arcade/), or on Roguetemple (http://forums.roguetemple.com/index.php?topic=4467.0), and please get in touch if you’re planning on coming along! The more the merrier, and this year’s will be something really different and, hopefully, something really awesome.

URR Development

The past two weeks I haven’t been able to get as much coding done as anticipated  – partly from spending a lot of time travelling, partly from some truly baffling real-life events, and partly from other commitments – but I’ve been turning my attention to the other civilizations in the world of URR (primarily the nomads, but I’ve also put together some early work on hunter-gatherer building interiors) and also the generation for some of the other buildings in cities, like mansions and jails. So, here we go:


Manors come in four sizes – small, medium, large, and “massive” (one of which the player will begin in, as a lesser noble). The images below show one medium and three large (the massive are not yet finished). The smallest manors can be found in upper class districts, potentially sometimes in middle-class districts once I rewrite middle-class district generation (but there would only be one in the district), and in the future will also be found in towns if the civilization has the Vassalage policy (I’m continuing to work on making the variation from policy choices more and more explicit). The medium size, then, can only be found around the edges in upper-class districts, where the “second tier” of families live (I might call these “lesser houses”?); the next size up can be found in upper-class districts only, where they are also for lesser houses, but those with real aspirations to becoming a major family in that nation; and the largest can only be found in upper-class districts; each district contains three, which house the most important families in that nation, one of which will be the ruling family. Manors contain living and dining rooms, at least one “special” thing – which might be a portrait, an ancient book, a valuable piece of armour, and the like, and which will likely be mentioned in books and other NPCs as a valuable family heirloom – and also store rooms, and quarters for servants (or, if the nation is a slaving nation, that room will be less pleasant and for slaves). The storage room is the only current “empty” room on the  pictures below, simply because I haven’t yet implemented the various item types that will soon spawn there.

You’ll also notice a little visual difference in the floor – since all of these buildings have the “ornate flooring” terrain type as their default, I decided I wanted this to be very visually clear and explicit, and I really like how this looks. Cathedrals also had the same floor type, but I found they would be slightly too visually busy if they were displayed in the same way since cathedrals generally have more stuff, so I decided to only make this change here. Personally, I think they look bloody gorgeous. Be sure to click on them to really appreciate the colouring used in these! In the first picture, the floors are the upper floor, the ground floor, and the cellar, in that order from left -> right.






In the centre of every nomadic fortress is a “citadel”, a last retreat for that nomadic people in case of disaster, war, and so forth (within which the nomadic rulers will dwell, along with various other unusual and rare rooms). I wanted to model these on a lot of palaces from northern Africa and southern Spain, so they have a certain “oasis” feel to them as well as being places of fortification; one will often find extensive gardens within the walls of the fortress, and within these gardens you’ll find things which spawn nowhere else on the map – intriguing stone stele, nomadic graveyards (a rare thing indeed), and if in the “capital” fortress of the nomadic nation, you’ll find some other intriguing stuff on the upper floor, according to the policies the “government” of that particular nomadic people pursue. I tried to make these citadels quite “oasis-like” – they have open areas, trees, and fountains and water, and with some interior/exterior areas, and with appropriate areas that the game can use to place slaves, servants, weapons, guards, etc, in future releases. There are two different floor types here – both are “ornate” floors, but they are displayed differently; which do people prefer for citadels? I’m definitely going to keep the “minimalist” ornate flooring for cathedrals, though.



I’ve also put in the code for the game to create gates inside the fortress, which will then form balconies you can walk over on the higher floors, although I haven’t yet got around to generating the upper floors:



The first picture is from one jail “shape” showing how the stairs link, and then the other two show the player actually wandering around two variations of the “sideways pyramid” jail archetype, and in the latter case, I didn’t explore many of the cells (which, after this release, will of course be locked and require the jailer’s key) but just opened up a couple. As you can see, each floor is always similar, but with a slightly different layout of pillars, corridors, etc, and the empty room on the ground floor will be the jailer’s office:




Barrels, Candles, Miscellany

Also just threw together some of the new lookup graphics required for this release. Have a procedurally-generated ale barrel, and candle stands:



What’s Next?

Well, next week we’ll probably have a very in-depth and detailed entry about altar generation, the one I mentioned a little while ago. As for this release, I’ve definitely crossed the 50% point in these past two fortnights. By the update in a fortnight’s time, I’ll also have the massive mansions done, and most of the remainder of this release (I hope). I’m still aiming to release 0.7 in March. It’s… a stretch, as I have two academic papers I need to finish and submit this month, as well as beginning the preparation for my thesis defense, but it’s the target. Meanwhile, go and sign up to this year’s European IRDC and help us bring roguelikes to a wider audience than ever before!
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: UltimaRatioRegum on March 14, 2015, 12:31:16 PM
In keeping with my mission to push procedural generation away from the “classics” – monsters, dungeons, levels – and towards more “qualitative” concepts that have never been generated before in games (nations, cultures, societies…), URR (as regular readers know) contains a range of procedurally generated religions. These are not just a name and a belief, but are designed to be complex, interwoven and often competing systems that procedurally generate a deity or pantheon of deities; their beliefs and forms of worship; what, if anything, is banned in their religion; what festivals (if any) they perform; what agendas the clergy of this religion have; what other religions they might consider to be infidels; where in the world the religion is found; the religious symbol; their cosmogenic and eschatological beliefs; what heretical sects within that religion exist; and – the focus of this blog entry – their altars.

This blog entry is a detailed post about generating the ANSI (ish) graphics for the altars (or “shrines” in some cases) for all religions.

There are three “classes” of religion – monotheistic, polytheistic, and what I’ve termed in the game’s code as “spirits”. Feudal civilizations can have either monotheistic or polytheistic religions (but are slightly statistically biased towards monotheistic, because there is more procedural variation within that type) whilst “spirits” religions are used for hunter-gatherer civilizations, who have a range of animistic of shamanistic beliefs, totemism, ancestor worship, etc. Nomadic civilizations, reflecting their role as melting pots of varied cultures and beliefs from across the globe, never have an official state religion (inasmuch as there is even a clear concept of “the state” in these civilizations). Each of these three kinds of religion has a wide set of different possible altars or shrines, based upon a significant number of archetypes which each contain within them a massive amount of variation.


Within monotheistic religions there are four possible archetypes for deities – to use the terms used in-game (though these are not seen by the player), religions can be “demonic”, “eldritch”, “egyptian”, or “general”. Each of these has its own algorithm for generating and selecting the depiction of the altars at which their devotees worship.

The first of these we’ll look at are what I’ve been calling the “egyptian” god type. These are gods that adhere to names of the sort “The ____-headed God” or “The ____-headed Deity”, and so forth. The heads of these deities, so to speak, are generated according to the climate within which that religion was first found. A religion founded in a cold, polar region might have a “bear-headed” god or a “wolf-headed” deity, whereas in the desert regions you may find those worshiping their “scorpion-headed” or “scarab-headed” equivalents. The altars, in turn, are generated with a central image, a colour, a selection of candles, and an altar shape. Here are two examples: on the left is the rather more ‘abstract’ symbol for a deer-headed god (with a particular randomly-chosen shape and colour), and on the right we have an altar for its bear-headed cousin. There’s over thirty different animals, a wide range of colours and shapes for the altars, and therefore a massive potential variation in the altars of the animal-headed gods.


The second are the “eldritch” gods. These are loosely based on Lovecraftian ideas, but also upon some of the more unusual gods in real-world pantheons (though generally ones no longer actively worshipped, or at least not by large numbers) which are not just “a person” of some description, and either have an unusual depiction, or are entirely animalistic. For instance, Chinnamasta is a Hindu goddess who holds her own severed head in her hands; the Rainbow Serpent in aboriginal myth (though these gods in URR are somewhat less benevolent); Lei Gong in Chinese myth; the Gnostic god Abraxas, and a few inspirations from voodoo, central American myth (primarily Aztec), and some of the truly bizarre demons from christian demonology (especially ones like Buer). This gives rise to gods like Uur Quog, the White Wolf of the Pit and Guardian of the Gate; or Fallin’thopar, the Transient Vulture of the Mountains and Taker of Souls. Those who like their Lovecraft can clearly see the procedural naming convention here, even if the descriptions and depictions of these deities draw from elsewhere as well. Their altars have a wide range of designs, “inscriptions”/patterns upon the altars, colours, bases, and patterns upon the basic, again yielding several thousand possibilities, of which two examples can be seen here:


The third are the “demonic” gods. These altars are the least procedurally-generated of the bunch, though still exhibit some variation in colour, and association with different forms of “demonic” gods. These are not gods which are worshipped secretly, or underground – these are clear, visible religions just like all the others in the game, but these deities are just not the most pleasant of sorts. In part my inspiration here was from the classic understanding one has of the “Old Testament” christian god – all fury, hatred, vengeance, wrath. I wanted to introduce some gods which were perhaps worshiped out of fear rather than out of the love and gentleness generally associated with the judeo-christian god in the present day, but at the same time deities who might have beliefs associated with them that state that although these deities are brutal and bloody, they are perhaps fair, or just, or expect a lot from their worshipers, or might give their worshipers great power in return for their loyalty:


The last class of monotheistic god is the “general” god, though that hides the significant level of variation within those gods, and their altars. In this case an altar for these other gods – such as the Cold King of the Moon, or the Lord of the Tall Grasses – consists of two components. The bottom half is a block of stone, wood or other material, over which is draped a cloth (all procedurally generated) which bears the symbol of that religion and some other general decorative patterns down the side. On top of that is placed one of roughly forty different items, ranging from candelabra to bowls, statues to bones, and plants to statues of various animals. Here are some examples of this last type, which generally makes up around 60-70% of monotheistic religions in a game world, whilst the rest are of the above “rarer” types.



Polytheistic religions also use three different altar archetypes, which are selected at random for each polytheistic religion. Around 80% of the time they will use the “general” altars described and shown above – a block of stone or carved wood, with a banner, and with a symbol either appropriate to some aspect of the deities or chosen at random from a much larger set of “general” religious symbols – but the other half of the time they will use altars that fall into another category. These are for gods of a pantheon centred around ‘elemental’ concepts or other groups like metals or stones (such as the Deities of the Five-Fold Firmament, or the Divines of the Six Elements). All those names are, of course, also procedurally generated from large and varied libraries of names/words. We’ve seen the “general” altars, so let’s look at these elemental ones.

I’m academically quite interested in alchemy, pre-modern interpretations of “elements”, and the interactions between the two, and this archetype draws on alchemical concepts and also a few of my own which are related, but not quite drawn directly from real-world history. There are several different “sets” of “elements” that might be chosen for a religion of this sort – they might be the traditional fire/water/earth/air/etc, or slightly more unusual. In the picture below, these are for two different elemental pantheons. The altar on the right has been generated for a pantheon of five gods, in this case gods of the sun, the moon, the earth, comets, and stars; the right pantheon has seven gods, in this case gods of gold, silver, bronze, platinum, tin, copper, and iron. As above, these are rare “religion types” and will not crop up often, in keeping with good procedural generation where all possibilities are not equally weighted. As with all the other altars here, there will be clues towards these altars scattered around the world, and the nature of the altars will be referenced in a thousand different places and integrated into the world’s cultural fabric.



As with everything in the game, these are designed to be integrated into the clues and hints the player pick sup. Perhaps the player will be suggested that a priest who worships at the altar of the three candles is harbouring a secret, and only one altar has three candles at the top? Similarly, if you come across an unknown altar, the experienced player should be able to make a reasonable guess about what kind of deity it “belongs” to, and if they have uncovered a range of deities that are worshiped but haven’t encountered their altars, they should be able to piece together this kind of information. Equally, as with all the other graphics in the game, these graphics are designed not just to aid in the kind of discovery/exploration/information gameplay that really interests me, but also just to aid in constructing a densely detailed procedurally-generated world. Several people have said they think URR stands already as the most detailed proc-gen world ever crafted; although I appreciate the appreciation (as it were), I think that’s a little premature, but the details in the interior of buildings (such as altars) this release (March, hopefully) should certainly move URR much closer to meriting such praise.

In Conclusion

What I’ve shown here is only the slightest fraction of the religious altars that might be generated in a single game world of Ultima Ratio Regum. The majority are the “standard” archetype, which gives far more impact to the discovery of one of the more unusual ones. The five different altar types all draw on very different traditions, either aesthetically, thematically or both, and offer similarity within an archetype whilst still remaining highly distinct, and having enough noteworthy features to allow their descriptions or nature to be disseminated by information throughout the game world. Lastly, if you liked this entry, please share it on your social media outlet of choice! To conclude, here’s an in-game screenshot of the player exploring a (procedurally generated) church, and finding the altar, and giving it a look (this being one of the ones shown in the examples above, in this case for a demonic deity called the King of the Spire):


And, a Reminder:

International Roguelike Development Conference (Europe)

I’m hosting this year’s IRDC! I’m trying something a little different this year and I invite everyone to come along. You can read about it here (http://www.ultimaratioregum.co.uk/game/irdc-2015/), and please get in touch if you’re planning on coming along! The more the merrier, and this year’s will be something really different and, hopefully, something really awesome.
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: UltimaRatioRegum on March 21, 2015, 04:04:36 PM
A vast, immense, terrifying update this week. A huge amount has been done in this past fortnight: almost everything required for 0.7 is finished except for some remaining procedural graphics and the last two remaining building interior algorithms, which I’m currently putting together. My intention/hope/plan is to release 0.7 on April 4th. My thesis defence is coming up very soon and I’m preparing for that, so I don’t know if I’ll be able to perfectly hit this deadline or not. In the mean time, though, bask in the ridiculous amount of new building generation! Though first, I must draw everyone’s attention to this year’s European IRDC which I’m hosting at the National Videogame Arcade. Please sign up if you’re planning to attend (http://www.ultimaratioregum.co.uk/game/irdc-2015/)! Now, onto the update.

Mansions, Part II

Firstly, I’ve finished the final set of mansions – the largest ones, found only in upper-class districts, and from which the player will begin their quest from 0.7 (or possibly 0.8 ) onwards (since the player is a lesser noble). Mansions of all sizes are among the more hand-made elements of the world; there are still many, many variations, but the algorithm which constructs them is more about piecing together and differentiating between a range of hand-made chunks, rather than the algorithmic placement of items, rooms, etc, but that’s just a necessity of the detail (and more importantly, logic/realism) I wanted from these: I tried several algorithms which just weren’t given me outcomes of the sort I wanted, so I’ve gone this way instead. There are ten shapes for the largest mansions; each shape has three different upper level layouts, three ground floor, and three basements, and each of these varies in turn according to colour scheme, table/chair placement, what room is used for what, and also another difference. If the mansion is the one the player starts in, the room in the middle of the ground floor below – containing the nine statues, in three sets of three – will contain nine things, be they paintings, statues, books, or something else, each of which will give you a single initial clue towards the nine items you need to uncover the locations of in the world. For this release, all nine are placeholder statues, but that room will be where you want to start.

Here’s an example of a ground floor and a top floor, with four bedrooms:



… and another (you simply must enlarge this one and look at it full-screen, just look at the flooring! The architecture! I am almost appalled by just how satisfied I am by how these mansions look):



… whilst the basements look much like they do for the smaller mansions, i.e. stone/wooden flooring (if servants’ quarters or slave quarters, respectively). On the upper floor, you will also be guaranteed to find one special item in all the upper bedrooms, which you may discover or be hinted towards by various means; however, although the player’s starting mansion will contain the nine initial clues (and other mansions won’t), it is other mansions which may contain special items in the chambers of the nobles in that family, whilst your “starting mansion” will not. Therefore, your starting mansion will get you going on the hunt, whilst other mansions – if you can find a way to gain access – may have things to aid you on your quest. You also see those empty rooms on the ground floor? A storage room, and an armoury, soon.

Officers’ Quarters

I’ve put in the generation algorithms for Officers’ Quarters, located in Military Districts in large cities. There will only ever be one per civilization, and will contain the highest-ranking military officials (and, next version, presumably a logically significant amount of protection); there’s always a decent number of 5×5 chambers, and then one larger chamber for the highest ranking military official in that army (whatever that may be). Here’s a reminder of how one of these buildings might look: flags and fountains for the nation in question will always be found outside, along with a reasonably ornate road pattern, and the OQ is generally either a “corner” shape, or a “trident” shape like the one below:


For the interiors I decided to use the ornate floor type again here, but once more in a visually distinct way; Officers’ Quarters will always have a “strip” of ornate flooring in the middle, and use ornate flooring in the bedrooms of the actual officers, but then will use stone flooring (the “second tier” floor type for interiors) for the rest of the building. The game places one from a large number of possible patterns of tables/chairs, and then places one from a long list of patterns of pillars/walls on top (deleting any tables/chairs that need to be deleted in the process!), and voila – you have the ground floor. So here we have three possible lower floors from another civilization to the one above, and three upper floors, in one shape:



The differences are small across a single “shape” of building, but across civilizations, building shapes, floor colours, we actually get a lot of variation, whilst (as ever) maintaining a clear visual style which denotes that these are Officers’ Quarters, and not anything else:


As above, in 0.8 you’ll be able to find the highest-ranking military officials here, but it will naturally be a location which is closely guarded. I’ve also worked on the generation of armouries in military districts, but since these are very “practical” buildings (i.e. not ornate in any way), and since weapons and armour and the like are not yet generating, they are not especially interesting! Likewise for warehouses in market districts; done, but currently empty. What is interesting, however, is arenas:


Arena interiors now generate for arenas in feudal nations. The arena consists of three components; an overall building shape, of which there are several varieties; a shape for the central “arena” section (the section within the grey symbols, which can be seen through) and the location of various candle stands which keep the entire arena constantly lit, regardless of where the player is located; and then a pattern of chairs (of which there are many) which is then placed in any remaining tiles. The initial “lobby” leads to open doors that lead to the chairs, and also a locked door (which in 0.8 will be guarded) towards an interior area where contestants will get ready, and where you will be admitted to if you intend to fight within the arena. I also made a very rare alteration here: all the chairs have a randomized wood colour (based on woods in that climate zone, of course!) rather than just picking a single wood colour for the entire building, which I do for every other interior. I like the effect it produces. I have also added the code (currently unused) to sometimes spawn arenas which might have certain… environmental hazards. Here’s an example of one I explored:


I thought this gif was especially neat: step through the arena, talk to those in charge, decide to throw yourself into the ring, step out, and suddenly the arena opens up, lit through day and night by candles, and surrounded by (in 0.8 onwards!) a host of NPCs keen to watch the combat…


Also: want more gifs in future blog updates? I think you do, but let me know.


Added gallery generation! These spawn in city centres and will always contain four procedurally-generated paintings (which will always contain tiny clues, cultural/historical information, etc). One issue was to distinguish this from the lower floors of Officers’ Quarters, so we can see four paintings (the white diamonds) and a pattern of chairs. I took the randomized chair colour idea from arenas and reapplied it here, and had the game place chairs in blocks or along diagonals at different distances from the walls. It’s very simple, but the main function of these buildings is simply to house paintings (and, in the future, relevant NPCs who can give you useful information) – they aren’t the most exciting, but they function. Painting generation coming soon.



I’ve now developed the interiors for embassies. I wanted to make these very close-knit and very dense, so the game generates a number of closely-linked offices, picks a layout for tables/chairs within them, then generates. The ambassador’s office (the room with the upward staircase) will always contain a few items of note from their home nation, and the ambassador’s quarters can be found up the stairs.




Mints and Banks

The interiors of Mints and Banks are now generating! I once again found another variation on ornate/stone flooring: in this case ornate flooring runs around the exterior of the bank. The code is in place to spawn guards on each vault and a teller on the chairs/table in the middle, and will be used in 0.8. Here’s a bank as you will normally see it, with the vaults un-explored, and then the same bank after the player has (in later versions) found a way inside:


Mints, however, are rather more exciting now, though obviously also still lacking in actual, y’know, coinage. Whereas anyone will be able to enter banks, mints will obviously be under heavy guard, and some serious firepower or political might will be needed to gain entry. Here’s an example of a mint (with the same ornate-flooring-outline idea to aesthetically link them to banks) where none of the vaults have been opened:


…and here’s another one in another nation where the vaults (which will soon contain that sweet, sweet money) have all been opened:


The staircase in the middle leads down to an underground vault which will contain un-minted bars of gold/silver/whatever, and also probably some coin presses too. These areas will be much more lively come 0.8/0.9 once NPCs and trade are up and running (but also much harder to access!). I’ve also, lastly, temporarily removed currency exchanges from generating; I need to think very carefully about how those are going to work, and where they should be placed, and how that will interact with the player’s actions around the world, and how to avoid it becoming deeply annoying/grindy to switch currencies. I’m now thinking about a system where there are no currency exchange buildings, but rather individuals stationed at every city gate who can perform the service for you? I think that would be better.

Hunter Gatherers

All the interiors for hunter-gatherer civilizations now generate, though there really isn’t much to see here yet. I won’t be really focusing on these for a release or two, most likely. All the flooring in these buildings is the same as that outside, e.g. taiga, tundra, tropical, etc. You can wander in and look at the lovely doors, though:


Reliquaries, Incense Stands, Khachkars

This fortnight I’ve also created the procedurally-generated graphics for reliquaries. These are found in cathedrals only (i.e. only in one location per religion), and there will always be more reliquaries in a cathedral attached to a theocratic nation than one attached to any other kind of civilization. These all have a distinct symbol on the front which one might find elsewhere in the world. They’re quite ornate, and their graphics draw primarily on christian reliquary iconography, but also some sources from India, Japan, and Islamic art. They will naturally be locked by default, and – one assumes – well guarded, but will also contain things of either great use, or simply great value. Here are some examples:


I also did the graphics for incense stands in cathedrals and religious buildings – these can spawn instead of things like vases, gongs, statues, fountains, etc, and are just another kind of variation. Happy with the algorithm that puts these together: it’s fairly basic, but I think it looks good, and they’re very distinctive.


I have also added some very, very rare graves to nomadic citadels where only the absolute elites are worthy of burial (the rest are presumably disposed of somewhere else in the desert). For now, all of these graves are Khachkars since I only have time to create one algorithm for those and not for other grave types, but in 0.8 each nomadic civilization will have a different form of burial (cairns, stele, various other ideas). Naturally, all the symbols on this Khachkar might be important…


Some General Screenshots

Here are some nice general screenshots, though they both happen to be in cathedrals. Enjoy!



Next Week

There’s only really the remaining graphics left to do now. Things like reliquaries, finishing off all the tables/chairs/beds variations, and the like. There are also a few minor bugs that have arisen in 0.7’s development which I need to fix (primarily one involving external fixed sources of light), and I’m not really sure how long that one will take. I’m pushing for a release on the 4th – there are still a hefty number of small bugs and improvements I want to sort out, and I want a couple of days of playtesting beforehand to ensure I release the best possible version. My PhD defence is in the week starting the 6th, so depending on preparation, outcome, blah blah, the release might end a little after that. Hard to say. Either way, though, 0.7 is in its final stages! Which means the final worldbuilding release will be out in the next few weeks. Hype.
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: Rev_Sudasana on March 21, 2015, 07:51:52 PM
Amazing work, but good luck on the defense too!
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: vultures on March 22, 2015, 09:14:39 AM
Already @tweeted you, but I'd have to add - special + for frontend and in-game menu design.
I really enjoy your aesthetics.
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: UltimaRatioRegum on March 22, 2015, 12:10:42 PM
Amazing work, but good luck on the defense too!

Thanks on both! I'm feeling pretty confident about the defence; there's a 0% chance of a fail, but the fear is of what are called "major revisions" (rather than "minor revisions" which are the norm). Majors will generally take a couple of months, whereas minors are a week or two of work. Majors would be wretched, but eh - if that's the case, I'll just get them done and move on with my life!

Already @tweeted you, but I'd have to add - special + for frontend and in-game menu design.
I really enjoy your aesthetics.

Very glad you like it! As the game goes on and new/different information is added in each release I realize that there is, to an extent, an ongoing process of menu alteration/upgrading, but I think that can only be a good thing...

Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: UltimaRatioRegum on March 29, 2015, 01:57:16 PM
Just a short update this week, partly since it is only one week’s worth of development rather than two, and partly because I’m preparing for my PhD defence. But, nevertheless, things have been done. Before that, though, two things – firstly, your weekly reminder about the EU IRDC (http://www.ultimaratioregum.co.uk/game/irdc-2015/) taking place at the UK National Videogame Arcade in Nottingham, which I am hosting. Come along! Secondly, I’m giving a talk on generating cultures and aesthetics at the Norwich Gaming Festival (http://www.norwichgamingfestival.com/talks-events/) on Saturday 11th of April. Come along! Both are totally free to attend. I don’t have any other public talks planned in the near future (though nearly a dozen academic lectures at conferences in the next five months), but I’ll obviously let you all know when I do. It is possible I’ll be at this year’s GDC Europe, too. Anyway:

Mercenary Guilds

One of the last few buildings left to generate were mercenary guilds, which have now been implemented. These spawn in (most) city centers. Again, it is hard to make every building distinct, but for mercenary guilds I wanted the idea that one might be “browsing” for mercenaries – each room will be the home of a single person from the guild, who should differ significantly in abilities and equipment but still be roughly similar (I’m going to have guilds designed around a “theme”). Each room has its own randomly-chosen layout. The flooring is a square-tiled mix of wood (the brown) and stone (the grey) – it’s a small thing, but it’s hard to distinguish between all kinds of buildings when you’re only using ANSI! Which is to say: obviously you’re unlikely to go into a building with a sign outside without knowing what the building is, but I’m still trying to keep the interiors very distinct (or as distinct as possible). The woods for tables/chairs/beds are also cycled randomly for each chamber. The locked-door room will be the archives of that mercenary guild – lists of past contracts, etc, which will obviously be useful to your investigations – and may also contain a staircase down to a vault below, containing… well, who knows?


Middle-Class Districts

I’ve redone middle-class district generation. Here’s an old example – this is, admittedly, a full release out of date (0.6’s middle class districts had a few smaller gardens, more trees/plants, etc), but you get the idea; much like an “upgraded” lower-class district, random housing patterns, and sometimes roads which end in nothing (or start and end in nothing). I had a few critical comments about middle-class districts after 0.6 and how hard they were to navigate and make sense of, so I decided to do something about them, and to just integrate them slightly more firmly into the rest of the city rather than feeling like a random add-on. So, here’s an old version:


…and here are two new versions, for a “square”-aesthetic nation (with a religious building, a bank and a park), and a “circle”-aesthetic nation (with just a park)…



… and how it looks to explore and walk around:



Some things to point out. Firstly, there are now three types of houses (although all are treated alike in terms of what one might find inside and how the house itself generates): houses will walls and gates, houses with gardens, and houses with neither. I felt these needed a lot more variation, so they’ve got it. Secondly, you’ll notice the thickest roads are of different shapes, and these layouts – like so much else – relate to the aesthetic preferences of that nation. A nation with octagonal floor tiles and octagonal furniture will also have an octagonal layout in their middle-class districts (and so on for the other shapes). Thirdly, you’ll also note that all the plants (in this particular biome) are currently green; in some later version I’m going to add more variety to climate plants, add in a large range of unusual plants, and also add that to the ever-growing “clue” database (such that maybe certain plants only grow in certain nations, or are only cultivated by a few monasteries, etc?). I’m also going to have the colours of plants tethered loosely to climate, so that as you move around the world, you’ll see different “palettes” of plants, which will be a lot more interesting. Fourthly, the buildings are positioned at the intersections of the major roads – I wanted the middle-class district to look more like a true middle-ground between the rigidity and order of the upper-class districts and the randomness of the lower-class districts, and I think that by placing the special buildings more specifically, and updating the road system, but still having the district fairly tight and crowded, I’ve made it into a much better balance than it was before (since I think it used to look like a “slightly nicer lower class district” rather than something really in the center). Theaters have also been temporarily removed due to my uncertainty over, frankly, how the hell they are going to work, and that needs to be left until I have NPCs wandering around the place.

Unlike the mansions of last week, these are the exact opposite of handmade – almost nothing about the district, nor the buildings themselves, is handmade, and is almost entirely algorithmic. The games tries to place an appropriate number of rooms, and then path between them, and it allows situations where multiple rooms can lead onto one another rather than back into a central “hallway”. Here are some examples of some two-floor interiors for middle-class housing:




… and for some more unusual shapes:



Very happy with how these look now, and they’re the last housing type that needed finishing off. Everything from slums to the greater mansions can now be explored, and generate differently. Here’s a last shot, just because I really do like these doors:


All Houses

So, we can now take a shot at all dwellings, from the slums to the grandest of mansions. Here’s a large picture you should take a look at the full size of by clicking on it:


0.7 Release?

I accidentally reneged on my promise to never again promise release dates last week, and now I must pay for it. I am going to rescind all previous predictions and say: it’ll be out when it’s done. All my time not spent preparing for my PhD defence is spent on URR and there isn’t that much left to do, but it’s still going to be a very busy fortnight. I shall now once again swear to never make predictions of release dates again. Let us see how long that lasts…
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: UltimaRatioRegum on April 05, 2015, 11:57:30 AM
0.7 Release

As mentioned on URR’s Facebook page (https://www.facebook.com/UltimaRatioRegumRoguelike), 0.7 will be released on Saturday, April 18th. This is (for once!) a 100% confirmed/guaranteed/absolutely certain release date, unless I die before then, in which case I will empower someone to release it for me. To remind everyone: this is the last worldbuilding release. As you’ll find when you wander around it, the world is now madly detailed, and contains every imaginable building ranging from crypts to cathedrals, townhouses to mansions, and banks to parliaments and slums to shops, with procedural graphics for everything within those buildings, ranging from walls, floors, tables and chairs to altars, reliquaries, tombs and vases.

Norwich and IRDC

Another quick reminder: if you’re in the UK or Europe, you should come to the Roguelike Development Conference I’m hosting at the awesome National Videogame Arcade. Go here (http://www.ultimaratioregum.co.uk/game/irdc-2015/) for more information! If you’re in the UK, you should swing by Norwich on Saturday 11th to listen to my talk at Norwich Gaming Festival (http://www.norwichgamingfestival.com/talks-events/). Now, onto this week’s update:


Our last building algorithm is complete: for courts! These will only spawn in nations which follow the “Penitentiary” or “Ordeal” justice policies, and appear in city centers. Again, I wanted to make them aesthetically distinct from all other buildings, which remains tricky when one’s not using a tileset, but I think I’ve managed to find another clear visual style here. They use lots of chairs in the various hearing rooms/courts/chambers, but they are set out in coloured “stripes” according to the wood of the chairs and the shape of the room. There are also rooms with just tables in, which will later contain court records of criminals, important trials, etc. The overall shape was inspired by the “Star Chamber” in English history – although it is generally agreed that the name of the court was based on its decor, I realized that I hadn’t created any building shape which was based on either a star (or a cross), so I utilized both of these for the external court shapes. Here are some examples!


Tombs (and Stairs)

I’ve finally done the last major graphical block in this release: the tombs. These are generated using a vaguely similar modular system to the nomadic khachkar graves discussed two weeks ago, and they vary in a number of ways. I debated at length whether or not they should ever have names on – given the extent to which that would give away the game! – and I decided that the answer was no. No matter how noteworthy the person who is buried there, the tombs will never have names, and will (as with much else) be understood/decoded according to their symbols and graphics, rather than text. As you can see, there’s also minor colour variation; tombs in flooded crypts will have a slight blue tint, those in desert crypts might have a fractional red tint, etc etc. There’s a huge range of pattern layouts – the ones below show three of the layouts (two lines, six squares, three columns) and a small portion of the possible designs that might be etched onto a sarcophagus; there’s also a whole bunch of different shapes/designs for the top of the sarcophagus, and a lot of pattern variation within that too, meaning that each sarcophagus consists of between 3 and 10 components each of which generally has between a dozen and several dozen variations. Each sarcophagus will, of course, be unique. So if you hear that Person X was buried “where the stars rise between the vines and the torch”, then…




Other Stuff

I also threw together stair graphics, and ensured that the downside stair graphics can integrate correctly with graphics for wooden, stone, and ornate flooring (yes, I am aware the perspectives on these two staircases is different; that’s fine, you’ll never see them “together” in-game, and they proved easier to draw in the two different perspectives anyway).



I’ve also worked on crypts, finishing them, and emphasizing the difference between under-cathedral crypts (in Theocratic nations) and under-graveyard crypts (in Monarchic nations). They each have a distinct set of rooms, though some of the rooms for the under-graveyard crypts won’t be fully “activated” until we have NPCs moving in 0.8. Also just done a host of other optimizations, slight changes, making sure the correct “quality” of tables/chairs/beds spawn in each building, blah blah blah.

Bug Hunting

I’m now onto the final bug-hunting phase of 0.7’s development. There are as ever a wide range of minor ones – things generating in slightly odd places, text that isn’t completely logical, incorrect grammar/typos, etc, but only a couple of major ones. As far as I can tell there are not any crash bugs, though, which is obviously a good point to proceed from. One of the major ones is an extremely rare but very annoying bug with external sources of light allowing the player to see “through” walls, but only at a distance; in all my playtesting it has only occurred twice, and whilst I would like to fix it this release, I’m not going to let the release drag on an extra week, say, if the only remaining issue is this bug.

Some Screenshots

Lastly, here are some nice screenshots: a nomadic citadel in the fortress of Khan’s Rest; an altar to Ahorim, The Grey Worm of the Nightmare in a crypt below a cathedral in the desert; wandering around in the Red Senate which rules over the Nation of Ghanari; in the upper-class district of the city of Mourning Sun.





Next Week

Who knows?! But hopefully a celebration of a successfully-passed thesis defense…
Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: Paul Jeffries on April 07, 2015, 10:42:28 PM
The generated images are super-cool.  As somebody who's done some procedural art stuff (http://www.vitruality.com/2014/11/spartan-v1-2-procjam-edition/) myself, I'm interested in how exactly you go about generating them and how you define the rules of the generation - do you have some kind of base image which then gets procedurally modified or is it all done from scratch?  Have you got some kind of editor that helps you define the parameters?  How constrained is it?  (I've been thinking of implementing some of SPARTAN's procedural stuff in-game to generate tiles etc. on the fly, but find that a lot of the generators produce stuff that looks good for some seeds, but absolute garbage with others - it needs a human driving it to avoid creating things which instinctively look 'wrong'.  How are you dealing with this kind of 'quality control' problem?)

It seems a bit of a shame if the player has to specifically press a key to look at them - if it's vital to look at everything then it might get annoying, but if it isn't the player is probably going to miss out on a lot of the procedural pretties.  It would be nice if there was some small sub-window permanently on-screen that showed whatever was under the mouse and/or the nearest interesting object, although I suppose that would take up a lot of valuable interface space...

Title: Re: Ultima Ratio Regum (v 0.6 released, 13th December!)
Post by: UltimaRatioRegum on April 14, 2015, 04:02:26 PM
The generated images are super-cool.  As somebody who's done some procedural art stuff (http://www.vitruality.com/2014/11/spartan-v1-2-procjam-edition/) myself, I'm interested in how exactly you go about generating them and how you define the rules of the generation - do you have some kind of base image which then gets procedurally modified or is it all done from scratch?  Have you got some kind of editor that helps you define the parameters?  How constrained is it?  (I've been thinking of implementing some of SPARTAN's procedural stuff in-game to generate tiles etc. on the fly, but find that a lot of the generators produce stuff that looks good for some seeds, but absolute garbage with others - it needs a human driving it to avoid creating things which instinctively look 'wrong'.  How are you dealing with this kind of 'quality control' problem?)

It seems a bit of a shame if the player has to specifically press a key to look at them - if it's vital to look at everything then it might get annoying, but if it isn't the player is probably going to miss out on a lot of the procedural pretties.  It would be nice if there was some small sub-window permanently on-screen that showed whatever was under the mouse and/or the nearest interesting object, although I suppose that would take up a lot of valuable interface space...

Your PCG graphical stuff was/is awesome! Hmm, basically, it varies: every single type of image (altar, sarcophagus, floor, chair, table, door, whatever) has its own generator. Some are more algorithmic, and some are more to do with piecing together various handmade components, and some lie somewhere in the middle. In many cases I try to guess whilst I'm making the generator what possibilities will look/read badly, and then after that, I'll generate it a large number of times to then add special exclusions of those which look bad (but which couldn't be predicted).

I've thought about the sub-window idea, but as you say, that just takes up too much space; the idea is to make sure that everything *might* be important, but that you won't actually need to look at too much to decipher what is/isn't (and besides, I've been testing it, and it's incredibly easy to just fall into a rapid routine of checking out relevant objects). I acknowledge, totally, that it isn't 100% ideal, but I don't think there's a better option out there!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on April 18, 2015, 11:58:29 AM
After a mere four months of development, I am proud to announce the release of Ultima Ratio Regum 0.7! This release procedurally generates the interiors of every single building in the world – from cathedrals and mansions to slum housing and shops, and everything in-between – and the graphics for a vast range of items and features within those, ranging from ordinary chairs and tables to rare altars and underground sarcophagi. You can download it here (http://www.ultimaratioregum.co.uk/game/downloads/), and read more detail about the release notes below.

This is the last worldbuilding release! From this point onwards I’ll be pushing onto gameplay, starting with NPCs in 0.8. This release now establishes URR as one of the most detailed procedural worlds ever rendered – and one unparalleled in procedural cultural, aesthetic and religious detail – and marks the end of generating the immense world over which the player’s “quest” will play out.


- All buildings now have procedurally-generated interiors, where every single building has its own algorithms, archetypes, and items on the inside. This means everything, from cathedrals to slums, can now be fully explored, and in many cases span over many floors.

- All features within these buildings are also procedurally generated, from the most lowly of chairs, tables and candlestands to the rarest of altars, reliquaries and sarcophagi. All of each are dependent on the cultural norms for each nation.

Full Changelog:

- Procedural generation of cathedrals and religious buildings, distinct for each religion but consist across iterations.
- Generation of religious altars, religious reliquaries, and incense holders.
- Crypts now generate beneath graveyards in monarchies, and underneath cathedrals in theocracies.
- City centers how have all interiors generated for embassies, courts, galleries,  mercenary guilds and mints.
- Generation of large family mansions in upper-class housing districts, for both dominant and “ascending” noble houses.
- Generation of middle-class housing and lower-class housing, as well as slum housing outside city walls.
- Taverns, arenas, jails and slave quarters spawn in lower-class districts in nations with the appropriate policies (taverns, however, are universal).
- Military hospitals, Officers’ Quarters, Stables, Barracks and Armouries can be explored in feudal military districts.
- Shops and warehouses can be explored in market districts, although they do of course currently lack any items!
- Banks spawn in middle-class districts.
- Parliamentary buildings spawn in city centers of democratic nations.
- Farmhouses can be explored in the farms outside cities and towns.
- All buildings in hunter-gatherer nations now generate – longhouses, chieftain huts, and general houses – although they remain currently sparse.
- In fortresses, the player can now explore barracks, housing, and most importantly the oasis-like citadels at their centers.
- Altars for all religions now generate, aesthetically varied according to the archetypes and beliefs of each religion.
- Cathedrals and lesser religious buildings contain procedurally-generated reliquaries, incense holders, ornate vases, and much more, each distinct to a given religion.
- Everyday items like chairs, tables and beds also generate, with shapes and wood types distinct to each nation.
- Several buildings now contain candle stands which offer external sources of lighting that can be seen, even if the tiles between you and them cannot.
- Crypts are filled with sarcophagi, each with a unique generated image, within which is buried a figure from the world’s history.
- Save files are no longer in a single monolithic file, but now spread out so that no matter how many map grids may have been generated in a given playthrough, saving/loading speed never slows down.
- Various bug fixes, improvements, optimizations, etc, and a whole host of under-the-hood things implemented in preparation for 0.8.

I’m now working on 0.8 – the introduction of NPCs, conversations, face generation, clothing, the works – with an approximate target of four/five months from now, give or take. To finish off, here are some nice illustrative screenshots of 0.7 as it currently stands. Enjoy!








Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Aukustus on April 18, 2015, 02:16:26 PM
I encountered a "ERROR: report me!": "This area is temperate, has a small lake sourced from the ERROR: report me!, and is at sea level."
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on April 18, 2015, 06:41:08 PM
I encountered a "ERROR: report me!": "This area is temperate, has a small lake sourced from the ERROR: report me!, and is at sea level."

Heh, thanks!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: chooseusername on April 18, 2015, 08:12:15 PM
This is the last worldbuilding release! From this point onwards I’ll be pushing onto gameplay, starting with NPCs in 0.8. This release now establishes URR as one of the most detailed procedural worlds ever rendered – and one unparalleled in procedural cultural, aesthetic and religious detail – and marks the end of generating the immense world over which the player’s “quest” will play out.
Well done.  Are there any competitors to this claim, or are you trying to refrain from blowing your own horn too hard?  ;D
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on April 19, 2015, 12:11:52 PM
This is the last worldbuilding release! From this point onwards I’ll be pushing onto gameplay, starting with NPCs in 0.8. This release now establishes URR as one of the most detailed procedural worlds ever rendered – and one unparalleled in procedural cultural, aesthetic and religious detail – and marks the end of generating the immense world over which the player’s “quest” will play out.
Well done.  Are there any competitors to this claim, or are you trying to refrain from blowing your own horn too hard?  ;D

Haha - well... I don't think so, re: any other competitors. DF is obviously a vastly more detailed procedural world in many directions than URR, but I think I can mount a strong claim in that direction re: generating cultures/aesthetics/religions/societies etc (and this will only become stronger in 0.8 once we have NPCs behaving according to their cultures etc!) :)
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Aukustus on April 19, 2015, 01:16:37 PM
Is there a way of knowing which building is it I'm inside?
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Rev_Sudasana on April 19, 2015, 07:37:57 PM
Congrats! Had a quick run around in the world. Is there any way to preview travel destinations without actually spending the time it takes to get there, or do you need to actually travel in order to find out more about another district?
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on April 20, 2015, 10:49:17 PM
Is there a way of knowing which building is it I'm inside?

Loads of buildings have signs outside (the '?' characters), whilst some of the others should (hopefully) be clear from what's inside, and you can always 'l'ook at the door to find out! I'm debating having it say "You enter the [building type]" instead of "You enter the [building]" in the future, and I probably will...

Congrats! Had a quick run around in the world. Is there any way to preview travel destinations without actually spending the time it takes to get there, or do you need to actually travel in order to find out more about another district?

Thanks! Er, currently you need to 'T'ravel, but in the future, you'll be able to find out information without visiting them directly, in order to help inform your decisions.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on May 02, 2015, 10:44:47 AM
Procedural ANSI face generation is here!


Ok, so a little about the system. I basically wanted a system which adhered to four (five) major objectives. Firstly, it should be massively varied, and even if you spend a decent length of time just looking at the ordinary people in the street, it should take some time and under you see any two people who are identical. Secondly, it should be demographic – which is to say, each nation can have a set of preferred hairstyles, likely skintones, other signifiers (like turbans, tattoos, jewelry, etc), and these should be distinct in each nation. Thirdly, and following on from the second point above, there should be enough of these that (much like everything else in URR) you should be able to gain visual information: when you meet someone you’ve never met before, you should be able to make a reasonable guess about their nation of birth. Fourthly, any combination should be possible, as a means of undermining the idea that only “primitive” peoples will be found with certain cultural signifiers – in one game perhaps the people in the most technologically and militarily powerful empire all have extensive facial tattoos, for examples. Fifthly (I suppose), the objective was to make them look visually and aesthetically interesting, and striking, and distinct: as with everything else in URR, if I wasn’t able to make face generation look enough to meet my standards, I’d have just cut it.

I’m not honestly sure how many variations there are (since some variants cancel out other variants in the generation process, making the simple solution of just multiplying everything together inaccurate). Roughly speaking there are nine skin tones, thirty hairstyles for women, thirty for men, a dozen different forehead/chin/nose shapes each, a dozen hair colours (which are genetically placed around the world and are toned appropriately to reduce contrast with skin tone), four eye colours (likewise, genetically varied around the world), several dozens beards (for the gents), and then a massive range of other visual identifers. There are five below: paint/dye markings, turbans, brands (sometimes consensual/cultural, sometimes as identifiers of slavery), facial tattooing, collars (always denotes slaves), scarification, and a bunch I haven’t shown here. There are also some rare additions like scars, eye patches (like the lady at the top of this entry), and some other neat and extremely rare properties as well. These will always tie to that NPC’s history, so someone with an eyepatch will have a distinct event in their past where it was lost – you can sometimes, therefore, get a bit of “personal” data from someone’s face, as well as cultural/national/etc.


When you ‘l’ook at an NPC, you’ll get a new range of screens to cycle through in this coming release. If you’re currently in combat, it’ll automatically go to the screen showing their health; if you’re not (which will obviously be the case in this release) it will show you their face, and a little bit of data. There will then a list where you can scroll through everything they are wearing and bring up the appropriate attendant images for all of those (clothing, shoes, any holstered weapons, jewelry, etc). I’m going to remove anything you could not “physically” determine, until you know for sure: which is to say, an NPC’s lookup will never state their affiliations, unless you have explicitly talked to them and found out (though they might have lied…) or someone else has told you. Here’s a spectrum of the skin tones in the game, with a bunch of hairstyles and beard styles (where appropriate). Alpha Centauri players might also note the worrying but entirely unlpanned similarity of one of these nine women to a certain Sister Miriam Godwinson…


And that glorious image pretty much concludes this entry. I’m currently working on a bunch of optimizations for the game – primarily in terms of how data is saved, and the efficiency of the rendering and line-of-sight algorithm, since this needs some serious improvement so that you can see further than a couple dozens tiles in front of you. Once that’s done (which hopefully won’t take too long) I’ll probably get working on clothing generation, and then doing some major work on families, family trees, and how NPCs should be stored for remaining still and/or moving around the map, as an important precursor to getting them actually spawning. See you all next week!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Zireael on May 02, 2015, 11:54:30 AM
As I already told you, this is a milion times better than what I hope to achieve even though the general idea is the same (to have different skin tones/hairstyles/eyes/noses/mouths and maybe scars and tattoos).
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on May 02, 2015, 12:35:24 PM
As I already told you, this is a milion times better than what I hope to achieve even though the general idea is the same (to have different skin tones/hairstyles/eyes/noses/mouths and maybe scars and tattoos).

Funnily enough, although I want to have scars, they are proving a nightmare to get them looking even remotely good! And getting them to integrate with all the other facial options is also proving surprisingly tricky... :\
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: AgingMinotaur on May 02, 2015, 05:47:06 PM
Gorgeous as usual. I'm looking forward to the upcoming releases, I must say. Did you already experiment with different shapes for eyes and noses (shorter/broader/crooked nose, piggy/fishy/narrow/slanted eyes etc.)?

As always,
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on May 03, 2015, 10:18:21 AM
There are actually a few slightly different nose shapes (I think... two for men, three for women, if I recall correctly?) and some eyes are fractionally wider or narrower on the inside, outside, or both (if you look this might just be noticeable), but given the constraints of using ASNI glyphs, it is/was surprisingly tricky to make eyes vary all that much. Honestly, eyes are probably the best of the face I spent the most time agonizing over and fiddling with until I reached something that I was at least vaguely happy with...
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on May 10, 2015, 02:27:14 PM
This week I haven’t been able to get any coding done, and the same will sadly be the case for the next seven days – I’ve been finishing off an academic book chapter due in very shortly, as well as doing some writing for various online game publications (links will be posted here once my pieces are published), and also writing three different conference presentations for three talks I’m giving at DiGRA in Lüneburg next week (so once I upload that, and my previous set of talks, I’ll be uploading six sets of slides for your perusal! I’ll get around to it folks, I promise). So, this week and next week we’re going to talk about some of the more abstract intentions/plans for 0.8 onwards, then hopefully after that we’ll be back to specific updates once I get working on 0.8 again upon returning from Germany (week of the 18th onwards). Two big abstract/worldbuildy changes in this release alongside the development of NPCs (!!) are policies, and nicknames, so let’s talk about these.


During the development of 0.7, I found myself making a major change to how national policies work. Originally the idea was for them to give abstract benefits to the player – one policy might yield a player who belongs to that nation extra strength, for example – but I found this increasingly uninteresting. So much of the game’s mechanics are meant to be about figuring out and understanding the generated world, and I realized it would be a lot more interesting if policies directly affected what spawned in each nation – so the macro of a nation’s political ideologies and policies then determine what buildings appear (or not) in cities, towns, within buildings, etc.


So, a pretty simple key. Green effects are policies which don’t relate to shops; yellow policies relate to types of shops which can spawn in that nation; which the red ?s, funnily enough, are policies I haven’t thought of a good effect for (any ideas?). Escort Cavalry is a nomadic-only policy, and Chiefdom is a hunter-gatherer only policy, but aside from those, any of these policies can spawn for any feudal nation (Monastic is in red because it is a new policy I haven’t yet added to the game or created an image for). At the bottom you’ll see two binary possibilities: from 0.8 onwards, nations will either be slaving nations or won’t be, and nations will either use gunpowder weapons, or won’t.

With this system policies will therefore seriously affect (I hope) a player’s path around the world and choosing which nations to visit, knowing that certain shops will only appear in certain nations, some will be more/less hostile to foreigners, some have different systems for payment (or not) when moving around cities, some nations will have different punishments if the player decides to commit a crime within their land, etc. Should add an interesting level of grand strategy to the player’s movement, and be a lot more interesting than “abstract policies” which affect the player, but fail to distinguish between nations.

City Nicknames

Credit for this idea must go to Retropunch on the Bay12 thread for URR. He suggested that I could add some distinguishing factors to cities which both make them stand out more from each other, and add the potential for nicknames. In this release I’m aiming to add this in over a dozen ways to make cities more distinct, and add in another “clue” – i.e. the nickname – by which cities might be identified. This means the generation algorithm for a small number of cities will be tweaked to ensure that something very noteworthy spawns in/around/throughout a given city, and then an appropriate nickname is generated. Some examples:

City with many slums: “City of the Downtrodden”, “The Evergrowing City”, etc

City with many gardens: “The Flowering City”, “The City of the Hundred Gardens”, etc

City near volcano: “The City of the Inferno”, “The City of the Red Mount”, etc

Slaving city: “The City of the Masters”, “The City of Shackles”, etc

City with many statues: “The City of Stone Watchers”, “The City of the Grey Men”, etc

And so on. I’ve got around fifteen ideas so far for feature/nickname combinations (you’ll be able to find the rest in 0.8!), so maybe five cities per playthrough will be granted some unique “overlay” (like lots of gardens, lots of statues, etc) and a nickname to go with it. So then the player will sometimes be told “Travel to [ City Name ]”, but will instead sometimes be told “Travel to [ City Nickname ]” – a small thing in gameplay terms, but something which’ll add some nice extra variety to the world’s cities and help the player remember which city is which. The idea of the nickname in general seems like something very promising, so I’ve also been working on adding nicknames to other things in the game, primarily rulers and important historical figures, and also noteworthy living figures the player will be engaging with, and it’s those I’ll be talking about next week!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Zireael on May 10, 2015, 06:02:07 PM
For the Hunter-Gatherer, I suggest Shamans :)
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on May 19, 2015, 09:07:19 AM
For the Hunter-Gatherer, I suggest Shamans :)

I'm working with/on something like that! See below: here's this week's blog entry, though you'll have to head to http://www.ultimaratioregum.co.uk/game/2015/05/17/policies-and-nicknames-part-2/ to get them! Just a short one this week.


Well, I almost missed a weekend update for the first time in over a year, but in my current timezone (Germany) it is still Sunday, so here we are! Just a quick one this week, but I’ve got a few really long and interesting updates, and some more abstract discussions, scheduled for the coming weeks. However, since this entry is rather short, here are four of my most recent conference/lecture presentations, in no particular order. Enjoy!

Talk to AISB AI & Games conference on designing URR’s upcoming NPC AI:

Talk at a conference on literary dystopias about Command and Conquer: Tiberian Sun

My main talk at DiGRA about Japanese arcade culture, danmaku games, high scores, and some other cool stuff (a full paper version is going to be published as a chapter in a book on Gaming and East Asia in 2016)!

My secondary talk at DiGRA about civilians in the original Command and Conquer

Remaining Policies

Thanks to everyone for their ideas on the remaining policies. I realized as I read through the suggestions that something had been a tad unclear: Tribal Knowledge, Chiefdom and Escort Cavalry are policies which can only appear in hunter-gatherer and nomadic societies, and are therefore rather like “placeholders”, so suggestions for those – although there were some great ones and I might integrate them as general buildings/NPCs/etc! – won’t be directly integrated into the policy system. So, without further ado, the Militia policy will result in citizens owning weapons in their homes; the Imperialist policy will allow that civilization to seize colonies (currently all feudal nations can do this, but this’ll therefore be changed); the Hegemony policy will mean that race (which is to say, skin tone) will directly affect citizens in that nation in some way, but I haven’t yet decided precisely how; and the Vigilantism policy will cause bounty offices to spawn, listing wanted individuals and the bounties on them. That means interventionist – by which I mean covert operations, spying, espionage – remains undecided.


So, as well as city nicknames, I’m working on nicknames for people. This means both historical figures, and living figures who the game considers important. Right now I’m splitting this into two categories: people from important noble families have a certain generation algorithm underlying their nicknames, whilst anyone else who isn’t high-born but has still become “important” will have a different generator. Firstly, if someone is from an important family, the game looks at the coat of arms for that family. If their coat of arms contains a “distinct” pattern, it will go to a unique generator for that pattern; if it doesn’t, then it will default to a more “general” generator. This generator can sometimes use words from the terrain of the homeland of this person as well.

So, for example, let’s say someone comes from an ice/tundra area, and their coat of arms contains the pattern of the dragon flying “upwards” (I’m sure many of you will have seen it). They might be nicknamed “The Roaring Breath of the Ice”, “The Adorned Wyvern”, “The Drake of the Hailstones” or “The Ennobled Dragon”. Alternatively, someone who hails from a temperate region and has a coat of arms containing a trident might be nicknamed “The Halberd of the Bluffs” or “The Invested Spear”; someone from a family with a harp on their coat of arms and who lives in the desert might be “The Singer of the Dust” or “The Sand Melodist”… and so on. Alternatively, if a coat of arms is generic or geometric enough to not merit any special words, it instead defaults to a name based on the policies of that person’s nation: “free trade” as a policy might yield “The Glorious Merchant”, “frontier” as a policy might yield “The Grand Marshall”, “theocracy” yields “The Sublime Conduit”, and so on. I still need to finish off some of the generation possibilities, but these are basically done.

And that, I’m afraid, is all for this week! I’ve been at a conference so haven’t been doing any programming this week, but there’s a lot of cool stuff on its way. See you all next week for probably a URR update, or a discussion of one of the many interesting game-related things this conference has got me thinking about!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on May 25, 2015, 05:03:30 PM
Teaser for the next URRpdate:

Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on May 31, 2015, 06:06:30 PM
This week's update:

So, last week I posted an entry which generated a huge amount of discussion here, on Reddit, on Twitter, and (if past experience is anything to go by) probably a few other places I haven’t even noticed. To those who I still owe replies to – I’m getting to them! I’ll be posting a follow-up next week, but this week we’re onto another URRpdate, finally!

Clothing Generation

This week I’ve been working on both generating clothing styles for different civilizations. There are currently six “archetypal” clothing styles, each of which has three sub-styles within it, and each sub-style has its own variation between specific items of “identical” clothing (just small things like the width of clothing relating to the size of its owner, fractional colour differences, that kind of thing). As the maximum number of feudal civilizations the game allows at any one point is eighteen, this works out perfectly, so all/most of the styles will be reflected in each game (though I might add more later). I’ve so far worked entirely on upper-class clothing for rulers, aristocrats, military commanders, etc. There are several dozen colour combinations, and each nation will pick one for its upper-class clothing and then have those same colours reflected, to a lesser extent, in its middle/lower-class clothing. This week we’ll have the upper-class clothing, then next week the follow-up to the metagame post, then the week after that, probably the remainder of clothing and some early development of crowd mechanics, if we’re lucky?! So, here’s an illustrative sample of five of the six “archetypal” clothing styles (the last one is not yet finished):


Going clockwise from the top left, these are inspired by “classic” Western medieval clothing of leather (or other material) waistcoats and a shirt underneath, though here I’m treating them as a single garment; the second is inspired by Japanese kimonos; the third is inspired primarily by older Chinese styles of dress, and also some more “tailored” Western styles; the fourth (i.e. the bottom-right corner) is inspired from a range of styles including far more ancient Babylonian and Hebrew dress; the fifth is based on a lot of Eastern European royalty, and the sixth will be based on Renaissance Western Europe (but is proving surprisingly tricky to realize). These then have the three sub-styles as described above – which consist of different patterns, different locations of buttons, lengths of sleeves, sizes of collar, colour schemes, etc. To take a closer look at the variation within one archetype, let’s go with the Hebrewlonian (???) archetype, of which I’ve included three below. (There are actually a dozen different possible patterns which can appear on the “clasps”, but just weirdly enough, all three I took for this picture happened to select the same one, and now I’ve only just noticed this and I’m severely disinclined to go and generate them again, so we’re just going to have to make do with these). The right is “average” size (which will include “muscular” or whatever other build definitions I wind up with), the middle for someone slim/athletic, and the right for someone much heavier-set. So these would be belong to three neighboring civilizations who might have experienced a level of cultural bleeding between each other’s society, but maintain their own styles of dress nevertheless:


So, each of these might be tethered to a different culture, but I’ll also be sure to place those cultures next to each other (think pre-modern China, Korea and Japan, for instance), so that you get some sense of “similarity” (sometimes) between clothing styles of nearby nations (though given that many nations might have complex territorial shapes, there is only so far this can be pushed). Naturally there will be coupled with appropriate lower-body garments, boots, gloves, etc, and then we’ll be done with clothing for this release (with armour and weapons… next release?). In the new NPC lookup (or the same for the player) you’ll be able to scroll through all the clothing on an NPC to let you examine what culture you think they might be from. Maybe a logical mechanic would be to have NPCs judge the player, at least in part, based on their clothing style (and many other factors) so that there might be some ability to attempt to pass “undercover” in nations unfriendly to your own. As with everything else: the game will never tell you “this is the clothing style of Nation X”, but once the player has that learned that, you should be able to come to recognize those you encounter in the street, or the origins of foreign merchants/travelers, etc.

I’m now working on two things simultaneously: crowd mechanics, and remaining items of clothing for middle-class and lower-class citizens, and then lower-body garments, boots/shoes, etc. I’m basically working to an “interim” deadline right now since I want to show off a stable build with crowd mechanics functioning (and all clothing items implemented) at the IRDC 2015 I’m hosting on 27-28 June, so all academic work is on hold now whilst I grind towards that goal. Metagame follow-up next week, then more delicious URRpdates!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Avagart on June 01, 2015, 12:10:11 AM
Impressive. As always. I'm very interested in algos and technics which are used... You made amazing work!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on June 04, 2015, 04:17:39 PM
Impressive. As always. I'm very interested in algos and technics which are used... You made amazing work!

Thanks! I rarely do technical updates, but a few people have been asking for those recently, so I may produce one in the next little while :)
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on June 14, 2015, 04:00:16 PM
This week I’ve finished off procedural clothing generation for the richest individuals in feudal nations. The game can now create upper-body garments, lower-body garments, and boots, for each civilization. These different garments across a given civilization maintain a consistency of colours, a general consistency of size/aesthetic, and a consistency of whether the patterns etched into the clothing are circles, octagons, squares etc, based on the visual preference of the nation in question. Thus far these are only the “upper-class” clothing variations, but I think one can reasonably extrapolate how the others will look (which will come in a few weeks, I expect). Here’s a summary of the three layers of clothing currently implemented – I’m also going to add gloves and cloaks this release, but haven’t got around to them yet (since they’re hardly a priority compared to implementing crowd mechanics before the UK IRDC in a fortnight’s time!), but they’ll probably reflect the coats of arms of important houses if upper-class cloaks, and then just have some appropriate patterns on for middle-class, and nothing special for lower-class. Anyway, onto the clothing of our procedurally-generated aristocrats:

Upper-Body Garments

There are currently seven “archetypes” for upper-body clothing, an example from each being shown below. I’m working on an eighth archetype but it is proving extremely challenging to make it look anything other than awful, so that one might not see the light of day. Regardless, each of these has three sub-archetypes, making for twenty-one high-level “clothing styles” at present, each of which then undergoes extensive randomness within that clothing style, meaning that even if the maximum number of feudal nations are present, there will still be several “unused” high-level clothing styles left over – so that’ll do for now.


Lower-Body Garments

It is very challenging to make “trousers” which look even vaguely as interesting as upper-body garments (or boots or gloves, for that matter!), but I’ve done my best. The “Japanese” and what I have taken to calling “Hebrewlonian” archetypes in the above picture (middle top, and third bottom) will count as both upper- and lower-body garments, whilst the lower-body garments shown here will be distributed to the rest of  the clothing styles. Although in many nations there will be little sexual dimorphism (so to speak) between clothing styles for men and women, this will not be the case in some cultures, and a “dress” clothing archetype has yet to be worked on (I’ll get to it in the next few weeks). So some nations have the J/H archetypes above for both sexes; some nations will have the other above clothing for both sexes; some will have different clothing for the two sexes (and this will all, obviously, be chosen procedurally). So, some trousers/skirts etc (skirts are especially hard to make interesting, but I’ve done my best):



Now onto the “paired” items of clothing – boots (and gloves). I decided for the time being to forego “shoes” and go with something of a Game of Thrones/TV-adaptation-of-Wolf-Hall logic, i.e. that even those at the very top of society have to give something towards practicality and pragmatism, and basically wear extremely nice boots, rather than wearing beautiful footwear which never comes anywhere near a bit of mud. Boots, like gloves, have a distinct item for each in a pair, so that we can handle things like losing limbs, damaged limbs, etc, later in the game. Gloves and boots use the same colour system – they take the established colours from the clothing above, and then blend it 70% into a generic “leather” colour, to give the impression of dyed leather. Boots are therefore deliberately a tad less “striking” in colour than other items, but still maintain a strong semblance of the same colour schemes. Remember, as always, that you’ll never see these next to each other in game!



Gloves are coming soon… but possibly not before the end of June, since now that I have the three most essential items of clothing in place, I’m working solely on NPC mechanics in preparation for showing off an interim “0.8”-ish building at the UK IRDC at the end of the month.

Complete Generated Clothing Sets:

Here are some complete (aside from gloves) “sets” of clothing – note, of course, that the zoom level does vary across each item of clothing so that the player can see maximum detail, and you’ll obviously never see them all in-game “lined up” like this, but I think it’s quite nice to look at some of the aesthetic consistencies across different items of clothing belonging to the aristocratic echelons of a given civilization:





(Note that Set 4 contains no lower-body garment since the robe covers both the upper- and lower-body slots, and also in some of these examples, the underlying pattern – square, diamond, etc – varies, which it won’t in the actual game.)

I will be working on middle-class and lower-class/slum clothing soon, but that’s taking a back-seat now to work on some mechanics for the version I want to be able to show off at the UK IRDC. There will also, of course, be distinct clothing styles for nomadic civilizations and tribal civilizations, but those are going to come along later, although I do have some ideas for what types of generators I’m going to build for both of those.

Future Mechanics

Clothing generation is increasingly pointing towards an obvious but potentially very interesting and unusual mechanic: the ability to “fake” being a member of a given culture. Perhaps you can don clothes of other cultures (and perhaps lighten/darken your skin, as many real-world explorers and “adventurers” in the distant past did for exactly this reason?) and attempt to “pass yourself off” as a native in a distant land… which then yields potential gameplay around attempting to maintain the deception, say appropriate things in conversation, and give nothing away, whilst perhaps other NPCs are capable of noticing slightly unusual things about your character which suggest to them that all is not as it seems? I think this could be some really interesting territory to explore in the future…

What next?

Well, we now have heads, upper-body and lower-body clothing, and boots, so I’d say we’re about to ready to actually create URR’s NPCs. This week I’m going to be working on optimizing the field-of-view algorithm which needs some serious improvement for the next release, creating the new “character lookup” window which has room to include a face and to scroll through their clothing (and in 0.9 their armour and weaponry, if any), and continuing to work on crowd mechanics, spawning/de-spawning NPCs, etc. See you next time for an update on hopefully all of these things!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on June 21, 2015, 10:33:57 AM
Other stuff to read

Before we start this week’s entry, I have some other stuff you might all like to read! This week I had a piece published at First Person Scholar about the intriguing player-AI dialogue which develops in the danmaku game “Warning Forever” (http://www.firstpersonscholar.com/warning-forever/), and a piece in Memory Insufficient about the alternate history aesthetics of the Red Alert series (http://meminsf.silverstringmedia.com/art/alternate-history-aesthetics-in-red-alert/). If you’re interested, do give them a read and support those other two sites!

Now, on to this week’s many attractions:

Clothes as Items, and Inventory Changes

Clothes have now been transported out of the file I use for working on the game’s graphics and added into the game itself, and turned into items (with a horrifyingly large number of variables – it took me much longer to integrate them than I expected). When you look at an item of clothing, it tells you nothing except the quality of the tailoring – “ornate”, “well-made” or “poorly made” – and what type of thing it is – “shirt”, “pair of trousers”, etc, and tells you nothing about the nation it is from, as that’s part of the learning/discovery process. Along side this implementation, the inventory system has been changed. Previously there were different keys for each action, so one would press ‘d’ to ‘drop’, ‘D’ to ‘drop several’, ‘t’ to throw’, and so forth; they’d then bring up your inventory, you’d select the item you wanted to perform the action with, and go ahead and do it. However, this meant you only saw the picture of the item when you pressed ‘i’ to simply look at your inventory, and that meant the images were (to an extent) being wasted. I’ve now changed it so that there are only two inventory functions: ‘i’ brings up your inventory, and ‘D’ allows you to drop many items at once (without looking at them). When you now press ‘i’, therefore, and choose an item, a line of text at the bottom of that item lists everything you can do with that item, so you always get to see the graphics, and the range of possibilities for each item is made a lot clearer (so things you can wear, or things you can use in some way, or eat, or whatever). I think this is a lot better, makes more use of the graphics, and tidies up the UI a little (given how many roguelikes use every damned letter on the keyboard). An example of a piece of clothing currently un-worn, and one being worn:


Character look-up

The look-up window for any character (player or NPC) has now been significantly changed and upgraded, and faces have also been moved out of the graphical-testing file and fully integrated into the game’s code. The first page currently shows the face of the NPC you’re looking at (or your own), and lists everything that person is currently wearing (which is visible; rings are “invisible” if they have gauntlets/gloves). The second page will soon show health, but I’m still working (yet again!) on thinking through how health is going to work, so we’ll have to see, and for now it has been removed (and will probably stay removed for 0.8 unless I finally figure out how health will work, even though I know how combat is going to work). So here’s a shot of me (without a first name, so the name up there is my family name), and this time I happened to be in the “scarification” civ. You’ll also notice I’ve made all eyes into a light grey instead of white! The reduced contrast is far less jarring.


Browsing clothes

The coolest thing about the new look-up? You can now hit Enter and browse through all the things a character is wearing, using the arrow keys. As you move around the “grid” of things the character has on them, each image then appears on the right-hand side (the first time the right side of the screen has ever been specially used!). For now, therefore, you can look over the upper- and lower-body garments, and boots, but I’ll be working on all non-armour garments in this release, meaning that we’ll be adding gloves, and probably cloaks too, but armour will come next time, and necklaces and rings will come… whenever. Either way, here are some nice illustrative screenshots of this! (With some placeholder first names and surnames…)




NPCs are now spawning

This speaks for itself, really, given the above screenshot. They don’t move, think, react, converse or do anything yet, but they are there, and the game can handle them and draw them correctly, and the player can ‘l’ook at them and browse what they’re wearing. My objective for this coming week before the IRDC is to really crunch and try to get crowd mechanics working to the point that NPCs will spawn and despawn out of the player’s line of sight. As for line of sight and field of view, there’s something cool on that point later down this entry…

Genetics, Culture, etc

I’m pleased to say (and one might extrapolate this from the integration of the facial images) that we’ve now got a model for genetics and cultures spreading around the globe. Genetically the game now chooses large chunks of land for eye and hair colours (they bleed out around the edge, but these screenshots show only the dominant colour in each region; equally, although these are very geometric and unsmooth, that doesn’t ultimately matter, since populations of NPCs in-game will always blend and travel). The first picture shows eye colour variation, the second hair colour, in a generated world:



As for how these work for individual NPCs, basically, each nation has a “core” set of values for their skin tones, eye colour, etc, and that’s based on what values are present in their capital city specifically. Equally, they can also spawn NPCs who might have been born hundreds of miles from the capital, but are still within the same nation. The further you get from a nation’s capital, therefore, the more and more people you’ll see who are born according to the demographics of that particular area, and the closer you get to the capital, the more you’ll see people who look like the people of that capital city. Cultural norms will be maintained however far you go – so people in the capital and a distant colony have the same hairstyles – but visual/genetic markers (eyes, skin, hair colour, etc) will vary as you move around. So if you have a capital city on the far, far east, and a colony of that nation on the far west, and in that colony you might expect 25% to “look like” they came from the capital in terms of eyes/skin/hair colour, most to look “native” to that colony in eyes/skin/hair etc, but they will be visually unified according to their hair styles, other cultural markers, beard styles, clothing, etc etc. So we basically have two layers – the “genetic” and the “cultural” – and these blend and intertwine as you move around the world. Also, different types of civilization have different levels of cultural variety – the open and well-traveled nomads have the most variation within a nation, the small tribal societies have the least, and the feudal civilizations are somewhere in the middle.

Field of View Optimization (at last!)

People have been asking for this for years, so I have finally put some time into optimizing the field of view algorithm, and now you can see basically everything on-screen at one time. Buildings will still have a reduced field of view, and it’ll reduce at night, too, but here’s a screenshot and a gif of wandering outside in the daytime:



Next Week

Well, the IRDC is in a week’s time, and I’m crunching like mad to get some kind of NPC pathfinding/crowd mechanic simulation going there. It’s going reasonably well, and I think I’ll have something good to show off, but I’ve been running into some fundamental design questions – can NPCs push past each other, for instance, if one occupies a tile the other wants to get past – which have surprisingly far-reaching algorithmic implications for how pathfinding and gameplay will actually play out in the longer run.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Avagart on June 21, 2015, 11:21:17 AM
Amazing idea (and, I belive that, good implementation) with genetics and cultures. Do you plan to expand this feature? Maybe region-dependent skin colour, or more cultural (and less genetic) issues like, dunno, tendency to specific weapons or city types?

I don't know if I like your FOV algo and I don't know if possibility to see everything on screen is good thing. In URR is a lot of obstacles, which block the field of view. With long-range of vision it might be a bit... illegible? This is proper word? Like bizarre, uncomfortable.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: chiguireitor on June 21, 2015, 02:18:31 PM
Liking a lot the progress here.

One thing, you can relax the voronoi vertices a little to enhance the geometry to a more natural look using Lloyd's relaxation (https://en.wikipedia.org/wiki/Lloyd's_algorithm).
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on June 23, 2015, 10:02:47 AM
Amazing idea (and, I belive that, good implementation) with genetics and cultures. Do you plan to expand this feature? Maybe region-dependent skin colour, or more cultural (and less genetic) issues like, dunno, tendency to specific weapons or city types?

I don't know if I like your FOV algo and I don't know if possibility to see everything on screen is good thing. In URR is a lot of obstacles, which block the field of view. With long-range of vision it might be a bit... illegible? This is proper word? Like bizarre, uncomfortable.

Oh yes, skin colour is region dependent, but everything like weapons/cities/etc is entirely culturally bound; each nation has its own preferences for basically everything which is then reflected and reproduced through the nation in its architectures, its people, it relationships with other nations, etc. FOV - interesting point, and I do see what you mean, but I still definitely think this is an improvement over the old tiny-FOV :).

Liking a lot the progress here.

One thing, you can relax the voronoi vertices a little to enhance the geometry to a more natural look using Lloyd's relaxation (https://en.wikipedia.org/wiki/Lloyd's_algorithm).

Thanks - that link is interesting, but I actually think that looks way less natural! The example in the link looks so artificial and formal, I'm far happier with what I've got going here. Yes, of course, some genetic areas are going to sometimes cut across massive regions of ocean, and perhaps that is a little peculiar, but I think that's less peculiar (or at least more "natural") than the kind of examples in that wiki page!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on June 29, 2015, 04:27:53 PM
This week's blog entry: a round-up of this year's (UK) IRDC from the past weekend! http://www.ultimaratioregum.co.uk/game/2015/06/29/irdc-2015/
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Krice on June 30, 2015, 02:06:25 PM
If you are removing combat (or even making it simpler) it will be nice, because then there is one possible competitor less for Kaduria. I want to be the winner when Kaduria is released.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 05, 2015, 05:05:03 PM
This week I’ve been developing the crowd mechanics, and it’s going well, but first we need to talk about how exactly I need this to work:

We have two levels of resolution: the map grid the player is walking around on, and then every other map grid (in the 250×250 tile world map) which is not currently loaded. Therefore, any NPCs who are important but are not currently spawned must be tracked by the game when they’re on a non-loaded world map tile. This, of course, gets very complicated when you have an important NPC start on the loaded map tile the player is walking around, and then step off that map tile onto another… and then how do we track them over, say, 50 turns if the player THEN decided to follow this important NPC onto another map tile, spawning that tile (which the NPC has been walking in, even though it hasn’t been spawned)? Well – for the time being we aren’t worrying about that, although I think I have a good solution. What I’ve been doing this week is getting the standard crowd spawning and walking around sensibly in city districts, which means Lower-Class, Middle-Class, Upper-Class, Military, Market, City Centre, and Religious districts (docks and castles are still not spawning; castles will be coming 0.9, and docks either 0.9 or 0.10 depending on how development plays out).

I tried a few systems last week where NPCs could walk freely around the map without paying attention to the roads, and this ran into two issues. Firstly, having 100+ NPCs moving at once was necessary for the city districts to not feel like a ghost town (even if I made sure the game slyly spawned/de-spawned NPCs around the player to give a false impression of greater density) and this, on 200×200 maps, was beginning to cause minor performance issues; secondly, it just didn’t look very interesting, and there didn’t seem to be any real method or deliberate action to what NPCs were doing. If you trailed them until they hit their target location, they’d just then choose another location, and repeat.

So, this new method had three logics: firstly, to create a form of pathfinding which doesn’t actually need the game to calculate paths to reduce CPU usage; secondly to make NPC movement seem more deliberate; and thirdly to allow NPCs to “path” (or rather, fake-path) towards the gates at the edge of cities, and thereby withdraw themselves from the map if the player trails them long enough, rather than just continuing to identify new locations on one map which they are allowed to travel between. So, I got to work.


The first step (above picture) was to identify areas of the map which a) any NPC could walk (light green), b) which any NPC could walk on and which were curves in the road which the NPCs would have to stop walking straight to traverse (yellow), and which only certain NPCs would be allowed on (dark green) for each of the seven current city districts. There are also some areas of the map which aren’t roads which are blocked to some NPCs (like the courtyard in a mansion, for example), but those aren’t integrated just yet. I created this secret road map, got NPCs spawning on roads, wrote a bit of code for them to be able to identify another road coming off the first road, and let it run.


The first trials would up like the above picture. NPCs spawned on roads, and could sometimes path correctly… but they were always looking for other branches of the road networks they could move onto, but seeing parts of the road they were already on as being a “different” road, and therefore they kept flicking uncertainly back and forth between hundreds of subjective “roads” which, to a human player, would be obvious.The next step was to add a road_direction variable (basically the same as the player’s facing variable) where they keep track of what direction they have been moving, and they can’t read a “road” into their current direction, or their opposite direction, and thus will only detect new roads to explore if those roads are at right-angles. I then upgraded the code for the curves, creating hidden “lanes” for the NPCs to path along:


Which can be usefully compared to the overall pathfinding map for the same district…


…for when we come to NPCs moving off the roads.

Anyway. With that fixed, I upped the number of NPCs, and we got this wonderful image:


This looked cool, but it was a bit too dense, and they looked too similar all sticking to the road paths rather than diverting. We’ll be coming to the “going off the road” issue later in this entry, but the next step was to try and balance their spawning, de-spawning, and the density of the crowd. I firstly needed to make sure an equal number were spawning in front of the player and behind the player, and that some NPCs would spawn directly at the gates, even if those gates are in full sight of the player, and that they would then cut back across the player’s movement. Once that was done, and people were likely to spawn in front of the player, and behind, and at all different locations – and a full complement of civilians was spawned before the player even set foot into a map grid – we had something which looked much better. Here’s a gif of watching a wide range of people wandering around (for now it is spawning them with a random culture, rather than spawning an appropriate population distribution for each nation), and then after they’ve walked around for a bit, I decided to have a closer ‘l’ook at one of them and browse their clothing:


And here’s a comparable screenshot of  “examining a passing NPC” in progress, which I have chosen simply because I really liked how this guy looked:


Two stages now remain: to ensure this works for all city districts (and then extend it to tribal settlements, fortresses, towns, etc), and to also make sure that sometimes NPCs wander off the road and go exploring on their own. The first is still in progress, but the second seems to be going reasonably well. The objective is to get the NPCs very rarely “breaking off” from the road and heading to other places on the map, either a randomly-selected location (which they are allowed to walk on), or a door they are allowed to go through (so a random “human” (‘h’) can path towards a random house in a lower-class or middle-class district, and then if the player sees them go through, that NPC is then associated with that house). Equally, we should have a small number of NPCs spawn off roads out of the player’s line of sight, and then path towards the roads, and then move towards road properly. When working nicely, this gets the majority of NPCs keeping to the roads, whilst very rarely we see one of the NPCs break off and head elsewhere, and if you follow them, they will either carve a path through the terrain or make their way to a door and then pass through – I’m clearly going to need some flavour text for “You see a person go through a door”, “You hear a door open and shut” if you’re right next to it but don’t actually see them go through, etc (whilst making sure this doesn’t get obnoxious and it doesn’t fill up the message log). As was suggested in a previous thread, I’m also going to add lots of flavour text when you enter/exit buildings, but that’ll come later this release. I’m still finishing off the pathfinding to non-road areas, so that’ll probably come next week when I’ll likely have finished pathfinding (I hope) and have the remainder of that to show off, and possibly some other clothing too? See you then!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: chooseusername on July 05, 2015, 08:05:41 PM
Looks great, as usual.

I've been going over old libtcod projects looking at the unique and interesting ones, and looking at this reminds me of Cult/Empyrea.  When the kickstarter funded effort was abandoned, he released the source, and people were all like "duh, no surprise, he has a 1 MB python script, WTF, trust me I'm an armchair expert".

Are you still fighting the good fight for one file Python scripts?  How large is it now?

And how have you upped your game to counter the Kaduria threat?
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 06, 2015, 03:20:16 PM
Looks great, as usual.

I've been going over old libtcod projects looking at the unique and interesting ones, and looking at this reminds me of Cult/Empyrea.  When the kickstarter funded effort was abandoned, he released the source, and people were all like "duh, no surprise, he has a 1 MB python script, WTF, trust me I'm an armchair expert".

Are you still fighting the good fight for one file Python scripts?  How large is it now?

Thanks! Ah, Cult, yes... the game we don't speak about... though I am glad to say I am still fighting the good fight! It's a solid 300k lines now (though at least 200k of those are string-based graphics). I still don't find it that absurd, truthfully, but MAYBE I'll add a new file in the future. Though I wouldn't count on it...  :-\

And how have you upped your game to counter the Kaduria threat?

In every way possible!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Paul Jeffries on July 06, 2015, 11:15:18 PM
Looks good!  I hope you saved the earlier 'dancing' code so that civilisations can throw street parties.

I'll stop boring everybody with "In Architectural Design We..."'s at some point I promise, but; in architectural design we use similar crowd simulations to help design routes through buildings etc.  There's a manual for our in-house software for that here (http://www.oasys-software.com/media/Manuals/Latest_Manuals/MassMotion_7.pdf); you might find the 'How Massmotion Works' section interesting and maybe it will give you some ideas you can use.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 11, 2015, 11:07:46 AM
Looks good!  I hope you saved the earlier 'dancing' code so that civilisations can throw street parties.

I'll stop boring everybody with "In Architectural Design We..."'s at some point I promise, but; in architectural design we use similar crowd simulations to help design routes through buildings etc.  There's a manual for our in-house software for that here (http://www.oasys-software.com/media/Manuals/Latest_Manuals/MassMotion_7.pdf); you might find the 'How Massmotion Works' section interesting and maybe it will give you some ideas you can use.

Heh, I didn't, alas, but I'll be coding religious festivals and things quite distinctly and differently afterwards, I expect. Anyway, that is an interesting link! I'll probably be working on NPCs in interiors... the week after next? I think next week will be expanding the crowd mechanics to all other settlements, then adding variations like day/night cycles and the like (er, by which I mean, the day/night cycle is already there, but the volume of spawned NPCs does not respect it yet), and so on, after which it'll be INTERIORS TIME, which... might be simpler? We'll see.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 11, 2015, 01:31:05 PM
This week I’ve pretty much finished off crowd mechanics for cities. I’ve also been working on the lower tiers of clothing, and the middle-class clothing looks great, but the lower-class clothing needs some work to be aesthetically comparable to the upper/middle equivalents, so I’ll show that off in a future entry. Right now, though: crowd mechanics are done (or cities), and that’s what we’re going to talk about here.

Permissions (and Guards)

Each tile of the human-scale in the game now has a variable called only_allow – this lists the permissions required to enter that tile (if the list is empty, than anyone can enter it). For example, we might have (“Religion”, 25) which means that believers of the religion with the “25” id can enter it, (“Family”, 6), and so forth. Sometimes I’m sure these will overlap, though currently they do not. At the moment these restrictions exist on upper-class mansions (where only that family and its allies can enter), warehouses in shop districts (so that random citizens don’t path towards them for no reason), religious buildings in religious districts (where only believers will enter them, though I suppose very occasionally someone from another hostile religion will…?), embassies in city centres (which are heavily guarded), and military districts per se. I’m sure some others will appear in the near future, but those are the only permissions in the city so far. As well as the existing crowd mechanics, I’ve also begun to write the code for guards who are tethered to a given permission, and are alerted if/when that permission is violated, and will act accordingly – but this isn’t a crowd mechanic, and isn’t finished, so we’ll talk about it more later. Here’s a simple example of a permissions diagram for an upper class district along with the outside of that district, where the areas inside walls for each of the major families is blocked for any outside that family (I will be adding in “lesser families” this release and giving them appropriately less-impressive crests). It’s simple, but effective (the other houses around the edge are wealthy, but not wealthy enough to merit guards, “territory” in the district, etc).



Irrelevant and Branching Roads

The NPCs on roads now avoid (for the most part) roads which go nowhere, and if they do go down a road which goes nowhere, they know that and will generally branch off and move towards their own target outside the road system. Equally, NPCs will no longer run in circles sometimes (a major improvement, as I’m sure you’ll all agree) and won’t branch onto tiny pieces of road. They can also cross each other intelligently without losing their sense of direction – in an earlier version two NPCs walking around each other would sometimes get “diverted” by the act of stepping around each other and wind up changing direction. Many of these irrelevant roads are also connected to permission-based areas as in the above section, and this is obviously a system I’ll be developing in more depth in the future as NPC/player relationships and factions become more complex. So this is the district from the above diagrams, where the light green roads can be walked by anyone, and the dark green roads either cannot be walked, or will only be walked by those with appropriate permissions or pathfinding objectives:


Moving Off-Road and On-Road

As above, NPCs can now sometimes decide to move off the road to find their own targets. They’ll do this if they see themselves approaching a dead-end road, and they’ll sometimes do this anyway regardless of what kind of road they’re on. In these circumstances they either select a region of the map where there is nothing in particular and path to there, and then continue pathing from there to elsewhere if the player is still viewing them (or despawn if they’re out of sight), or they will choose to path towards a specific door (which they have permission to enter) and then go through that door. As the below gif hopefully shows, this makes the movement of NPCs appear far more organic and stops NPCs looking like creatures just being channeled down the road with no ability for doing their own thing. We’ll obviously see how this works once we introduce important NPCs who have their own non-crowd objectives, etc, but you can see it pretty well in the gif in the section below…

Crowd Generation

The game can now generate appropriate “crowds” who might move around. For example, a civilization with the “Theocracy” and “Vassalage” ideologies might decide to have priests moving around their city, escorted by priests. A civilization with the “Monastic” (new to this release) and “Conscription” ideologies might enlist conscripts to escort high-ranking monks safely. Equally, there are some more general groups – groups of clerks and diplomats in the city centre, groups of general humans in any area, etc – who can also spawn in any nation regardless of their ideological preferences. Here’s an example of a priest and a few general citizen followers moving around a district – one will also note that certain skin tones are surprisingly hard to see against the road’s background colour. On the one hand, all roguelikes which expand their colour schemes a little bit (e.g. DF, CoQ, etc) will sometimes have certain colours which can’t be combined well, and whilst it’s annoying I’m not sure if there’s a solution; but on the other hand, maybe there is some solution? Change the road colour to make it more grey so it always stands out against all skin tones? I’ll ponder it. Either way, this gif starts with a priest (‘p’) being escorted by a bunch of soldiers (‘5′) moving around the corner around this religious building. I then just let it play on a little longer to see the slaves (since this is a slaving nation) wandering about. Note also that the game ensures the priest is “leading” the little convoy, since i had some problems with the leader’s escorts dancing around in front of the leader due to a quirk in the pathfinding system. Enjoy!


“Party” Generation

I’ve also implemented a system where “parties” (in the “group” sense of that word) can spawn more organically around certain areas – these include parks and gardens, around taverns, around markets, and in graveyards. In this case a number of NPCs from all over the map will path towards the area and then basically “hang around” for a while, before then making their way off. I’ve found around some places it gives an interesting feeling to these areas when you just sit and watch, and although I’m still working on exactly balancing the algorithm so that the ebb and flow of NPCs is exactly how I want it, this gif from a city centre garden is *fairly* illustrative, though it still needs some tweaking. And bear in mind, of course, one isn’t generally going to be waiting around to see the grounds form and un-form, but I’ve just stood here for this example so we could see groups forming, growing, and then disbanding.


District Demographics

I’ve also implemented a system for spawning appropriate demographics of NPCs (and their clothes, items, etc) for each NPC who spawns in each district. This comes down to three things: NPC type, NPC wealth, and NPC “distance”. To explain this slightly better, let’s have a look at this diagram, newly added to the in-game Guidebook (‘?’ to access). This is (currently) the full set of possible NPC types which will be able to spawn in the game:


So, NPC type is the “class” of NPC – we might want general humans to be spawning in lower-class housing districts, classes of soldier to spawn in the military districts (who I intend to give patrol routes to, but that hasn’t been coded yet), clerks and diplomats might be spawning in the city centre, and so forth. Capital letter NPCs will be specially tracked by the game, whereas lower-case NPCs make up the crowd. Also, nations which keep slaves will spawn slaves in the appropriate districts, just as nations which have eunuchs will spawn a very small number of those unfortunate individuals around the place. NPC wealth, meanwhile, means currently the quality of their clothing (and, in the future, the quality of any armour, weapons, bodyguards, jewelry, etc) – this is obviously closely tied to the district that the crowd NPC is spawning in, but with some variation. Middle-class districts spawn mostly middle and a few lower wealth NPCs, lower-class districts do the reverse, markets spawn an even mix, and so on. NPC distance, lastly, relates to whether the NPC spawning is from that nation and from its capital; from that nation and from a distant town or colony; or from a different nation altogether. Currently everyone who walks around in a city is from that nation (though I will of course later add groups from other nations) but might be from different regions, so you’ll see people who are culturally similar – clothing, hair style, etc – but physically different (skin tone, hair colour, eye colour, etc) as they come from different areas of the same nation. The game picks all of these according to a range of factors, and then spawns a mix of NPCs appropriate for the crowd in a given nation.

Bugs and Issues

In this process I ran into a bunch of bugs and issues. Firstly, for some reason, saving and loading the game would cause the AI for each NPC in the crowd, and the NPC itself, to become disconnected so they no longer referred to each other, meaning that when I tried to delete “self” from the list of NPCs when a given NPC no longer needed to be around, it couldn’t find self, and crashed. Weird. I tried to find a proper solution to this issue, but in the end I just changed it so that the scheduler only referenced the .npcid of each NPC, rather than the NPC itself, and that meant that even if some byte somewhere in the AI changed itself in saving/loading for reasons I could not divine, the npcid was always remaining the same (being a variable, not an instance of the AI class attached to an instance of the NPC class), and so the game could always identify the correct NPC and AI to delete upon reloading. Similarly, moving on the human-scale from district to district made some weird errors like massive groups of NPC suddenly spawning and NPCs from the next map tile teleporting into another map tile, but those were all quickly fixed. Some maps were also coming up with extremely rare tiles which didn’t have a .roadmarker variable, which denotes what NPCs are/aren’t allowed on it and whether it is a road curve which should be treated specially, but that was due to another bug I hadn’t even noticed involving the types of terrain spawning under trees (we had some trees spawning on road tiles!). This has all been sorted, and it all runs extremely smoothly. Additionally I noticed some unnecessary variables were still stored on every tile in the human-scale maps, so those have been removed, and save files have been reduced by around 15% as a result, with an attendant (very minor) improvement in load times!

Next up?

Well, the next things to do are to extend this outside cities. I need to get NPCs behaving sensibly in slums, graveyards, villages, fortresses and tribal settlements, each of which is going to need some unique changes to the algorithms I’ve worked on for cities. After that, we’ll be moving onto handling NPCs within buildings (and entering/leaving buildings), which is obviously extremely imporant. Then we’ll be moving onto unique NPCs who are specially tracked by the game because they matter (merchants in shops, rulers, nobles, etc) and who therefore need to be able to move around the world. These three steps are my three primary goals for the rest of July (it’s a lot, but I think I can crunch it), then in August I’ll be moving onto finishing off clothing styles (we’ve got feudal clothing almost finished, but I need to add military clothing, religious clothing, nomadic clothing, and tribal clothing, so there’s still a ton to do on that front!) and adding in a conversation system to the game. This system is going to be essential, so I really need to think hard about how the conversation system should work, what the balance is between the hand-made and procedural, etc. Then I need to redo how families and allegiances/associations work, fix a bunch of minor bugs from the last few versions which continue to stack up, and then 0.8 will (amazingly) be pretty much done. Aiming for a September release currently, which is around the time I’ll be starting a new job I can’t yet formally announce, and probably starting work on the other secret project I also can’t yet announce (both game-related, though!). Exciting times! Let me know what you think of this week’s development, and I’ll see you all in seven days…
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: chooseusername on July 12, 2015, 05:43:59 AM
Your efforts are inspiring.  At worst, it'll be a magnum opus.

I used to work in commercial game development, and one of my coworkers was hired out of university on the strengths of his modding work.  This to me is the sort of thing, along with your self motivated productivity, that makes his "portfolio" look like tiddlywinks.  When you move onto the next thing, I'd be surprised if this and your blog of continued work didn't help you get it, if it's to something applicable.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Rev_Sudasana on July 12, 2015, 06:59:26 PM
Now I've got this clear mental image of leader escorts dancing around him as he walks down the path.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 13, 2015, 07:16:55 PM
Your efforts are inspiring.  At worst, it'll be a magnum opus.

I used to work in commercial game development, and one of my coworkers was hired out of university on the strengths of his modding work.  This to me is the sort of thing, along with your self motivated productivity, that makes his "portfolio" look like tiddlywinks.  When you move onto the next thing, I'd be surprised if this and your blog of continued work didn't help you get it, if it's to something applicable.

Well thank you very much! And that is strikingly astute - the academic game studies job I got a while back post-PhD, but can't announce just yet (hopefully soon, though!) I actually got largely on the back of URR, the blog, my visibility in the RL world, etc etc. Due to various reasons I didn't have a lot of publications, but I had a doctorate in a relevant field and URR, threw that out at the selection committee, and subsequently got the research funding. I'm now churning out papers like mad, but I wasn't when I applied for this job, but URR was absolutely what swung it/secured it. As games academia is my job now, and will be in the future, I'm confident that having a strong game development portfolio will only help me in the future. I think it's really good and a very positive development that jobs (academic and otherwise) in games take account of non-traditional CVs, having things to show in other areas of "gaming" (very broadly), modding and game development, etc.

Now I've got this clear mental image of leader escorts dancing around him as he walks down the path.

That is exactly what was happening! It looked wretched. Sometimes a follower got "stuck" in front and the leader would keep trying to move around, but then the best path for the follower would be to stay in front (as the other followers would follow behind), so you'd get something like:


moving around the map, moving left to right. Very odd.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Rev_Sudasana on July 14, 2015, 06:53:21 AM
That is exactly what was happening! It looked wretched. Sometimes a follower got "stuck" in front and the leader would keep trying to move around, but then the best path for the follower would be to stay in front (as the other followers would follow behind), so you'd get something like:


moving around the map, moving left to right. Very odd.

You could always adapt this in the future for a jester character. They could even follow the player and annoy them with witty banter as they dance.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 15, 2015, 08:19:21 AM
You could always adapt this in the future for a jester character. They could even follow the player and annoy them with witty banter as they dance.

Heh, very possibly!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 27, 2015, 12:34:03 PM
Well, it has been another very busy week – I gave a talk on URR’s PCG and AI systems at nucl.ai in Vienna (and spent an afternoon sitting the sun outside a rather nice vegan cafe working on the secret project I’ve mentioned a few times, which continues to inch closer to the point where I can actually announce something) and I’ve also had a piece the 35th Anniversary of Rogue published in Paste Magazine (which you can read at http://www.pastemagazine.com/articles/2015/07/before-spelunky-and-ftl-there-was-only-ascii.html) and another on the role of text and characters in classic roguelikes published in Imaginary Realities (http://journal.imaginary-realities.com/volume-07/issue-03/how-integral-are-letters-and-text-to-ascii-gaming/index.html), but nevertheless significant progress has been made (though I anticipate this next week to be a full week of coding with nothing else, so we should have a major update in seven days).

Towns, Fortresses, Etc

NPCs can now pathfind sensibly around other places which aren’t city districts – they know where to spawn and how to behave in the crowd in fortresses, in towns, in slums, and also in hunter-gatherer encampments. In these cases they generally don’t use the roads, because having people pathfind on a road until they get close to their target, and then move off the road, magnifies pathfinding complexity immensely – what if they get near the target, but then the actual path from the end of the road to the target is long due to a wall (so they are physically proximate but the path to that proximate location is huge), and the complexity of the problem of making sure they take an efficient road path, followed by an efficient off-road path, is massive – so we’re ignoring it. Besides, particularly in towns I think this actually works quite effectively when roads look more like a form of aesthetic/spatial structuring of the town rather than literally what everyone uses to walk around, and fortresses tend not to have roads anyway unless there’s a river cutting through them. The right groups of NPCs now spawn in fortesses and elsewhere, of course, so we see lots of soldiers in fortresses, the poorest of the poor in slums, ordinary citizens in towns, and tribal peoples in hunter-gatherer territories. This is, however, making it clear that I need to return to clothing generation at some point soon and really get moving on the other algorithms for lower/middle class feudal clothing, and other clothing types too – it’s a huge job, and actually bigger than I thought, so I’m going to devote a solid week or two to that once I’m back from GDC Europe (if you’re there, come along to my talk!). Here’s a town brimming with activity:



The big one – NPCs now actually go inside buildings (they previously despawned at the door, in essence) and if you then go into the building, you can then see that same NPC inside the building. If the building has already been spawned and exists, then the NPC will go about their business inside the building. Alternatively, if the building hasn’t yet been spawned, they are temporarily placed in “limbo” until one of two things happens. If the building is spawned (i.e. by the player stepping inside), then that NPC is granted a number of turns to move around in the building as if they had been moving around inside the whole time. Alternatively, if an NPC has “entered” a building that the player doesn’t spawn, then after a random length of time they will the leave the building and continue on their way. In this method we are left with no pointless NPCs milling around in “limbo”, ensures that the crowd is always centered on the player, and means that if you see NPCs going into a building, they will be inside. In this gif, an NPC has previously entered this tavern; we’ll now enter, causing the building to spawn, and then the NPC spawns and we see them take a seat, and then if we go outside, they’ll exit again after a certain point (at the end we then see another NPC enter). This basically means that regardless of the player’s actions and which parts of the map actually exist, the crowd’s actions always appear to make sense. A similar system will be needed once I start tracking the important and non-spawned NPCs around the world (rulers, merchants, etc).


Inside Behaviour

NPCs will now create a list of potential “targets” within a building and will hang around at those targets for sensible amounts of time, and then when those timers end, they’ll either leave or go to something else within the building. This process depends on the building and the nature of a given target. For example, someone who goes into a tavern and sits on a chair to drink for a while will not then get up and move to another chair – they’ll either just stay on the chair, or get up and leave. By contrast, somebody in a cathedral might spend a lot of time sitting at one chair worshipping in front of an altar, then move to study the holy texts at a desk, then talk to a priest, then leave, etc. I’m working at the moment on finishing off this list of targets, and then also adding a second layer whereby the list of targets is modulated by the time of day; so people will tend to leave as its gets near night, or people in this houses will head to bed, etc. Here’s a gif of some inside behaviour in a tavern:


As you can see, more people currently leave than enter; I’m working on balancing these two algorithms at the moment so we have a steady flow of entering/leaving whatever structure the player might happen to be in at the time.

Sorry also about the relative lack of images this week: a huge amount of this week’s work has just been improving pathfinding, improving how NPCs move and behave, a lot of technical improvement on saving/loading and managing buildings and floors and buildings which are/aren’t spawned, etc, so there aren’t that many pictures to show. I hope for more next time!

What now?

Making the interior behaviour sensible and interesting for all NPCs, giving buildings a “maximum” number of people they can hold, adding day/night differences, fixing the massive number of edge cases which are slowly building up… etc. More next week!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on August 01, 2015, 12:02:02 PM
This week I’ve worked on some new graphics, on a lot of the AI for interior behaviour, made some alterations to a district generation system I wasn’t happy with, fixed various bugs and minor issues, and moved closer to the point where I can confidently say all crowd NPCs are working correctly. First, though, I must give my appreciation to one James Patton for this extremely kind and very thoughtful write-up (http://james-patton.net/2015/05/29/the-world-is-a-found-object-and-we-are-imperfect-archeologists/) – he has (or “you have”, if he’s reading this) hit the nail on the head with my objectives, my design philosophies, and basically everything else, and that’s always very gratifying to read. Also, if you fancy some other roguelikey reading, I’m building up quite a number of roguelike pieces – I wrote for KillScreen about the demonic enemies in NetHack (http://killscreendaily.com/articles/demonic-properties-ampersand/), for Paste Magazine about the 35th Anniversary of Rogue (http://www.pastemagazine.com/articles/2015/07/before-spelunky-and-ftl-there-was-only-ascii.html), and for Imaginary Realities about the role of text, characters and letters in roguelikes (and URR) (http://journal.imaginary-realities.com/volume-07/issue-03/how-integral-are-letters-and-text-to-ascii-gaming/index.html). Hope you enjoy giving them a read… and now, onto the update, which is rather more substantial than last week’s paltry offering:

Prayer Mats

I took a moment this week to do some graphics, and decided to finally implement something I’ve been meaning to for ages: prayer mats. Some religions now use prayer mats in their religious buildings instead of chairs, and the design of these mats is dependent on both the religion, and the civilization the religious building is found within (so religions across many nations will have similar, and aesthetically comparable, but slightly different, prayer mats across nations). The colour scheme is based on the altar, as shown in the three examples here, and the shapes (squares, octagons, etc) are down to the nation, whilst the specific layout of shapes and symbols, and obviously the religious symbols, are down to the religion. Here are some rather nice examples:


And some prayer mats in a religious building and a cathedral (note that the colour of the maps vary based on the actual mat colours, though now ‘=’ can’t be used for anything else!):



Further Interior Behaviour

This week I’ve done a lot more NPC interior behaviour. There is still a little bit which needs doing, particularly with special cases – NPCs going into banks should talk to the clerks, for instance, just as NPCs in hospitals should go and sit by the bed-side of someone they know, etc, but a lot of these actions are now working very nicely. In a cathedral, for instance, I just sat by and watched as NPCs came in and prayed at the altars, sat on the chairs/prayer mats, looked at the relics, admired the cathedral’s decoration, talked to one another, sat down to study the holy texts, etc. Here is an awesome gif of this which is neat enough to watch to the end, I think, of various people in this cathedral (the one above) doing these types of activities:


Next up was the gallery. As with all buildings, I’m leaving the “permanent” NPCs until last – so worshippers will wander around a cathedral, for example, but there are no priests there yet, as they will be tethered to that building and a particular routine – but here we now have people coming in, admiring the paintings, and showing themselves out again. Painting generation will happen when I swoop in and redo the history generation from the fairly simple system there is now, to something which truly encompasses every piece of information in the world, and begins to lay the foundations for sneaking in clues to the game’s central cultural cipher. Anyway, the gallery:


By the end of next week I hope to have more interior algorithms finished, and by the week after, they should all be done (this week is GDC Europe and Gamescom, and I’m attending 100% of the former and ~25% of the latter, so that’ll be taking up a bunch of time). At this point I’ve implemented some general code for all buildings, and now it’s a matter of going into every building and checking the code actually works there.

Middle-Class Rivers

I suddenly noticed that under the new generation algorithm for middle-class districts, when a river goes through them, they don’t look very impressive at all, and we end up with something like this (with the issues ringed in red where multiple “bridges” seem to overlap:


This wouldn’t do, and it just looks rather dull, so I rewrote this algorithm into producing something rather more interesting, so here’s the same district using this new algorithm which encourages the river to flow around/past major roads, avoid smaller ones, and to then design the rest of the roads differently and place buildings/parks a little differently in order to accommodate the river. Here are two examples with a “corner” river and a “long” river, from the same city (note that the shapes of the corners and the roads sometimes change – I set it to randomize that aesthetic choice each time I generated an area so I could make sure the new system always worked):



Other Small Changes

A number of other minor changes have also been implemented this week:

– Colonies can now only be established with nations with the “Imperialist” ideology, rather than all nations which are not “Isolationist” (which it was until now).

–  An extremely unlikely edge case involving rivers and lower-class district generation has been fixed, ensuring you never end up with a part of a district that cannot be accessed without entering the district from another angle, due to the river’s location. See below:


– Each NPC’s face is now tinted fractionally to add further diversity within nations – everyone’s faces are tinted a tiny bit (between 0.03 and 0.06%) towards yellow, orange, red, white or black at random. That might sound tiny, but the difference is noticeable.

– Roads are now grey merged with just the tiniest bit of brown, and all skin-tones are now very easy to read on it. However, others do struggle on the “soil” terrain type, so I’ll fiddle with that too (probably make it a little more green, perhaps). Equally, chairs are made out of wood – with colours that range from light brown to dark brown – and therefore chairs, in some cities, do tend to blend a little with the populous. Again, considering solutions, but I might tint everyone’s skin tone a fraction to the red.

– Fixed a thrilling bug where chairs sometimes decided to spawn in the empty void of nothingness outside the map… and then NPCs wanted to sit on them.

Next Week

As above, I’m flying out tomorrow and returning in a week, and I’ll be doing lots of GDC stuff. So… expect either a shorter update, or a non-URR update, depending on how things go. See you then!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Paul Jeffries on August 01, 2015, 03:03:24 PM
– Fixed a thrilling bug where chairs sometimes decided to spawn in the empty void of nothingness outside the map… and then NPCs wanted to sit on them.

And thus the Ultima-Ratio-Regnum-Land Space Program was born.

"I believe this nation should commit itself to achieving the goal, before this decade is out, of sitting a man on the chair and returning him safely to the earth..."
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on August 04, 2015, 06:57:43 AM
"I believe this nation should commit itself to achieving the goal, before this decade is out, of sitting a man on the chair and returning him safely to the earth..."

Alas, unlike Twitter, forums have no "favourite" button :(
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on August 08, 2015, 10:16:15 AM
This week's post is a trip report on my time at GDC (talking about procedural generation) and Gamescom!

Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on August 15, 2015, 10:40:38 AM
This week, I wrote a detailed review of David Craddock's new "Dungeon H@cks" book about the history of roguelikes: http://www.ultimaratioregum.co.uk/game/2015/08/15/dungeon-hcks-book-review/
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on August 22, 2015, 09:48:00 AM
It has been a busy fortnight, with house-moving (in progress) and secret projects (almost ready to start) and programming (proceeding nicely) and various other endeavours (far from complete), but I’ve finished all ambient crowd behaviour, and a couple of other things besides. Here’s a pretty massive round-up of what has been happening in the last three weeks since the last full URRpdate:

Priest Clothing

I decided to work last week on a second of the four high-level clothing archetypes (feudal, nomadic, hunter-gatherer, religious) – the religious clothing. For this I did a standard expansive image search, collated a range of religious dresses, and then attempted to break them down into commonalities, differences, and readily exchangeable parts. The colouring of each piece of religious clothing, much like the prayer mats we saw a few weeks ago, are connected to the altars they worship at. The highest-ranking priests in the religion will have slightly snazzier robes, whilst if the religion has any kind of poverty-is-holy ideology or similar, they might have duller robes. Here is a set of six possible robes all using a potential “demonic” colour scheme (just since that’s the one I was testing the systems with, but how nice do they look?!), and then some with their attendant altars alongside (one “Eldritch” archetype, one “Pantheon”, and two “Standard”), and lastly an example of the higher tier of religious clothing reserved for religious leaders (hence the lovely gold filigree):




Priests use the same shoes as the nation they’re in, and usually the lower-class variation (though in some religions priests will be barefoot). With these done, that means approximately half the clothing generation for 0.8 is done – feudal clothing is 99% finished (I just need to put in a few final touches to the lower-class variations) and religious clothing is now finished. I’ll probably work on nomadic clothing next, as I have a few ideas of what archetypes I want to generate those around, then I’ll do hunter-gatherer clothing probably last before this version’s release. Armour and things like that will come later (0.9?) so for the time being, all soldiers and other military personnel just have lower-class clothing, or upper/middle-class if they are officers (which in the future they’ll probably keep, but just wear beneath their armour).

Slums and Encampments

The last few areas which needed handling for NPCs have been dealt with. NPC crowds now spawn, move and despawn intelligently in slums outside major cities, and also in hunter-gatherer encampments. Pictures of slum, and encampment, and example crowds:



Remaining Interior Behaviour

All buildings which can have crowds in them (e.g. a tavern can have randoms wander in. but a royal mint cannot) now have those crowds behaving intelligently at all times, and – as far as I can tell – this is entirely glitch/bug/crash free regardless of what building, what civilization, what demographics the NPCs in question are, etc. Here are some examples of an arena and a longhouse, since I thought these were both rather pleasing, especially in the longhouse as people gather around the table:



Pathfinding Problems

Some buildings and some parts of the external map were starting to produce a problem – if you had two NPCs (or an NPC and the player) trying to get through the same one-tile tunnel between walls, at the same time, then they couldn’t slip past each other. I implemented a temporary solution (whereby crowd NPCs will look for another objective if they find someone blocking the one-tile route down to their current objective) but this wasn’t good enough for the future, especially once we begin handling important NPCs whose paths cannot just be changed on a whim. So, now, if you have two NPCs who meet, and NPC 1 is trying to move onto the tile NPC 2 is on, and NPC 2 wants to move onto the tile NPC 1 is on, *and neither of them can find another way around* by stepping on a diagonal, and they would both allow the other to step past them (so they aren’t enemies), then the game will look at which one of them has the longest wait until their next turn, and then schedule a special “simultaneous” turn for them both to switch places at the same instant for that more distant turn (so that neither NPC can move “faster” than it should be able to). I’ve now implemented this to work indoors and work outdoors, so here’s an outdoor (filmed in “slow motion” to make it clear) example of this:


However, this became trickier when I wanted to combine it with the player. Clearly the player should be able to do this as well, but it required writing quite a hefty new chunk of code, for handling if the player tries to move through an NPC, or an NPC tries to move through the player, because obviously I don’t want to remove agency from the player, or allow NPCs to shove the player around the place (as that would get quickly annoying), but nor should the player somehow be able to exploit this ability to move NPCs around the map (I’m not sure how this could be an issue in the future, but it seems better to just produce a robust system now rather than worrying about it later). Either way, we clearly needed a way for NPCs to walk past the player if the player is being an ass and standing in the way:


So, there are two scenarios: what if the player wants to move onto another NPC, and what is another NPC wants to move onto the player. It would be deeply annoying to allow the player’s character to be “pushed around” by other NPCs, so that was something I knew I had to avoid, but at the same time I had to ensure that you cannot exploit the system by somehow pushing around NPCs yourself. If an NPC wants to move onto the player, therefore, they initiate a special two-turn move, where the NPC takes two turns instead of one and “squeezes” past the player, taking both moves on the second turn – so from the player’s perspective, the NPC moves next to them on Turn 0, remains there for Turn 1, and then moves to the other side of them on Turn 2. If the player moves in the interim, then normal pathfinding resumes and the two-turn move is cancelled. (Of course, the two turn move only works if the tile beyond the player is free, the player and the NPC’s relations are friendly enough that the player would let the NPC get past, etc). Here’s an example, where I start off looking at the approaching slave, then turn to the other side, and sure enough the slaves pass “through me” using this special two-turn move:


This also results in a message being printed, along the lines of “The [NPC type] squeezes past you”. The other version is; what if the player wants to get past an NPC who is blocking a one-tile area? An NPC blocking a one-tile area and standing *still* should be an impossible scenario – I am certain there are no areas which are valid for crowd NPCs adopting the “meandering” walking type which are also only one-tile wide – so if one encounters an NPC in an enclosed space, it’ll be if you and the NPC are moving towards each other and need to cross over. If the NPC “initiates” the move, we get the scenario shown above. If the player initiates the move, then the game looks at both the player and the NPC, does the usual check of whether they are allowed to move through or not (this might have to wait until 0.9, as it’s going to be a complex calculation – for now it just returns “yes”) and then, if so, it has the player move along with the obstructing person during the later of their two turns (so if the player is next scheduled to move on turn 18174, and the NPC on turn 18175, then both will move on 18175, so that neither character is able to have a “free turn”). You then switch places with them, as shown in this example, where I step into an NPC who I am friendly enough with to switch places, then I turn around (taking one turn) and we therefore see the NPC two turns behind me, and they then leave. Had I just stood still, then they would have initiated the two-turn move, going “through” me without forcing my movement.


The three systems shown here also work when indoors as well as outdoors. These are all very rare scenarios, and I suspect will (for the most part) only happen if the player is standing deliberately still to try to annoy the NPCs, but it still needed handling. With all of this done, I am now… 99% that all NPCs of all categories, whether inside or outside, and whether dealing with the layout of the terrain, the motion of other NPCs, or the motion of the player themselves, should be able to path correctly past any obstacles (I think there is still one final minor non-crash bug here involving NPCs who have stopped to admire something, and if they have stopped in a “line”, then other NPCs may struggle to get past, but I’m working on fixing that one). As a last note on this, it’s also worth noting that in almost all cases I’ve worked hard to ensure every corridor/path both inside and outside is, in most cases, at least two tiles wide. However, in certain areas – slave quarters, some cathedral generations, slums, and a bunch of other places – one tile corridors can generate, so it was clearly important to handle these sorts of scenarios.

Also, now I need to at some point have you be able to switch your “walking style” from “walking” to “shoving” (or “pushing”, maybe?) so that in the rare possibility of a blockade (which I *think* should be impossible, as I’ve modeled spawning a bunch of NPCs on every tile in an enclosure and they’ve always managed to find their way out so far) you can always push your way through NPCs and force them all to move into the position you previously occupied, though that might not make them all that friendly to you. Nevertheless – and although I’m not even sure such a scenario can ever happen – it seems like an important addition which I’ll probably add this release, and it should be simple (note if there’s an NPC there, and if so, just switch places with it).


Hunter-gatherer encampments now have campfires, beds, and tables. Only the fires so far have an image, but the beds and tables will be made of either wood or stone, and will get images before the end of this release:


We still need more variation and detail in these areas – a lot more, honestly – but hunter-gatherer areas now look slightly less bleak and empty than they did a little while ago (in the above picture you can see some stone chair/tables and a second fire). More soon, hopefully, though anything beyond tables, chairs and beds might have to wait until 0.9 or a little beyond. I’m focusing on feudal nations this release (although all NPCs will be present), and it’ll probably be the next release when I do more on nomadic and hunter-gatherer NPCs and societies.


We now have guards! Guards appear outside Parliaments, Mints, Embassies, Officers’ Quarters, Armouries, Mansions and Citadels in the middle of Fortresses, and also inside Banks and Arenas (the former to guard the vaults, the latter to keep the crowd at bay and make sure nobody interferes with the combat). The game also now notes every part of the map which needs a special “permission” in order to access it, and guards are tethered to certain permissions, meaning that if the player steps onto a tile which has the (‘Embassy’,24) permission and the player isn’t from the nation with the id# 24, then the guards will act – right now the game just registers this since the conversation system isn’t in yet, but that’s the plan. So, here are some guards doing their guarding thing (they currently wear standard clothing since armour generation doesn’t exist yet):


And then here’s a slice of the visual map, and the “forbidden” map, which shows the parts of the terrain close to the armoury door which will trigger the ire of the guards, so we can see that anything within the courtyard, and some of the tiles just outside the the gate, will trigger their ire (the guards don’t show up on this view, but as we saw above, the guards are basically standing just outside the gate):


So, now we just wait until later this release when I get working on a conversation system and the guards can accost you! More on this later once I figure out how precisely it works, but all the guards spawn, and detect intruders, and that’s all that matters for now.

Distance Demographics

The crowd’s demographics now vary according to the expansiveness of the nation in question. By this I mean – if the nation is small, then all people spawn with the genetic demographics (skin tone, hair colour, eye colour, etc) of the capital, or nearby. If the nation is large, the game will sometimes look for a random tile in that nation’s territory to choose the demographics from (which is to say, if you’re in the capital city it’ll normally be a “capital person”, and sometimes someone from further out; if you’re in a town, it’ll normally be a “town person”, but sometimes someone from further out) and use those to spawn the person instead; and if the nation has colonies it’ll do the same. This means if you run into two people in a nation with the same cultural demographics (clothing, hairstyles, etc) but very different skintone/hair colour etc, then you can reasonably deduce that nation is either very large, or has some colonies somewhere. Here are two examples of this kind of crowd, and the latter you’ll note has a priest leading some followers (the priest of course now spawns with the right robes). Rather annoyingly I wasn’t able to quickly find a nation which had colonies/homelands with skin tones at the two extreme ends of the spectrum, but you still get the idea from these of a lot more variation in the larger and more expansive empires:



Another thing this has got me wondering: in future versions (0.9 or 0.10 onwards) all the map except your home nation will be in shroud when you start. Should colonies be “lit” or not? I think the best solution is that colonies don’t start as explored, and if you take a ship to one of your own nation’s colonies, perhaps all the colony land is then revealed when you arrive? In contrast, normally, you’ll just explore the tiles around you as you move, and if you take a ship, it will perhaps show you the ocean path you move along? That seems like a good compromise without having a situation where you start with a few chunks of the map explored which are disconnected from your nation’s homeland.

Lesser Houses

I’ve now implemented the first stage in generating families/houses which are less important than the small number at the top of each civilization (one of which, of course, belongs to the player) but are still noteworthy. In nations with the “Vassalage” ideology, one of these families will have a special “Manor” building spawn in each town in that nation, and a family rules each of these manors and therefore each town. In Vassalage nations the other smaller buildings in upper class districts will also belong to these families (so they have a manor, and a home in the capital), whilst in non-vassalage districts these buildings will also belong to second-tier families, but not “special” ones (as in, rich merchants or whatever, not those with direct feudal/political power). However, for the vassalage nations, these all needed coats of arms! So, I’ve returned to the sigil generation system and added in the ability for “lesser” houses to have coats of arms. These are much simpler than the major houses, and have a geometric pattern determined by the aesthetic preference of their nation (octagon, square, circle, cross, diamond) which feeds into an algorithmic sequence that combines various elements (I’ll also add a system ensuring there can’t be more than 5 vassalage nations, and they can’t share a shape, to ensure variety across the game world). Now, bearing in mind of course there are meant to be for lesser/more general houses… what do you think?


Compare, of course, with some examples of important families:


So what do you think of the minor ones? Good, bad, too little detail, too similar, just right…? Of course, they still need mottoes, and I’m thinking of having it tether them to the towns they’re from in some way (or perhaps these lesser houses don’t have mottoes?).

What next?

Next up I’ll be working on adding more “fixed” NPCs like guards – so this means tellers in banks, priests in religious buildings, servants in mansions, officers in officers’ quarters, delegates in parliaments, and so on. This week is probably also going to see a little bit of reworking of some aspects of world generation, since I need to add in a system for vassalage nations to generate and track these other houses, and for parliamentary nations to figure out how many delegates they should have (I have a cool system planned for this), and I might add in the new “Monastic” religious ideology I’ve been thinking about for a while too. Either way, I’d say we’re about 75% through NPC mechanics at this point, and in a fortnight or so I think everything with NPCs should be finished, and then we can move onto the other massive part of this release – conversations. See you next week!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Avagart on August 22, 2015, 09:28:21 PM
Great job, as always. Whole your work is impressive.
However, I have some questions about game, hm, design. For now, your main goal seems to be make big, very immersive random generated world (world ie places, civilizations, persons... everything).
What about gameplay? PC possibilities? I don't know, are you going to implement guild-like organization, random quests, etc? Or player's role will be to live simple life, so walking, being ambushed, observing country? 'Live the life', as in 'roguelike sims' or good oldie Darklands? Or maybe you have another vision of gameplay?
I'm sorry if you wrote somewhere about it already, but I checked your development plan and I didn't find answer.
Cheers :)
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on August 23, 2015, 06:11:39 PM
Great job, as always. Whole your work is impressive.
However, I have some questions about game, hm, design. For now, your main goal seems to be make big, very immersive random generated world (world ie places, civilizations, persons... everything).
What about gameplay? PC possibilities? I don't know, are you going to implement guild-like organization, random quests, etc? Or player's role will be to live simple life, so walking, being ambushed, observing country? 'Live the life', as in 'roguelike sims' or good oldie Darklands? Or maybe you have another vision of gameplay?
I'm sorry if you wrote somewhere about it already, but I checked your development plan and I didn't find answer.
Cheers :)

Thanks, and sure!

Basically, the game is going to be about information. You are seeking to locate a very small number of items scattered around the world; to do so, the more the player understands the world, the easier this task will be. This means conversing with NPCs, examining books, coming to learn about the cultures/religions of that world, the history of various nations, exploring and gaining access to buildings, and plotting your path around the world map to "track down" these items. It's almost a... research game, one could call it? The world is insanely detailed (and only becoming more so with every release), and it's the close examination of the world and figuring out the paths these artefacts have taken, and who may possess them now, which will be key to success! But for this to work, the world must be in place first, hence the worldbuilding focus up to this point...
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: jim on August 24, 2015, 08:17:22 PM
Where in the Procedurally Generated World is Carmen Sandiego?
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on August 26, 2015, 09:41:28 AM
Where in the Procedurally Generated World is Carmen Sandiego?

Such is the central quest! You shall have to find her anew each game...
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Krice on August 26, 2015, 10:00:31 AM
For now, your main goal seems to be make big, very immersive random generated world (world ie places, civilizations, persons... everything).
What about gameplay?

I've commented this before, but even the large game world alone will most likely create some annoying navigation problems. I find navigation annoying even in traditional 80x23 levels! That's why I've been thinking about stuff like placing level stairs next to each other if it's possible, just to reduce stupid walking when you travel between levels back and forth. I guess finding stairs is one of mini puzzles in roguelikes, but I think if the game world is large it's time to forget that puzzle and make navigation/travels easier.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on August 28, 2015, 03:22:19 PM
For now, your main goal seems to be make big, very immersive random generated world (world ie places, civilizations, persons... everything).
What about gameplay?

I've commented this before, but even the large game world alone will most likely create some annoying navigation problems. I find navigation annoying even in traditional 80x23 levels! That's why I've been thinking about stuff like placing level stairs next to each other if it's possible, just to reduce stupid walking when you travel between levels back and forth. I guess finding stairs is one of mini puzzles in roguelikes, but I think if the game world is large it's time to forget that puzzle and make navigation/travels easier.

I agree, this is a tricky one, to which I've several solutions:

- A goto system like DCSS seems absolutely essential; the game will path to where you tell it, whether that's inside a building, on the local map, or on the world map.

- Alongside the above, have a way to quickly "check" where the exits are; so you hit Goto, then you TAB through the stairs/doors on your floor, perhaps.

- Try to make the building layouts sensible, which is hard to describe, but - although obviously I am the designer - I'm at the point here I pretty much always know roughly where a door is going to be in a new building because I know the algorithm behind it, and I'm confident players will come to identify the different architectural styles and be able to make (reasonably) educated guesses without using either of the above two things.

- Also, the overwhelming majority of buildings are small enough to always fit in the viewing rectangle of the screen at once, or near enough, so in those cases the door won't go "out of sight".

I guess I'll see what happens over the next year, but I think/hope that should suffice (especially once I actually add in that kind of go to function)...
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: AgingMinotaur on August 29, 2015, 09:17:28 PM
In regards to this, you might want to compare Gearhead 1 and 2, if you haven't already played them. They both feature quite intricate pseudorandom quests which require you to communicate with people in different townships. This is all quite complicated in the first game, and it's very clear that the designer learned a lot about how to implement the ui for all of this in the sequel. A practical log where you can look up people, rumors etc. helps a lot. Gearhead also implements phones, for when you just need to quickly chat with someone in another place. (I'm guessing something like carrier pigeons are more in the spirit of URR than a magic-driven postal system; are you planning on something like a time system where you can hang around/study/train for several seasons in one place?) Anyway, it's been years since I played those great and innovative Gearhead games, so I don't remember the details so well.

It's certainly rather uncharted territory in RL/game design, I think. I'm guessing one possible pitfall of a huge integrated "lore" ui is that it might become a lot of busywork to keep track of all the NPCs and civilizations. Then again, browsing and interacting with the lore should ideally be made interesting in itself.

As always,
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Krice on August 30, 2015, 09:13:07 AM
- A goto system like DCSS seems absolutely essential; the game will path to where you tell it

Even you have path finding and stuff like that it doesn't remove the "problem" of scale or total space of levels and the game world. When you look at DCSS it actually has quite boring levels and auto-explore was created to "solve" that, but in fact it doesn't help the actual problem.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on August 30, 2015, 10:13:12 AM
In regards to this, you might want to compare Gearhead 1 and 2, if you haven't already played them. They both feature quite intricate pseudorandom quests which require you to communicate with people in different townships. This is all quite complicated in the first game, and it's very clear that the designer learned a lot about how to implement the ui for all of this in the sequel. A practical log where you can look up people, rumors etc. helps a lot. Gearhead also implements phones, for when you just need to quickly chat with someone in another place. (I'm guessing something like carrier pigeons are more in the spirit of URR than a magic-driven postal system; are you planning on something like a time system where you can hang around/study/train for several seasons in one place?) Anyway, it's been years since I played those great and innovative Gearhead games, so I don't remember the details so well.

It's certainly rather uncharted territory in RL/game design, I think. I'm guessing one possible pitfall of a huge integrated "lore" ui is that it might become a lot of busywork to keep track of all the NPCs and civilizations. Then again, browsing and interacting with the lore should ideally be made interesting in itself.

As always,

This is very interesting (I haven't played either). Re: looking up people/rumours - yeah, the player character is effectively going to have an eidetic memory. Anything you've seen/read/heard/discovered before will be listed and I'll be developing a system allowing people to "tag" pieces of information their player has learned and thereby store clues they think might be related, move clues from one mystery into another, etc, and generally navigate such a large amount of data. As for carrier pigeons/letters, what an interesting idea. I really, really like the notion that you might be able to send off questions in one direction whilst moving in the map in another.

Even you have path finding and stuff like that it doesn't remove the "problem" of scale or total space of levels and the game world. When you look at DCSS it actually has quite boring levels and auto-explore was created to "solve" that, but in fact it doesn't help the actual problem.

A fair point (though I think some of the DCSS level generators, like the Vaults and many of the Hell levels can be very interesting). I'm striving to make everywhere interesting (or at least, everywhere that should be interesting, should be interesting - by which I mean I'm working hard to make a city interesting, but it doesn't really matter if a standard forest tile isn't particularly fascinating) in order to deal with that issue, and I hope no-where should be "dull" - equally, the denser the world becomes with people and information and clues and so forth, the less I think this'll be a problem.

-- This week's update --

This week I’ve implemented almost all the “stationary” NPCs. To explain what I mean by this, URR has three “tiers” of NPC: the crowd, the stationary, and the crucial. Crowd NPCs spawn and despawn as the player moves around the world map and are of importance insofar as they demonstrate the demographics of the nation, and you will be able to acquire significant information about the generality of the nation/religion/culture they belong to from them, and they serve also, when in crowds, to illustrate something of that nation’s ideologies (so you’ll only see a crowd with a bunch of people trailing a priest in quite a religious nation, for instance). Stationary NPCs are positioned in locations where there must always be an NPC serving a certain function, but the individual is not of particular important. Examples would be priests in religious buildings, jailers in prisons, innkeeps, guards, and many others. In some cases these individuals will “change” around after time – guards, for example, will be “met” by another guard at a certain point who will then take over the guarding role, i.e. they change shifts – whilst others, like priests, will obviously not change every few hours. Crucial NPCs, meanwhile, are those NPCs who are of sufficient importance to the game and the world that regardless of where the player is, the actions and movements of these NPCs will always be tracked. This category is primarily for NPCs like rulers, religious leaders, inquisitors, heretical leaders, nobles, military officers, and the like. Also, very rarely, what appears to be a stationary NPC will actually be a crucial NPC. Which is to say: in a jail, maybe 95% of the prisoners will be “general” prisoners, but a tiny number might have massive global significance due to their past role in a grand plot, and one wouldn’t know which was which until uncovering a path of clues which lead you to the important prisoner. Ninety-nine out of every hundred priests might be good loyal clerics… but perhaps one in a hundred hides an religious artefact of immense importance in their private quarters?

So, this week it has been the turn of all the stationary NPCs. Here are some examples:


Priests now spawn in religious buildings and cathedrals. In religious buildings, the priest lives on the top floor and will return there in the evenings; in cathedrals they have distinct rooms on the ground floor to which they will retreat as and when appropriate. For the time being,  however, they just spend their time around the ground floor of the cathedral interacting with the worshipers, going about their own worship, etc. There is actually a tiny bug in the below gif – the priest was standing on the same tile at the altar, when they should be standing next to the altar – but I’ve since fixed that, but I otherwise rather liked this gif so decided to stick with it.



Embassies now have clerks and diplomats in them; the clerks are probably going to be “general” NPCs in the embassy crowd, whilst I think diplomats will be assigned to specific areas. The ambassadors for each nation in other nations will be crucial NPCs who will always be tracked separately, so they haven’t been coded just yet.



Servants/slaves (depending on whether the nation is a slaving nation or not) now spawn and go about their business sensibly in upper-class houses. The houses will also, of course, get visitors in the form of various aristos from time to time, and then later, we’ll get working on the “crucial” NPCs – i.e. the family who lives there – generating properly. Thus, for now, here’s an example of some servants and some general citizens. You’ll note the servants will always stand next to something, either next to a person to serve them, or next to a chair/table/whatever in order to keep it clean and tidy. They’ll sometimes return to their quarters in the basement, and once I get schedules working, they’ll obviously retire there at night.



In jails (in nations with the Penitentiary ideology) we can now find prisoners in the cells, one prisoner per bed, milling around. As mentioned above, a small number might be someone of particular importance, but it’ll be up to the player to decipher who (if anyone) that might be. Prisoners will also be on release schedules (or at least, the lucky ones will be!) so they’ll be replaced whenever one moves out. I might add some kind of system whereby the different floors of each jail are for different types of prisoner – I’ll think about that going forward.



Below the cathedrals of theocratic nations you’ll find a crypt… and if you explore that crypt, you might come across a room containing the most secret archives of that religion. Right now these are tables without books, as we don’t have book generation yet, but we do now have the archivist, and their guard(s), spawning. Here’s a gif of me finding an archivist in a half-flooded crypt in a city next to the ocean, and then having a look at the archivist, and looking at his religious garment (which you’ll note has grey patterning – as well as “default” robes and the “religious leader” robes with gold patterning I showed last week, I’ve added in a mid-tier version with grey patterning which will be given to people like archivists, abbots, inquisitors etc, who are higher-ranked than the average priest but not the leader(s) of the entire religion). The “Archivist” is depicted with a ‘V’, and the ‘g’s are of course the guards:


Once books are generating, archivists will be guarding the most important secrets of their religion, so the books behind them will be immensely important to find a way to read…

More Guards

Guards have also been added to several other areas which need them, such as Officers’ Quarters, and Mansions, and various other places, and the guards for now all shout the “Oy, shop that!” placeholder (along with their x/y coordinates) once you walk into their territory:



I’ve now temporarily (or permanently, we’ll see) removed the “Cultism” religious ideology and replaced it with, for the time being, the far more interesting “Monastic” option, and as such, we now have monasteries spawning. These are structured in the form of a religious building in the middle, a range of paths and vegetable gardens around it, a “loop” of monastic housing in a shape based on the civilization’s spatial preference, with several other important rooms (libraries, dining halls, abbot’s quarters, etc) spaced around the outside (or sometimes the inside). As examples, here we have a map grid containing a monastery (diamond), then the player standing outside one (cross), then inside from the player’s perspective (square) and an absolute perspective in the same monastery (circular) – note of course that all the wall in middle and edges of the fourth picture is not actually wall, since outside the monastery is where the vegetable garden is, but all the spare space in an “interior” map is just filled in with wall:





Next Release?

I find myself with a quandary. Everything to do with NPCs and their schedules, behaviour, appearance, etc, will be finished, at the latest, by the end of next month. However, one will not be able to interact with NPCs at this point: there will be no conversation system. At this point my intention is to continue working on this release until the conversation system is fully implemented and as deep/detailed as I want it to be, and thereby make this the largest (in terms of time invested) release URR has ever had, so looking to release in Oct/Nov. As the first gameplay release, this seems appropriate on some level – I want the first gameplay release to have a lot to do (or at least a lot of people to talk to!) rather than a little. On the other hand, I do strive (with mixed success) to release new versions as rapidly as I can. So: what does everyone think? Right now I feel I’d rather save up both NPCs and conversations for one massive first gameplay release, rather than make NPCs 0.8 and conversations 0.9, as I think a world full of NPCs you can’t interact with will feel rather peculiar… but I’d like to hear your thoughts.

Next Week

Next week… I have no idea. Something involving NPCs in some way. See you then!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on September 06, 2015, 04:42:01 PM
Short-Term Replacing

Now, some stationary NPCs require two special things: they might need to be replaced in the short term (so there will always be a guard in any guard location, but at certain points in the day a new guard should come along and relieve the other guard, who would presumably be getting tired), and they might need replacing in the long term (e.g. gladiators who have died by now, or sailors lost at sea, etc – the game needs to replenish its volume of some of these NPCs when some are killed or cease to be important). Long-term replacing is not yet required (since NPCs, and the player, cannot yet die), but for short-term replacing, there is now a system in place to perform this task. When a guard spawns, the game sets a length of their watch, and when this period is up, a new guard is spawned as close to the guard as possible without the player being able to see the new guard spawn. The new guard then travels to the location of the old guard, and once they are on adjacent tiles, they switch places, and the old guard then moves out of the district and despawns, whilst the new guard becomes effectively identical to the old guard. I’ve also set up a system where there is a set “pool” of guards for each place, so perhaps you’ll be able to persuade certain guards to let you in if you know when their shift is, and their willingness to be bribed/persuaded/threatened/etc? Here, therefore, we have both the guards on a mint changing over, after which a priestess and her escort ramble past:



And the equivalent in a bank: they would not ordinarily all change over in this short a space of time, but for the sake of testing, it looks pretty neat:


Travel and Abstract Scheduling

Once I’d implemented this guard system, I then realized the game needed to track this wherever in the world the player was (or, at least, when the player next sets foot on that tile, work out which of the two guards should be on their shift, and spawn them). This seemed trivial, but it quickly became clear I was going to have to do other things before this. If I want the game to see how long it has been since the player last set foot on a map grid, then I have to know precisely how many turns/how much time moving on the travel map takes – and that, in turn, means programming that fully (currently there is just a placeholder of 20 “ticks” of the clock for each grid moved) and also making sure it cannot be exploited, and that moving on the travel map is never more/less efficient in terms of time spent than moving on the local maps (so, for instance, if on the world map you move north, north-west, then west, it should only count you a few turns as you move through the “corner” of the NW tile, since you wouldn’t walk to the middle before turning… but this rapidly makes the calculations very complex, as the calculations have to look at your previous two turns to figure out what would have been the most optimal way to move from Tile 1 -> Tile 2 -> Tile 3 if you’d been doing it on the local map instead of fast travelling). As such, I spent two days this week developing a detailed calculating system for working out the most optimal path the player could have taken between what I call two tiles and their outcome – the outcome being either pressing Enter to explore that tile, or moving onto a third tile – and thereby ensuring that, for long distance, fast travel is always equal to the most optimal path the player could possibly take on foot, i.e. the player should not be encouraged to spend real-world minutes slogging around the world on the local map, as it will never be faster (it will either be equally fast, or slower). So, basically, the system now tracks your previous two moves, and all the possibilities of those moves, and then when your third decision causes these possibilities to “collapse” (forgive the quantum terminology) the game calculates how long the most optimal way of carrying out that movement would all have taken, before then letting the player do any more interacting. This might sound strange, and it took a solid two days to code, but now it works perfectly and can handle all scenarios of the player’s fast-travel movement, and is always efficient, and allowed me to finally return to guards and ensure that the game knew which guard should be on patrol duty. In 0.9 therefore this system will be expanded to actually take account of terrain: moving on roads will be very fast if you have a mount, moving on desert will be extremely slow if you aren’t in a caravan, moving on mountains will be even slower unless one takes a mountain pass, and moving on ocean will, of course, be impossible unless one charters a ship.


As part of the above, I decided to do a little bit of work on how the world map is going to look to explore -this is still not going to be the first release where the map starts mostly shrouded (though it seems very clear that that will be 0.9 early next year), but I wanted to implement it at the same time anyway. When you move you now uncover all the tiles in a circle around you (effectively a 5×5 grid centered on the player with the corners removed) but you can also see all mountains in a far larger area, to simulate the ability to, naturally, see things which are higher up than other things (profound, I know). In the future I’ll probably let you see a decent distance across the ocean, too, but I haven’t added that yet. Here are gif and image examples of how this looks, which I’m very happy with at the moment:




Last but not least, many thanks to the extremely generous donations of the last couple of weeks; I really appreciate them! Over the coming week I’ll be working on completing the scheduling system for NPCs – day night cycles, going “home”, that kind of thing – and doing a lot of remaining edge cases and things like that, so once that’s all done, I might get working on one of the other clothing generators for this release, or keeping track of the “crucial” NPCs. We’ll see. See you then!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: King_of_Baboons on September 07, 2015, 09:15:51 PM
This game rocks!It has one of the best ASCII graphics that I have ever seen and has a lot of cool mechanics judging by all of your posts.

I have a few questions about some future features you might add:

-What kind of enemies will the player encounter besides bandits and heretics?Since it's a more realistic roguelike I assume that it won't have any generic goblins,trolls,dragons or any fantasy monster.

-Is there going to be more sources of quests besides the nobles and our religion's leader?It's not hard to imagine that the popes and priests are going to be our main quest givers by looking at the religion's description("Wants to eliminate evil cults.Rewards its followers with weapons and armor.").I just don't want to be just the church's private hitman.

-Speaking of cults,will they practice necromancy and other dark arts?A little bit of paranormal stuff regarding cults and religion would be nice.

-How do you take those awesome screenshots like that monastery one?
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on September 08, 2015, 01:32:08 PM
This game rocks!It has one of the best ASCII graphics that I have ever seen and has a lot of cool mechanics judging by all of your posts.

Well thank you very much! Yeah, I'm aiming at something pretty different: I suppose the three core mechanics will be conversations, examining things, and exploration (and then piecing it all together!).

-What kind of enemies will the player encounter besides bandits and heretics?Since it's a more realistic roguelike I assume that it won't have any generic goblins,trolls,dragons or any fantasy monster.

-Is there going to be more sources of quests besides the nobles and our religion's leader?It's not hard to imagine that the popes and priests are going to be our main quest givers by looking at the religion's description("Wants to eliminate evil cults.Rewards its followers with weapons and armor.").I just don't want to be just the church's private hitman.

-Speaking of cults,will they practice necromancy and other dark arts?A little bit of paranormal stuff regarding cults and religion would be nice.

-How do you take those awesome screenshots like that monastery one?

1) All humans, no fantasy creatures. Combat is actually going to be extremely rare, and unlike more games which have "optional combat" but position combat as the *easier*/simpler option (so stealth is harder, or magic is more complex), combat in URR is actually going to be the trickier path through the game in many ways.

2) The game's central quest - to uncover a conspiracy hidden throughout the world - is the player's main objective, but I'm not completely sure yet how many lesser missions might be attained which move you in the direction you want to go. I'll have this more figured out in the near future, but I assume a wide range of high-ranking figures might try to enlist your help.

3) There will be rituals and stuff, but it won't be paranormal, in the sense of it will be belief, not "effect on the world". With only one tiny exception to do with the main story, I'm going full "realism"!

4) Ha, that's using wizard mode. In game you can save the area you're on so .png, but it only saves the parts of it you've explored!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: King_of_Baboons on September 08, 2015, 06:18:57 PM
4) Ha, that's using wizard mode. In game you can save the area you're on so .png, but it only saves the parts of it you've explored!

Now I'm sad because I found the largest city on the map and I wanted to take a giant screenshot of the whole thing...

But now Im curious about the next update,how will the NPCs interact with us?Will their speech be more like the sometimes weird DF speech or are only the important NPCs be able to talk with me?
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Aukustus on September 08, 2015, 07:33:51 PM
It still bothers me that the green "Poi" bar is shorter than the others :).
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on September 09, 2015, 11:13:04 AM
4) Ha, that's using wizard mode. In game you can save the area you're on so .png, but it only saves the parts of it you've explored!

Now I'm sad because I found the largest city on the map and I wanted to take a giant screenshot of the whole thing...

But now Im curious about the next update,how will the NPCs interact with us?Will their speech be more like the sometimes weird DF speech or are only the important NPCs be able to talk with me?

Heh - I did once take such a screenshot, but it needed a bit of fiddling with wizard mode to actually allow it. It's rather out of date, but it looked cool: http://www.ultimaratioregum.co.uk/game/files/2014/12/A-City.png - the empty district there is now the market district; I hadn't finished its generation when I took this picture.

All NPCs will be able to talk, but I do *not* want them to have weird idiosyncratic/non-sequitur speech at all - I'm pushing for far more realistic conversations, sensible flow of conversation, etc. From the average person in the street you probably won't be able to find out that much, but you should still be able to talk to them! From people of note, though, you'll be able to get way more information.

It still bothers me that the green "Poi" bar is shorter than the others :).

Ha! Those will probably be removed in the next release as I work on other things before then returning to think about how health/combat will work in a version or two :).
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Tzan on September 09, 2015, 03:58:05 PM
All NPCs will be able to talk, but I do *not* want them to have weird idiosyncratic/non-sequitur speech at all

Forum Member said: "I used to be a game developer like you, but then I took a job to the wrist".
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on September 11, 2015, 10:27:19 AM
All NPCs will be able to talk, but I do *not* want them to have weird idiosyncratic/non-sequitur speech at all

Forum Member said: "I used to be a game developer like you, but then I took a job to the wrist".

We've all been there :(
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on September 12, 2015, 11:27:51 AM
A rather short and snappy URRpdate this week, with hopefully something rather more substantial in a week's time:

Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on September 19, 2015, 11:12:33 AM
I’ve just finished reading Q, a novel by the Italian literary collective Luther Blissett (that actually being the name of a footballer, a name they deemed to be inherently comic), which I absolutely loved. I recommend that everyone interested in URR give it a look since it looks at a lot of themes similar to those I’m trying to convey in the game, and so I will avoid spoilers, but there is one crucial point here (and that is mentioned in the book’s blurb, so it’s not a spoiler) – the narrator adopts a wide range of names and identities throughout the book. The book – set during the Reformation – emphasizes, albeit implicitly, the impossibility of ever being truly secure in knowledge of someone’s identity in an era where transport is limited, countries appear “massive” without aircraft and trains and cars to traverse them, and for all except the highest-ranking members of society there are no clear records kept on who is who, who lives where, and who is from where. Reading the book managed to segue quite nicely into some thinking I’ve been doing myself recently, but the book made this all the more certain in my head: URR has got to have a disguise mechanic.


Of course, we can still have a layer where the player can “earn” permissions to certain areas via transparent means. By which I mean – bribe someone to give you documentation to access Place X, or earn the loyalty of a religion so they’ll let you into Place Y, and so on – but surely we could take full advantage of the detail of the world’s faces/clothes/cultures/social norms/etc by implementing a disguise mechanic. I think this would have several components:

Appearance: add items for the temporary dyeing of hair and lightening/darkening of skin tone and temporary facial tattoos, and allow for adjusting hairstyle. Other NPCs will, in part, judge whether you are part of their nation based on how your face/hair look.

Clothing: the player adopting certain items of clothing lends other NPCs to assuming the player belongs to certain categories. This would be both clothing, but also things like rings, necklaces, types of armour worn, weapons sheathed, etc.

Speech: this is a really interesting one, and I suppose ties back into the ongoing question of “how is the conversation system going to work?”. It would be amazing if there could be some kind of system where the player can try to “fake” the forms of speech expected in that nation/culture/religion, and the better they can do this, the less suspicion they fall under. Perhaps the player can offer special greetings once the player has heard them once (“Greetings of the Divine King of the Snow!”) or generic greetings if not (“Greetings”), and the more “generic” comments the player makes, the more suspicious NPCs become, but the more the player knows what needs saying, the more they’ll fit in. Equally, once one becomes used to how people of a certain nation speak, perhaps one can select what “style” of speech to speak in a given conversation? That could be so interesting (in my current ongoing drafting of how conversations are going to work, I’m working on trying to define methods for generating different styles of speech).

So once you adopt the first two – dye your skin, and find the right clothes – you’ll be able to walk around in most nations undetected. But if you want to talk to anyone there, you’ll need to mirror their patterns of speech – and, equally, perhaps a particularly isolationist nation has a lot of guards on every major trade route, and you’ll be challenged by them even if you look like you belong to that nation? I think there are so many interesting potential gameplay experiences here: to some cultures your character presents themselves as they “truly” are, in other nations you entirely try to fake it, and maybe in other nations you play it by ear? This seems like another mechanic which would really take advantage of the detail in the world if we can make NPCs very observant about when something seems to be “off” when looking at/talking to the player.

Whether this will be 0.8 or 0.9 remains contingent on precisely how large 0.8 ends up being – is it just NPCs, or is it conversation as well? – but this is definitely going to turn up very soon, though it might be in a different release to conversation per se. If anyone has any other ideas for some more details on this mechanic, or perhaps how it could work in other contexts, or other parameters we could civilizations vary by: let me know!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: King_of_Baboons on September 19, 2015, 08:05:23 PM
Nice idea,bro.

I think that the whole disguise thing could open some paths for future stealth missions(if that ever becomes a thing).

Example:The Elbwin Family,one of the most influential nobles in town,are going to throw a costume party at their manor.Infiltrate the party and steal their secret documents and bring them to *name of rival family here*.Don't forget to wear a costume and a mask.

It would also be interesting to wear some sort of royal jewelry and then everyone would think that you are a noble and give you gifts and whatnot  8)
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on September 20, 2015, 11:32:37 PM

Your final comment raises an interesting question: can you disguise yourself as a *demographic* (person from nation X, religion Y, etc), or as a *specific* (so you can pretend to be Person X who Person Y has never  met, which could be rather interesting). I'm inclined to say #2, but it'll be trickier to code!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: King_of_Baboons on September 21, 2015, 07:53:39 PM
Okay,so I was checking out the interiors of the manors and I noticed that there is slight error in the manor making thingy.

The civilization Im in doesn't like slavery and yet the lower levels of every manor has about 16,or more,slave beds.

So unless these families have a shitload of babies(which could be plausible since the civ has no gladiatorial arenas to keep them entertained,I mean,what else would you do in those times?),I feel that the town manors need to have variations with no basement beds if there is no slavery in their towns.

Also the game crashes if you try to export stuff inside a manor.But its not a big deal since the game is smart and saves before closing the window.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on September 27, 2015, 02:56:21 PM
Okay,so I was checking out the interiors of the manors and I noticed that there is slight error in the manor making thingy.

The civilization Im in doesn't like slavery and yet the lower levels of every manor has about 16,or more,slave beds.

So unless these families have a shitload of babies(which could be plausible since the civ has no gladiatorial arenas to keep them entertained,I mean,what else would you do in those times?),I feel that the town manors need to have variations with no basement beds if there is no slavery in their towns.

Also the game crashes if you try to export stuff inside a manor.But its not a big deal since the game is smart and saves before closing the window.

Ah - those are probably servant beds. Is the flooring wooden or stone? If stone and the beds are proper beds, then servants; if wood and the beds are extremely simple, then slaves. Ah, interesting re: exporting, thanks for pointing it out!  I'll look into it.

And now, this week's update, cross-posted from the game's blog...

Normal service will be resuming next week: I’ve moved house, settled in, and started planning out the final push on NPCs, which is to say tracking all the important NPCs as they move around the map – a process which has required me to do a lot of thinking about how to code it before actually getting started (this will turn into what it is effectively a Travelling Salesman problem where the time values at certain points are unknown, which I’ll write about here in the next few weeks). Anyway, here’s a post I wrote a little while ago with some of my thoughts on the future of the Encyclopedia; next week we’ll have an URRpdate as usual.


I’ve decided to remove the Encyclopedia from URR because I increasingly feel/fear it is going to end up doing the player’s “job” for them, and because my original conception of how the Encyclopedia is/was going to work is clearly going to be a programming nightmare.

Let me explain my logic. Right now, the Encyclopedia gives the player a full overview of everything in the world, though that’s only because the game is obviously not replete with gameplay as of yet. The intention was to – either this version, or more likely the version afterwards – fundamentally change the Encyclopedia so that it only starts off with information about your nation, religion, culture, histories, etc, whilst the others remain unknown. Then, each time you uncover a little nugget of information on your quest, the Encyclopedia would update itself. So when you first discovered the name of a nation, it would add in an entry for that nation, but all the information about that nation would be displayed as “????”s (or maybe just blank regions where text could be inserted) until you found those out, and then it would be added. Equally, were you to discover some piece of information that was meaningful, but you didn’t know which nation/religion/whatever it was associated with, there would perhaps be another list of entries in the Encyclopedia without names, noting that *some nation* somewhere has a given flag, but you don’t know which nation. When the player then encountered irrefutable evidence that Flag X belonged to Nation Y, the Encyclopedia would then “conflate” these two entries into a single entry, associating Flag X with Nation Y for ever more.


However, as in the first paragraph of this entry, I increasingly realize that there are some pretty major issue with this type of system. Firstly… surely this is doing the player’s job for them? Surely if the focus of the game is uncovering these cultures and how they interact and searching for the items you seek in the maze of heresies and histories and all the rest of it… surely we should be leaving these connections to the player, and getting the player to come to recognize the nations and cultures they encounter? I fear now that codifying this type of information in the Encyclopedia will run into several major issues. Firstly, it’ll “force” the player (or at least behaviourally strongly encourage) into constantly opening the Encyclopedia to check things, rather than remembering “ah yes, this is Nation X, I encountered some of their emissaries before”. Secondly, the player might not actually notice a useful bit of information, but if the Encyclopedia then updates, it tells the player that piece of information is useful! It seems to me this second one presents a major issue. Thirdly, there’s a question of what information the Encyclopedia should show. To stick with the nation example, should it show the national flag? The national dress? The national style of shoe? What vases in that nation look like? There has to be a line drawn somewhere, because if you want the Encyclopedia to potentially list everything about a given nation, you risk basically reproducing everything about that nation and leaving nothing in the actual game.

So, those are the gameplay issues. There is also a programming issue, which is that I increasingly realize this type of tracking – and perhaps most imporantly, getting the game to notice when a useful piece of information has been “seen” and then updating the appropriate Encyclopedia page – is (or would have been) a horrifying nightmare. This is a secondly concern to the gameplay, of course – if I still thought this was a good method I would certainly have done it – but it still matters somewhat.


What’s the alternative? Well, I think I’ll keep the Encyclopedia in for 0.8 and probably 0.9. Whilst the world is “open”, I think it only enhances the game to be able to see everything at the start and give new players some impression of the size/scale/scope/variation of the planet and the variation of its cultures. However, a little further down the line – shall we say 0.10? – I’m now 99% sure that I’m going to remove it permanently, and rely two things. Firstly, the player’s ability to become familiar with the interconnected world they find themselves in; and secondly, crucially, an alternative to the Encyclopedia (maybe a “Journal” or something of that sort) which records every piece of information the player character sees/hears/experiences, but not the significance of it. With this model you can once more view/read everything of note you have ever looked at/seen, but it doesn’t tell you *what does/doesn't matter.* So once you’ve read a book, you can forever “look up” the information in that book (so it basically as if the player character has an eidetic memory). Therefore, this will be a replacement Encyclopedia where you browse “books”, “clothes”, “paintings”, and the like, but you do not browse information about “nations”, “religions”, “cultures”, since that’s what you’re piecing together. Equally, I'll also work on a system whereby the player can "tag" certain items in their viewed history as things they think are relating to a particular riddle, and then browse according to tags and assess the data they have and what else might fit into that category.

Therefore: the Encyclopedia will survive 0.8 and 0.9, and then be replaced by this new version which records player character experience but leaves understanding up to the player – which is surely the whole point of the idea of the game and the riddle(s) hidden across the world’s cultures! For now, however, the Encyclopedia will remain to assist players as we go through the worldbuilding -> gameplay transition in looking around the world, getting some grasp on its detail/complexity, etc. See you all next week for the resumption of normal service!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on October 04, 2015, 09:50:01 AM
I’ve planned out how important NPCs are going to be handled, and starting tomorrow (Monday) I’ll be working on this. If all goes well… I would expect this to take a week to get all the basics going, but then some of the activities for more complex NPCs (so rulers have to find their way back to their bedrooms in castles, for instance) might take a little longer. I know I rarely write technical entries, but here’s a rare semi-technical entry about how exactly I’m designing the NPC system. Enjoy!

1) The game looks over the entire world and identifies every location where a guard should appear. This means it counts up the number of guard-worthy buildings in each city centre (mints, parliaments, etc), in upper-class districts (currently always three major families, but I do intend to change that in the near future), and stores each guard in a list. It then also looks for an appropriate place for that guard to live – if we’re in a fortress, the guard will be stored in the same map grid (i.e. the fortress) and if we’re in a city the guard will almost certainly live in a nearby lower/middle-class district. Either way, it also stores where these guards should spawn. For non-guards the game assess how many other important people should be appearing on each tile based on the ideologies/religions/etc of each area (so we’ll have ambassadors, blacksmiths, chieftains, doctors, executioners, gladiators, inquisitors, judges, monarchs, lords, ministers, officers, other nobles, regents, abbots, archivists and mercenaries). For now they cannot spawn in the middle of what I’m calling a SCHEDULE event (see below) as this would quickly increase the complexity, but I don’t think this will be an issue, since the world will be vast enough that 99.9% of important NPCs will have begun doing things by the time you ever get to see them.

2) There is now a new dictionary called abstract_creatures, who are the important creatures (I assume only people, but I’ve named it “creatures” in case there are… I don’t know, noteworthy mounts or something later?), which all of these people are put into. For each guard it places a guard in their guarding area, a guard in the district/place they would live, and then has them both schedule a time at which they cross over. For everyone else it just places them in an appropriate starting location. Whenever one of these people takes a turn, it’ll look into this list (instead of the grid-specific lists) to get the person – and as for when it does this, we then look at the kinds of event I’m creating for these abstracted-out people.

3) The game then generates two kinds of “event” for the schedules of these guards, and for all important NPCs – what I’m calling “TIME events” and “SCHEDULE” events. TIME events are those which happen at the same *time* every day – get up, go and guard the thing, stop guarding the thing once the other guard appears, return home, etc. For those in governments it’ll involve going to the appropriate buildings, for rulers it means holding councils, for gladiators going to the arena and fighting and hopefully-not-dying, etc. Then they will sometimes gain SCHEDULE events, which are one-off occurrences: talk to this diplomat, check this town out for heresy, meet secretly at this location on this date, etc. The game will track whether an important NPC is going a TIME or SCHEDULE event, and if a SCHEDULE event, it will ignore all TIME events until there are no more SCHEDULE events to complete, at which point the NPC will look at the next TIME event it would normally have, do that, and from that point onwards behave within its normal list of TIME events.

4) The NPCs use the time “quantum scheduling” system previously described, and when they are heading towards a target in a grid which has not yet been spawned, they assume the highest possible time it would take them to reach it were it spawned – so if there’s a building that could spawn anywhere, we assume it takes 200 ticks to reach it (all grids are 200×200) – if it could only spawn in the left-most side of that grid and the NPC will be approaching from the left, we assume it will take 100 ticks to reach it, etc. After the grid is spawned, the game will actually create a list of all possible timings from each gate leading into that grid to each important location on that grid; this can never be exhaustive for non-city areas or for houses (as there are simply too many), but for NPCs moving to important doors (of which there might be a dozen) from one of four city gates, one can readily see it’s the work of a moment to have the same calculate those and store them for future use after the player leaves that grid and the grid becomes abstracted once more.

5) What then happens if the player steps onto a grid with these abstract people, or leaves a grid on which there exist people who need to be abstracted? Well, this (obviously) is the tricky part, and something I know Dwarf Fortress found challenging to program, and now I’m at this point myself I see why. If you step on and there are abstract NPCs, it will have them “rewind” to the start of their most recent action, generate/reload the map, and then have them play out that action physically. This will mean creating quite a static list of “Actions” and “What This Looks Like On A Spawned Map”, but that shouldn’t be a problem (creating rigid lists is often much simpler, if more time-consuming, than writing PCG!). When the player then leaves, the game will then track how far through their latest action each NPC was, and schedule their next action for either the standard time (if a long way off) or the shortest possible length of time it would take that NPC to start doing that action when moving on the spawned map… and then save the map and do everything else as normal.

6) This means – I think – that NPCs will never wind up doing anything faster than they possibly could if they were “walking it” on an actually present map, but they will sometimes do things slower, but this is simply unavoidable without spawning every single grid at the start of the game (in this regard this is vaguely akin to a Traveling Salesman problem where the travel-length value at each vertex is unknown and/or changeable based on the actions of an external actor). This means that whether or not a particular area has yet been spawned or not, the player will be able to track with great accuracy the movements of important NPCs, and guards will change their shifts irrespective of player actions, and so forth.

I’ll be starting coding this tomorrow. I’ll start with guards since I already have most of their code, and then once I’ve checked that I’ve got them going from their guarding place to their homes and vice versa at appropriate times, and changing over their watches, I’ll move onto the more complicated important NPCs who move between more districts, might move between cities, etc, and we’ll see how it goes. An update on important NPC progress will therefore be next week’s blog post – see you all then!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on October 11, 2015, 08:58:31 PM
I am absolutely *swamped* with work and coding and everything else right now, but thanks for the extra resources! I shall get onto them shortly :)


Some Updates

A couple things before we get started this week. You can now watch my talk (https://www.youtube.com/watch?v=NxV5Ln8BOAo) from the UK IRDC 2015 on URR’s general generation systems. Check them out! Also, I’ll be at this year’s ProcJam (http://www.eventbrite.co.uk/e/procjam-2015-kickoff-day-tickets-18723814433) opening talks (though not speaking this time) down in London, so you should all come and say hello, both to me and other excellent PCG folk speaking. Hopefully see you there! And if not, I recommend taking part in ProcJam – a lot of awesome stuff came out of it last year and I’m sure the same will be the case this year. Also, as mentioned previously, I’ve now started a job as a three-year research fellow; currently I’m therefore working on URR at weekends and in the evenings. Progress is speeding up again now, but it’ll inevitably be a little slower than it had been pre-move. As such, I’m now seriously once more considering releasing NPCs without the conversation mechanics as 0.8… but I might not. Basically, I’m going to finish NPCs, and then take stock; but that possibility is still on the table. I don’t want people waiting ages, and I do obviously want the NPCs to be tested, but at the same time I promised gameplay and the conversation system is going to be in-depth and exciting, so I want to offer that, even if that means a longer time between releases. We’ll see.

Now, onto this week’s update, where I am pleased to report that development has now resumed after around a fortnight of moving house and starting-new-job admin, and we have some initial progress in the handling of the game’s important NPCs. So, read on…

Placing and Counting NPCs

When a world is generated there is now a block of code which looks over each tile, examines what is in the tile and the ideologies of its owning nation, religion, and all this kind of data, and comes to a conclusion about how many guards there should be, what kinds of guards these are (Mansion, Parliament, Castle, etc), where they should rest (in that same tile, as in a Fortress, or in another city district), and so forth. It does the same for all other important NPCs, and then counts up the total. Here’s a map I had the game print out where each tile was coloured according to how many important NPCs it had. A black/grey tile had none, and then the colours/numbers went through the rainbow to denote numbers of guards from 1 to 10 – dark red, red, red/orange, orange, orange/yellow, yellow, yellow/green, green, light blue, mid blue. If there are 10 or more, it uses a ‘+’ symbol. One can see roughly where all the major cities are, and get some impression of where fortresses are, and for the time being nothing spawns in towns which would “merit” a guard (though this will probably change) and so those don’t show up (same goes for tribal encampments, though I might add guards to certain buildings there in the future). I think it’s quite interesting to note how different cities have different textures of how important NPCs are laid out, depending on their ideologies and so forth. Note also that some of the fortresses have different numbers, again according to their layouts/ideologies. Anyway, here’s an example of this map:

(Hyperlink due to size) http://www.ultimaratioregum.co.uk/game/files/2015/10/Important_NPCs1.png

And some zoomed-in examples of cities with very different “important NPC textures”, where in most cases the +s are indicative of things like city centers and upper-class districts and military districts, whilst the common 1/2/3/s tend to be lower-class districts where the national ideologies vary what spawns and doesn’t spawn there:


As for these important NPCs: they are stored in two areas – if it is an important NPC who will never ever leave the tile they are currently on, it saves them in the potential_npcs list on that map tile; if it is an important NPC who will be moving around the world, it saves them in the potential_npcs list in the world overall; this separation is to avoid a situation where even NPCs who never leave their map grid were in the global set of abstracted-out NPCs, there would be no point scheduling them and going over their routines/actions, since those can just be modeled when the player goes near. At this point it also (though this is not fully implemented yet) creates a bunch of tags for each important NPC. This might be something mundane and overt like “Guards the mansion of Family X”, or something covert like “Intends to murder NPC X in a plot with [list of other NPCs]”, or “Once met a mercenary who knew where [secret item X] was buried”, or whatever, which one might be able to discover. This brings us back to the previous discussion a while ago of secrets NPCs hold: a jail might have 50 prisoners, most of whom might be mundane, but a few will hold secrets which might be of use to you in some way.


Spawning Important Folks

Until the player goes near to any of the important NPCs, they remain “abstract”. They are able to act and gain connections by possessing the list of “npc_info” stuff listed above (who they plan to usurp, their other secret agendas, etc), and this also means that a spawned NPC can talk about an unspawned NPC without that NPC having to be spawned, which means that all the important NPC information is set up before the spawning of any of those NPCs. When the physical version is spawned because the player has stepped onto their map tile (or they are a roving important NPC and they have just moved into the player’s map tile), the game looks for the “npc_info” which describes an NPC of that sort and then tethers that npc_info to the physical copy of that NPC and deletes the abstract copy. That then doesn’t change the abilities of other NPCs to reference the important NPC, but it just means they now reference the physical copy rather than the abstract copy, but either way the game knows the information relevant to that NPC, and that NPC can move around the map (whether “physical” or “abstract”).


Reworking Guards

When I worked on guards in the past few weeks, I hadn’t fulled realized that guards were, basically, an “important” NPC, and therefore would actually need to be tracked to their homes and the rest of their schedules just like all the others. This means I’ve had to undo a little bit of the code I wrote before for tracking guard pairings and so forth, but this didn’t actually take as long as I’d feared. Guards now still spawn correctly and match up with their “abstract” selves, but no longer exchange their positions, as that requires me to transform some abstract guards into real ones at appropriate moments, and then get them matching up whether or not all, some, or none of them are spawned – the next step is therefore to get them (and everything else) performing according to their schedules, which is the objective for the coming week.


Next Week

Important (and unimportant) NPCs remain permanently/temporarily spawned when they cross districts, so you can follow them; guards can exchange their patrols with one another at the correct times; TIME (regular) and SCHEDULE (unique) events work, or at least have begun to be implemented. See you then for more work on the important NPCs of URR![/list]
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on October 18, 2015, 09:39:21 PM
Major progress on important NPCs this week! We now have all NPCs correctly linking up with their abstract selves, the game correctly listing and assigning historical and interconnected importance (if any) to all important NPCs before they are actually generated (from slaves to kings), the delegates/representatives for democratic nations being generated and tethered to a home district/town/etc, minor vassalage families are spawning, and early progress has been made towards even the generation of castles! Read on…

Importance of Important NPCs

Firstly, the game now selects a lot of new important things during world generation; or rather, it has always done this and then stored “keywords” and information so that specific areas can be generated later if/when the player sets foot in them, but this has now been expanded to every NPC who might be important. Therefore, the world at generation decides precisely how many servants live in a given mansion, for example, and how many mercenaries live in a mercenary guild in a certain city, and so on. The map I showed last week was partly complete in this regard but was lacking a bunch of other important NPCs I had actually forgotten about, but I believe the game now generates them all correctly. This means all guards are generated at world gen, along with all other obviously-important NPCs (like rulers) and a small number of other NPCs (like slaves, servants, prisoners, etc) who are then intermingled with non-important versions of themselves.

Since new important NPCs have been added, take a look at this new diagram – you’ll see that there’s now a bunch of important NPCs spawning in towns, settlements, more in cities, all over the place! Much more colourful and much more variety, and shows that not everyone who matters lives in a city…


Historical Importance and Secret Information

The game can now assign “notes” to each important NPC, notes which might be referenced elsewhere in the game and will determine some of the unique things you might be able to do with each unique NPC. Examples include whether that NPC is involved in a plot, is secretly a worshiper of another religion, has an unsolved crime to their name, fought in a war/wars, is corrupt or embezzling somehow, what other important NPCs they’ve met, where they traveled, and so forth (and also past-tense examples for all those I wrote in the present tense, so an important NPC might have been involved in an un/successful plot in the past, but is not involved in one currently). This will obviously develop far more in 0.9 onwards, but the basic framework is now in place for meeting a merchant in one place, who tells you about a plot he overheard involving someone in the next town over, then finding that person and encouraging them to give you information about the plot, and discovering it is being lead by a number of political delegates who all secretly worship another religion, and then finding out a list of delegates and trying to decipher who it might be, and finding out this plot may be attempting to put a particular person on the throne, a person who – as someone else told you – may just know the location of one of the items you’re seeking…

…and so forth.

Representation and Delegates

I turned back to the democratic ideology choices this week and added a nice bit of extra detail here. There is now a new NPC type, the “delegate”, shown for now with an “a”, and each democratic(ish) nation will have a selection, depending on how many seats there are in their parliament. Once the game knows this number, it then carries out a reasonably complex equation. The game counts up how many towns, monasteries, and districts there in a nation (say, 4, 2, and 18), and then attempts multiples alongside each of those (1,2,3,4) for how many representatives there might be from each town/monastery/district, and then attempts to get that as close to the target delegate value as possible. If it hits it directly: great. If not, then the game gets as close as possible to that value, and then adds in a few extra delegates which belong to the major families, the military, the national bank, the national religion, or some combination, depending on how many “extra” delegates are required. This obviously produces a lot of variety – in some nations each monastery has two delegates, each city district just one, and each major house two; in another maybe each city district has two delegates, but the military fields six of its own delegates, and the bank a couple too. Delegates have been given (temporary and very basic) schedules for me to test in the coming week getting them all moving correctly around the world map. Here’s an example map of nations with the “representation” ideology (in white) and their distribution of delegates, who will all be scheduled to come together to the parliamentary building once every X weeks/months/etc:


Road Aesthetics

A minor thing – I noticed that all road curves were curved, and that doesn’t really stick with the whole geometric-aesthetics thing, so road curves now vary, just like almost everything else, depending on the nation they’re found in. A truly minor detail, but once I realized it, I just had to fix it. The octagon and diamond inevitably look similar (the octagon just has less diagonal), but still:


Early Days for Castles

On evenings when I didn’t have enough time to sit down and really do a lot of this complex scheduling/technical stuff, I started work on castle generation and, although it took a long time to figure out how exactly this was going to work, I’m very pleased with the initial results, and I’ll definitely have something to show in this regard in… two weeks? Something like that. But here’s a little hint of some castle walls, a gate, a moat, and is that… is that something which might become a DRAWBRIDGE?!


Vassal Houses

The game now spawns an appropriate selection of lesser houses for nations with the “vassalage” ideology. There’s a longer blog post in the work for the future about how I’m reworking these for 0.8 and the new variation I’m trying to add to all the nations as a result, but that’s a future thing; nevertheless, these now appear, and each is given a town to rule; in the very near future I’ll be expanding this so that a “county” appears around each town which each family rules, and all the farms and whatnot within it, which is the area that vassal then controls. Still not quite sure how the mottoes for these lesser houses will generate, but I’m sure I’ll come up with something acceptable in the near future.


What next?

Well, by the end of next week I hope to get the important NPCs moving and scheduling themselves around the map, even if only in a very basic state, and to have significantly more progress on generating castles, and hopefully to allow you to follow and track important NPCs whether they are”abstract” – i.e. the player hasn’t yet gone close enough to them to pawn them – or “real” – i.e. the player has gone close enough – and these NPCs should carry out their schedules regardless of whether they are on the other side of the world, or directly in front of the player. That’s a pretty big ask, and I’ll be busy for much of next weekend, but I’d hope for the first steps towards it next week. I’m also drafting out in the background a few other improvements to the policies system (which is now becoming “ideologies”, as that is far more descriptive of what I’m after here), extra variation in each nation, and also some thoughts on ambient flora and fauna and making those a) more interesting and b) actually exist, respectively. I’m also now strongly leaning towards saving up both NPCs and conversations for a big release, as DF did that a while ago and it seemed to work out fine, and I know it would be worth the wait… I know I mention this debate every entry at the moment, and I still haven’t 100% decided, but I’m about 95% on the “save it up for an epic first release” side of things. Either way, see you in a week!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on October 25, 2015, 09:14:41 PM
Lots of further work on important NPCs (this “Important NPCs” series of blog posts is probably going to hit at least eight or so in total). The major developments this week: the game now assigns nearby home districts to each important NPC, and in turn an actual house when their district is actually spawned; the game now adds in naval trade routes and creates a range of maps for optimizing NPC pathfinding around the world; and NPCs now move around the world map and take an appropriate length of time to make moves! Read on:

Homes are Assigned

Homes are now assigned to all important NPCs, and each NPC has a “work” location and a “home” location (although special events, like a gladiator being pulled away from their training to fight in any one of many possible arenas, will add another “work” location). In some cases these are the same districts – so the guards who guard castles are also guards who live within castles, and their work and home districts are the same, and the same goes for every guard in a one-tile fortress, town, etc – whereas other guards will live elsewhere. There are no homes in a city centre, but the guards who guard the mints or parliaments have to live somewhere, and so they now live in other districts, where the district depends on the NPC (so the guards of mansions are better-off and live in middle-class districts, whilst the guards of arenas will live in lower-class districts, and so forth). When the player then enters a district with homes in for the first time, the game will look over which important NPCs are housed in that district, and will assign actual doors and houses to those NPCs, and ensure that random NPCs in crowds will never enter these houses. Here’s a little output noting which guard in a pairing each guard is (“first guard” or “second guard”, their form of guarding, where they begin the game (whether on duty, or not on duty), and then where they work and where they live; and you’ll notice a range of living districts for the mint guards.


Ocean Trade Routes

The game now generates ocean trade routes. All settlements except hunter-gatherer encampments which “touch” the coast now count as being a “dock” (even if these do not physically spawn yet, but will soon), and the game now has an algorithm for attempting to piece them together in a reasonably interesting, efficient, and wide-reaching way. The player will be able to jump onto these shipping routes, as will important NPCs who need to travel very long-distance (which will be rare, and mostly for mercenaries, soldiers, ambassadors, diplomats, plotters in various schemes, explorers, inquisitors, preachers, etc). I’m very happy with the kinds of shipping patterns this produces, and is something I’ve been meaning to add for a while, since it connects up parts of the map not ordinarily connected and thereby allows important NPCs to potentially travel to places they couldn’t travel to before (more on this below). These routes will show up on the world map once you find them, and when you consider boarding a ship in 0.9 (probably) onwards, you’ll be told where that lane stops, how long it will take you to each location, how safe from pirates etc each part of the route is, and so forth.


Road and Off-Road Pathfinding

When an NPC is looking for a path between settlements, the NPCs consider two possible routes – one using any tile they’re able to use, whether something fast like a road or something slow like an ordinary piece of terrain, and another using only “special” forms of travel, meaning roads, naval trade routes, and (in the future) desert caravans and mountain passes. Whichever one is faster (and safer) will be the one the NPC selects. So in this first picture, we see the terrain of a given world. In the second picture we see “all valid tiles”, and we can see that oceans are excluded aside from shipping routes, deserts are entirely excluded (since caravans do not yet exist), mountains are excluded (since mountain passes do not yet exist) and rivers are excluded, except on tiles where a road crosses them. In the third picture we see the final map which only uses roads and shipping routes, which might take longer paths to a given location but each particular tile will be faster – and so the game will check them both whenever an NPC wants to move. I debated going even further and weighting every single tile and using some kind of A* with Bounded Costs system, but a) that would be a surprising nightmare, b) it’s very CPU-intensive and this multi-settlement pathfinding has to be done effectively instantly, and c) I actually think this can have gameplay value: if you are told Person X is travelling to Y, you can be told if they’re travelling by road, or not, and can try to catch up with them that way, rather than knowing they’re going by the absolute optimal route, which might be very challenging for a human player to deduce.




A final interesting note: we can see in both of these pictures that the area in the northwest is cut off from the rest of the world. That area happens to have no towns which are on the coast and therefore have docks, and same goes for cities, and it is separated from the rest of the world by mountains and desert, and cannot therefore be accessed by land (unless the player is willing to move through desert or mountains without caravans/passes, which will cause each turn to take many many times longer than normal; NPCs will not have this option). Therefore a future (but probably quite simple) system will be required to floodfill the world and to ensure that every settlement, no matter how obscure and hard to reach, can always be reached via land, road, shipping route, caravan route, or mountain pass, or some combination – something this particular generation doesn’t achieve.

NPCs Moving Around the World Map

Although this is all snazzy and important, the most important thing by far is that all important NPCs now move around the map on their standard schedules. They will not yet appear and spawn if the player enters the same tile, and they are not yet able to be given one-off tasks (“Come together in Parliament for a vote”, “Go to this arena for a fight”, “Present your latest artistic work in front of the King”, etc), but they all correctly make their way around cities and towns, they perform their actions at the right times, they get up and go to sleep, change watches if they’re guards, tend to vegetable gardens if they’re monks, and so on and so on. Now, naturally making sure that the player can physically see this happening is the next step – and a big one – but at any moment in time I can now check what every single important NPC across the world is doing, or in the process of doing, and when they’re going to stop doing that and start doing something else. There isn’t really a nice picture I can put up for this, but it’s happening, and that’s crucial and very exciting.

Next Week?!

The next two weekends are both free for me to focus entirely on coding (as well as ongoing evenings etc), so I’m hoping for a lot of progress. For next week I’ll be continuing to inch forwards on castle generation, hoping to get guards once more changing over their patrol timings with each other, and start to get all the important NPCs spawning when the player steps onto those tiles and being tracked whether abstract or spawned. That’s quite a lot, so we’ll see how it plays out, but I’m very pleased with my speed of development at the moment, particularly considering how many other professional (and personal) commitments I have at the moment. See you next week!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on November 01, 2015, 12:23:18 PM
This is now the fifth post in a row about handling the game’s important NPCs who need to be tracked in the abstract even when the player is nowhere nearby, and need to spawn when the player is nearby, and need to move appropriately when the player leaves map grids, enters them, and does anything else. In the last week I’ve coded it so that the game will correctly match up physically-spawned NPCs with their abstract “copies”, making sure that the right NPCs spawn in the right places; towns in nations with the “isolationist” policy now spawn with town walls, whichI think are *really* excellent and I’m very pleased with how they turned out; towns in internationalist nations also now reflect this preference; I’ve enabled the game’s ability to distribute important NPC information to a small number of a larger group of NPCs (if you read on it’ll be apparent what this means); NPC homes are now identified specifically when the player generates the map grid they live on and I’ve ensured that all abstract schedules now work correctly. In all honesty this is more of an “important NPCs and other stuff” update, but nevertheless there has been enough NPC progress to merit continuing the title. So: read on!

Matching Up NPCs

Now when any important NPC spawns, the game correctly matches them up with their abstract version. In some cases this can be slightly more complex than usual – for instance when spawning a priest in a map grid with a whole bunch of priests, it needs to spawn the right priest, or when spawning a merchant in a market district it needs to correctly choose the merchant who sells the particular type of goods in question (who will be stored in the game’s abstract information, so that they can be referenced at any point even if they haven’t yet been spawned). I know I’ve mentioned this several times in past entries, but I think this time it is *actually* full implemented, at last. There are some classes of NPC who do not yet spawn physically and therefore cannot yet be matched up to their abstract counterparts – for instance lords of towns in vassalage nations, or delegates for parliamentary nations (since I haven’t yet worked out where the heck they live!), but the system can be easily expanded to those when the time comes.

Town Walls and Diasporic Communities

In keeping with my plans to ensure that all ideologies have actual physical effects (akin, this is a blog post in its own right, which will probably appear in the next few weeks) I’ve added in the code for placing walls around the towns which exist in isolationist nations. Depending on the aesthetic preference of each nation – the standard square, circle, octagon, diamond, cross I’m going with at the moment – town walls generate according to a slightly different algorithm, and look quite different once constructed. Here are illustrative examples for each shape (square, diamond, octagon, cross, circle). At some point these will likely gain guards at the gates at the outside, either to check who turns up, or perhaps to charge those wishing to enter depending on economic policies…


Additionally, “Internationalist” civs have the reverse of this, and all of their towns contain what I’m calling diasporic communities. When such a town spawns the game will look for the nearest nation to that town’s nation which the nation actually has diplomatic ties with (so no nations they’re hostile with, and no tribal nations) and will then spawn a few of the houses (and some of the crowd) from that nation instead. Here’s an example of a town which had a community from another feudal nation, but sometimes they might even have a nomadic community living there, which would merit a different brick tile as well as brick colour:



(You’ll see some new shapes and things in the latter picture, which are the new “Barracks” and “Military Base” structures for various ideologies, with (of course) an appropriate shape for the nation in question). I am of course fully aware that this two-colour system is not how these things would look in the real world, but again, recognition/visuals/gameplay > realism in this case, since I want it to be very visually apparent that you’re living in a more varied town than normal. As above, all of this is part of the background objective of this release, which is making the world’s nations even more varied by completely reworking the ideology system. More on this later!

Prisoners, Farmers, Monks, and so forth

There is a particular category of NPCs where you have a number of the same kind of NPC in a grid, but only some of them are “important” and therefore need to be tracked. As I’ve mentioned in a previous entry, a jail might have 80 prisoners, but only 3 of them might be particularly important. The game can now distribute the importance to a random three prisoners, whilst also storing the remaining 77 so that the player cannot leave, return, see which prisoners have “respawned” and thereby deduce which matter and which do not.


All Abstract Schedules Work

This is a small but crucial point – I’ve now confirmed that all abstract schedules work correctly for all important NPCs, and that when the game starts (now fixed to exactly midday on Jan 1st, 1700) they all start off doing the correct job they should be doing. Whether an NPC moves from tile to tile, or always stays within the same map tile, and whether they are exchanging guard duties, tending to vegetable gardens in monasteries, ruling a nation or shopkeeping, all schedules now (as far as I can tell, and with 2000+ important NPCs per world gen, this is tricky) seem to work perfectly. I haven’t had a crash in a long time, and I can look at the important NPCs sitting on any map grid and they all always appear to be doing the correct thing. It is of course possible there’s a bug hidden in here somewhere, but I’m actually feeling very confident about it now. This is a major step towards next week’s objectives (see below) and it feels really good to have it all functioning correctly. I’ve also worked hard on optimizing the time it takes for abstract NPCs to take their moves, particularly when the player is fast-travelling, though this inevitably takes a bit of time; but since the laptop I program on is ancient and garbage, and players won’t be fast-travelling during gameplay anywhere near as often as I’m doing it in testing, I think a tiny pause per step is acceptable (though I will still continue to improve it).

Home Doors

Now, when the player generates any map grid, the game looks over all the important NPCs stored by the game, notes those which have their homex/homey variables on this map tile, then looks over what kind of door they should be living behind – a standard house, a castle, a church, and so forth – and then finds an appropriate door on that map grid and makes that their home door. For buildings with multiple doors (cathedrals etc) it stores all doors in a list of “home doors” rather than just the one. For some NPC types this hasn’t yet been completely handled – inquisitors, sailors and explorers will probably lack any home tile, I’m not yet sure where exactly certain NPCs will spawn and act (e.g. blacksmiths), and so on – but the overwhelming majority now get a set of door tiles attached to them. This also means that once such doors have been assigned, random crowd NPCs will never go through that door. Again, we continue to build towards next week’s objective (see below) of getting all the important NPCs to always act correctly “in person”, as well as in the “abstract”.

Next Week

My plans for the coming week are to begin work on the most challenging part of all: getting spawned NPCs (i.e. those the player can physically see on their map tile) to act according to their abstract behaviours and schedules. This is a huge one, and it will likely take more than a week for the entire thing, but I hope to have significant progress to show in seven days. I’m also probably going to slowly continue work on things like castles and ideologies in the background, and continuing to add to town variation (I need to get manors spawning for “vassalage” nations, and military bases for “standing army” nations, for example), but ensuring identical behaviour for spawned/unspawned NPCs is the core goal for the next couple of weeks. See you then!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: King_of_Baboons on November 01, 2015, 02:14:14 PM
Wait,Im confused,did you removed those walls that block access to other districts just for these town screenshots or do towns no longer have them?
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on November 01, 2015, 10:02:16 PM
Wait,Im confused,did you removed those walls that block access to other districts just for these town screenshots or do towns no longer have them?

Towns have never had them! Only cities have their districts split up; towns are just a single map tile :).
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: King_of_Baboons on November 02, 2015, 12:48:09 PM
Oh nevermind then  ;D
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Aleksanderus on November 04, 2015, 04:48:01 PM
Congratulations developer! I think that this game is going to be more revolutionary than dwarf fortress and will be major roguelike.
Here are the features that I love:
randomly generated history (like in dwarf fortress but much more upgraded)
randomly generated religions are awesome!
randomly generated EVERYTHING!!!

I hope that this roguelike won't waste its potential!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on November 05, 2015, 04:22:02 PM
Congratulations developer! I think that this game is going to be more revolutionary than dwarf fortress and will be major roguelike.
Here are the features that I love:
randomly generated history (like in dwarf fortress but much more upgraded)
randomly generated religions are awesome!
randomly generated EVERYTHING!!!

I hope that this roguelike won't waste its potential!

Well thank you! And I've been developing it for 4 years, and it's somewhere around 50% complete (I think), so rest assured I intend to finish it and have it meet the potential I see :).
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: King_of_Baboons on November 05, 2015, 09:30:49 PM
I've been thinking...how are religion and science going to affect the civilizations?

I know that religion affects pretty much how the citizens act and live and is basically a source of quests but what about science?The only scientific things that exists in the game right now are gunpowder and firearms.What kind of new science stuff are we going to see in the future?I am hoping that science plays a larger role in the future and that the "scientists" give us quests as well.Ex: "I'm in the verge of creating a new medicine!However,I need someone to collect a rare plant that grows in the forests outside the city.Will you help me?" or "I need you to deliver this weapon prototype to the workshop of a friend of mine.".I can imagine scientific cities full of Leonardo da Vinci kind of inventions.

I was also viewing the old NPC chart that you posted some time ago when I saw 2 NPCs that gave some ideas:the Explorer and the Mercenary.How often will explorers and mercenaries leave cities to complete quests/missions?This is interesting because there aren't many roguelikes where we see NPCs doing player stuff.The only exception being Dwarf Fortress,where you can meet actual adventurers roaming the world to kill beasts and looking for artifacts.I'd imagine that if you do enough bad stuff you would start to be hunted by mercenaries looking for your head's bounty.Some sort of anti-players that can do everything you can.

Also what's the deal with the other planets?Is there going to be a commemorative day when the planets align or something?
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on November 06, 2015, 07:50:46 PM
Excellent question! Quick answer: I'm honestly not sure, though I am interested in the Renaissance, the cusp of rationalism, the scientific revolution, etc, as this is the kind of era the game is set in. There will definitely be some nations a little more advanced than others, and possibly a little anachronistically so...

Heh, my inspiration was actually Dark Souls, not DF in that regard, since the other NPCs there spend a lot of time on "their own agendas" and only sometimes happen to intersect with the player. For the time being mercenaries don't actually move around the map, although explorers and inquisitors and one or two other classes will also not have "homes" and be in perpetual motion. And yes, definitely, I want how friendly/hostile you are with each nation/culture/religion to have a serious effect on you :)

Good question! Right now, they're just for detail. I intend to add a possibility for gods to be based on the planets, and possibly PCG constellations which have particular meanings in particular cultures?!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Aleksanderus on November 07, 2015, 07:04:25 PM
I have got features to suggest to you:
1. Ability to become leader of faction and i will tell you how this will work for some factions
Theocracies- when you will serve the ruler long enough he will give you the ultimate task- killing him
And when you will kill him then you are considered as leader of this theocracy and you will be also considered as a "god" of this religion

Uncivilised factions- you will just need to challenge the ruler and defeat him.

And also i wanted to suggest you reputation system and it will work like that:

Your reputation will be represented by (mainly) fame, alignment and proffesion

For example if you are evil but unfamous thug then noone will be scared of you becouse you are not famous but if you will be famous then peasants will run away from you, guards will try to kill you and things like that

And also fame will be:

Local- local people will know your name or not

Kingdom fame- your name will be known in the whole kingdom but it will be imcreasing slower

World fame- your name will be known everywhere but it will increase very slowly and won't increase from small actions

And that's all for now, i hope that this will be implemented
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on November 08, 2015, 01:03:28 PM
Thanks for the ideas! Some of these aren't really in the direction I'm going, but my responses are in bold:

I have got features to suggest to you:
1. Ability to become leader of faction and i will tell you how this will work for some factions
Theocracies- when you will serve the ruler long enough he will give you the ultimate task- killing him
And when you will kill him then you are considered as leader of this theocracy and you will be also considered as a "god" of this religion
I haven't yet decided if the player can wind up ruling factions, but if so, there would be many different methods!

Uncivilised factions- you will just need to challenge the ruler and defeat him.

And also i wanted to suggest you reputation system and it will work like that:

Your reputation will be represented by (mainly) fame, alignment and proffesion

For example if you are evil but unfamous thug then noone will be scared of you becouse you are not famous but if you will be famous then peasants will run away from you, guards will try to kill you and things like that
I certainly intend to have some kind of reputation system, but systems of this sort either tend to be extremely simple or so complex that one doesn't really keep track of them, and struggles to understand what it is that affects your reputation up or down. So I appreciate the suggestions, but I'm probably going to do something a little different!

And also fame will be:

Local- local people will know your name or not
I'm definitely going to program this idea soon!

Kingdom fame- your name will be known in the whole kingdom but it will be imcreasing slower

World fame- your name will be known everywhere but it will increase very slowly and won't increase from small actions
As above, this kind of global/national/local recognition is definitely something I do want to add - probably in a release or two from now?

And that's all for now, i hope that this will be implemented
Thanks for the ideas! There will be more detail on some of these on the blog in due time, but some (like becoming a leader) are probably a bit too sandbox-y for what I have in mind for URR :) 
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on November 08, 2015, 02:27:42 PM
For this week's blog update I did a write-up of the ProcJam opening talks, and normal URRpdates will resume next week...

Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Aleksanderus on November 08, 2015, 05:29:13 PM
Thanks for reply. And also will be there magic in URR? If yes then i think that magic won't be something usuall among people in-game world and i think that it will be used only in the "endgame" (if there will be any) and it will be used not by wizards becouse it would be too easy but it will be used by for example cultists worshipping hell or true gods.

And also will be there avaliable to join factions?
If yes then will it be possible to join evil factions like bandits or cultists?

Another question: how will combat look like. Will it be classic and not complex hitting and missing mechanic or maybe complex and VERY FUN and brutal (which i hope it will look like that) dwarf fortress like combat system?

And last question: why you don't want to make this game very sandboxy? I personaly want this game to be sandboxy becouse i see that there aren't enough good sandbox games in the world.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on November 08, 2015, 08:49:48 PM
Nope, no magic! That has been off the table for years. It's an entirely realistic renaissance world. Factions... well, part of what I'm going for is trying to stress the lack of clear loyalty on the side of the player, so you'll be able to act out belonging. I want to get away from this idea of people magically recognizing you as belonging to a faction, and instead what you wear, how you act, what you say, etc, will determine if people think you're "with them or against them". A lot of what you've asked (I don't mean this as a criticism) is very "traditional" RPG fare, and I'm trying hard to move away from that. Combat - think about a turn-based Dark Souls. Why not sandbox? It's hard to answer that succinctly, as I've been talking about it for years, but there's basically a particular story I want to tell, and a very specific set of themes i want to explore (see http://www.ultimaratioregum.co.uk/game/info/), and those just don't match up with a sandbox, I'm afraid. It's a huge and expansive world, but with a directed player objective!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on November 14, 2015, 11:19:15 AM
As I’ve mentioned a few times in recent entries, I’ve been working on how nations vary and how the game keeps track of the various beliefs of each nation. In the past we had a “policy” system, but that wasn’t really working how I wanted it to, and it was proving rather simplistic, so I’ve made a bunch of major changes, both to how the system works and defines itself, and also to the impact(s) which ideological choices have. Firstly, I decided to change them to “ideologies” instead of “policies” to move them a little bit away from the Civilization-esque model of a policy being something which affects a nation in an abstract way – greater taxation here, reduced freedoms there, etc – and rather use the term ideology to emphasize something which more structural, reproduced throughout the nation, and which has imprinted itself on many aspects of national life. So this week I’ve been working on updating these and in the process adding a huge amount of new variation to the nations in the world, and adjusting NPCs and their behaviour appropriately in the new nations. So, the impacts of ideologies on both the outside world, and the castle in the capital of that nation, are now as follows. I realize lists of this sort have appeared on the blog before, but I’m pretty confident now that this is the final system:

Collective Faith: churches spawn in towns, but not cities.
Organized Religion: churches spawn in lower- and middle-class city districts. Chapel spawns in castle.
Religious Freedom: capital city contains district housing all religious buildings; towns contain no religious buildings. Many small chapels for each religion spawn in castle.
Zealotry: churches spawn in every lower- and middle-class city district and every town. Chapel spawns in castle, and holy books spawn in many rooms.
Monastic: monasteries spawn outside cities. Monk quarters in castle.

Conscription: barracks spawn in towns. Conscript training area in castle.
Standing Army: military bases (larger, and containing barracks and armouries spawn in all towns). Large garrison in castle.
Militia: many citizens carry weapons of some sort.
Pacifism: there is no military district in the capital city.
Vassalage: in towns there are manors instead of village halls, and there are a large number of lesser noble families (beyond those living in the city), each of which controls a town and its surrounding area. Hall filled with banners of lords/nobles spawns in castle.

cartographer shop spawns in market district. Map room spawns in castle.
Isolationist: towns have walls around them. Extra defensive walls spawn around castle.
Internationalist: towns contain diasporic communities from other nations. Foreign tribute room spawns in castle.
Interventionist: Spies and informers spawn in other nations. Secret vault/room with espionage information spawns in castle.
Imperialist: colonies owned by the home nation appear on the world map. Trophy room of captured items from other nations spawns in castle.

biographer shop spawns in market district. Super-rare biographies spawn in castle.
Mathematical: architect shop spawns in market district.
Mechanical: mining shop spawns in market district.
Literary: bookseller shop spawns in market district. Super-rare books (of any sort) spawn in castle.
Antiquarian: historian shop spawns in market district. Super-rare histories spawn in castle.

Representation: parliament spawns in city centre; delegates are assigned to an appropriate mathematical distribution across towns, monasteries, colonies, districts, families, religion, and the military (depending on other ideologies/factors). No throne room spawns, but rich quarters for current elected ruler spawn instead.
Stratocracy: barracks in every housing district. Military-focused throne room with heavy guard spawns in castle.
Monarchy: large graveyards with crypts spawn. Regal throne room spawns in castle.
Theocracy: crypt with archives spawns under cathedral. Throne room with altars and holy texts spawns in castle.

Free Trade: all city districts are free to enter. Well-guarded cache of foreign money spawns in castle.
Mercantilism: cities cost money to enter/exit (and towns if also with isolationist policy), but there is no cost for movement inside.
Planned Economy: each district in a city costs money to move through.
Protectionism: inferior prices for selling foreign goods; increased prices for selling domestic goods. Well-guarded cache of domestic money spawns in castle.
Barter: black markets spawn in lower-class districts and towns.

Hegemony: racial background affects relations with NPCs and other nations.
Aesthetics: jeweller shop spawns in market district. Art gallery spawns in castle.
Venatic: fletcher, bowyer and crossbowyer shops spawn in market district. Hunting trophies are displayed in castle.
Wisdom: linguist shop spawns in market district. Super-rare philosophy books spawn in castle.

bounties for wanted individuals are listed on posters, and may be acquired from a central bounty office in the city centre. Heads on pikes spawn outside castle and/or in castle grounds.
Gladiatorial: arenas spawn, both for entertainment and punishment of criminals. Information about champions spawns in hallway in castle.
Frontier: pistolmaker, riflemaker and powdermaker shops spawn in market district. Rifle armoury spawns in castle.
Ordeal: punishment is by ordeal, the nature of which varies from nation to nation. Torture chamber spawns beneath castle.
Penitentiary: prisons spawn in lower-class districts. Dungeon spawns beneath castle.

The idea here being that these aren’t “abstract” changes, but physical and structural changes that the player should see in each nation they visit, and which in turn will be reflected in the kind of people you meet in each nation, how they behave and talk, and so on. Perhaps one can learn about the ideologies of distant nations in other ways – a book about a nation would only mention a famous fight in an arena if that nation has the gladiatorial ideology, for example, or a painting would only depict a nation invading another if they were (probably) imperialists – and perhaps plan out one’s path around the world, at least in part, based on this; at the same time the player should be able to have a decent idea of what they’ll find in a nation before they set foot there. Here are some examples – some of these already exist in 0.7’s world generation, but some of these variations are very new. We have here a town with walls and various military facilities and a mansion (and no town hall, since a town with a manor is ruled from there instead), a city centre with a parliament, a town with a diasporic community, and a new marketplace of a sort redesigned for the next release:





Many of the ideologies are however smaller in scale – certain shops spawn, or people behave in a certain way, and so forth – and are therefore not quite as easily represented in a nice blog entry screenshot. Equally, I’m also going to add a new set of variations which aren’t really “ideologies”, per se, but rather things like: regular statuary at junctions and alongside roads in cities, gardens in every district, writing everything on tablets instead of books, having developed gas lighting for their streets, and another two-dozen or so ideas I’ve got along these lines (using prayer mats instead of chairs in religious buildings falls into this category of non-ideological variation). Just more and more stuff to be developed slowly but surely in the background to further add to the variation and difference in each nation.

Next week we’ll have a big coding update. It has become apparent that I’ve stacked up quite an impressive list of bugs and issues and small things requiring fixing over the last few months, and I think it is wisest to deal with all of these in the coming week before starting anything new (i.e. getting NPCs moving around correctly according to their abstract schedules in the physical world). It is reaching the point where I just have too many things 95% finished in the next version to really keep track of, so the focus before next weekend is in clearing up and optimizing a huge number of things coded in the past couple of months, in order to free up a bit of cognitive space to then proceed with finishing off NPCs. Equally, apologies for two not-progress-heavy blog posts in a row; coding is going on in the background, but there’s so much on my plate at the moment (full-time research, book proposals, papers, etc) that I’ve been inevitably focusing on smaller coding tasks than larger ones which require serious focus for several days on end. Anyway – see you next week, at which point a bunch of papers and other tasks will have been concluded, and so coding should accelerate once again!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: King_of_Baboons on November 16, 2015, 03:18:46 PM
I would love to do some Assassin's Creed action on that last pic.Looks  like a nice place to do parkour.

Are you planning to do something related with the city/town underground?Like catacombs and secret passages?No better place to hide a conspiracy than your secret basement.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on November 17, 2015, 04:56:35 PM
I would love to do some Assassin's Creed action on that last pic.Looks  like a nice place to do parkour.

Haha, I know what you mean!

Are you planning to do something related with the city/town underground?Like catacombs and secret passages?No better place to hide a conspiracy than your secret basement.


Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on November 23, 2015, 01:52:16 PM
Before I started work on anything important-NPC-related this week, I came to release that I had stacked up a rather worryingly massive list of small bugs, issues, errors to fix, and so forth, which I should really try to round off before developing new, and which I should test extensively to make sure everything is currently stable before I start adding the next section (getting important NPCs to respond to their schedules when spawned near the player, as well as when physically abstracted out). So this week has been a blitz of smaller jobs, and here’s a brief list of some of the changes, bug-fixes, and refinements, some of which are slightly more significant than others and might get slightly more mention in a later entry. Firstly, the actually new stuff, and then the fixes and improvements.

New Stuff

Firstly, in nations with the vassalage ideology, we will now find that towns no longer contain town halls, but instead contain manors, each of which belongs to a specific noble family which rules that town and its surrounding area. These are naturally different in shapes according to the nation, and have some pleasant gardens surrounding them akin to (but smaller than) the gardens in upper class districts. These have three floors just like their larger kin, and now all generate correctly across all three floors. Also, you’ll note that they have clear gardens but they can be a little tricky to see when the colour match – once I redo plant generation and ensure visual variation across the world, this should be much clearer (and the same goes for all other buildings with clear “garden” areas. Here are some examples with the exterior on the left, then the floors from highest (with bedroom) to lowest (for servants/slaves):


Next up, delegates now have identified houses in all possible map grids. What I mean this is that whether a delegate in a democratic nation represents a city district, or a town, or a monastery, or whatever, they will now always have somewhere appropriate to spawn and to live. These are generally houses that stand out from the rest, but are not ordinarily of a higher status than “middle-class” (of the sort shown below). In an upper-class district they get upper-class homes, but everywhere else special middle-class houses will spawn. The one shown below is in a city centre with the “cross” aesthetic preference, and three delegates from the district. I recognize this looks a little artificial, but I’m content with how they look here (given that delegates in various democratic nations in the real world are naturally given special statuses of various sorts). Similarly, everywhere else, houses of this size that stand out will belong to a delegate.


There are now a suitable number of priests in each cathedral, and they know that they sleep there, and so when we move onto getting NPCs to physically follow their abstract schedules (the next major task), they will be able to retreat to their quarters at night when appropriate. The number of priests in the cathedral varies per cathedral, but they will always be found moving around the space and talking to others, or worshiping at the altars, or working at a table, and so forth.


Town halls also now have an interior, and some quarters where the mayor lives (I decided to combine those two roles into one), but as above, in vassalage-y nations there is no town hall and towns are instead ruled by a noble from their manor. Here are a couple of town hall interiors (they are all this kind of “star” shape, since I try to make every building a noteworthy and distinctive shape, and those happen to be a shape I haven’t really used anywhere else yet, and certainly not in towns). The rooms on the ground floors with tables will be where town records spawn once I’ve implemented books/scrolls/tablets/etc.


Training areas now spawn in city centre districts in nations which enjoy gladiatorial combat. This will be the standard “work location” for gladiators on days when there are no fights, and you’ll be able to watch them sparring once weapons get introduced. For the time being I’ll give them the same “meandering” code as NPCs get when they look around memorials or art galleries and the like. Doesn’t look super-exciting right now, I realize, but once it has gladiators training (and maybe things like training dummies?) it’ll be rather more noticeable. The shape of the layout is, of course, determined by the nation’s aesthetic preferences.


Improved/Fixed/Resolved Stuff

- Prevented market districts from spawning too many shops in nations with “forced shops” in their ideological preferences.
- Dealt with a bunch of issues involving sand, snow and ice terrain behaving oddly when certain structures are placed on them (since these are handled differently to “ordinary” land).
- Dealt with an interesting scheduling bug where monks really, really hated tending their vegetable gardens.
- Fixed an issue where guards for inside and outside mints became confused about their roles.
- Increased the colour contrast on prayer mats for certain religions to make them less painful to look at.
- Fixed a weird bug with segments being taken out of corner towers in certain districts.
- Fixed an issue with important guards (which is to say, all guards) not being corrected abstracted and returned when the player leaves their map grid.
- Random crowd NPCs will no longer go into a house that has been assigned as somebody’s home.
- Jailers, Mercenaries, Prisoners, Merchants, Innkeeps and other classes of NPC who generally wander around a given room/floor for most of their ordinary day no longer make a mad sprint for the exit the moment they spawn.
- The roads surrounding barracks, military bases and mansions do not override existing walls when spawned.
- Crowd NPCs in towns with foreign communities now only go into the appropriate houses from their culture when returning “home”, and NPCs from the other civilization present actually spawn and go about their day.
- Jail offices now contain, y’know… office stuff. Chairs and so forth.
- Roads in snow/ice/desert towns no longer sometimes appear at a strangely low z level.
- Towns in snow/ice with at least one edge of water no longer have edges that look strange and flat.
- The inside of monasteries always resembles the exterior, and are therefore no longer sometimes somewhat akin to the TARDIS.
- Houses in middle-class districts can no longer spawn, somewhat incongruously, in the middle of parks.
- Fortresses can no longer spawn on adjacent tiles to towns (I’ve only ever seen this ONCE, and should have been impossible already, but it is now doubly impossible).
- Fountains no longer look like delegates when they’re downhill. No, I don’t understand either.
- The quantum scheduling system no longer causes a crash at map edges.
- Fixed an issue that encouraged NPCs to run in circles in a particular form of middle-class district.
- The sex of NPCs is now chosen before they ever spawn – this allows them to spawn according to cultural preferences (only female priests, only male rulers, either in army, etc) and for people to talk about them with correct pronouns.
- Ensured that smaller upper class houses work again – since implementing something that assigns houses directly to families they had been riddled with bugs.
- Leaves are no longer made out water when they hang over tiles of water…

Next Week’s Stuff

At this point I’d say we’re at around… 80% completion on *everything* to do with NPCs and their AI behaviours (for now). We have crowds spawning, crowds pathfinding in every possible area, crowd demographics for nations and cultures, crowds entering/leaving buildings appropriately, important NPCs being spawned, important NPCs being tracked in the abstract, important NPCs being spawned when the player steps onto the appropriate map grid. All that remains is 1) to get important NPCs, when spawned, acting the same way they do when abstracted out, and therefore moving correctly around the physical maps, and 2) to add in the remaining important NPCs who don’t currently spawn (executioners, chiefs, and the like). Then I need to finish off the remaining clothing types (some of the lower-class clothing, and then all the clothing for nomadic/tribal nations), and finish adding in all the new ideological variation between nations, and then it will be onto castle generation and the conversation system! It’s hard to say what order this will be done in. Finishing off scheduled NPC movement is a very technical task and I like to leave myself clear periods of a day or two to work on that kind of thing – but I’m full-time employed now and I’m busy next weekend and the weekend after. As such, I’m probably going to focus on Everything Else for the next fortnight or so, and then come back to NPC scheduling to finish off the calendar year with. Therefore, I would guess that next week we’ll have my continued purging of the bugs and glitches I’ve stacked up (since only around 50% of the issues on the list have been resolved this week) and work on clothes, castles, or both. See you all then!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: King_of_Baboons on November 29, 2015, 05:21:44 PM
Cities and towns really need one of those,man:


Big open markets full of cheap and bootleg stuff for you to buy when you're short on money.Also a great place for you to get easy food.

Also, for curiosity, are NPCs and maybe the player going to be able to have some sort of disability?Like a disease or a physical thing like dwarfism?Really think that there should be a town suffering with a plague or something.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on November 29, 2015, 10:27:45 PM
Markets: ah, I have two solutions to this. Firstly, nomads tend to have open-air markets, but I wanted to keep markets in feudal nations more "closed". I recognize this is a slightly arbitrary distinction, but I've found that procedural generation becomes far more memorable when you draw clear lines between things instead of allowing things to merge and blur into one another. Secondly, there will be black markets in feudal nations, which will probably be more like the picture you've sent, but I haven't actually decided how these will work yet! That's probably for 0.9 (working frantically on 0.8 now)

Disability/disease/etc: oh yeah, I definitely want to implement diseases and plagues, and various biological differences, and in some nations assign these (dwarfism, leprosy, eunuchs, etc) particular social noteworthiness in some way.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Avagart on November 30, 2015, 05:09:53 PM
Sorry for this 'it's just a question', but... Can we expect URR 0.8 in this year, or 2016 is more likely?
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on December 01, 2015, 08:53:10 PM
Sorry for this 'it's just a question', but... Can we expect URR 0.8 in this year, or 2016 is more likely?

Sadly, it's going to be 2016. I hope to have NPCs completely finished in December (a tall order, but I think it can be done), but I don't want to release a world full of NPCs you can't do anything with, so I'm going to save it up for a huge release and add in the conversation system as well. I've pondered this long and hard and taken opinions from fans, and I'm now confident that this is the right choice.


This week's update!

This week I’ve been continuing my plan of trying to finish Everything Else in the lead-up to finishing NPC scheduling and the like, so there have been four major developments. Firstly, a significant change to how delegates are represented in democratic nations, which is far more interesting and far more distinctive; secondly more progress on generating castles, which I will probably unveil in a fortnight, though conceivably in just a week, depending on how things play out; thirdly I’ve redone the sigils for lesser houses, and they look vastly better; and lastly a range of other general bug fixes, optimizations and general improvements which continue to clear out my list of unresolved problems, hopefully resulting in a stable game in which I can then return to working on NPCs. My goal remains to have Everything Except Conversations done by the end of December – it’s a big target, but I think it can just about be reached. Read on!


I decided to return to what I mentioned last week about giving delegates special homes and make this a little bit more detailed and a bit more interesting. I’m always looking for things that make each civilization distinctive, and doing this for democratic nations in a little more detail was something that quite appealed. Therefore, in each possible delegate location, there is a different kind of housing. The diagram below shows this – the top row are for “district” delegates, and the bottom row for “other” kinds of delegates (who might of course be resident within a district, but the game counts them differently). Middle-class districts use standard middle-class district houses (but gives them flags outside) just as upper-class districts use standard upper-class houses (again, with flags outside to denote that they are special), whilst aside from those every other area does something slightly special to denote the housing assigned to democratic delegates (all have flags outside). Here’s the full set:

Huge image, so linked it instead: http://www.ultimaratioregum.co.uk/game/files/2015/11/All-delegates1.png

These are, I think, pretty identifiable, and are another way to mark out differences between nations. It will also make it clear where delegates live, which might have use a little further down the line. The most challenging of these was for the “Bank” delegates who might live within the mint, and the “Religion” delegates who live within religious buildings, since those required me to return to buildings whose generation algorithms I thought I had entirely finished with, and add something new. With that said, though, I’m really happy with how all of these turned out, and they continue to add a little more depth to the more democratic of nations, and variation within democratic nations (since each nation distributes its delegates differently – one nation might have religious delegates and bank ones, another might have monastery and farm delegates, and so forth).


This week I’ve done a fair bit of preparatory work on castles. As I mentioned, I’ve been away this weekend, and will be away next weekend, but I’ve still had (and will have next week) a couple hours at the end of each day spare to get some coding done. As such I’ve tried to give myself something that doesn’t require sitting down and doing a huge amount of technical effort (since I like to focus on that kind of thing for long periods) but rather something creative which is primarily down to creating variations and having them generate correctly. As such, prior to this weekend I set up the system for the exterior generation of castles – they now generate according to national aesthetics, and of a size appropriate to the number of rooms they need to contain, and with various other things outside based on policies (severed heads on pikes, extra defences, homes for delegates, etc). This weekend and next weekend I started to work on their interior generation, which is complex and time-consuming but will look extremely exciting once concluded. I don’t think by next week’s blog entry I’ll have enough to properly show off a castle, but the week after that I suspect will be the big “castle generation” entry I’ve been working on for a while (I’m extremely pleased with how castles are coming together). In the mean time, here’s another little castle teaser:



Given that I wasn’t happy with them before – and everyone who commented seemed, generally, to agree – I’ve changed the “lesser house” sigils for nations that have them to something that looks way better than the previous set. There are now 15 unique ones for each shape aesthetic that are far superior to the previous set. Here are some examples:

Again, huge image: http://www.ultimaratioregum.co.uk/game/files/2015/11/Newminors.png

Fixes, Improvements, Minor Changes

- Vases now only spawn for religions, not upper-class families; I didn’t want to allow the colour clashing between a nation’s colours and those of the vases (which have their own large set of nice-looking presets). Since I want more and more to be tethered to national flag colour-schemes in the future (armour, books, etc), I thought this potential slight ambiguity should be taken out. (Admittedly incense stands and vases both don’t match with religious colour sets, but that’s because they look terrible if I try to force that upon them, so we just have to accept that and move on, and besides, they are more “decorative” than an integral part of the religion – like altars, vestments, etc)
- Fixed a few minor problems with certain river generation possibilities in middle-class city districts.
- Fixed a problem where the orientation of Officers’ Quarters did not transfer correctly from their exterior to their interior
- Stopped servants/slaves getting stuck in gates…
- Ensured that all the new aesthetic-based road layouts still keep all relevant NPCs pathfinding correctly
- Other stuff I failed to note down whilst writing this entry!


This week I want to continue castle generation, continue working through the list of small things and required fixes, and move closer to having everything except conversations and spawned-NPC scheduling done; then do spawned-NPC scheduling; then move onto conversations. I’ve decided I am definitely going to go for a big release, so I’ll be moving onto the conversation system as soon as January swings around. The majority of people voted in this direction, but I hope this is ok with everyone. I don’t want to release a world full of NPCs you can’t engage with, and although I don’t want people to drift away with the length of the release (hopefully constant blogging prevents this!) I do now quite strongly think it’s the right idea and will be a very impressive, and very comprehensive, release. As above, my target is to finish everything except conversations by the end of the calendar year, for which I have a month left. Yikes. See you next week!

(Next week’s update will also be a late Sunday/early morning, but after that, we’ll be back to the normal Saturday/Sunday updates)
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on December 07, 2015, 11:52:02 PM
First, before anything else, I received some incredibly exciting news in my email inbox this week about the Secret Project I’ve mentioned a few times. Once the contract is actually signed – a phrase that itself perhaps gives a few hints – I’ll post what’s actually happening, but I’m very confident in saying it’ll be to the interest of every single URR follower. I’m hugely excited – it’s my first step into a very exciting and important area of my professional life as both a games academic and a game designer and I can’t wait to start talking about it! More soon.

Now, onto this weeks’ update. This week I’ve continued the great bug purge and I’ve dealt with a massive volume of bugs, even with most of Saturday and Sunday being lost to other commitments. At this point I’ve got through a good 70% of the bugs that have accumulated in the last few months (although new ones begin to bubble up from my quagmire of code), so by the end of the next fortnight I would expect to have them all done along with castle generation, and I can hen finish off clothing generation and conclude pathfinding and AI scheduling behaviour. I’m still aiming to have all of this done by the end of December, which remains in the category of “difficult but not impossible”, so we’ll see how it goes. Here’s a complete list of issues resolved this week:

Bugs, Glitches, Improvements

- Fixed a few minor errors with delegate generation in democratic nations and ensured they are always distributed correctly.
- The basement vaults and the upper-floor delegate quarters in Mints that have delegates present are no longer mysteriously switched around.
- Ensured that small officers’ quarters (spawning in military bases in towns) always generate correctly on the inside, and don’t sometimes appear devoid of all furniture.
- All delegate houses can now be entered, and look distinct on the inside from standard middle-class housing (they have ornate flooring instead of wooden flooring)
- A major issue where you could sometimes see through church walls has been fixed!
- A minor issue with rivers in middle-class districts sometimes being smaller than they should be depending on the placement of district gates has been resolved.
- Castle generation is now appropriately affected if a river goes through the district.
- Sometimes closed doors were not opaque and sometimes open doors were; this has now been permanently fixed.
- In lower-class districts buildings can only be placed either in areas without road tiles, or on standard rather than special road tiles, in order to prevent some weird AI behaviour when roads surrounding buildings meshed with special road tiles.
- A minor issue in middle-class districts where special roads were given priority over standard roads (it would take a while to explain what this meant) at certain points, and was producing weird AI behaviour; again, as above, this is now resolved.
- When you load the game, it no longer mysteriously advances one turn.
- Religious symbols actually blend correctly on prayer mats instead of blending in a slightly peculiar way.
- People who spawn in groups now actually have clothes…
- Doors to delegate homes no longer glitch out weirdly.
- Fixed a weird issue where mountains that spawn rivers could no longer spawn them correctly; I think this was a result of some under-the-hood changes to storing world data a little while back.
- Fixed a weird issue with religious buildings that have additional corner branches instead of “side” branches, wherein they were not generating perfectly on the inside (this was a small error I suspect nobody else even spotted, but it was bothering me).
- Fixed a bug where a few orientations of delegate housing in city centres spawned houses that were actually too small to correctly generate an interior!
- Sorted out an issue where town walls in isolationist nations would sometimes stretch to the map edge and make it impossible to enter without leaving the map grid and then going back inside at the right “angle”.
- Ensured that smaller middle-class houses have more room partitions on the inside and look rather less empty and bleak.
- Dealt with a final remaining issue with middle-class houses where the interiors were, STILL, sometimes slightly too large.
- Resolved the final few issues with Mints re: the number of guards that spawn inside them, thereby making sure there are never now too many guards or too few and spawned guards can always match up correctly with their abstract counterparts.

Next Time

This coming fortnight I’ll be handling all remaining accumulated bugs from the last ~6 months of development (that weren’t dealt with in the past fortnight) and finishing off castle generation. My expectation is that the update on the 12th/13th will be castle generation, then 19th/20th will be the final bugfixing/improvement entry, then 26th/27th will be clothing, and then 2nd/3rd of January should be the conclusion of all remaining pathfinding/scheduling developments. After that we’ll be moving towards the conversation system, which is beginning to take quite a solid form in my mind. See you all next week for, I hope, castle generation! It’s looking extremely impressive and I think you’ll all be very happy with how it looks. You’ll even be able to walk along the battlements (if you can find your way up there)!

Also next week will have pictures. Dozens of awesome procedurally-generated castle pictures.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on December 13, 2015, 09:03:50 PM

At long last, castles are generating, and you will be able to visit them in this release!

So get some food and drink, relax, put your feet up, and sit back for a detailed exploration of how castles are going to generate, what you’re going to find inside them, what the player will be able to do there, how you’ll gain access, who you’ll find living there, and so on.

Firstly – castles are one of the only two districts which are barred to player entry in the current version of the game (the other being dockyard districts). I tried a few early models of castle generation in the present release but just couldn’t find something which worked relatively quickly, generated them in the detail I wanted, and ensured that they were aesthetically consistent with the rest of the nation – not to mention that I was redoing how all the ideologies work and I wasn’t quite sure how these were going to tie in (more on this below). So I decided to leave them until this release, and now that NPCs are almost “done” and the majority of the bugs created over the last few months have dealt with, I realized the time had come to implement castles.


What goes into a castle? Castles are located in cities and take up a full district in that city. As I’ve talked about before, policies/ideologies have been completely reworked to provide physical and structural changes to each nation, rather than more abstract things. Therefore, the “Zealotry” ideology has religious buildings spawn in all city districts; the “Conscription” ideology places a barracks in every town; the “Isolationist” ideology creates city walls; “Theocracy” always ensures a crypt beneath a cathedral; and so on. I’ve now extended this system to castles, meaning that the rooms you find inside each castle (aside from the standard halls, guard quarters, etc) are entirely dependent on the ideologies of that nation, and forms a kind of microcosm which reflects the city around it (and all the people in that nation, and its towns and settlements, and its citizens, and so forth).


So, a Monastic nation will have some monks resident in the castle, a Vassalage nation will have a hallway depicting the banners and armour of all its important houses and families, an Imperialist nation will have a room filled with trophies from past conquests, a nation which cares about Aesthetics will have an art gallery within the castle, one which believes in a Penitentiary justice system will have a dungeon, and so on. This therefore means that each castle can have a range of special rooms, from the smallest possible number of two (I think!) for a nation where almost none of its polices necessitate special rooms, to a grand total of sixteen rooms for a nation which happens to have chosen ideologies which necessitate something special (and everything in-between). As ever I wanted castles to reflect the aesthetic/geometric preferences of each nation (square, octagon, circle, diamond, cross) and also, of course, to actually look like a castle on the outside with walls, moats, and so forth. This leaves us with a “two part” castle system – generating the outside of the castle which is the “district” of the city, so to speak, and then generating the inside of the castle.


Here we have an example of a “castle district”. In the design of this generator I wanted to accomplish several things. Firstly it should look defended, aside from the city walls which interpenetrate each city and delimit one district from another. This means walls and/or moats depending on the particular policies of that nation. Secondly, it should fit with the rest of the nation: this obviously means the usual consistency in brick colour, but also in shape, so we see here the castle for a octagon nation (and there will be others shown elsewhere in this entry), and the moat and the walls both clearly reflect this aesthetic preference. Thirdly, of course, it needs to fill up the district – splitting cities into square districts is an acquiescence to various gameplay and technical requirements or decisions, and trying to get a singe building to fill up an entire district just wouldn’t work (cathedrals in city centres, for example, are massive, but only take up around 1/4 of the district at most). Therefore, what else do castles often have? Well, castles (and stately homes/mansions/manors more generally) often have expansive gardens, so I decided to take a leaf from the mansion generation system and add some rather snazzy gardens into the mix as well, behind the walls (these will have more detail once I redo plants in some later release). Some more of the district is then “taken up” by adding small shape-appropriate towers into the external wall of the district as well as the internal; I think this makes quite a nice visual effect, and helps the districts with smaller castles (as castles can vary in size depending on how many ideology-dependent rooms spawn within them) feel a little less empty and devoid. Ultimately it is tricky making the entire district full via a single building, and there is more variation I want to add in the future, but I think it’s working well enough for the time being (as there will also have guards on patrol and so forth to add more detail). Here’s another example for a cross nation:


We then come to handling the inside of a castle. As above, there is a significant range of possible rooms, *and* each possible room has its own layout, and these need to somehow be shoved correctly into a castle of a particular shape and size. Suffice to say, this is no easy programming task, but the game can now select from a range of preset “starting points” for castles, and then split and subdivide rooms in a number of ways, and then add in the special rooms (and the ordinarily rooms) in sensible locations, and do this for any number of shapes, sizes and permutations of important rooms. Like most of the most complex generators in the game this is a mix of PCG, handmade regions, and large databases of areas that are somewhere between the handmade and the procedural. This system took the best part of a week’s coding to complete, but now it works (I think!) for any value (within the scope of possible values). Castles always contain a great hall and guard quarters (and/or soldier quarters depending on ideologies) which are positioned in the parapets/towers surrounding the castle. All castles then contain a range of studies, dining rooms, bedrooms on their upper floors, and so forth, and then a throne room situated somewhere on the ground floor, although the precise nature and position of this throne room varies for democratic/ theocratic/ stratocratic/ monarchic nations. Alongside these are all the ideology-determined rooms, of which there are dozens. Rooms that might otherwise be similar – like quarters for monks, servants, soldiers, etc (how many ways can you make a room with a bunch of bed distinct??) – always have some variations, so they might have different floors, or different extra furniture, and so forth, so every kind of room will be distinctive. Also – you see those rooms below with just tables in? Those will soon contain books, maps, trophies of battle, tributes from weaker nations, etc, but for now,they’re just tables! So, here are two examples of what the bottom-floor interior of a castle might look like, taken from an octagonal castle and a cross castle:




Naturally, not all castles have an “open” interior section that leads back outside, it just so happened that the two I generated for this entry did! More important rooms means a larger castle and a lower chance of an open inside. Similarly, there are various things that can appear in corridors – banners showing the coats of arms of vassal houses, holy books on pedastals, placards noting arena champions, and various other things – but I haven’t quite got around to adding those in yet at time of writing (but they won’t take more than a few hours at most). Similarly, see the odd empty room? Those will be money caches soon. Also, if you see some unknown symbols… well, you’ll have to explore some castles to find out what those are! Next we also have some top floors, containing the master bedroom for the ruler (and potential space for a harem, or consorts, or multiple partners, if the civilization in question goes in for that), then various bedrooms for the various offspring of the ruler, guests, and so forth, again with a nice lot of variation for different shapes and sizes of castle – these are of course rather similar to the ornate quarters in mansions in officer quarters in military districts, but there is only so much variation one can give to a bedroom. There are also the upper floors of each tower on each side, which lead out onto the roof! I’ll get pictures of these up at a later date as I’m still finishing them off, but you’ve no doubt seen the bedrooms in URR’s mansions, for instance, so you get the basic idea. There are also various rooms that spawn underground too, and various secret rooms as well…

What about the castle’s inhabitants? Well, naturally we’ll have the ruler; we’ll have any assistants, clerks, eunuchs, partners/consorts, and so forth; potentially priests and monks if the ideologies suit it; lots of guards and soldiers, though again their number and placement vary for various reasons; servants and/or slaves; and any guests, though I’m not quite sure what guests we’ll have visiting rulers. The rulers will of course sometimes leave the castle to preside over parliament, meet foreign dignitaries, and that kind of thing, but that’s in the future. What about access? I’m not going to implement the key/permission system in this release, since most of the things that will be later required to gain access to areas aren’t implemented yet anyway! You’ll remain free to wander around the world for the time being and meet the people there and talk to them, but it won’t be too long until you’ll need the appropriate keys and permissions to gain access to the most important areas; for now, therefore, guards will let you wander.

So there we have it. Castles are now, I would say, as detailed and interesting as cathedrals, which certainly makes a lot of sense – these should be the two most impressive structures in the world (although I have an idea for some special massive buildings in the future, like rare one-off huge prisons, or asylums, or arenas, and so forth). Here’s a comparison pic of a generated castle and a generated cathedral (the two largest structures you can find) to give you a good idea of the similarities and differences. I’m immensely pleased with how these now look and I hope you like them too!


Next week I’ll probably post about the final removal of (hopefully) all remaining bugs, at which point I would hope that the game will be stable, or at least as stable as a massive release of this sort can possibly be because major wide-ranging playtesting by a community rather than an individual. Then, hopefully, I can finish off AI/pathfinding and clothing stuff before the end of the year. It remains a hugely audacious goal – I need to get all nomadic clothing and tribal clothing generated, and get every single NPC scheduling and pathfinding correctly on the “human” rather than abstract scale – but I… think it can be done before the end of December. See you all in seven days!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Avagart on December 14, 2015, 12:50:20 AM
So. Fucking. Awesome. I know that URR is closed source, but can you please write more detailed technical info? Not as what did you do, rather how did you do this. I'm very interested in this topic, because... I just see it and I can't imagine how is possible that these castles are not premades.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on December 14, 2015, 09:20:59 PM
So. Fucking. Awesome. I know that URR is closed source, but can you please write more detailed technical info? Not as what did you do, rather how did you do this. I'm very interested in this topic, because... I just see it and I can't imagine how is possible that these castles are not premades.

Haha, why thank you. More technical info... sure, I'll add a tad, cross-posted from my blog where I just answered a similar question. The corridor placement is the most handmade part of it; there is a little procedurality, but most of the corridor layout system draws upon a large database. Then there are many many layers which offer various rooms, various walls, various items/structures/features, various layouts, and these are interposed and combined and spawned and ignored based on both the generator per se, and the inputs (the national culture) put into the generator. I’ve spoken before about things on URR being on a scale from “lots of handmade versions with small PCG elements” (e.g. mansions or hunter-gatherer encampments) to “almost total PCG with minor handmade aspects” (e.g. cathedrals or city districts); if the former is 0, and the latter 10, castles are somewhere around…. 7 or 8? So very PCG heavy but also with some combining of huge databases of elements I made myself. And - this will sound trite, but it is true - never underestimate the power of inverting or rotating things to add variety, especially where the shapes and structures are so complex (and vary in so many other ways) that the player is never going to notice!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Avagart on December 15, 2015, 10:07:01 PM
Thank you for response :) It means that every of your handmade elements fits to each other (in range of type of site)? Or just list of elements are filtered by compatibility?
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on December 16, 2015, 10:15:18 AM
Thank you for response :) It means that every of your handmade elements fits to each other (in range of type of site)? Or just list of elements are filtered by compatibility?

Er... a combination! Each handmade element also varies in each generation, so there might be an element with a particular kind of room, but the parts that do spawn, don't spawn, and how they spawn, will vary. They are fitted into each other, and filtered, and then varies in each iteration.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: TheCreator on December 16, 2015, 12:15:06 PM
These look more like table napkins than castles to me, but still your procedural generation skills are truly impressive :).
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on December 16, 2015, 08:04:33 PM
These look more like table napkins than castles to me, but still your procedural generation skills are truly impressive :).

Ha! That made me laugh. But thanks anyway :)
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Tzan on December 16, 2015, 11:43:10 PM
The first 4 at the top.
I saw them, then immediately thought, Oh nice rugs!   :)
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on December 17, 2015, 10:37:29 AM
The first 4 at the top.
I saw them, then immediately thought, Oh nice rugs!   :)

Rugs, napkins, whatever next?!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Avagart on December 17, 2015, 05:54:41 PM
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on December 17, 2015, 11:57:49 PM

Working on it already!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on December 19, 2015, 11:24:21 AM
Not technically fully a URR entry, but very relevant - for this week's blog entry here's that Secret Project I've been talking about recently. Enjoy!

Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on December 26, 2015, 03:34:56 PM
2015 in Review! URR and a million other things:

Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Aleksanderus on December 27, 2015, 11:38:03 AM
When will be combat implemented? Will it be v 0.11?
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on December 28, 2015, 09:55:40 PM
When will be combat implemented? Will it be v 0.11?

It's really not a priority; unlike lots of games that have combat as the "default" mode of gameplay and other things (stealth, conversation, etc) as being more unusual, I want to invert that; I want combat to a rare and highly advanced form of gameplay for only the most experienced players, all of which means it isn't urgent! But hopefully 2017 :).
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on January 02, 2016, 03:25:55 PM
This week's update is all bug-fixing, then we'll be back to new stuff (AI development, clothing, pathfinding) from next week onwards!

Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on January 18, 2016, 06:18:50 PM
For the last fortnight I’ve been working extremely hard on AI pathfinding and scheduling. It has been massively challenging – after two days searching for the conclusion to a single bug, only to discover that it was a single word misspelled in the 5000+ lines of AI behaviour code, something broke within me, and I need to take a break from the damned thing! So, for the last couple of days I’ve gone back to clothes and churned out all the remaining clothing for 0.8, and I feel intellectually rested enough to return to facing AI in the coming week. But back to clothing: nomads now have generated clothing, and tribal nations do as well, and these therefore now accompany the feudal clothing and the religious clothing styles that we have seen before. This entry will therefore talk about the nomadic clothing generation, the tribal clothing generation, and also small additions to feudal clothing to handle both lower-class and rulership-class variations in those clothing styles. With this done, almost all the graphics required for 0.8 are done, and it’s still just the pathfinding/scheduling stuff for important NPCs that needs finishing (as I say, I’m working hard on this in all my spare time at the moment, but it’s a huge task and by far the most intellectually challenging thing I’ve ever coded, without doubt). Anyway:

Nomadic Clothing

For nomadic clothing I wanted something fairly practical and rough-and-ready, but still visually interesting and distinctive, and something “modular”. The feudal clothing is less modular, in many ways, as there are clear archetypes that clothing will appear as a subset of, whereas for nomadic clothing I wanted to design it from the get-go to have more combinations – which is viable (unlike feudal) because it is a little less ornate, more pragmatic, and because you’ll simply see less of it in the average game, so you don’t have to “force in” quite as much variation in a single world generation. Each clothing generation selects three colour schemes, consisting of a plain colour (generally white, grey, some kind of pale brown), a pair of rich colours based on the flag of that nation (e.g. pink and purple, red and orange, blue and cyan, etc) and then a lighter version of the combination of those two colours (so a violet and red flag might wind up with a pale magenta as the third colour). Nomadic clothing is similar to the “robe” archetypes for feudal clothing, i.e. it takes up both the upper- and lower-body clothing slots when worn (unlike tribal clothing, as below) and consists of five layers – clothing shape, pattern shape, pattern pattern (you’ll get what I mean when you look at them), strap locations, and strap pattern, all combined with the various colour sets as described above. Here are some examples with illustrative flags that might be associated with the same nations, so you can see the colour-scheme similarity:


I’m really happy with how these came out! As you can see there, rather than two ranks – “normal” and “ruler” – that we have in the tribal clothes you’ll see below, there are three ranks here, each rank gaining an extra stripe. I actually really like this system as another visual way to denote rank within a single civilization. So, for example, normal people in a nomadic civilization get one stripe, people like merchants or caravan leaders or the ruler’s family and the like get two, whilst the ruler will be the only person to get three stripes. You’ll also notice the background fabric of these is simpler than the tribal clothing below; as above, I felt nomads should be a little more utilitarian than tribal people, and I thought the large blocks of colour on some of the nomadic designs actually worked really well, so I decided that I didn’t need to add in any more detail in that regard. Also, nomadic boots  – quite a bit simpler than feudal ones, but distinctive and a little more colourful (as the clolthing styles of many real-world nomadic peoples often are), so I’m pleased with how these look (also, feudal ones tend to be more vertical whilst these flare out at the top more, which for some reason makes complete sense to me for nomadic footwear). The little buckle shape reflects the shape preference of the nomadic nation.


Tribal Clothing

Tribal clothing proved extremely challenging. From the get-go I’ve tried to emphasize relativism in URR, a lack of technological determinism, and so forth, but it is tricky to create “tribal” clothing styles that are intriguing and interesting, without them appearing “primitive”, but still acknowledging that a tiny (or at least, small) tribal nation will not have the technologies of their colossal feudal neighbour, for example. I also, of course, needed them to look very different from feudal and religious clothing, whilst still having enough variety that the clothing of one “tribe” will look nothing like another. After a lot of thought and several full days of trial and error, I’m very happy with the system I came up with. When I was doing the research for these styles I tried to find as many styles of dress used by ancient people that didn’t necessary look “primitive”, and that looked nice and varied. I looked for things like ancient Mesoamerican dress, ancient Egyptian clothing styles, and so forth, whilst accessories (necklaces, bracelets, etc) will appear in later releases. In the end I wound up with ten total possible “styles”, and three rankings of the technological sophistication of the tribal nation. For those with the greatest tailors you get something like the “high” one below – a thick background colour and lines running down it; for those with middling clothing technology (if there is such a thing) get a pale background with a coloured pattern and running lines, whilst “low” technology clothing has no lines and pale/dark pattern. You’ll also note the pattern becomes less dense each time – there are no tiles between the pattern in the left-most, a one-tile gap in the middle, and a two-til gap on the right. I also, of course, had to think about leadership signifiers. Just like religions use silver and gold thread to denote high rank (abbots, inquisitors, archivists, etc) and the highest possible rank (popes etc), and feudal nations will use gold thread for their rulers (see below), there are various signifiers of a leadership position in these clothes. They either have a number of patterned “discs” hanging on their front; a pattern down the middle of their clothing; or a bar that rests in the centre of their torso (the patterns on all of these also, of course, vary).


And here we have various lower-body permutations, which will be similar in colour and graphics to the above set (the colour is always dependent on the flag of the tribal nation in question, as with nomadic clothes). These were far, far trickier to create than the upper-body tribal garments (although that was also the case for feudal clothing) but I’m happy with what I’ve come up with, most of which are (broadly speaking) kinds of skirts/gowns. As above, the most technologically advanced tribal nations have their colours inverted for someone that looks much richer, whilst each rank creates background double-line patterns that get denser as you go up in technical ability. As with the upper body clothing, there are equivalent variations for lower-body, so when you view a Chieftain, for example, both their upper- and lower-body clothes will be very distinctive with the appropriate leadership signifier. Naturally in all of these pictures any shape could be of any technical level – to reiterate,the high/mid/low distinction only applies to the detail and complexity of the background pattern on the piece of clothing.


I also in the process of creating these figured out how I actually want tribal nations to function in the game, at long last! More on this much later when I get around to it, but suffice to say the existing tribal nations are very un-varied, and adhere to very comparable “technological levels”, and it would be far more interesting to create nations that might resemble the Mayans, or Babylonians, or Hittites, or Aztecs, or ancient Egyptians, and so forth. I’d like to expand “tribal” nations to mean more than just what we would now call tribal nations, but rather to encompass civilizations that are smaller and more self-contained and inward-looking, but vary vastly more than those currently spawning in the current version. Either way, this is a future project, but I’ve already had some very interesting ideas for how this could work. Oh, yes, and as for shoes, tribes either go barefoot or have some fairly simple sandal-type shoes, which I haven’t got around to making yet, but I’ll throw those together on a spare day sometime before release.

Class and Clothing

I’ve returned to the highest and lowest class statuses for standard feudal clothing. I didn’t want to create a special clothing set just for rulers because the player will so rarely ever encounter them (although rulers do get unique crowns and unique thrones!), but I wanted something to mark out “ruler clothing” from “upper class clothing”, so I’ve gone with a similar model to the “pope clothing” of adding a special colour of highlights to upper class clothes. Therefore, “ruler clothing” now looks like this, with some nice gold/orange/white trim which varies depending on the other colours of the clothing (however, if the ruler is of a theocracy and therefore also a pope/godking/archcleric/whatever, they default to the religious clothing). Examples:


Meanwhile, lower-class clothing wasn’t looking particularly impressive and needed a significant overhaul, since there is only so much brown one can look at. I tried to build up a decent library of “standard” colours that wouldn’t require any kind of serious wealth – whites, greys, browns, etc – and then I’ve tried to actually make them interesting (though I admit, this was tricky). Here are some instances of lower-class clothing types with the upper/middle equivalents for the same nation next to them:


There is still one final thing to do for the lowest-class clothing, which is to make certain archetypes even less ornate (though you can see that the buttons are smaller, the belts less patterned, etc), because the 1st and 2nd on that list, for example, are still a bit too snazzy. Although, with that said, I don’t want to make the most common kind of clothing too uninteresting to look at, so there’s a balance to be found between realism and variety. I’ve also made the variety of colours possible for lower-class clothing significantly greater than it originally was, and hopefully you can see that in the left-most column. I’ll update this image later in the week once I reduce the complexity of some of the designs!

Final Clothing Thoughts

I’m extremely pleased with how different all four forms of clothing are. I feel confident saying that although the styles within each vary very significantly, it’ll always be fairly apparent when looking at an unknown person’s clothing whether they are wearing feudal, nomadic, tribal or religious clothing (and the armour sets I intend to develop later this year will obviously be highly distinct again). Here’s a rather nice image of some compiled generated clothing which illustrates this point better than I can, and shows very nicely the massive range of clothing you can now find on all the people you meet in the world(s) of URR:

Very large image: http://www.ultimaratioregum.co.uk/game/files/2016/01/Hoi2-5.png

Next Up?

I’m very happy with how these are all looking, and with these finished all clothing except armour is done (though armour won’t appear until 0.9) so we’re done with clothing for now (at a later date I will also add gloves, necklaces, rings, crowns, etc – I am really looking forward to crown generation – but not for 0.8, and probably not 0.9). I’m now turning back to pathfinding and scheduling for the third week of work, and we’ll have a large update on this in a week’s time… hopefully with it completed, but we’ll see how it goes. The task remains massive, complex and challenging, and although I’m making progress, it’s a long way from done. If I don’t think enough scheduling and pathfinding is done by next week, I’ll probably post an interim update on some of the other small additions and changes I’ve been implementing into 0.8. Either way: see you then!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Krice on January 18, 2016, 10:32:25 PM
Is there any gameplay whatsoever in this project? I think (and also now know) that everything else should be built around the gameplay and rpg system. There is no other way to know whether you actually need all that stuff or is it just a waste of time to design it.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on January 18, 2016, 11:23:10 PM
Well, in the copy on my laptop which is the upcoming version - yes, a significant amount. But the nature of the intended gameplay necessitates massive world detail before anything can be done, since I'm not really making an RPG in the traditional stats-and-numbers sense. It'll all come together soon enough.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: chiguireitor on January 20, 2016, 08:07:38 PM
Well, in the copy on my laptop which is the upcoming version...

Please, tell me you have backups :) Btw, i should be doing some backups, brb....
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Avagart on January 20, 2016, 08:56:54 PM
Why don't use revision control?
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: chiguireitor on January 21, 2016, 02:23:02 AM
I use GIT... however, as i'm old fashioned, i like me some backups too :D
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: TheCreator on January 21, 2016, 12:17:01 PM
Revision control helps a lot when programmer's creativity goes too far, but it is good to backup the repository as well. I do it every week (which means once every 2 lines of code I write :D).
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on January 21, 2016, 01:24:14 PM
Ha, don't worry, I back up religiously every evening :). Losing nine months of work would be... painful.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Krice on January 21, 2016, 10:57:57 PM
since I'm not really making an RPG in the traditional stats-and-numbers sense.

You are not making a game?
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Avagart on January 22, 2016, 12:05:22 AM
Your Teemu isn't the game?
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Krice on January 22, 2016, 08:22:25 AM
Your Teemu isn't the game?

It's a game, thanks for your concern.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on January 22, 2016, 04:13:05 PM
since I'm not really making an RPG in the traditional stats-and-numbers sense.

You are not making a game?

I'm not making a traditional stats-and-numbers RPG, no. I'm doing something quite different (and have been for a few years!).
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Krice on January 22, 2016, 05:36:38 PM
I'm not making a traditional stats-and-numbers RPG, no. I'm doing something quite different (and have been for a few years!)

What is so super secret that you can't tell about it? I'm just saying. When I started Kaduria I had an idea that I could like create the world, monsters, items etc. and then start to work on that pesky RPG system, but it turns out that I was wrong and did lot of work for no reason. Now I'm practically starting from square 1 with the RPG system and then design game objects for that. Of course some of the objects and monsters are going to be there anyways. And luckily I think dungeon generation is such a detached part of everything that it's possible to create it without knowing anything about the RPG system. But whatever you are using, it's always better to match objects etc. data for the RPG system. Otherwise you have a bunch of random items without any kind of balance.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on January 22, 2016, 08:33:56 PM
Nothing's secret! It's all over my blog; it's an exploration/discovery/puzzle-solving game with obscure procedurally-generated riddle-like clues scattered through the world's generated cultures/religions/societies/people. Combat will appear, but as an advanced option for advanced players rather than the norm. The world has to be massively detailed, therefore, before you can even begin to engage with it on the level I have in mind.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Krice on January 23, 2016, 01:10:59 PM
it's an exploration/discovery/puzzle-solving game

It's worth following how are you going to make that interesting. At least it sounds boring, but who knows?
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on January 23, 2016, 01:45:49 PM
Who indeed...  ::)
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Krice on January 25, 2016, 09:28:31 AM
Who indeed...

No one knows. But it'll be interesting I guess. And of course it's always possible to add the RPG system later.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: AgingMinotaur on January 25, 2016, 01:20:27 PM
Never give up, Krice! You've got him cornered now!

As always,
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Worthless_Bums on January 25, 2016, 02:46:09 PM
I'm ashamed to say I've been refreshing this thread repeatedly for the last few days.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on January 26, 2016, 10:35:56 AM
I am greatly entertained by both the above posts, but moving swiftly on...


First, sorry about the late update this week! I had a ton I wanted to get finished for this update, and I came close, but needed some of an extra evening to actually get it all done, hence the late Monday post (next week we’ll be back to the usual weekend stuff). This week we have a fairly major update again – more work on scheduling, pathfinding, and so forth – and a bunch of minor updates on various things that needed finishing or improving before 0.8’s release. Scheduling and pathfinding for important NPCs is coming along well, but is still not finished, owing only to the immense difficulty of the task (pretty much all my spare time is currently going into this) – but I’ve pushed well past the 50% mark now, probably to around 75%, and with a really concerted push this week we should be almost completely finished by next week’s blog post. So: this entry is going to update you all on that big task, alongside a bunch of other smaller things…

…but first…

Fancy coming to work with me for 9 weeks?

Are you a student? Fancy coming to work with me on procedural generation for a few months? Now’s your chance! We’re looking for two people to come and join myself and Dr Sam Devlin(https://www-users.cs.york.ac.uk/~devlin/) and Dr Gareth Beale(https://www.york.ac.uk/digital-heritage/members/gbeale/#research) on a nine-week project for the “YCCSA Summer School”(http://www.york.ac.uk/yccsa/activities/summerschool/) to examine methods for setting rules and subsequently generating a particular category of building – those that have strict and explicit social rules to their layouts and their use by different categories of human actors. For example, this could include religious buildings, hospitals, police stations, prisons, airports, military bases, etc. The exact direction of the project can be altered to fit the right candidate, but that’s the basic outline now – generating architectures of buildings with clear social, not just architectural, requirements to their physical layouts. YCCSA is the York Centre for Complex Systems Analysis, and is a highly multidisciplinary research group that the three of us are all currently a part of.


As above, you must currently be a student, though you can be from any field and any country. We’re looking ideally(http://www.york.ac.uk/media/yccsa/documents/summerschool/2016/Algorithmic%20Generation%20of%20Social%20Architecture.pdf) for one computer scientist and one artist (2D or 3D are both fine), but that’s open to change if particularly good candidates from other backgrounds apply. You’ll be housed at the University of York in the UK for the nine weeks during which this should be your full-time occupation/work, and we’ll (i.e. you, me, Sam, Gareth, and the other person) meet up at least once a week to discuss the project. We may well collectively get a paper or conference submission out of the project at its conclusion, which would look extremely strong on any undergraduate CV if you plan to pursue further study. If you’re interested, feel free to ask some questions here, send me a message, etc, or pass this on to your friends if you aren’t eligible but you know someone who is. The competition is usually pretty fierce for the positions, though, so you’ll definitely need a strong CV to be successful. Deadline for submissions is March 17; hopefully we’ll get some applications from some roguelikers and produce something innovative and interesting! If for some reason you aren’t an undergraduate student this year but will be next year, I would expect similar opportunities to arise in 2017 and 2018 too, which I’ll announce as and when…

Now, onto the URRpdate proper:


I’d say I’m… 75% finished on AI scheduling and pathfinding for important NPCs? As far as I can tell, we’re now at the stage where:

All important NPCs spawn correctly in their houses and can be seen sleeping/behaving within those houses.
All important NPCs whose day jobs are OUTSIDE buildings – e.g. guards who guard outside a building, or gladiators, or merchants in open-air markets, and so forth – all now have perfectly working schedules and find their way to their jobs, irrespective of where the player is, what the player’s doing, etc.
What this means is that one can follow an NPC from sleeping in their bed all the way to walking half-way across the map, through exchanging their guard post with another guard, and then track that guard all the way back to their home in another district, and watch them go to bed. Although this might not seen all that tricky to code, the complexity emerges when one considers that due to the size and scale of the world map, it is of course chunked. Only the map grid the player is currently in is loaded, whilst the rest of the world is stored elsewhere in your save files. The same also applies to buildings, which are only actually generated when the player first steps inside, again to save on generation time and memory usage.

What this means is that there are many, many variations of scenario that can apply to something as seemingly simple as just having an NPC move across a map:

Their house has been spawned.
Their house hasn’t been spawned.
Their home district has been spawned.
Their home district hasn’t been spawned.
Each district between their home and their work has been spawned.
Each district between their home and their work hasn’t been spawned.
Their work district has been spawned.
Their work district hasn’t been spawned.
The player is in their home district.
The player is in a middle district between home and work.
The player is in their work district.
The player moves between districts whilst the NPC is moving, thereby spawning and despawning areas of the map whilst the NPC is trying to move through those areas!
Therefore, the NPC might enter unspawned areas, enter spawned areas, leave unspawned areas, leave spawned areas, and must have their schedule consistent as they move between these different areas, whilst always making sure that if the player “looks in” on them at any time in their schedule, they are doing the right thing, just as the player might enter/leave spawned/unspawned areas with NPCs going about their thing.
This has necessitated four major systems – we have a list of “potential NPCs” who have yet to be spawned and who have thus far moved entirely in the abstract, a list of “abstract NPCs” who HAVE been spawned but have since been de-spawned due to the player moving away from the map grid they’re in, active “creatures” on the map grid the player is currently on, and abstract “building” creatures for creatures who have been spawned, but are now in a building, but the BUILDING hasn’t been spawned. All NPCs are thereby shuffled between each of these four categories, each of which can be accessed or acted upon in various ways according to the player’s location and the status(es) of the NPCs within them. This is by far the least complex system I was able to come up with for handling all of this, and it’s actually coming together now! You can track people all across different districts irrespective of your movement and their movement, and they always turn up in the right places at the right times. The remaining AI stuff is all to do with handling NPCs whose schedules take them indoors (for their work, not their homes), of whom monks are going to be the most challenging, though I don’t anticipate TOO much difficulty for the others…

Clothing Implementation

Clothing has now been transferred out of my graphics-testing python file and implemented into the game proper. Everyone in nomadic and tribal nations now therefore wears all the appropriate clothing, which like all other clothing can be examined. This means all four major clothing types for this release – feudal, religious, nomadic, tribal – have been implemented, at all ranks from the lowest peasant to the highest ruler, leaving only armour to be generated in a later release (probably the next release, 0.9).




Vassalage nations now split their land up into counties, or regions, or districts, or duchies, or whatever the nation calls them. Each is roughly centered upon a town, and therefore “owned” by the lord, count, viscount, duke, or whatever the nation calls them, that controls that town (and thus mansions spawn in those towns to house these important people, and town halls do not generate as these nations would not have mayors for their towns). I’ll be doing a little more with this system later, but for the time being, here are some example maps of the vassalage-y nations and the counties they created (shown by arbitary colour differences, though when you view them in-game, you get colours of the house in question that rules the area). I’m happy with the kind of size these regions are, and it’ll add another nice bit of variation to a couple of nations each time. There are still a couple of minor peculiar bugs to work out here, but it should be resolved soon:


Castle Basements

Castle basements have now been finished as well, and can contain slave quarters, and a torture chamber or dungeon, and potentially… other stuff as well? They often have two parts and two down stairs, if for example the nation keeps slaves and there is a dungeon or torture chamber, as those would be accessed from separate staircases (though I just need to make a mental note to ensure that the AI can figure that out!). Here is an example, going from the slave quarters, back into the main body of the castle, and then down the other staircase into the dungeon (which is much nicer than jails, since these dungeons are for important prisoners). Upper floors are being changed a little, but I should be able to show them off next week.


Jail Bedrooms

Jailers now have bedrooms which are underneath the jail, rather than having them sometimes leave and return and so forth. This was a slightly strange solution, but I decided it was a solution I was happiest with rather than having jailers leave and return in the morning (leaving prisoners alone would seem strange) or having jailers who take many shifts (I didn’t like this and wanted to emphasize that jails *belonged* to the jailers on some level), so there is now only one jailer who sleeps in a “secure” chamber below the jail. These bedrooms are minimalist and simple so they aren’t really worth showing, but suffice to say that that’s where they now appear.


Although the appropriate NPCs will not actually exist in this release – they join a list of NPCs like inquisitors and explorers who will be added in 0.9 – there is now space in castles and mansions for the rulers/lords to have a harem, of either sex/both sexes (depending on cultural practices, accepted norms, and the orientation/age of the ruler). Harems contain reclining couches, which are a new form of furniture I very quickly set up a really cool generation algorithm for, and I really like how these look. Right now these couches only appear in these areas, although I might change that in the future. The couches themselves are, of course, both coloured and patterned according to the family whose mansion you find them in, or the ruling house if they’re found in a castle, so here are some examples of reclining couches with the coat of arms that would have them next to them, whilst the shapes emblazoned on them are dependent on the civilization to which they belong, in this case three “lesser” houses in a vassalage nation and one major house:


What next?

This week I’m still working on scheduling/pathfinding, and will be focusing on getting all the scheduling around castles working, and then moving onto those who need to schedule their way into, and around, buildings, and then those who spend their entire schedule within certain buildings (such as certain categories of priests). If the progress on scheduling seems slow, please let me assure you it isn’t, and basically 100% of my spare time is on URR development at the moment – it’s just a huge, complex, and challenging task. But I’m definitely well past half-way and I can see how it’s all going to (finally) come together, even if there’s still quite a bit of ground to cover. See you in seven days!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on January 31, 2016, 08:45:00 PM
I was hoping for a large scheduling/AI update this week, and although significant progress has been made, the game’s code is currently quite unstable and uncooperative for the taking of screenshots, and replete with bug-tracking code that slows the game down to a crawl and makes taking nice gifs quite challenging. So, rather than doing a scheduling-and-other-things update this week and the same next week, I’m going to do a brief other-stuff update this week, and a much larger scheduling update next week with a massive volume of screenshots. Aside from the improvements to scheduling, two small other things have been done this week – banner graphics, and the upper floors of castles. That’s all for this brief post, I’m afraid, but we’ll make up for it next week with a massive and more tech-focused AI entry.


I’ve generated the graphics for banners, which are somewhat like flags except they can only be found inside castes, and probably inside mansions and manors as well once I get around to adding them in. In castles, in vassalage nations, you will always find a corridor lined with the banners of all the lesser houses in that nation. Here are some examples (the frills at the bottom of course vary with civilization preference shape) – these are quite simple, but I’m very content with how they look, and that’s another one I can tick off the list of the last remaining graphics for 0.8. With that said, they might be just a little dark, so I may lighten them just a tad.


Castle Upper Floors

I returned to the upper floors for castles and made some major changes, almost entirely in order to just make them less boring, as they were looking rather uninteresting beforehand and a bit too hand-made. The system used here is again (like castle basements for slave quarters, dungeons, etc) quite similar to the algorithm used in crypts to connect areas and draw corridors, and so forth, but this one is rather more fluid. It places all the important rooms first, including a harem if appropriate (the new dark red icons you see there are the reclining couches we talked about last time, and their colour varies according to the coat of arms of the house to whom they belong), and then ensures they can all path back to the up staircase that brings you to that level. This first stage results in something that looks like this:


If the castle is smaller and there’s a garden in the centre of the castle, you get something like this, since it’s rather harder to generate appropriately – but I actually rather like it! You’ll note that in this case the harem is not placed directly adjacent to the master bedroom, since in many cases that wouldn’t fit, but is instead positioned at a distance with a corridor that then paths in to the main sequence of bedrooms. This gif nicely illustrates the gap in the centre for the octagonal garden in the middle, then the player goes upstairs, and you can see the rooms loop around the middle bedroom.


I’m content with how these look – as ever, it’s hard to make upper floors fascinating when there are only so many ways to draw a bedroom, but they’re distinctive, they get the job done, and leave plenty of room for me to potentially add other things in the future, if anything useful presents itself. So now here’s a little gif using wizard/admin mode, to look at the three layers, from top, to middle, to bottom, to middle, to top. Note also that the corner towers where guards and soldiers live are present on both the ground and upper floor, but the overall shape of the castle is irrelevant underground.


And lastly (I just added this at the last second before posting this entry), here’s an upper floor for a democratic civilization that doesn’t have an ornate throneroom on the ground floor, but rather a bedroom with two sections – one for general governance and receiving relevant people, and a secondary part for the elected ruler to sleep in. Like ground-floor throne rooms, they vary heavily based on ideology, but in this picture you can see it in the top-left corner of the circular castle, and the middle of the “cross”-ular castle, both of which have harems attached (although roughly 1/3 nations will have those, I temporarily activated them for all nations just to help me test the room-placing algorithm).


AI Stuff

Oh, all right  – one brief AI thing. The best thing I’ve seen all week is this debug screenshot, where guards were coming in and out of a mint from all directions and timings and data structures, and sure enough, they all showed up on time (displayed here as the white tiles) and every single guard was there, no matter what the player had been doing and what parts of the game world were spawned and loaded, spawned and unloaded, or unspawned and unloaded. The most beautiful image I’ve ever set eyes upon.


What next?

Moving closer to all this AI work being finished! I cannot wait to be done with all this and be able to watch all the important NPCs going about their days. Once all of this is done, and all the current minor bugs (~a dozen) are fixed, I’m actually going to take a week or so off from URR development. Honestly, the extended crunch to getting this AI stuff finished has been really tough and lengthy, and once it’s done, I’m going to recharge a little bit before I start work on dialect generation and the conversation system (though I will probably continue brainstorming those aspects in the interim). I have a particular game I’ve been desperate to play for a long time, and having finally acquired (second-hand) the console required, I’m actually going to give myself a little time off to play the thing. Don’t worry, blog posts will of course continue! But I do feel a little burnt out for the first time ever, and I just have to have a little coding rest once this huge block is finished, so chances are next week will be “AI is almost finished”, the week after will be “AI is completely finished!!”, the week after will be something else, and maybe even the week after that, and I know this will push back 0.8 a tiny bit further but I just really need a bit of a break. Once that’s all done, though, we’ll start thinking about dialect generation. See you in a week for a big AI update!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on February 02, 2016, 01:02:41 PM
Meanwhile, emerging from recent discussions between myself and Darren Grey, a very important thread about the future of Roguelike Radio has just gone up - all feedback here/Reddit/elsewhere welcome! https://www.reddit.com/r/roguelikes/comments/43u2ju/the_future_of_roguelike_radio/
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on February 07, 2016, 11:05:53 PM
A big URRpdate this week, as we hit around 80% completion on the scheduling and pathfinding for all the world’s important NPCs, and also add some smaller additions like banners, drawbridge chains, and finishing off the upper floors of castles. At this point you can now track NPCs leaving their home and going INSIDE buildings – and this again works regardless of what the player does, where the player is, what maps/buildings have thus far been spawned, etc. This is, to put it mildly, a landmark moment. It works completely for guards in mints, and banks (though I have yet to test arenas and archives, but those are the first tasks I’ll be working on checking this coming week). It’s always hard to tell how much code written to deal with Situation A will actually also apply to Situation B until you give it a shot, when the Situations in question are so complex and have so many variables, but I think this code should be entirely transferable. I hope.


So, it’s time for some gifs! Various gifs here of guards leaving districts, entering districts, entering buildings, leaving buildings, exchanging guard duty with others, etc. Guards now work correctly for all outside guards, and almost all inside guards work correctly, and any and every weird combination of movement across the map and the player’s actions also, as far as I can tell, work perfectly.






However, all of this has given rise to a very amusing bug. So, consider this: the world map is split into map grids, each of which is 200×200 tiles when spawned but naturally starts unspawned, and each map grid might contain a range of buildings. When the world is generated I can check exactly what buildings will be in each district, but naturally in most cases I don’t know exactly where each one will be placed – since that would entail spawning the entire map, on the human rather than world scale, at world gen! Which would be absurd and take probably the best part of an hour or something, possibly more (I’ve never tried it and don’t intend to).

Now, consider this. The player is in Map Grid A. In Map Grid B is a guard, who is due to leave their house and move into Map Grid A, to relieve another guard on guard duty. Map Grid B has never been spawned. How long, therefore, should this first action – moving from B to A – take? No matter how any map grid spawns, moving from any point of a map grid to an appropriate edge can never take more than 200 turns, and therefore all movement of this sort, in unspawned areas, takes 200 turns. Were it spawned, it might “actually” take 20 turns or 190, but we have no idea what the correct number would be until spawned, and since it hasn’t been spawned, I play it safe and assume 200.

With me so far? Splendid. Now, let’s say that the guard leaves their (unspawned and nonexistent) home at turn 1000, and therefore is due to leave Map Grid B and enter Map Grid A at 1200. Now, the player is sat in Map Grid A. If the player waits until turn 1190, and then enters Map Grid B, it will then spawn all the buildings and have the NPC do 190 turns of their action. However, what if this building is near the edge to Map Grid A? Let’s say they get there with 90 turns left. Ordinarily, they would go through, and then take 90 turns on the other side… but that would mean if the player immediately went back through, from the player’s perspective, upon returning to Map Grid B, it would appear as if in two turns an NPC had just appeared and teleported ninety tiles up the map grid! Therefore, if an NPC is just about to cross grids, and the player is about to enter that grid, it takes them to an earlier step in their movement so that the player, just entering Map Grid A, sees the NPC for a few turns before they go into Map Grid B. However, what this means, is that if the player keeps hopping back and forth, the NPC keeps getting pushed back and never actually moves through until the player goes somewhere else! It’s very silly. I’m not sure how to fix it yet, though it probably needs some kind of counter that notes if the NPC has already been pushed back once in its current district, and resets after moving to a new grid. But still: it’s an interesting example of the complexity of the system, and some of the weird situations that arise, and how I’ve tried fixing them.

To further illustrate this point, here are some examples of the scenarios that can arise:

- Player is in a map grid and an NPC moves into that map grid, and should physically spawn.
- Player moves into a map grid, and all stationary NPCs outside buildings (e.g. guards) must spawn.
- Player moves into a map grid and another important NPC is moving in that map grid, and must spawn in the right place, an appropriate way along their schedule according to the timing of their schedule.
- The player follows an NPC into a new grid, and the NPC should be x turns away from the edge of the grid once they are spawned, despite having been unspawned after leaving the player’s grid.
- NPC enters unspawned building, player stays in grid, things must happen in building that doesn’t exist.
- Player is in grid with unspawned building and NPCs within that unspawned building need to leave.
- Player is in grid, NPC enters building, player leaves, NPC must be handle its behaviour in unspawned building and unspawned grid.
- As above, but player enters building first, leaving a spawned but unloaded building in a spawned but unloaded grid.
- Player enters building part-way through NPCs doing behaviours within it, causing it to spawn for the first time, and they should all be at the right part of their schedules…

Basically, consider every variable of 1) the player’s action, 2) spawned grids, 3) spawned buildings, and 4) important NPCs moving through all these, and I cannot begin to describe all the variations. Naturally in many cases a piece of code I wrote to resolve Scenario #14 also worked for Scenario #26, and so forth, but in many cases it didn’t and a massive amount of code had to be written to handle every possible variation and permutation. But I think a large part of it is now done.

Drawbridge Chains

What is says on the tin, really.


Next Week?

Dare I hope… AI pathfinding/scheduling… finished?!?!?!?!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Aleksanderus on February 08, 2016, 11:45:30 AM
Combat will appear, but as an advanced option for advanced players rather than the norm.
Well, we'll see if this won't be a norm.  ;D

EDIT: But how the character will gain money then, by work and theft? I don't want to make my character a thief. And also I think this will be more like simulation than a boring puzzle game.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Tzan on February 08, 2016, 05:52:20 PM
To further illustrate this point, here are some examples of the scenarios that can arise:

In an MMO all these issues are solved by spawning a 3x3 grid of zones.
I worked at Turbine for a while, they call them land blocks, which are 160 meters.
So if you stand at the edge you need to see creatures in the next area, so they need to be spawned.
In most MMOs NPCs never leave their land block.
Some important elite creatures in World of Warcraft seem to cross over but I dont know how they parse their maps. But its just one guy per big area.

Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: jim on February 09, 2016, 04:30:05 PM
It would be awesome to be a spice merchant. Just wandering the roads with mule in tow.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on February 09, 2016, 10:47:42 PM
Combat will appear, but as an advanced option for advanced players rather than the norm.
Well, we'll see if this won't be a norm.  ;D

EDIT: But how the character will gain money then, by work and theft? I don't want to make my character a thief. And also I think this will be more like simulation than a boring puzzle game.

Haha, challenge accepted! But I'm confident. As for gaining money, see my reply below, but basically I see trade, haggling and conversation as being the major methods for money acquisition.

To further illustrate this point, here are some examples of the scenarios that can arise:

In an MMO all these issues are solved by spawning a 3x3 grid of zones.
I worked at Turbine for a while, they call them land blocks, which are 160 meters.
So if you stand at the edge you need to see creatures in the next area, so they need to be spawned.
In most MMOs NPCs never leave their land block.
Some important elite creatures in World of Warcraft seem to cross over but I dont know how they parse their maps. But its just one guy per big area.

Hmm, interesting. The never-leave-their-land-block thing is a good point to note the difference, though; URR's NPCs are much more ambulatory!

It would be awesome to be a spice merchant. Just wandering the roads with mule in tow.

This is... actually pretty close to what I have in mind. A lot of trade, a lot of haggling, a lot of talking, little fighting!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Tzan on February 09, 2016, 11:21:25 PM
The player is always at the center zone.
If an NPC wanted to leave the 3x3 it would be at least 1 zone away.
When it enters an unloaded zone, just instantly assume its at its destination on time.
I would probably use 100 not 200 for unseen movement. The player will never see it.

If the player moved to follow him and even was faster, it wouldnt matter because the NPC destination zone would load as soon as the player entered the adjacent zone. He could follow like normal and even catch up if he was faster.

I wouldnt even bother resolving where in the newly loaded zone he is because the player is at least 200 spaces away.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on February 10, 2016, 06:09:57 PM
That may well have worked if I'd done the 3x3 loading model! At this point way too much has been committed here to make it work, but I obviously acknowledge my mad method isn't the only method :)
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Tzan on February 10, 2016, 08:44:34 PM
Yeah I wasn't expecting you to change anything as you had already mentioned you had fixed all the odd conditions.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on February 15, 2016, 12:20:27 AM
Another big one this week! Even though AI is still not finished, it feels as if things are moving quite a bit smoother now. It’s less like I’m adding in new code, and more like I’m just tweaking the code to make sure that each class of NPC in each situation (particularly more unusual ones like monasteries and castles) behave correctly. This is still going to take some time, but the major mind-numbing difficulty of the actual coding process is pretty much finished; now it’s just a mopping-up task to make sure tellers can use the code written for monks, soldiers use the code for guards, and so on and so forth, and that everything is suitably applicable to every scenario rather than the small subset of scenarios I originally used to get the system up and running (i.e. guards). As such, this week a lot of new NPCs have started working correctly in their schedules, and various amusing or peculiar bugs found along the way have been fixed. My rather bold goal last week of finishing AI entirely hasn’t been met (ha! I was so naive, and will never make such an absurd prediction again), but we’re still getting closer and closer, and it certainly emotionally feels like the home stretch… at long last. Sorry again for the late-evening update; there’s just so much to do that I find myself coding all day and then suddenly quickly typing the update post before I go to sleep…


Tellers now go about their day correctly. The bank remains open all day for people to come in and sit down and wander around, and guards naturally keep guard all day but the teller is only there in the day time. I’ll probably change it at some point so that once the teller exits, ordinarily people won’t path into the bank, but for now that’s going to be how it works, since there are only so many tiny additions and minor things that 1/6000 players will notice, that I can implement in any given release. Here’s a teller packing up and deciding it’s time for a relaxing snooze:


And the same from outside:


And entering their home, with a rather jumpy gif due to the volume of de-bugging stuff happening in the background, but you can still see that the teller enters, realizes they need to find the stairs, finds them, goes up them, finds bed, goes to bed.


In the process of handling bank tellers I also discovered a weird bug where either priests could spawn in a middle-class map grid, or bank guards, but not both. This was a result of a silly “elif” where I should have written “if”, and this promptly got fixed!


Priests seem to be doing their thing correctly! Priests (and worshipers) doing their normal routine in the day time:


And then I left, came back at midnight, and sure enough found the priests sleeping in their cells:


And then, at the appropriate time, the priest awakes and starts doing her thing!



Look at this merchant going into their shop first thing in the morning!


Truly magnificent.

Walking Through Walls

Found a funky glitch involving pathfinding through cities that wasn’t correctly taking account of where doors inside and outside the city actually went. Basically, in this city, an AI was trying to take this path:


Once I was in the grid below the one in the top-left, it couldn’t spawn properly since it was trying to spawn at a gate that didn’t exist. The path had been allowed because, sure enough, none of those map grids were blocked – i.e. were oceans or mountains or deserts – and a pathfinding map of the area basically looked all green, and didn’t take account of where gates are and are not! I tried to find an elegant solution to this problem, but failed, so I just changed the city pathfinding algorithm to consider any tile outside the city to be blocked (and I’ll think of a more elegant solution later, for when I want NPCs to move from city to city). So before, the pathfinding grid for these map grids looked like the one on the left, and it now looks like the one on the right, so city NPCs have to move always within a city, even if going out-and-in would be more efficient, because taking account of gates is too damned confusing.


Pleb Purge

I noticed a tiny weird bug where sometimes, upon entering a map grid in which the NPC needed to “catch up” to where they should be and would have been if the grid had previously existed, they would reach a tile away from their destination (e.g. a door to a building or gate to another district) and then just dance around the tile for a while. It took quite a while to figure out the issue, but the problem was that the game was spawning the random crowd NPCs *before* getting the important NPCs to catch up to their positions, and so there was a truly tiny chance (I probably encountered this in 2/200 game loads before I figured out the issue) that a random crowd NPC would be spawned on an important NPC’s target square, and prevent them from reaching it. Therefore, when you enter a grid, the game now ensures that a) there are no random NPCs standing in the exact tiles in front of gates to other districts, and b) that there are no random NPCs seated on the exact “endpoint” tiles of any important NPC. As such, from what I can tell, this weird little bug (which admittedly wasn’t a game-crashing bug, but still merited dealing with) has been resolved.

Other Bug

Also ffound one bug where certain important NPCs, upon leaving a building, wouldn’t change their internal x/y coordinates to an appropriate external set because they were looking for the wrong kind of door, which resulted in them leaving buildings and being magically transported on top of buildings, into lakes, into trees, etc. This no longer happens.

Next Week

Well, more AI stuff, of course. What else?!


Since AI stuff is proving so complex, I’ve decided not to move forward the release – I still think the conversation system is absolutely vital – but I’m going to put out a secret, intermediate release, to a small team of playtesters, to make sure that the pathfinding system all works correctly. Despite my best efforts, there’s no way I can really test every single possibility exhaustively. If you’re interested, leave me a comment! This won’t be until probably next month, and would require you to basically wander around the world, entering buildings, looking for NPCs, leaving buildings, entering other map grids, and just basically doing anything you can to upset their scheduling.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Aleksanderus on February 15, 2016, 01:35:02 PM
I want to be a tester becouse I have got GREAT "ability" to find bugs!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on February 16, 2016, 07:40:24 PM
Hmm, I cannot tell... are you being sarcastic?! Why the "s?  :o
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on February 22, 2016, 12:22:50 AM
In light of the death of one of my literary/academic heroes, an Umberto-Eco-focused blog post discussing his work and its relevance to URR. Back to AI next week!

Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Rev_Sudasana on February 22, 2016, 08:29:27 AM
Is there going to be an in-game tribute to Eco? Something subtle that doesn't break immersion?
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on February 22, 2016, 11:49:08 PM
Oh, yeah, though I haven't decided what yet :).
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on February 29, 2016, 10:35:52 PM
———– Call For Playtesters ———–

Firstly this week, before anything else: I’m still looking for a small team of playtesters to test out all the AI stuff in the next URR release, probably starting some time next month. If you’re interested, please send me an email to mark at my domain name, and also link to your Twitter, or Facebook, or something that shows me a little about who you are, and just give me a line or two about why you’re interested and how much time you’d realistically be able to give it – please be honest! I want people who can really contribute to making 0.8 the best it can possibly be. I’m recruiting people to basically wander around the map, go into every building they can, check the NPCs are there and behaving sensibly, and do everything they can to mess up the schedules of the important NPCs. I’d suggest being able to commit at least 6+ hours would be a decent start, but I might ask for more if someone quickly finds a major bug, which I correct, and then upload a new playtesting version. Either way: if you’re interested, give me a shout! I should add, though, that’s it’s possible I’ll just decide to upload an explicit “beta” version with some massive warning saying THIS VERSION MAY NOT BE STABLE and let everyone test it… or I might not. So I’m not yet certain whether I’ll do a closed or open playtest for 0.8 (which I’ll probably just call 0.7.5). But to give me an elite team in case I do decide to do a “closed” test, please let me know if you’d be available by the method outlined above…


This week we’ve been continuing to really push Roguelike Radio towards a major re-launch: our recent episode on Strategic and Tactical decision-making (http://www.roguelikeradio.com/2016/02/episode-117-strategy-and-tactics.html) is particularly excellent, I think, and I highly recommend it. Meanwhile, we have another fairly big update this week, which is pleasing, since it shows that things are progressing at a good pace (although I do have a fortnight’s work here, so naturally there’s bound to be a lot). I’ve covered a whole bunch of new NPC types in the last two weeks, and it’s proving very reassuring that the pace at which I’m moving through these things continue to accelerate. Much like I said in the entry before my Umberto Eco post, at this point the task is more “check each bit of code works for each kind of NPC” than “add major new bodies of code”. It’s slow and difficult, but it’s coming together, and it feels so reassuring and pleasing each time a particular class of NPC seems to be working correctly and I can move onto the next one. Here’s a run-down of what we’ve had added since I last URRpdated you all:


It turned out that merchants weren’t even close to finished, due to a significant complexity in getting NPCs to spawn at the right time when they are moving between things on a single grid of the world map, i.e. in this case they both live in work in the same district. This needed a lot of new code that would note when they should be spawned in certain scenarios, even if the player hadn’t seen them acting before then, but as far as I can tell this now works perfectly. The code should also carry over into a range of other NPCs that I’m slowly working towards testing, but suffice to say, merchants now appear in their shops at the right times and don’t appear at the right times. Here’s a merchant going from their house, leaving it, wandering across the map, and going into their shop to start the day’s business.


Non-Cathedral Priests

Priests in standard religious buildings now behave appropriately, find their way up to the correct floor when they sleep, etc. Here’s a priest deciding to turn in and going to their bed – and this would happen in the abstract too, of course, if the player wasn’t nearby:

And then later on, they wake up, head downstairs (I foolishly let them get a few tiles ahead, but you can still see that we’re following them in a few glimpses on the upper floor), and start going about their way, in this case first settling down in one of the chairs in front of the altar.


And here’s a priest in another church going up to their bed late in the evening:


Archive Guards

Archives – found in crypts, below cathedrals, and only in theocratic nations – now always have their guards switch over correctly. This necessitated a little extra complexity because they aren’t on the ground floor, but I’m pretty sure this now works correctly no matter what. Here’s a changeover from the outside, into the crypt, where the guards switch…


…and then the other guard heads upstairs, and out! (From a different crypt that was generated later, hence the change in layout)


Arena Guards

Arena guards now change over correctly, which means that at this point, I *think*, all guards, whether inside or outside, all work correctly on their schedules. It’s very possible that some other weird bugs still lurk out there, given the complexity of the thing, but I’ve been going around trying everything I can think of to break the game, and thus far I haven’t been able to.


And they get home, and I immediately barge in:



Archivists have a super-simple schedule – get up, work, go back to bed – but they now do it correctly regardless of the player’s actions. I entered crypts at various times of day at various points in their schedule, and always found them correctly sleeping or working at their desk regardless. Here’s a gif of an archivist deciding it’s time to call it a day (they do sleep in the crypt/archives beneath a cathedral, which might make them a little peculiar once the conversation system is implemented). These NPCs were also quite tricky because they have various bits of special code determining where they should be sitting most of the day, and their relationship to the guards around them, and they aren’t on the ground floor of the building which adds to code confusion, but still, here we go:


A little bit of dialect generation…

In a spare couple of hours in the evening of Friday 19th, I officially started work on dialect, and therefore speech, and therefore conversation, generation. I have almost nothing to show for it yet, and I’m not really going to dedicate much time to it until all the AI stuff is working, and I’ve distributed the special playtesting version, and I’ve taken a week or two off, but: even from the earliest things I have right now, the variety is going to be amazing. More on this in a month or something, but I just had to take a minor break from coding this never-ending AI nightmare, and I’m incredibly excited about how speech generation is going to look.

Next Week

I’ve been doing the AI for around three months now. You all know the drill. MORE AI STUFF!!! As I’ve said before, though, the amount of new stuff I’m adding is slowly decreasing as time goes, and most of the time now is testing the existing code for every variation of NPC in every scenario. There will come a time when the issues of URR’s AI are finished… but alas, it is not this day. But soon!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Aleksanderus on March 01, 2016, 07:01:04 PM
+1 to open betatests!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on March 04, 2016, 10:06:15 PM
Your vote has been noted!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on March 07, 2016, 08:18:47 PM

This year’s US IRDC has now been booked, and will be at NYU from August 6th to the 7th! Unlike last year where various tedious things got in the way, this year I will 100% be dragging myself across the ocean for this, and staying at least until late on the 8th, and possibly a little longer depending on Various Factors. If I’m going across the Atlantic for it, those of you already in North America have no excuse! I hope to see a lot of URR fans there – for more information, you can check out the information here on Roguebasin http://www.roguebasin.com/index.php?title=IRDC_2016-usa. If you want a European IRDC – and naturally, I do too – then you should pester DarkGod, who volunteered to host it but has since gone mysteriously quiet…

This Week:

Well, in one sentence, even more NPCs now (as far as I can tell) schedule correctly. Here’s a run down!

Guards (again)

Yep, guards needed still more work. Found a bug where if you entered the house of a guard, even if they were actually meant to be in another building, so long as that building was a) in the same district and b) currently unspawned (e.g. an arena, whose guards always spawn in the same lower class district). This has been fixed. Also discovered a bug during testing that sometimes under very specific conditions actually duplicated an NPC – if an NPC went into a building, and you saw them go in (so they had been physically spawned), but the building had not yet been spawned, and you waited until they completed their initial task, and then entered (and thereby spawned) the building, they would appear in the building and behave correctly, but a doppelganger would be made and stored back into the list of abstract NPCs. Then, when it came time for that NPC to take another scheduled action, both the abstract non-existent NPC, and the physically spawned NPC, would both try to take the action (since they shared the same unique identifying number), at which point… Bad Things would happen. This has been dealt with. I know last week I said everything with guards was working, but now I *really* think everything with guards is working. Hopefully.


Due to a classic case of chaos theory, making a totally minor change that was essential to the game’s code for handling important NPCs had the unexpected side-effect of causing only the tiniest fraction of prisoners to ever actually spawn – only the secretly-important prisoners in jails were spawning, whilst the other prisoners who are classed by the game as “important”, i.e. they are saved and still appear when you change map grid, were not being spawned. This has been fixed! Here’s a jail full of prisoners (the “z” characters) wandering about their cells:


And the jailer knows how to go to bed, though I slightly messed up this gif by going up the wrong staircase first and letting the mouse cursor stray in at the end…


And when I go back in at night, they’re all on their beds like good prisoners, and the jailer is where they should be in their quarters:




There was an earlier bug with mercenaries, and although I didn’t explicitly fix it, something I’ve coded in the interim seems to have fixed it, so I’m assuming it now all works perfectly. Hooray! Mercenaries are found in mercenary guilds, and spend their day wandering/pacing their rooms. In the future, of course, you’ll be able to engage with them, but that’s where they stand for now. Here’s a mercenary guild I entered at night, and sure enough found everyone in their appropriate beds:


And one waking up and starting to wander and pace:


Servants and Slaves

I… think servants/slaves in upper-class houses are now working correctly. The important ones spawn and behave, the unimportant ones spawn and behave, and so forth. Here’s me running around the upper floor in a non-slaving nation (so “v” is servant, “s” is slave) and watching the servants going around their day – though in fairness, we’re in a equatorial region here, so both skin tones and wood colours tend to be darker, and combined with the brown/red in the floor patterns here, I admit that the servants are a little tricky to see! But there isn’t really much I can do about that, as it’s a rare occurence to have all three of those match up. Though this might finally galvanize me towards actually adding a 14×14 font size soon, that should help in situations like this!


And in another mansion, at night, all the servants are sleeping in their quarters!


However, there is some remaining weird issue going on – if we’re physically present when they should be waking up, they don’t! This is the top priority to fix this coming week.

Bugs and Whatnot

Found a weird bug this week when a guard who had left their house and was going towards the arena to relieve the other guard there somehow got switched from the “Local Pathfinding” state (where they move from one point to another on the local map by any means necessary, regardless of roads) to the “Roadmap” state (where random crowd NPCs just follow roads). This should be totally impossible, and having gone over the code many times I cannot find how this could take place, and sadly I had no debugging stuff going to catch that happening since I’ve been doing AI for three months now and this is the first time that’s ever happened. Weird. I’ve put in even more safeguards into the code to prevent this happening, but I suppose there’s got to be a tiny chance that whatever weird collection of flukes led to this occurrence could still be lurking out there. Very peculiar.

Also discovered an issue with the way I was actually playtesting things; due to things now being saved in their own subfolders in the save folder instead of being saved in one massive file, saving/loading is vastly faster and more efficient, but it does mean it’s harder for me to “reset” the game to its previous state to continue testing the same thing in fractionally different scenarios. So I wrote in a bit of stability code to basically help me testing; this probably won’t be noticed, but it just makes saving and loading things in the background a little slicker.


I’ve continued to take brief breaks from all this madness to work a little bit on the dialect generation system. I’ve identified a massive set of variables including word order and various other things, and it’s looking amazing even at this early stage. In my brief moments of dialect generation, I am coming to realize that before I go much further, I need a very clear and solid idea of what “a conversation” will actually look like. More on this in a near-future blog entry…

What next?

We are approaching a point where there is only so much I can do to try every possible scenario that I can imagine, and I’ll just need to release a playtesting build and rely on the skills of the masses (you wonderful lot!) to help me find it all. Still debating whether to do a closed or open playtest. Leaning slightly towards open right now, but I was leaning towards closed last week, so I’m very changeable at the moment on this point. I’ll update you all once I have more information. For now, though, my focus this week is on ambassadors, clerks, diplomats, innkeeps, delegates, and finishing that issue with slaves/servants.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on March 13, 2016, 02:58:03 PM
AI stuff going well, aiming for 26-27 on playtesting release, and in the mean time, I wrote up a piece about the AlphaGo vs Lee Sedol matches this week, for those of you with particular interests in AI: http://www.ultimaratioregum.co.uk/game/2016/03/13/alphago-lee-sedol-and-grand-ai-challenges/
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on March 20, 2016, 10:43:37 PM
To anyone who sent me an email about playtesting and I didn’t reply: I’m very sorry! I think I’ve caught them all, but I’ve had a lot, and my inbox has recently been blasted with spam, so it’s possible I missed one. If so, rest assured it was entirely accidental and nobody has been shunned on purpose, and I *massively* appreciate every single offer!

But as for this fortnight’s update: YES, as I’m sure you could guess, I’ve done more work on AI, but my goodness, we’re getting close to an acceptable level of completeness here for the 0.8 release. I just realized with something of a shock how close I am to having this release’s AI finished: Chieftains, Priests, Archivists, Mercenaries, Clerks, Diplomats, Farmers, Guards, ordinary citizens, Innkeeps, Jailers, Merchants, Slaves, Tellers, Servants and Prisoners all work! If I can make sure officers work, and all the NPCs in castles and monasteries work, it’ll be done! Then I’ll do speech generation, then release 0.8, then return to finish off the more obscure NPCs – blacksmiths, delegates, explorers, gladiators, and so forth – in a much quicker 0.9. So here’s a run-down of everything this past two weeks, as I enter what I desperately hope to be the last week of concerted AI work in this release. I will be releasing the playtesting release on the weekend of 2/3 April, and I’m probably going for the closed playtest option. For now, though…

Servants and Slaves, Again

Found a few fascinatingly rare errors involving saving and loading specifically when important but non-unique NPCs were next to, or on, a staircase, and were either transitioning to sleeping or transitioning to doing their normal everyday stuff. If next to the stairs they were trying to find a new target when the game reloaded instead of continuing to the stairs, but if they were already on the stairs, they would cause a soft lock with the NPC trying to find another target. I’m pretty certain I’ve fixed this now for all NPCs this might apply to, and if it isn’t finished, they should roll over to a piece of code that will encourage them towards a chair or a bed for a temporary rest, rather than having them lock up the game, so there’s a slightly less-elegant backup solution in there in case the main solution doesn’t work. I went into the basement of a mansion and waited until it was time for the servants to wake up, quickly modified the code to make them all wake up around the same time instead of over a longer period in order to take a nice gif, and voila:



Ambassadors and innkeeps have a similar thing to them – they spawn and sleep on the upper floor of their building, and when they get up, they head downstairs and do their thing, and then return upwards. As far as I can tell (I know I keep putting this proviso on everything I write about AI, but the stuff is so damned complicated that I have to!) ambassadors work correctly, although there remains a tiny issue with innkeeps because in their business day they can sometimes drift onto the upper staircase, and if they decide to go to the upper staircase when already standing on it, they go up but then don’t look for a target, and freeze. Not quite sure why, but for the ambassadors, here’s a quick gif of one turning in for the night:


Clerks and Diplomats

Clerks and diplomats all now seem to work correctly, using effectively the same code as tellers, albeit with a minor slight difference. They live all over the city, head towards their appropriate embassies, and behave correctly, although there was a really strange issue for a while with the game trying to spawn a duplicate whenever one of them was due to act! Then we had another issue with clerks and diplomats sometimes deciding to sneak upstairs and occupy the ambassador’s bed! Cheeky buggers. All very odd, but now resolved.


Monastery Name Generation

To my amusement, I realized I’d neglected to get monastery names generating! I’d just left them with a placeholder, “Monastery of the Six Halos”, and entirely forgotten about them. I returned there this week and spent an hour putting in a robust name generation system which draws upon the specifics of the religion in question – whether it worships an animal god, a demonic god, a lovecraftian god, an “ordinary” god, a pantheon, etc – and then churns out a series of related but distinctive names for the monasteries in each civilization. Here are a few groups of examples:


Archivists again

Archivists weren’t behaving perfectly and couldn’t find their way back to their desk after a good night’s sleep. Now they do!



Farmers now farm! You can head into a farm, and for each farmhouse, we’ll see a farmer doing their thing, which basically involves moving from point to point in the fields, and only moving a few tiles at a time. By this, I mean they select a group of crops to work on, work there for x turns, then move no more than 5 or so tiles in any direction onto another crop, tend that, and so forth, and so you see them slowly moving around their fields. At the appropriate time, they head home. Here’s a gif of a farmer… farming… which is about as exciting as you’d expect, but hey, it works:


And goes to their farmhouse:


And going to bed:


Thrilling stuff!


Innkeeps are now in the appropriate place in the day, and at night. As above, innkeeps use pretty much the same body of code as ambassadors since they sleep in the building they work, they sleep on a floor above their working floor, and so forth. At the moment they should come down stairs in the morning and tend to the bar. I’m also considering using the graphics for the beer barrels stored in the basement for barrels more generally, and adding those into the generation algorithms for some other buildings to add some variety to the standard chairs/tables (i.e. use them as food storage barrels and that kind of thing). For now, people do still come into the tavern when the innkeep is asleep, but that can be fixed some other time, and definitely fits into the “long set of very minor issues” category that I’ll handle in the future. I assume they just sit around and drink their drinks very slowly until dawn once more spins around.


Next Week

The final AI update before the playtesting release, and hopefully pretty much all the AI needed for 0.8… and what a relief that will be!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Aleksanderus on March 21, 2016, 05:54:59 PM
Demonic religion + Theocracy = Fun!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on March 22, 2016, 07:26:43 PM
You've got that right!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on March 30, 2016, 05:36:03 PM
I was going to publish this update on Sunday, but I decided to leave it until today so that we could hopefully have all the monastery stuff done. Almost all of the monasteries’ AI now works correctly, along with the other stuff, which means next week’s update will be on castles and everything else that needs doing in the interim. This update looks at monasteries and a ton of extra work on innkeeps and farmers, and a pretty exciting selection of bugs that came up in the process, the combination of which prevented me from also getting castles done this weekend (in the UK we have a four-day easter weekend, so I’ve been coding all Friday and today as well as Sat/Sun/Mon). What all of this means is that in a fortnight from today, I should be releasing the playtesting release. It’s just castles and a few monastery issues to go, and then clearing and neatening some things up, then we’re (finally) good to go to move onto speech. Thanks to everyone for sticking with me this long – it has been tough, but we are so close to having all the AI stuff working for the playtesting release. If you want to be part of the interim playtest, you can still email me at my first name at this domain. For those who haven’t seen me mention this before, this is not 0.8, but rather an interim closed playtesting release for making sure that all the AI stuff is working correctly. For now, though, here’s a summary of all the final AI stuff implemented this week:


Monasteries and castles were always going to be two of the hardest areas to make work perfectly. Castles are complex because they have so many different classes of NPC going about their day and many different floors, whilst monasteries were always going to be challenging because they can contain many buildings – the monastery itself, a nearly religious building for worship, and potentially delegate housing if in a democratic nation that allows its monasteries to have delegates – and the schedules of the monks include interior and exterior behaviours within the monastery (studying), within the religious building (prayer), and outside (tending to the vegetable garden). Additionally, monasteries are an area with a tiny number of important NPCs (i.e. a couple of the monks) and a large number of semi-important NPCs who should be indistinguishable from the other monks (i.e. the rest of the monks), and these categories need to work correctly despite having quite different code with regards to their scheduling. I’ll be working on all the NPC schedules we need in castles this coming week, but as far as I can tell monasteries are now all working correctly! Here are some examples – you’ve seen lots of monks before, but they now tend their vegetable gardens correctly, and head to bed correctly, although there remain a few minor issues that need resolving for next week…



And a monk (I’m using “monk” for women and men, since “nun” has a lot of connotations that are distinct from monk) in such a monastery:


More Farmers and Innkeeps

As is becoming a pattern, it turned out that farmers and innkeeps were not working perfectly. The issue with the former was in matching up both important and non-important farmers in their homes at the appropriate times in their schedules (e.g. night) and then making sure those farmers are the ones that start farming in the day, instead of spawning a second copy. Later issues were then discovered with various combinations of being in buildings, out of buildings, being important, being unimportant, etc, including a few weird errors that arose because “Farmhouse” wasn’t in a few places it should be in order to acknowledge it as a potential type of house for an NPC.

The issue with the latter was that although 95% of the ambassador code was usable, I had forgotten that the usual movement for innkeeps (wandering around behind the counter) uses a very different chunk of code from ambassadors (wandering around their embassy and sitting at chairs and talking to people), which meant that innkeeps, if they had just been awoken and then the player entered and therefore spawned the building, it would often place them outside the bar’s counter and get them wandering around their own tavern instead of serving drinks! I’ve now fixed all of this nonsense.



A huge number of bugs were resolved this week. For some reason, wandering NPCs who enter a building whilst the player is outside and the building is not spawned, and then the player enters and spawns that building, were not behaving properly and were causing the game to crash by attempting to path outside the building. I don’t understand what caused this, since I don’t think I changed any code that deals with that stuff, or even any code related to that stuff, but either way, it’s now fixed; fixed by dealing with the effect instead of finding the cause, but fixed regardless.

Then we had another very weird bug which took a while to track down, but basically if you moved onto the same tile as a sleeping NPC, on a different floor, and that NPC was of a specific class and had been spawned in a particular way, they would move onto the staircase down, and then just sit there doing nothing. Turned out this was an incredibly old line of code that wasn’t fit to handle buildings of multiple floors, and just needed a single line added, but that took a good few hours to hunt down…

Another bug emerged whereby when you went up a staircase, if you then immediately tried to move onto a tile which was occupied by another NPC, and that NPC wasn’t moving, you could switch places with them. This one meant that, in effect, you could transfer someone off their bed, whilst sleeping, and put them on the staircase. Very silly. Like the first in this list, I’m still not completely sure what caused this, but I’ve fixed it regardless by adding a special line of code that prevents you doing a “force switch” with another NPC so long as you’re on a staircase, since the staircase definitely creates the problem.

I also ran into a really strange bug involving the corners of city walls placed outside those walls. If you were going from Map Grid XlY to Map Grid X,Y-1 and there was a city on Map Grid X+1,Y or Map Grid X+1,Y-1, then the game would check whether you could path to the corner of the map grid (as it should), but rather than concluding that this couldn’t be pathed to (on account of being city wall), it instead concluded it could be pathed to with a path time of 0 moves. As in, it defaulted to 0 as the “error” path length, rather than 9999 or some equivalent. This took a while to find since it has been a long time since I’ve handled the code for keeping track of the time it takes the player to move around the map, but has now been fixed, and no longer teleports the player into impossible corners if they then instantly re-enter a map grid after travelling out of it, and there’s a city wall in the corner.

Another bug emerged where it turned out that moving from map grid to map grid on foot, if the player was outside a city, caused the important NPCs to mysteriously vanish into oblivion. This was because I had originally codded it on the assumption – falsely, but it just didn’t occur to me – that only cities would have important NPCs… but of course monasteries, farms, towns and so forth do as well. This meant that when you simply walked from grid to grid, it didn’t think to check in on important NPCs because the player wasn’t going through a city gate, and everything was tethered to the gates. This was a quick copy-paste job to call the same “Check what important NPCs are doing” function when going over map grids, and as far as I can tell, that should have done it.

Honestly, a ton of this week has been on bug-fixing. It’s a real case of two steps forward, one step back: I code a bunch of new AI stuff, and then discover loads of weird new bugs in the process, spawned from the massive complexity of URR 0.8. Still, there can’t be that many bugs left now… right?

And finally, since this is a relatively screenshot-light entry, some NPCs from a nation I ran into during the process of playtesting. See you all next week for finished monastery AI, and hopefully the completion of the biggest challenge of all – CASTLES.



Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on April 11, 2016, 05:47:35 PM
Well, I wound up taking two days off work and three more days working from home, but I’ve mostly recovered from my recent chest infection through the combination of rest, food, and copious amounts of medicine. This was originally going to be the penultimate AI entry, but having lost over a week in total from this bloody thing, we’ll see how that actually plays out. In the last fortnight, when not hacking and coughing, I’ve been working on finishing off the remaining NPC AI needed to put out the playtesting release in the near future. I worked on castles which were a lot of fun to do all the AI for, most of which is already working really well due to the ability to reuse their code from elsewhere; on making sure merchants, priests and guards in other contexts (i.e. not just cities) all worked correctly, on getting monks and abbots to behave correctly, and on fixing another huge volume of bugs. At this point it’s just castles and monasteries that need finishing, and these are my main tasks for the coming week (assuming, of course, no other illnesses that confine me to bed…). Read on!


Castles have proved to be a very enjoyable break from the rest of this hell – most of their NPCs never leave the building, their schedules are relatively simple, and they’re just so different and aesthetically pleasing that I’ve found this process all rather pleasant. At the moment almost everything seems to work, though there are some tricky things I’ve had to catch where I’d written code for a particular NPC class, forgetting that they could sometimes spawn in castles as well as elsewhere. One example was servants, who in upper-class housing and mansions automatically always sleep in the basement, but in castles actually live on the ground floor (if present); in castles it is only slaves (if present) who sleep below ground. I had to go through quite a bit of code and make sure that the game checked whether servants were in castles or mansions before directing them. The same applied to a few other NPCs, like guards that both sleep and work inside (unique) and so forth. Similarly, I also found that I needed to add in a special line of code for NPCs trying to do inside schedule targets in castles that checked they coud actually path to the target they’d chosen. This might seem obvious and surprising that I hadn’t put it in before, but previously all upper floors of buildings had only one large connected space (even if some of it had permission requirements), so one could always be sure an NPC could path from X to Y on a floor; by contrast, castle upper floors can have parts of turrets and towers that are disconnected from the main floor, and thereby impossible to path to from certain areas, and so NPCs now always check the path they’ve chosen can actually be walked, instead of relying on the game to never generate/choose an unwalkable path. As I say, this was the case until now, but it isn’t any more! Here’s me approaching a castle with some soldiers (‘5’) and guards (‘g’) outside, showing that this is a nation with a standing army:


Here are a few gifs and images from inside a castle (I’ve been using one particular civilization for all my testing, hence the universal silver/grey colour). First we have a throne room with a lot of knights (‘2’). This is a stratocracy, so the ruler’s throne (the yellow symbol in the middle, which will soon have its own unique generation system) has an unusually large amount of high-ranking protection.


The quarters of some soldiers, with various soldiers sleeping off-duty whilst their duplicates guard the castle outside (soldiers appear in castles in nations with standing armies).


Some priests (very slowly) meandering in their respective chapels in a castle for a nation with religious freedom as its ideology; whereas priests in normal churches are programmed to wander around and look at altars and desks and statues and whatever, these folks use the same body of code as chieftains or prisoners or mercenaries, i.e. wandering around within particular confines (since it would be rather odd to have them looking at the altars of others!).


And here we have a servant on the ground floor going about their day, going up one of the towers at the edges/corners (depending on the layout) of the castle and cleaning one of the chairs on the upper floor; on that floor we also find a guard (‘g’) and a knight (‘2’) sleeping. Somewhere their equivalents will be on


Here’s a monetary cache. This nation has a free trade economic policy, so they have a cache of coinage from a range of other nations in the castle – or, y’know, they will very shortly once I implement currencies. For now though, if you see two guards like this – that’s what they’re guarding. Alternatively, another policy (protectionism, I think) leads to a castle having a large cache of domestic coinage instead, and these are mutually exclusive policies, so there will only ever be one, or neither.


Merchants, Priests and Innkeeps in Towns

Merchants and priests all work correctly in towns. I had a momentary bit of panic as I realized that I’d only tested priests and merchants in cities, and although the code should work in towns just as well… there was always a chance it wouldn’t, since various things are stored in different ways in towns and cities. Nevertheless, a little bit of experimentation confirmed that everything was working fine there. Here are two shops in a town near the above castle:



Monks and Monasteries

Wow. Monks and monasteries. What a nightmare. This is taking so much longer than anticipated – the complexity comes from having multiple buildings on one map, all of which might or might not be spawned, and the presence of tasks that take NPCs from one into the other… and various other things besides. Therefore, I have taken the decision to actually massively simplify them as spawning NPCs from this release. Their schedules are just too damned complicated ordinarily and need too much moving between buildings, acting outside buildings, blah blah… it’s all trivial to handle when the player is on the map grid, but when the player is elsewhere, or they’re present and they’ve spawned some buildings in the monastery complex but not others… urgh, what a nightmare. Therefore, for this release, despite the lovely gif of farming monks from a few weeks ago, monks will actually stay completely indoors. They will awaken, get up, do some work throughout the day, then turn back in. For 0.9 I’ll return here and get them tending to their vegetable gardens and visiting the religious building in their complex, but not just yet.


Another fortnight with loads of new bugs discovered and dealt with.

Firstly, we had a bug with categories of NPC who all sleep on the same floor, in the same building, and go to their bed at roughly the same time. If two were targeting the same bed, they would not register it as an inaccessible bed since nobody was on that bed YET, so they would both go there, the person to get there first would claim the bed, and the latter would just stand next to the bed, desperately pining for the bed they could no longer have. Some new lines of code now detect if someone has just stepped onto the bed you’re going after, and NPCs now change directions appropriately; in a future release I’ll have NPCs actually claim specific beds, since right now they only go to general beds – servants will go to any servant bed in their mansion, priests will go to any priest bed in a cathedral, and so forth…

I then ran into a bug that took about four hours to resolve, whereby in a tiny subset of possible religious buildings, priests couldn’t figure out what to do. This took a disappointingly long time to diagnose, especially since it was a block of time that I’d marked out for making sure monasteries worked correctly, but in the end I sorted it out. It happened in religious buildings that contained pools and only a tiny number of chairs/tables, or contained only prayer mats without chairs around tables in the building. These are both pretty rare subsets, but basically the code for choosing locations for humans and priests to meander to weren’t correctly handling pools (they should just gaze into the pool, like the gif below) and weren’t handling prayer mats, since they are stored separately from “chairs”. This is now all sorted, and I think this should work fine for any and all religious buildings.


And here’s a rather nice gif of a matching prayer mat, clothing, and altar, just since I happened to be in a religious building with a pleasing level of colour-coordination:


Then ran into a rather strange bug, whereby people who work in buildings they don’t sleep in, and did everything from their work day before then going to bed and reaching their home away from the player’s observation, would fail to spawn when you then spawned their map grid and went into their home. This one was puzzling, since I’m sure this worked before… but on the other hand, there are so many permutations of saving/loading and whatnot that it may well have been a particular variation I’d missed on my first sweep a few weeks ago. Either way, it all works now!

Next Week

Castle AI finished, Monk/Abbot AI definitely functioning correctly, any remaining tweaking required to put out the playtesting release, and… who knows, I might even start working on the conversation window?!?! But let’s not get ahead of ourselves (for once)…
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on April 18, 2016, 09:11:29 PM
This week I’ve been recovering from my recent thrilling illness, and made a load of progress on the AI for castles, fixing a ton of new AI bugs discovered in the interim, and some other small changes that I wanted to implement. Alas, my week of illness has pushed things back just a tad, but I’m actually still hoping to release the playtesting release next week. It’s going to be close, but my intention is to really focus on URR for the next week and try to get it out next weekend – there aren’t any academic deadlines in the next seven days or so, and those which are a little further past that I’ve made good progress on already, so I’m cautiously optimistic that it might be possible. I still haven’t decided whether to make it public or private (I know, I know…) but I guess I’ll have to decide soon enough. Probably private, though. Either way, here’s a very image- and gif-filled update for you all!


Almost all the AI requirements for castles are now done. As I mentioned last week, this was quite an easy and enjoyable part of AI programming, both because a large part was already done for all the involved NPCs and because castles are just very interesting spaces I enjoy moving around and exploring (even as their designer). The stuff that still needed doing after our previous update was to ensure that all guard exchanges work correctly (which they do, almost entirely), that monks behave in a sensible way (they do), that everyone goes to a logical bed when they turn in for the night, which is surprisingly tricky in a building with so many beds on so many floors (I think they do). As with everything else, this should work regardless of the player’s actions going in/out of the map grid, leaving the building unspawned, spawning the building, etc. Therefore, here are some screenshots.

Monks awakening for the day and moving around the castle:


A guard switch-over when the castle itself has not been spawned; although some of the colours here make it slightly tricky to see at times (I’m still trying to figure out a solution), I love the complexity of this dance as all the conscripts (“6”) and guards (“g”) exit the castle and exchange places with their comrades, before going back inside. In a later version the timings will be varied a little, of course, so that they don’t all appear at the same time, but for the time being this is more than adequate (and does look pretty cool!).


Here we have a bunch of knights guarding the throne room switching places. Sorry for the laggy parts of this gif – there was a lot of debugging stuff going on in the background which slowed it down every now and then.


In a slaving nation, we have several slaves in a castle going about their day and maintaining upkeep of the great hall; this was the same civilization as all the above gifs. A few minor issues arose here with behaviour that had been coded for mansions and manors not quite working perfectly for castles, but I’m pretty confident that’s all resolved now.


Three debugging images of a generated castle with the NPCs placed within it, and where they start. C = conscript, g = guard, K = knight, s = slave, M = monk. They normally start at their guarding locations or their beds, and then start moving as soon as they’re spawned by the player entering the castle.




More Monks

Monasteries have been successfully simplified for this release – abbots and monks now behave entirely indoors within the monastery, rather than venturing outside into the vegetable garden and the religious building at the core of the complex, and thereby causing all manner of confusion. Here we have some monks going to bed and already in bed, and then for reasons unknown I go for a wander into the next part of the monastery before ending the recording…



Lots of fun bugs!

Firstly, something started crashing when I entered inns. It turned out that this was because of a slight typo I’d made in a line of code handling the decisions of important NPCs that accidentally scooped up a particular subset of non-important NPCs (e.g. those who can do their thing in taverns) and caused the game to implode. This wasn’t too tricky to fix once I found the line of code, although it took a fair bit of hunting down. Secondly, we had a bug involving the middle courtyards of castles (see below) which resulted in the player, upon leaving them, sometimes being transported onto the roof of the castle instead of correctly settling into the courtyard. This has also been fixed. Thirdly, we had another bug that caused certain categories of NPCs to duplicate themselves under extremely rare circumstances with the player’s movement and their spawning/non-spawning of buildings at various times in the player’s movement schedule, and this caused a bunch of problems with the clone NPCs overlapping in their schedules, or only doing half of their schedule, or all kinds of strange things. I figured out what the particular permutation was, and dealt with it. Fourthly, I ran into a bunch of problems with soldiers, conscripts and knights attempting to use the code designed for guards (since when guarding, the game should just treat them the same as guards) which needed fixing in a laborious but not massively challenging process, which basically entailed adding [‘Soldier’,’Conscript’,’Knight’] to almost every line of code with ‘Guard’ in it.

Lastly, I discovered a rather fantastic bug whereby guards and conscripts and suchlike inside a castle, who were trying to path outside a castle in order to relieve their comrades, would sometimes path to the internal doors in a castle (if that castle has an external courtyard) and would emerge into the courtyard, not have any idea how to path to their guard partners (despite being outside, and therefore supposedly able to path), and then for reasons I’m not entirely clear on, they would insert themselves into the door (see picture below) and sit there until I noticed them. This has only happened once, because I resolved it immediately after, but I really have no idea how they put themselves into the door. I guess it’s just one of those mysteries.


I also made a range of other minor changes this week in preparation for the interim playtesting release. Firstly, I removed the stat bars from the bottom of the screen, and the stats from the windows on the left of the screen. Those are almost certainly going to need updating/changing in the future, but for now, they’ve just distracting, especially as the game’s current stage is fully about exploration and (once 0.8 is out) talking to people. I’ve also made some minor changes to a bunch of flavour text here and there, primarily relating to travel and the player’s movement in the world, and changed a bunch of things relating to the wording of various items and features and terrain types and the like, as well as clarifying a few mechanics points, keypresses, etc. Naturally my focus is on the AI for the playtesting release, but I want to make it at least a reasonably streamlined experience for the playtesters!

Next Week

All that needs doing is finishing off castle AI, which is mostly done already. Next week will be the last AI update for 0.8, and hopefully the interim playtesting release. Finally!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: AgingMinotaur on April 18, 2016, 11:30:27 PM
Looking wonderful as always. Glad to hear you are better. Don't worry about temporary setbacks, I guess. You know what they say: Release sometime, release sometimes 8)

As always,
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Musaab on April 19, 2016, 06:10:24 AM
Just amazing...
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on April 30, 2016, 11:25:51 AM
Looking wonderful as always. Glad to hear you are better. Don't worry about temporary setbacks, I guess. You know what they say: Release sometime, release sometimes 8)

As always,

Just amazing...

Thanks folks! Greatly appreciated. After this I'm going to put up last week's blog post, then today/tomorrow we'll have this week's, too!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on April 30, 2016, 11:32:21 AM
Ladies and gentlemen, I am pleased beyond words to announce that, as far as I can tell, all the AI requirements for 0.8 are finished! Now, I must qualify this: there are a number of NPC classes that do not yet exist in the game, but those that do exist perform almost all their actions, although there are a small number of events currently omitted (rare or unique events like religious festivals and the like). What this means is that around 80% of all NPCs now do 98% of their schedules, and I think they work correctly no matter what kind of strange behaviour the player involves themselves in with regardless to moving, saving, loading, spawning/unspawning areas, and so forth. As a result, I am indeed putting out the interim playtesting/bug-finding release in the next few days! If you emailed me asking to be on the list, you should find an email in your inbox with details of how to download the playtesting release, and some things to look for, within the week. For the rest of this blog post, therefore, I’ll go over the final additions and refinements done in the last week, and then from next week onwards, we’ll finally be on to dialect and speech generation! I’m so excited. But, first…

Finishing Castles

On Tuesday, Wednesday and Thursday I finished off everything that still needed to be done for castles, and so as far as I can now tell, all the possible NPCs that can spawn in a castle all function correctly with their schedules, their placement, their tracking whether the castle map grid is spawned/unspawned and whether the castle itself is spawned/unspawned, and so on and so forth. One major issue was with sleeping and waking NPCs, and in a few particular contexts guards who should be spawned sleeping in beds were spawned sleeping at their posts, whilst those who should have been on guard duty at their posts were on guard duty in their beds! This got fixed by copying a line of code which should have applied to all guards, but was instead applying to around 90% of them thanks to a typo. I then ran into some issues with entering a castle after the 1080 time of the day (which has 1440 “ticks”, each being ten “turns”) which is when all the guard schedules should switch over; for some strange reasons, the knights guarding the throne room were struggling to spawn correctly and causing a crash, which had *something* to do with beds, but I wasn’t quite sure what.

The “filled” doors are doors to the outside whilst the hollow doors are within one building, so here we see various guards and conscripts going outside. It’s slightly jerky due to all the debug processes printing, but I think it still looks rather snazzy, and I love seeing such a large volume of people going about their day without the game crashing! (You’ll also see slaves and knights in these gifs also just going about their daily business in the castle)


And then immediately after, the guards/conscripts who were guarding outside come back inside and head to appropriate beds:



Here’s a cache guard switching with another cache guards whilst various other guards/knights/etc on the same timetable also move to wherever it is they need to go in order to switch over:


Guards on upper floors wouldn’t behave

As a result, here are some guards and a knight in one of the towers finding their way down correctly, rather than misbehaving terribly:


I ran into a bug whereby I sometimes ran out of beds on certain generations, but only for knights and guards. It took quite some time to diagnose what was actually happening here, but it finally became apparent that when the smallest possible number of beds spawned in the corner/side towers (four per tower, so sixteen total) and the game was trying to place guards and knights in those towers, and there was a cache in the castle, there simply weren’t enough beds, so the NPCs were stuck trying to find a bed; this meant I had to specifically enable their ability to climb up towers to find another bed, but only specific staircases (because the main staircases are in the main castle, rather than in the towers)! The disconnected nature of the upper floors of castles is unique, and has basically required adding in quite a few exceptions to a lot of NPC behaviour which ordinarliy wouldn’t have to think about impossible paths on a given floor.

After that, though, things went quite smoothly with servants, slaves, and monks. Here we have a basement in this castle containing the castle’s slaves, who were all going about their day most of the time and then filed into the basement as time went by:


And monks sleeping at night in their quarters:


I then turned my attention to priests, who – in castles – can fall into two categories. In religious nations you’ll find a single large chapel with a priest walking around inside, whilst in nations that have freedom of religion you’ll find a large number of small chapels, each with a priest (and altar, book, etc) of the appropriate religion. Here’s a priest wandering around a full-size chapel for a nation dominated by a particular religion (you’ll note various servants coming and going at the same time), and then various priests in smaller chapels in a castle in a nation with a plurality of religions:




And I must say there were some cool religions in this castle. Jaguars for the jaguar god!


Then, servants. They work the same as slaves (aside from being on the ground floor instead of underground), and these worked pretty much immediately thanks to all the code in place for slaves. I then moved onto torturers and jailers, who should be spawning in a different section of the basement, away from slave quarters (if slave quarters are present) and who keep to a very simple schedule. Sure enough, these folks seem to work perfectly well now too. Here’s one of them wandering around (I also really love how under-castle jails look, don’t you?).


And heading to bed:


And here’s a torturer checking out the cells under their control (where unfortunate people will one day appear), and in a later version there will be various unpleasant things in the centre of this room, which will vary from nation to nation (so different nations have different methods of torture, if torture is their thing).


And slave quarters and a dungeon in the basement of the same castle, with two different staircases. This is a rare-ish scenario, but meant I had to make absolutely sure that slaves returning to their quarters knew which staircase to take (servants, being on the ground floor instead of the basement, don’t have this issue)…


And that’s pretty much all the NPCs for castles! In future versions I may add in a couple of extra NPCs, like book-keepers for archives and the like, and also I need to add in concubines at an appropriate point – and the actual leaders themselves! – but for now, castles still appear very active when the player wanders around them, and that’s what matters for 0.8.

Final Check, Final Bugs

The last thing to do before sending out the playtesting release is to active all possible AI actors and spend a little while wandering around the world and trying to break them myself. I’ve now done so, and to my absolute delight, I have thus far discovered that everything seemed to be working correctly, although I do still harbour a tiny, tiny concern that certain NPCs in certain houses might not always appear in their houses at the correct times, depending on the player’s actions… but I couldn’t produce any bugs here, so that’s down to be super-secret super-elite playtesting team to figure out.

I’m also going to implement a few debug tools for my playtesters, so they can now look at a debug print-out which shows all the important NPCs in that area, where their homes are, what their current tasks and schedules and objectives are, and so forth. This, naturally, will not be in the final release, but I thought it was a pretty essential feature to maximize the potential of the interim playtesting beta.

Although I have ever confidence in my team, the complexity of all this stuff does mean it has to be possible that the final 0.8 release will go out with a few minor issues still in place. This would be disappointing, of course, but so long as there are no AI related crash bugs present when 0.8 hits the shelves, I’ll be content – it would obviously be even better if there were no AI bugs of any sort whatsoever, but I’m being realistic. Pathfinding and scheduling is massively complicated already and made even more complex by the variety of permutations of spawned/unspawned/loaded/saved areas the player can bring into existence or push into the background through their movements in the game world, and despite my best efforts, I’m sure it’s still possible for an NPC to duplicate, or to vanish into nonexistence, or something else of that sort. But we’ll see! Maybe the playtesting release will be remarkably stable and nobody will find any problems whatsoever.


Next Week

DIALECT GENERATION! For the next week or two I’ll be working on the underlying mechanics for generating different styles of speech for each in-game culture (in the average game we need to produce around 40 very different styles of speech, and ideally many tens of thousands possible across a long enough stretch of time). I’ve started to draft this in various forms over the last month or so, and so next week I’ll give you all a run-down of what I have in mind here. After that we’ll be onto designing the conversation screen! I’ve also been giving this a lot of thought, and I have some idea how this is going to play out, and how it will connect to the dialect/sentence generation stuff I’ve been quietly putting together and experimenting with in the background. See you in a week!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on May 08, 2016, 02:56:44 PM
A huge update this week, so let’s skip the introduction and get on with it!

AI Refinements

I’ve had a wealth of fantastic feedback from my playtesters this week – thank you to you all! As such, I’ve implemented a whole range of fixes, some of which were for issues that I thought had been resolved ages ago, but some code edit in the mean time had apparently ruined, leading to these problems.

Firstly, we had a wealth of problems with servants/slaves in upper-class housing districts entering non-crucial mansions, and then when players enter them, a whole suite of Very Strange things happened, normally resulting in a crash. Quite a few people reported it. This bug was a leftover from a previous model of NPC handling, and required me to prevent random crowd servants/slaves from going into buildings, so now they just move around the district or sometimes leave the district instead; in turn, I’ve disabled servants/slaves in second-tier upper-class houses, and I’ll put them back once I come to 0.9 and I’m putting in all the other NPCs and NPC variations 0.8 will lack. This should all now be fine!


Secondly, I’ve had a bunch of reports of crashes when saving/loading the game, and these are very hard to diagnose, unfortunately, but I think I’ve fixed it. One was a rather strange issue with the pathfinding maps in buildings; these were just saved and loaded, but for some reason this has stopped working when you save and close the program; save and reload works fine. In truth, I don’t really understand what could be causing this in the slightest, but it takes just a few milliseconds to recalculate when you load the game instead of trying to load it from scratch, so I’ve dumped in some code to that effect, which will be sufficient for now. Debug logs still look crazy, though.


Thirdly, a major problem arose with non-“important” NPCs sometimes straying into the code for important NPCs, and being asked by the game to report their “current_step” variable (which relates to how far through they are moving from one district to another on a regular/routine schedule), and the game thereby crashing because they don’t have that variable at all. A lot of people reported this, and it turned out to be pleasingly trivial to diagnose and fix, since it basically required the addition of “if npc.important:” to a particular piece of AI code, and that sorted it out. Result!

We also had an issue with guards failing to appear to relieve other guards in upper-class districts, which has now been fixed:


And ambassadors were not always in their embassies at night, which needed a quick fix:


There were also reported issues of jailers sometimes getting into an infinite loop (fixed), an issue with castles that contained both slaves and jailers/torturers in the basement and they would sometimes try to path to beds in the other segment of the basement and cause the game to go into a loop (fixed), farmers sometimes didn’t always appear on their farms at the right times (fixed), and entering a farmhouse after a farmer who you saw enter, entered, and that farmer wasn’t an important farmer, would cause a crash (fixed), due to them inexplicably attempting to use a line of code designed for guards and knights moving between floors in castles, and the game freaking out with concern about the impossibility of pathing to duplicate mutually-exclusive staircases which didn’t exist. Weird. Also, we had a problem with guards sometimes teleporting themselves into the inside doors of a castle, which was screwing up their ability to exchange places with their counterparts at the right time (fixed, below) and a whole host of little minor problems which I didn’t write down whilst solving, but were generally not crash bugs, but just strange actions.


There is still one issue, which is that if you enter a “farm” map grid at night, the farmers spawn outside and then immediately rush inside to sleep; this really should be fixed, but it’s low priority, so in 0.9 I’ll make sure they appear in their buildings. It’s basically because most farmers being unique, but unimportant, AND being in their own buildings, is a unique combination, which requires some special code to it though. If I don’t mention on the blog that I’ve fixed this in the next couple of months, somebody remind me!

If you’re on the playtesting team, you should have a link to a new version in your inbox in the next few days. For everyone else, suffice to say that major bug-fixing improvements are taking place at the moment, and the team are doing damned well. More news as and when…

Talking Screen

Insanely exciting developments this week! We have a first draft of the conversation screen! It is heavily *in progress*, but check this beautiful thing out:


Now, I’ve been working on how this should look for quite some time and there’s a lot of stuff here to explain and describe, so let’s take it in order. Firstly, when you want to talk to someone you press ‘s’ for speak – ‘t’ is currently used for throw, and the options are therefore “throw” and “speak”, or “chuck” and “talk” – I think we can all agree that chuck is far too informal, so the first option is obviously better. This gives you a crosshair like the look function and the grab function and so forth, which can be moved in a 7×7 square centred on the player. Anyone in that area, and without your line of sight and on an explored tile (so you can’t exploit it by trying to speak through walls and finding where other NPCs are!) can be spoken with by pressing Enter, which brings you to the above screen. (In the below gif I quite rudely start talking to an NPC whilst they’re sleeping, but these are early days – naturally waking someone else will soon have some effect on their mood in the conversation).


Once you’re there, we have a bunch of options, which fall into three categories. Firstly, we have the “standard options”.


These are the options that the player will be given for every single person they ever talk to. These will be related to the player’s “memory” (which will soon replace the existing “encyclopedia”, which is to say that you can ask anyone a question about any sub-topic within these topics, so for every important painting you’ve seen, you’ll be able to raise it as a potential topic of conversation (if you’re thinking “this will make for extremely tedious optimal gameplay – don’t worry, I have a solution, which is later in this entry). These options will likely form the majority of one’s conversations, and allow for a great breadth in potential conversation topics. Naturally, some people will be more or less willing to discuss each topic, for reasons of their own preferences or their culture/religion.

Then, we have the “special options”.


These are options specific to the class of NPC you’re talking to. A priest will give you options like “Worship”, “Holy Book” and “Relics” that we see here; a servant or slave will show “Tasks”; a noble or lord might show “Family”; an archivist will show “Archives” and “Tombs”; and so on and so forth. There are never more than four special options, but quite a few classes of NPC now have four special options listed. These will often be the crucial topics to speak about with an NPC, but naturally the standard options will also often yield important or interesting data of various sorts. I think these add a nice sense of variety when encountering new types of NPC, and also direct players to some almost “recommended” topics of conversation, which might be especially important when people are learning the game and find themselves a little overwhelmed by the sheer volume of Stuff you can talk about.

And thirdly we have the “dialect” option.


Now, you may be thinking – what is to stop the player simply asking every single question to every important NPC in the hope of extracting some information? We all know that gamers can often be satisfied with performing some very unexciting things in games if they are gameplay-optimal, and naturally I therefore don’t want it to be gameplay-optimal to “grind” in this way and just ask everything you can in the hope of landing upon something which matters. Once you’ve explored the world a fair bit, you are going to have hundreds, and potentially (in the late game) thousands of things which you could ask a given NPC. The solution to this problem is rather simple, and I think rather elegant. Basically, all NPCs will have a “conversation interest” meter, hidden to the player, but reflected in the tone with which they speak. If you ask relevant questions, the conversation continues. If you don’t, they will quickly become disinterested, and past a certain point, just end the conversation with you. This will therefore strongly encourage the player towards focusing only on conversation topics you know are important, or towards those you think might be important, getting the player to make intelligent and informed judgements instead of just taking a shot on every conversation option. This is very different to most games with conversation options, in which players are generally strongly encouraged to exhaust every conversation tree, and I think it’ll be interesting to see how this plays out.

Also, I then thought of a way even this could be exploited – end the conversation, start a new conversation, try some more options, etc – but that’s also readily fixed. Characters who end the conversation due to your stupid or irrelevant questions will be unwilling to start a new conversation for a period of time, and since time will be the fundamental “food clock” resource in URR, you won’t (in almost all cases) be able to just wait around until they reset (a few days? A week?), and if you do, then it will have to be a strategic choice because you strongly feel you need to speak to a character who has previously shunned you.

Anyway, back to the screen. When you select an option you’ll get a list of every possible topic, and whether you know the dialect well enough to speak that question in that dialect (I’m still working on how exactly that will be “acquired”). These are empty for now, but will be one of the next things I’ll work on. We also see two images at the top of the screen, for the player and the person you’re talking to, whilst the conversation will scroll up (and be scroll-able) in the middle of the screen, with your comments left-aligned and the comments of the other character right-aligned. These are all the things I’ll be putting together in the next few weeks!

Lastly, on dialects, I would also like to add (on a more personal note) how enjoyable it is to be working on the speech generation/conversation system stuff! There’s a real pleasure to be found in starting to work on an entirely new and very cool system, and the past few days have been a great little period of starting to piece the disparate components required together. I’m really happy with how this initially looks and excited to keep working on this in the coming weeks. Stay tuned!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on May 14, 2016, 06:50:16 PM
Playtesting and Bugfixing

Lots of new bugs fixed thanks to the playtesting team!

Fixed a very rare issue where important NPCs, moving in a map grid you are in, and then you leave, will crash upon trying to calculate how long it will take them to hypothetically complete their task, which is a number the game needs in case the player doesn’t return to that map grid, and therefore the important NPC must “tick” over into their next task at the appropriate time – and, if the player returns to the grid half-way through the NPC concluding their task, the important NPC should be half way there. The problem would arise from a random NPC being placed on the important NPC’s target square, and preventing them from reaching it and the game from acknowledging that they’d finished testing out their remaining steps. To fix this the game checks if there is a random NPC, and if there is, it deletes it. If there’s another important npc there (super rare, but… I think it has to be possible?) then it shifts them aside by one tile, has the first important NPC test their route, then shifts them back. It’s not super-elegant, but it’s entirely unseen by the player and gets the job done, and fixes a crash bug that a good two or three people reported.

Fixed an issue with guards under very rare circumstances in castles not correctly exchanging themselves with the other appropriate guards, which now works fine again. (Again, as before, they tend to change over at the exact same time, and that’s a truly minor aesthetic thing I’ll alter in the future).


Fixed another bug where, for a small subset of possible nomadic fortresses, merchants wouldn’t spawn because I’d failed to ensure that there were spawn points for all the (twelve?) possible market generation algorithms. Fixed another bug which had slaves/servants failing to spawn in large-but-not-massive mansions in upper class districts, due to a rather silly typo in the function that generates them and wasn’t adding beds on the bottom floor to the list of beds that slaves/servants could spawn upon. Also fixed a bug with doors and iron bars in torture chambers in dungeons in castles, whereby looking at the bars would very rather fail to produce a picture, whilst looking at the doors would often result in a crash, due to the lack of a wall nearby for the game to use as the correct terrain/texture (this was quickly fixed by adding an exception telling the game to look further in the map for the right wall terrain instead of just the surrounding tiles, which is adequate in every single case/scenario except this one).

At this point, it is actually looking like… dare I say it… everything for NPC AI / scheduling / pathfinding is basically working? The volume of bug reports have slowed down from a torrent to a mere stream, and nobody has found any truly catastrophic issues that required me to seriously rewrite large portions of code.


Guards and Merchants in Fortresses

I’ve also continued to work on AI and NPCs and whatnot in the background whilst I wait for my playtesters to send me more bugs and issues. For instance, similar to a question I posed a little while ago about NPCs working correctly in towns, i.e. out of cities, came a similar question – would guards and merchants work correctly in nomadic fortresses?! Short answer: no, there were some serious issues with merchant scheduling, although guard scheduling appears to work completely fine. I had to put in quite a bit of new code to ensure that merchants were spawned correctly at the right places (whether in house or at their stalls), and to ensure that when merchants awake for the day and leave the house, they actually go directly to their stalls, and that when you leave and come back, the game actually correctly spawns the merchants at their outside shops instead of placing them in an imaginary “shop” building (which would be correct for a city, but is not correct for a fortress). Here’s a bunch of gifs from fortresses, the first three of merchants selling their wares, at home, and then emerging and returning to their location (a two-part gif).





However, as you will note… this does again raise the issue of skin tone and soil/sand colours. As I said a few entries ago, I’m going to try fiddling with the sand colours, and potentially making soil more of a “red brown” and even the darkest skin tones a little closer to “light brown”. It’s damned tricky though when you only have one-colour tiles to play with, in most cases, and there are only so many shades which are even light enough to see in the first place! Still: I’ll fiddle with these colours a bit and try to make sure that darker skin tones and soil/sand stand out a little better than they do at the moment, since although you can follow this, it’s obviously nowhere near as clear as dark skin tones on lighter terrain types / light skin tones on darker terrain types, and this is an issue that needs fixing somehow.

Conversation Window

You’ll notice a few other slight changes to the conversation list: “Exchange” and “Challenge” have been added, whilst one or two other options have either been removed, or subsumed into a larger category. “Exchange” is distinct from “Trade”, which is only an option for merchants and is explicitly for offering money, in exchange for an item, which they are selling; by contrast, “Exchange” will allow you to either demand something from them for nothing, or offer them something for nothing, or propose an exchange of items/information/money/anything else. It’ll then up to the other character to determine whether or not they want to accept the offer/demand/exchange, or they’re offended by it, flattered by it, etc. I realized that this was a pretty crucial thing to add, so that’s now in there, and will lead to a slightly different screen to the rest of the conversation options, although some of the others are definitely going to have unique/distinct stuff too. When clicked on, it’ll bring up three windows – one for your items/intelligence, one for their items/intelligence, and then a middle window to put in items from both lists and see what they think of it. The same window will be used for bartering in nations that aren’t especially fond of coinage.

“Challenge”, meanwhile, will be another more detailed function to allow the player to challenge another NPC at various things – or, at least, offer/demand a challenge. This could be a battle, or to accuse them of something, or offer to gamble with them, or anything of that sort. This will probably be developed a little later once I have some idea of what kinds of things you should be able to challenge NPCs at/with/for! This will bring up two windows, one for the nature of the challenge, and one for the stakes that you propose .The same two windows will probably be used for “Smithing” as a conversation topic, to decide on what you want smithed, and the resources/payment you want to contribute. Anyway, I think both of these more complex options will be very interesting and very important, alongside the other “standard” conversation options which will list topics the player can potentially speak about.

In this gif, we look at a standard conversation option which will give you one window with a list of things you can say and whether you know how to convincingly say them in that dialect, then we move onto the “Challenge” option which shows us two windows, and then “Exchange” which shows us three. Hopefully by next week we should have some idea of what’ll be in these options! (You’ll note the below gif was taken before name implementation)


0.8 Small Changes

I’ve spent some of this past week also putting in a somewhat sizeable range of small edits for 0.8 across a range of areas.

I’ve removed the “History” and “Heresies” options from the encyclopedia. The histories option has been removed because it no longer correlated well with the new forms of name generation for each nation (as outlined in this and the previous entry), and because this needs a substantial re-write anyway, and because in the near future players should be discovering the world’s history through their actions and conversations, rather than in the encyclopedia. The “heresies” option has been removed because it was always just a very early draft when I first implemented it, and it really needs a lot more work before I’m happy making it a core part of the game. Equally, as discussed before, the encyclopedia won’t be around for long anyway, so I don’t think it’s a tremendous loss to remove these options. In the Guidebook, meanwhile, I’ve updated the “Controls” list, disabled the “Histories” section, and updated the “NPC Types” list, as well as changed a couple of comments in a few entries which were no longer totally accurate.

I’ve also updated the policy descriptions for each nation, since these were out of date, and didn’t fit! Again, before too long these will probably be less visible and abstracted out, but it’s an important improvement for now. I’ve also updated the “0.7” stuff everywhere to “0.8”, and various other fiddlings just to fix things here and there. Quite a few people reported as bugs things that I’d just put in as placeholders, so I thought it was important to prevent any future confusion! I also disabled the “grab” function (for pulling/pushing large objects) since a) it isn’t relevant right now and b) it doesn’t seem to be working properly.

Next Week

Names will be integrated from the experimental file into the main game, and I’ll be figuring out how exactly dialects are learned. I have come up with four main options, and I think the fourth is definitely the strongest from a gameplay perspective, but I want to get some feedback before I go ahead in put in all the infrastructure for this! And probably some more bug fixes, but I am rather pleased to note that bug reports have trickled off, so I’m quietly hopeful we’ve now fixed all the major issues with 0.8…
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Aleksanderus on May 15, 2016, 07:36:59 AM
So playtesting was very useful after all!  ;D
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Tzan on May 15, 2016, 03:14:31 PM
How many testers did you get?
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on May 21, 2016, 04:05:53 PM
Got about 30 or 40 signups, and tons of good feedback!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on May 23, 2016, 07:59:08 PM
This week has been absolutely bonkers with academic commitments, personal commitments, and travelling all around the country, and I just haven’t had time to program very much at all. However, there is a major question I’d like some input on, which is what this entry is going to be about – and, indeed, it’s actually important to resolve this question before going too much further.

Learning Dialects

I’ve got the conversation window opened up. You can see yourself and the person you’re talking to, browse the appropriate options, and access some special windows for challenging the person you’re talking to, exchanging or buying/selling items, etc. The next stage (this is the task for this and next week) is to add in the full database of possible sentences, add in a data structure to allow new sentences to be easily added (by me in the future) and easily “unlocked” (e.g. when you learn about a painting, you can then talk about that painting), and in order to do this, I need to think about the other half of the conversation system: being able to ask these questions in appropriate dialects. We now therefore face a rather challenging question: how does the player learn a dialect? I see several options, and I’m still not quite sure which one to go for.

1) You can only say a sentence in a dialect once you have heard that sentence. This would be the simplest; I’d add some colour variation in sentences said by the other person in a conversation to show whether a) you already knew that dialect bit or b) you were hearing it for the first time.

2) You gradually acquire % knowledge, and it is distributed randomly across topics. This could have a range of methods: maybe it’s the number of conversations you have, or the time you spend in a particular nation (though I’d have to make sure that couldn’t be exploited by just running around in the forest, so maybe settlements only!), or something else; as time goes by you can say more and more in that dialect.

3) You can acquire books, or blocks of knowledge, which teach you *everything* in a dialect for *certain topics*. So, for instance, a book called “Laws and Finance in the Nation of Mugoppe” will, once acquired, allow you to speak like a native on the “Laws” and “Money” topics; similarly, perhaps certain characters can be encouraged to tell you everything about a certain topic, which then triggers a little under-the-hood acknowledgement of the same thing, i.e. you can now speak on that topic as a native.

4) Some combination of the above?

5) Something I haven’t thought of?

So, from readers, may I request: can you think about these options, and any potential fourth options you might conceive of, and let me know your thoughts? The basic requirements are for there to be a truly MASSIVE volume of potential sentences, a volume of sentences which can be added to as the player discovers more about the world, and a “learning” system that is interesting, distinctive, and can be somehow “distributed” throughout the world – i.e. you will always learn languages gradually, rather than instantly. This might be fast if the player specifically sets themselves to quickly learning a dialect and doing X (the learning process) a lot, but it should never be instant; there needs to be the option for the player character to know a tiny part of a dialect, a lot of a dialect, some of a dialect, etc.

There’s also  an additional exciting technical question of how to code and store it all… but my intention is to get to plan that out in the next few days once I have some idea of how it should all work!

Also, for this release, I think the player will have full access to every dialect, but in the very near future (0.9 or 0.10) that will change, and the player will have to learn each form of speech for each dialect via whatever means we decide upon.

Chatbots or Robots

A very interesting idea came up in URR’s Bay12 thread this week about whether URR could perhaps instead use chatbots rather than the “option robot” approach. A very strong argument was made for it, and I did actually seriously ponder it for several days, but in the end I decided it wasn’t the right move. Succinctly, my reasons were:

Technical/speed – I’ve never used a chatbot before, and it would require a potentially lengthy process of up-skilling, and I’m really desperate to get 0.8 out asap.

Clues – how easy/hard would it be to program a chatbot to “drop clues” of the right sorts at the right moments in the right context? I have no idea, but I don’t think it would be easy, and given the above point, I don’t know where I’d even start!

Annoyance – a chatbot means the player has to type things, and selecting greetings is one thing, but typing out a greeting every time would quickly get quite infuriating I think. Don’t get me wrong, it would be super cool if the player learned things rather than the player and the player character learning things, but the corrolary there is that the player would have to type everything.

Uniqueness – I already think the system I’ve proposed here will be very different to any other “option robot”, although I am certainly open to further ideas about how to further differentiate it. This is because: a) You have a massive wealth of options and no explicit clues towards what you should say, or implicit “suggestions” for what you should say (i.e. games tend not to give you “pointless” options, but URR will effectively do so, but it’s up to you to decide which are useful/pointless), b) you cannot exhaust all options and have to carefully choose options, c) you’ll be speaking in and moving between dialects and different styles to say the same things. I feel the combination of those three will be very distinctive.

So, I decided not to go to with the chatbot, but I thought it was an interesting enough idea to be worth posting here, in case anyone else has some other ideas, or some other ways to make the system even more distinctive (but you’ll have to be fast, coding starts this week!). Of course, had I elected to go with the chatbot model, I wouldn’t have needed to think about the player character learning dialects as discussed above in this entry, since it would be up to the player themselves, but for the reasons above, chatbots just don’t seem like the best solution for URR.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on May 31, 2016, 12:53:34 PM
This week's blog entry touched on lots of things (including my first live TV experience!), so the full thing can be read at http://www.ultimaratioregum.co.uk/game/2016/05/30/television-canada-dialects-talks-esports/, but here's the URR-specific bit, about dialects and whatnot.

Dialect System

In light of all the excellent comments last week, I have some idea of how dialect learning will now take place in the game. The overwhelming answer seemed to be “some combination of 1 and 3”, and I agree that this is the best solution. If you’re talking to someone about a topic and they make mention of a particular aspect of that topic, then you’ve heard someone say that particular thing in that dialect, and that’ll get added to your list. Alternatively, you’ll be able to buy books or ask someone to specifically tell you about extensively about a particular topic (for a price), both of which will add appropriate information to your database for that dialect. There were also five really interesting ideas raised which I hadn’t thought about, and here they are, and my thoughts on them:

General books? It was suggested that perhaps one could build up a reserve of “points” which are acquired through “general books”, perhaps, which allows you to talk in a dialect for quite a while without needing expertise, but once you exhausts that knowledge of the “basics” of the language, you then pursue more specialist information. I quite like this idea for the basics, and perhaps a system where you can choose where to focus this basic learning? It needs a little more thought, but I think it has promise. Verdict: Probably.

Event learning? The idea was put forward that your character can learn dialect information by attending particular events. I think this could be a fantastic middle-ground between learning language bits just by hanging around in a city, and learning from items – if you go to an arena you’ll learn how to talk about combat, going to a religious festival will let you overhear info about that religion, etc. I’ll have to think about how exactly to put this in to prevent farming/tedium, but I really like it. Verdict: almost certainly.

Fast forward feature? One comment suggested that you can choose to spend time in a city just learning the dialect as another means of acquisition. I think if I implement this you will not be able to pick up language just by hanging around in a city normally, but you will be able to choose to click a button to spend X time in a city talking to people, and at the end of that time your dialect proficiency will go up; spending time as a resource, therefore, which is always a good option in a roguelike. Verdict: Probably.

Learning basics helps you learn advanced? It was suggested that you learn advanced parts of a language faster the more of the basics you know, but I’m not sure how well that would line up with learnings in “chunks” through books, events, etc, but the concept makes a lot of sense. I’ll think more about how to add this. Verdict: Maybe.

Mastery? The idea came up that when you reach over a certain % of a dialect, you are automatically given the small parts you don’t have – so when you have 90%, for instance, everything is automatically filled in, since your player character can “work out” how everything else would be said. This makes a lot of gameplay and thematic sense, and I like it. Verdict: Definitely.

Also, I realize that I should make explicit the difference I’m intending here between “languages” and “dialects”! All the major civilizations in the game world will “speak English”, but different dialects of it which produce different phrasings, different ways of speaking, etc. By contrast, smaller tribal civilizations will speak their own languages, which will need their own systems I haven’t quite decided on yet…
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on June 05, 2016, 05:28:41 PM
Remember that technical stuff I talked about last time, and the dialect learning system we discussed the week before? This is going to be one of those rare URRpdates which is actually semi-technical, and I’m going to talk a little bit about how I’m going to implement and store the player’s knowledge of each dialect.

Dialects vs Languages

Firstly, as mentioned last week, I’m talking currently only about dialects – which for the sake of URR I’m currently defining as “a way of speaking English” – rather than languages, which in the URR context I’m defining as a totally different set of characters being used for speech, which might be unintelligible to the player character. The latter will be used for tribal nations (once I figure out a way to implement it that isn’t totally infuriating), but for 0.8 and all immediate future releases, we’ll be focusing on dialects rather than entire languages. It was suggested on URR’s Bay12 thread this week that languages could actually play a small role in the “main” civilizations of the world, i.e. the feudal and nomadic ones, by having 3/4/5 languages across the world as well as dialects, so that you have a lot of nations you can visit that speak your language (which would offset the potential annoyance of having exploration curtailed by language problems) but there are still multiple languages even in the large nations of the URR world. I’m pondering this option and haven’t reached any conclusions yet, but it’s definitely an interesting option.

Technical Specifics

So, I am faced with a bunch of interesting challenges here. I see these four in particular, and I have four solutions I’m currently implementing, with the target of having a working model by this time next week, and some nice screenshots to show off!

Firstly, a system is required that can both keep track of standard “sentence meanings” – such as [Standard Greeting] – and however many custom sentence meanings might be required within a particular game world, such as [Ask about the painting “Sunrise over the Empire of Nurnek”], which will obviously be unique to that particular playthrough. These should all be given to the player in the same way and at the same time, so that the player starts with just a bunch of standard conversation options, and then as time goes by and they learn more about that generated world, they’ll gain a massive range of other conversation options. My intention is that upon world generation, the player will be given a range of sets of the sort greeting_questions = [], farewell_questions = [], and so forth. These will then be populated with a standard set, but they can also be added to manually by the game as a particular playthrough proceeds; so encountering a work of art will append a new possible sentence about that work of art. In turn, each of these additional sentences will be part of an archetype, e.g. “ask about painting”, “ask about sculpture”, etc, and a “tag” on each will keep track of what each sentence means, so that when the player learns how to say [Ask about painting “X”], every sentence of that sort becomes ask-able. A quick mock-up of how this should look, if the player had clicked on the “Past Life” option:


Secondly, the game needs to track what dialects the player character can and cannot say each thing in. This has two obvious options – either the game tracks sentences and lists for each one the appropriate dialects the player knows, or lists the dialects and tracks the sentences that can be said. It became immediately clear that it should track the sentences and then record valid dialects for each sentence, rather than the other way around – if I tracked the dialects, then each dialect would quickly fill up a massive list of valid sentences which would take a long (“long” by roguelike standards) time for the game to sort through each time. Therefore, the game tracks all sentences, and in each sentences has a list of numbers, which relate to each civilization whose dialect the player can say that sentence within.

Thirdly, a method for storing dialects themselves is needed. I’m not currently completely sure about the correct method to do this, but it’s one of the things I’ll be thinking about this coming week, and then implementing the week after. If you look at the URR slides below, you’ll get a good impression of the variables that need to be recorded, and those need to be put into each civilization somehow. More on this later!

Fourthly, we need a method for sorting through certain conversation options that might come with a particularly large volume of viable options. For example, regardless of your dialect, the “Greeting” menu might only have a few options – “Warm Greeting”, “Greeting”, “Terse Greeting”, etc. By contrast, the “art” menu will end up including every piece of artwork you ever see, and if you reach the end of the game, and you’ve investigated a lot of galleries, mansions, cathedrals, castles… it’s going to be the pretty colossal list, and there probably needs to be some way for the player to immediately sort through them. Maybe options to sort by civilization, or start typing in a word and it tries to match that up? So once you know a particular piece of art called “Sunrise over the Great Southern Ocean”, you can type in “Sunri” and it’ll immediately offer you that option. There could be other methods, but I think some combination of those might be the best.

My intention for this week, therefore, is to populate all the option menus with an appropriate set of options, and to start figuring out how exactly to store dialects and therefore generate sentences. More soon! And here’s another mockup I put together for this week’s presentation:


Lastly, if you want the slides from my recent talks in Canada, head here! http://www.ultimaratioregum.co.uk/game/2016/06/05/dialects-the-technical-side/
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: jere on June 08, 2016, 04:33:21 PM
Fourthly, we need a method for sorting through certain conversation options that might come with a particularly large volume of viable options. For example, regardless of your dialect, the “Greeting” menu might only have a few options – “Warm Greeting”, “Greeting”, “Terse Greeting”, etc. By contrast, the “art” menu will end up including every piece of artwork you ever see, and if you reach the end of the game, and you’ve investigated a lot of galleries, mansions, cathedrals, castles… it’s going to be the pretty colossal list, and there probably needs to be some way for the player to immediately sort through them. Maybe options to sort by civilization, or start typing in a word and it tries to match that up? So once you know a particular piece of art called “Sunrise over the Great Southern Ocean”, you can type in “Sunri” and it’ll immediately offer you that option. There could be other methods, but I think some combination of those might be the best.

Search is good. One of the issues I ran into with TOSTTDK is a huge number of books gets generated and I currently just have them sitting in a menu list, which is quite unwieldy. I really need to add a search feature.

I played Her Story last year and it pretty much blew my mind. At heart, the game is about searching because the gameplay involves literally searching for video clips by keywords. In Her Story, the limitation is that you can only see the first 5 results for any query, so stop words like "the" and "you" won't unlock everything. Search isn't just some fiddly user interface in this context, but is in fact a way of reifying thoughts, questions, and relationships. In order to know the right keywords to search, you have to think pretty hard about what concepts are the most relevant and what leads might be the most fruitful. It really does make you feel like a clever detective, which I think is part of the feeling you're trying to evoke with URR. Search as a game mechanic is untapped potential. Something worth looking into if you haven't already.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on June 11, 2016, 11:58:40 AM
Thanks for the thoughts! I completely agree, search as a game mechanic is definitely untapped, and I'm really keen to (late this calendar year, or early next calendar year) start work on those elements of URR. Also, that's very interesting, as I actually didn't know Her Story had those elements in it. I'll have to investigate!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on June 11, 2016, 04:35:53 PM
Just a short update this week on a lot of things outside URR, but implementing the conversation system is proceeding, and we should have a lot of stuff to show there next week! In the mean time, a general "what am I doing with my time?" update can be found here, with some rather nice ANSI art: http://www.ultimaratioregum.co.uk/game/2016/06/11/micro-update/
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on June 21, 2016, 10:51:35 PM
I’m pleased to report a nice big (if two-day delayed) URRpdate this week! Lots of progress has been made in the last fortnight, and now we can scroll through all the standard options for each conversation options, with an appropriate pairing of colours to denote whether you know how to say it in the dialect you’re currently speaking (if you don’t and you select that option, it will say it in your home dialect, thereby “giving you away” somewhat if you pretending to belong to a different culture); and in the future I might add a language layer as well, assuming I come up with a good mechanic for language-learning and language-based gameplay.

So, firstly, here’s now the conversation menu looks now, with and without a scroll bar. I’m still finishing off the coding on the scroll bar as these things are really just remarkably awkward and difficult to program in well, especially when you have options that can take up multiple lines and change size, and be sorted into windows of different sizes depending on the player’s selected options. Nevertheless, screenshots/gifs:



These are all, of course, only the default options, as the system for implementing extra questions is not yet in place, but will be soon! So as you can see, we’re going for a two-part colour coding here: green and white means that you’ve got the knowledge to say that in the chosen dialect (obviously you can say everything perfectly in your home dialect, otherwise you’d be in serious trouble!), red and grey means you haven’t. For looking at dialects, the currently-selected dialect shows up with a blue diamond and all the other dialects you know anything of have a red ‘X’. When you’re in the “Challenge” and “Smithing” options and the other options that have two windows, selected/rejected options will be displayed the same way; when you’re trading, which has three windows (your trade goods, selected trade, their trade goods), the items in the middle window will have a < or > arrow next to them showing which person of the two trading parties (i.e. you and the person you’re talking to) they came from.

Now, some techy stuff. When the world is generated, the game now has an (in the process of being written) list of every possible question archetype. There will probably be somewhere between one and two hundred default questions, at a guess, and finishing these off is one of my tasks for the coming week. As for questions that are generated? Well, every question of the sort “What do you think of [work of art]?” will simply be a variation of a default “What do you think of a specific work of art?” question, and once that question is learned the player will be able to ask about any work of art. Those meta-level questions are not present in this initial list, since one would never ask “What do you think of a specific work of art?” without stating the work of art in question, but they are also stored, albeit in separate lists. I am still calculating exactly what the best way to store the player’s dialect knowledge of these meta-questions, but I expect we’ll have a large list of meta-level questions – since there aren’t that many (ask about an artwork, a city, a town, a book, a poem, etc) I think they should be stored fine in their own list.


You’ll note a “gap” between the top and bottom lists; the bottom list is for question topics that only show up when you talk to particular classes of NPC, whereas the top lists apply to everyone. Of the two special instances shown in the above picture, for instance, the “tombs” questions apply to priests and archivists in cathedrals, whilst the “harvest” questions (as you might expect) apply to farmers. In turn, each question in each category has a list added onto the end of it, which contains a set of numbers, relating to which dialects the player does/doesn’t know how to ask that particular question in. This system obviously requires me to type out all the standard question forms – which I’d have to do anyway, regardless of system! – but works very rapidly in the speech system when listing possible statements and whether they can be said in a particular dialect. Upon a particular sentence being selected, the game will then translate the overall question into a specific question for that dialect – so “Who built the tombs?” might become “By the efforts of what craftspeople were these tombs carved?”, or “What people created these great crypts?”, or “Under what ruler were this tombs mined out?”… and so forth, and the same then obviously applies to every possible question, including the generated ones. As well as finishing all the question lists, the other goals for this week are ensuring the scroll bars work correctly, storing the meta-questions, properly allowing the player to switch dialect, and allowing the player to start typing something and then have the list of potential questions adjust themselves based on the “search” – as we discussed before, this is going to be *vital* for some of the really long question lists.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on June 27, 2016, 01:02:00 PM
An even bigger update this week! I made a lot of headway on my academic commitments (one of which can be seen at the bottom of this update) and so I managed to carve out quite a few evenings to really focus on game development for a bit. This week I added the current list of every single standard conversation option (which is then generated for each culture when spoken), implemented the scroll bars for going through some of the longer lists, allowed the player to change their dialect and see what they can see in each dialect (I haven’t yet decided how much dialect knowledge will be present in this release – we’ll see), and then implemented a system for keeping track of all the meta-questions (such as “Please tell me about [novel]”) and what dialects the player can say those in! Lots of big progress therefore, and all the underlying aspects of the conversation system are now there – except selecting options and having them appear in the conversation itself – and all the elements of the dialect generation system are now there – except for exhaustive generation of every possible statement. My task for this week, therefore, is to make as much progress as possible in these two areas. I have no idea how fast/slow these will be, but I’m confident about having something solid to show you all in a week from now. In the mean time, though, here’s some more detail about the latest developments:

Conversation Options

I’ve created a draft list of every single default conversation option in the game. I haven’t actually counted them up but there are several hundred default options, and these will be available in every conversation, as well as another hundred or so “default” options limited to a specific class of NPC (so you can ask a guard about guard duty, an archivist about their archives, etc etc). Here’s a screenshot with an entirely incomplete section of potential default questions, and a gif of looking through the default question options for a whole bunch of conversation options:



I’m sure I’ll keep adding new questions here, but I’ve built the rest of the technical architecture (i.e. the parts more complex than the lists shown here) in such a way that just adding something to the lists here will implement a new question in all the relevant parts of the game’s code where it should be, and allow me to put in a system for generating that question. You’ll also note the different colours! After some excellent thoughts in a comment last week, there is now a range of knowledge the player can have about a given sentence. A green diamond means you can say it perfectly in that dialect; a red diamond means that there is absolutely no chance you will say it correctly; but the interesting ones are the numbers, which range from 1 -> 9 and mean you have a tiny -> very high chance of saying it correctly. If you select one of those options, a die will be rolled to decide if your character says it correctly. If they do, that sentence is then elevated up to a green diamond; if no, it is reduced by 1 or 2 (we’ll see how this goes in gameplay) making it harder to correctly guess next time you try (since you thought you knew it, but didn’t, so actually have less info than you thought). In terms of how these numbers will go up – learning a single sentence in a dialect will means that X other unknown sentences in that category will be moved upwards by Y values; X and Y will be both dependent on the size of the category. The “greeting” category, for instance, only has three options – “Polite Greeting”, “Neutral Greeting” and “Blunt Greeting”. If those are all at values of 0, and then you hear someone give you a polite greeting so that becomes a 1, the others will also immediately go up to around 0.3, for example. By contrast, the ideology category contains almost two dozen standard entries, so learning from from 0 -> 1 might add a 0.1 onto three or four of the others. This means two things – firstly, some interesting and I think valuable chance-based gameplay where you decide whether or not to risk a sentence you might be able to say correctly. Secondly, the player character’s knowledge of a particular dialect will be a more gradual development process, rather than an absolute (although some things will still immediately move you from “0” to “1” knowledge). I think this is a really good development, and I’m so glad it was suggested last week – it also makes the UI look far more interesting!


The scroll bars in the conversation window now work correctly. I don’t know if any of you have ever tried to program in scroll bars, but these things can be surprisingly nightmarish to code, I’ve found, but they all work rather nicely. Here’s me scrolling through the list of dialects (which is entirely complete for now, but will of course start off almost empty in future versions) and the scroll bar adjusting appropriately. I know it’s only a small thing, but these sorts of UI elements are definitely important when you’re going to have potentially large volumes of stuff to look through. Which leads onto the next section…



On the topic of large volumes of stuff, I’ve also implemented the system for being able to search through a particular block of possible questions and narrow them down based on some typed letters. As you type letters into a particular window, they show up at the top; backspacing then remove them; and the game quickly updates the list of possible questions. Here’s an example of           – I typed quite slowly in this example to show the list shortening, as it shortens quite fast as soon as you’ve got a few letters in there, and then backspaced back and typed in quickly just to demonstrate that the system works effectively. In the future, therefore, even in conversation categories where there might be hundreds of options – towns, artworks, novels, etc – you’ll be immediately able to just type in “Red” to find the “Town of Red Eagle” in a second without having to scroll through potentially a hundred options. I was actually very surprised by how easy this turned out to be – I was expecting implementing search functions with large volumes of entries to take far longer. Here’s a gif of me typing in “when” into the “Past Life” category – this short category is not one you’d necessarily want to search, but it illustrates how the search function works (note the “when” appearing at the top of the window as you type it, and then the questions are narrowed down).


Changing Dialect

You can now change dialect. Selecting a new dialect switches the player’s current_dialect value, and all the conversation options then update based on whether or not you know the new dialect. Fairly simply, but obviously important. For now, all dialect knowledge is totally randomized for the sake of testing – not sure how I’ll leave this for the release. Depends on timing!


I’ve also implemented a draft list of meta-questions. There are the “What do you think of X” questions where the full list of such questions slowly expands as the player discovers more and more of the world. As there aren’t too many of these meta-questions, these are just being stored in a separate list. These won’t be present in the 0.8 release, as these need integrating with the system that’s going to replace the encyclopedia in the near future, but the basic implementation is there. This will probably be one of the first things I start doing for 0.9, although since 0.9 will include generating weapons and armour for soldiers and guards, and it has been a long while since I did any artwork, it might be hard to resist starting there…


What next on conversations?

This coming week I’ll start developing the sentence generation. All the “abstract” dialect generation is in place, so the game can select word elements, appropriate cultural/historical/geographical reference lists, sentence complexity for a dialect, various ways of speaking about various things, and so forth, and so now I need to translate this into actually spawning different sentences! I have a good idea of how to structure this, so it’s time to get started on that.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Aleksanderus on June 27, 2016, 02:12:17 PM
In upcoming update I'm gonna insult king, pope, guards, commoners, bandits, merchant and nobles!

It sure will be fun.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on June 27, 2016, 11:11:49 PM
Good move!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 05, 2016, 07:19:55 PM
This week has seen the implementation of name generation into the main game file, to rather fantastic results, alongside a substantial amount of bug-fixing. For name generation, the names now consider all the relevant religious/cultural/geographical background of the nation they hail from, and generate appropriately. The game also tracks the various different structures of the names – some name types have just one name, some have two, some have several with a mini-title in the middle, and so forth – and can always produce a “casual” version (i.e. “Mark” to “Mark Johnson” or whatever) as well as accurately reproducing a name when needed, without looking for name-segments where they don’t exist, or failing to look for a name segment relevant to a certain name archetype.

I have to say, I am *so* happy with how these look! They’re all very different, some speak to particular locations or cultural ideas, whilst others don’t, but they are all distinguishable. I’m still doing a little bit more work on these, but only a couple of hours’ work remains, and then in 0.8 everyone who you speak to will have their name highlighted. So, here is a rather splendid set of examples from a whole bunch of cultures in some playtesting world generations! Hope you like black-and-white images…
















In the process I also had to develop the very start of the system for generating sets of animals and plants within particular climate zones. Plants were already present but were distributed across all biomes of a certain type (so northern tundra and southern tundra areas would have the same plants, somehow), and also tended to be colour-matched to their biome, which made a degree of sense but definitely reduced the kind of background/aesthetic interest they could potentially generate. Plants were therefore redone, and their naming conventions were also altered somewhat to reflect these changes (all of which come before visual generation at some later date when I have a spare couple of days). Animal generation has now appeared for the first time, and just like plants, they are tethered to a certain area of a certain biome – so the game finds a tile of desert, looks to see how far contiguous desert extends, and then all that desert has the same group of species. The species elsewhere, by contrast, will be completely different, even if they are also desert. Like plants, I’ll generate the images for these at some far-later date (since this isn’t exactly gameplay-essential stuff, just general background worldbuilding), but the names will be used in this release, as they serve to inform the name generation for individuals in certain nations, and they’ll also show up in artworks and literature and metaphors and the like later on. I also thought quite a bit about which animals I can realistically vary in appearance and name, so a few common animals aren’t in here because I couldn’t think of how to vary them well enough, whilst a couple of more obscure animals are present precisely because they vary a lot. Here are some animal/plant printouts, with their biome attached:


And then two massive printouts of all the plants/animals generated across a world, so you can get a full idea of the generation systems for these:



As for the bugs, I’ve reached the point where only two things remain for 0.8: sentence generation, and bugfixes. Sentence generation is such an intellectually complex task – although once I have a suitably complicated but usable and modifiable programming framework in place, I’m confident it will actually move quite quickly – that I need to spend a lot of time simply planning it out before I actually start coding it in. In this vein I’ve been scribbling ideas all over paper for the last week, and although it is taking a while, I am zeroing in on a workable method. Much like most things in URR, it will wind up being a balance between some structures and templates, entirely procedural elements, and then a range of variation within these aspcets based on the speaker producing the sentence – a soon-to-be-gigantic function called make_sentence has now been constructed, and so the only remaining task is to actually write the thing (ha!). As a result of this week’s focus on planning, however, on the actual coding front I’ve been working instead on bug fixing, in order to ensure that 0.8 is actually stable once I release it (hopefully at the end of July/start of August). Some of these were found from my own playtesting adventures, but a large number were submitted by the playtesting team I recruited a few months ago (thanks again, all of you!) and with these all fixed, I do actually feel fairly confident that every part of 0.8 (aside from speech/dialects/etc) is finished, bug-free, and ready to release. I can’t rule out the possibility that there are NPC-related problems I simply haven’t anticipated yet, but I haven’t run into any in quite some time, and everyone basically seems to behave correctly (though I’m going to have to revisit  NPCs in 0.9, of course, to implement the NPC classes that aren’t being included in the upcoming 0.8). Here’s a run-down:

Fortress guards no longer sometimes fail to move when they should exchange schedules with another guard.
Fortress merchants always appear correctly even if the player enters the grid part-way through their move from their home to their stall.
Fortress merchants are always assigned to the correct open-air stalls.
There cannot be two open-air stalls of the same sort within a single fortress, nor too many merchants for them to all be assigned a stall.
Slaves and servants in upper-class districts absolutely, definitely, without a doubt, always sleep in the correct places on the correct floors no matter how and when the player spawns the mansion and what other movements the player takes.
Drawbridge chains do, actually, appear, when the player looks at them.
Looking at certain doors in torture chambers or dungeons no longer causes the game to crash.
Looking at a small number of bars in torture chambers or dungeons no longer results in a black screen instead of the appropriate generated image.
NPCs are always the correct inverted colour when they pass under trees or a gate.
Handled some weirdness with players stepping through gates and sometimes winding up on the tile next to the gate, and sometimes winding up one gate further away.
Fixed an issue where you could read sections of the encyclopedia that should have been disabled.
Fixed an entirely aesthetic issue with some potential colour patterns on couches.
Resolved strange issue with a small subset of square-based castle generation outcomes that would position guard towers in the wrong orientation.

See you all next week for what might be quite a technical post about sentence generation!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Tzan on July 05, 2016, 10:51:36 PM
As for the bugs,

Seriously, I thought you were about to explain how you are going to name thousands of bugs (insects)  ;D
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 07, 2016, 12:12:32 PM


That's a great idea, actually.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 18, 2016, 11:04:51 PM
Since last week we had a post about my third bullet hell world record high score instead of an URRpdate, this week’s should be the longest in quite some time! Lots has happened in terms of naming NPCs, fixing remaining bugs, changing the player’s dialect in a conversation, and also sentence generation is now actually happening! Most exciting. Read on…

Names in Conversations

As well as being generated, names now appear correctly in conversations. In future versions you will naturally not automatically know the names of strangers you bump into – unlike certain RPGs we could mention where the player magically divines the names of every single you talk to – and learning someone’s name will therefore sometimes be a gameplay mechanic. You might, for instance, know that a particular merchant called [Name] knows something, but the civilization that merchant comes from are not particular friendly to you, and you don’t know what they sell, so you’ll have to try to figure out which of seven merchants in a market district the particular merchant you’re after is, and potentially use other clues (sex, clothing, behaviour, whatever). Equally, of course, the game will remember perfectly the names of everyone you meet, and I’m actually thinking of a system that might alert you when you encounter someone whose name you already know – perhaps a message in the text log saying “You see [Name] [doing task X]” for someone you already know, because there is no visual way to mark out someone you recognise from someone you don’t (i.e. two merchants will both be ‘m’ whether you know them or not). Here are a couple of screenshots showing some conversation windows with people from various name-types:




Changing Dialect

You can now actually change your dialect by selecting a different dialect. This is a small thing, but it required me to start building up the code for handling what happens when you press [Enter] on an option in an in-conversation window, and it therefore has to detect the sentence or the item or the dialect you select, and then notice what kind of thing it is the player has selected, and then take the appropriate action. This works correctly now, though, so you can switch to another dialect and all the % chances of uttering each possible sentence immediately update appropriately. You can see in this gif how the chances of successful/unsuccessful words changes as we change dialect from one to the other.


Sentence Generation (Part I)

After thinking long and hard about sentence generation, and managing to free up a spare day to do nothing else except working on this, I’ve been able to make a substantial start. So, basically, the game splits sentences down into three categories, I’m naming “clauses“, “archetypes“, and “kennings” (which applies to a range of things that are not technically kennings, but the term gives us a good impression of what we’re talking about here).

Clauses: these are segments of a sentence, which vary massively from culture, religion, geographical background, and all the other factors that basically everything else in URR tends to be varied along.  A sentence will contain several clauses in most cases, and clauses are basically sections of a sentence that the game will generate independently (via archetypes) and then stitch back together (see below for more information on this).

Archetypes: these are hand-written default versions for each possible question. For each of the questions that the player can possibly ask (or the NPC can ask back), I’ve gone through and written a dozen or so variations of that serve as the foundations of possible replies (although once a reply is finished it will be almost indistinguishable from the archetype that created it). These are then distributed to each culture semi-randomly, with some relationships between some archetypes which others are “free-floating”, and each culture then starts the game with a few basic and foundational ways to talk about the things people might need to talk about in-game.

Kennings: in the case of URR, this refers to a particular way of referring to a particular thing. So this might mean referring to historical events, or a title to put in front of the name of a deity, or a particular way to talk about oceans or mountains, and so forth. These are basically segments of clauses that have to be expressed a particular way, so a clause might say [Title of god] and then the game will look up the appropriate “kenning” for that element and place it into the clause; alternatively, if it says [Desert] then maybe that nation says “Deserts”, or “Great Sands”, or “Great Dunes”, or “the Red Expanse”, or whatever, and the game will quickly check what the appropriate (generated) term is for something in a sentence.

So, in trying to create a sentence, the game does the following process:

Stage 1: select clauses. This first stage means that the game looks at how many clauses should be in a sentence, and what they should be. A nation with a dialect with low “sentence complexity” will have very few clauses in the average sentence, for example, whilst a nation with high sentence complexity will have many clauses. I’ve developed a fairly complex but easily-added-to system for adding clauses into sentences based on the nature of the sentence. This means that extra historical, personal, geographical, religious, etc, detail can be added to a sentence depending on how many clauses it has, and those clauses will be handled intelligently and sensibly.

Stage 2: select an archetype for each clause. The game then checks how that particular culture would express a particular clause and retrieves that archetype (which will then, in stage 3, be massively varied) and readies it. Archetypes are generated/selected in such a way that they should be broadly consistent across a culture, so you shouldn’t get a culture that talks about mountains in one way and talks about oceans in another, but rather talks about all those things in a broadly comparable way. Archetypes also affect sentence structure and in some cases word order, and these elements are also taken into account.

Stage 3: implement kennings/references. This third stage is perhaps the most important part of sentence generation, since at this point the game looks up how to express everything in every clause in that sentence. As we see above, archetypes say things like [Religion-title] and these are all triggers, telling the game to look up the appropriate phrase for the appropriate thing in the appropriate culture. As such, the sentences themselves within archetypes tend to have a large volume of square brackets in them, and aren’t really human-readable – although you can get a good idea of their meaning – until there’s a nice lot of kennings and references in place.

Stage 4: stitch it all together. The game then goes through all the sentence components – now transformed from archetypes with square brackets to archetypes with appropriate references and the like – and stitches them together with appropriate punctuation. This is partially done through the system that places clauses together, and also a bunch of signifiers that handle things like vowels/consonants, plurals, etc.

It was very tricky to find a system that struck the right balance between a) generating a huge volume of potential sentences, b) making the number of hand-made sections relatively low so that I actually get the release out before the 2020s, and c) ensuring a huge amount of modular variation within the sentence structures. With this system – selecting clauses, selecting archetypes, varying almost all of the components of those archetypes, and then stitching the sentence together into a meaningful whole – I’m confident that I’ve found a balance between all of these requirements. I think I’ve struck a balance between large volumes of hand-made sections, large volumes of procedurally-generated sections, and sections of speech that sit somewhere in the middle where handmade elements can be altered or twisted in some way depending on the particular nature of the speaker. I’m really excited to see what this will produce! These are just initial trials, but in the coming week I’ll be trying to build up all the possible conversation options and archetypes and clauses and whatnot, and then we’ll see how that looks. Here are two variations OF THE SAME CONVERSATION, and just look at all that variation!



(Note: you’ll also see a tiny bit of procedurally-generated calendars there! Some use years, some use a bunch of other systems; this might not make it into 0.8, but I just happened to be testing it out whilst I took these screenshots)

(You’ll also note the lack of ‘?’ in the second – just a typo!)

Having looked at the power of this system, even with the incredibly simple conversation above, I am *so* excited about how this is going to work. I now just need to write all the other words to slot into every other part of the system, and this is a huge task, but by next week’s blog entry I hope to have it all done and to be able to show off some more detailed conversations, as well as some of the other conversation options I’ve been developing this week – these extra things aren’t totally ready just yet, but they’ll be essential to making conversations feel very human, and adding extra depth.

Next Week

Conversations, sentences!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Aleksanderus on July 19, 2016, 07:23:32 AM
Damn son, which bullet hell game did you play?
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 19, 2016, 12:55:28 PM
http://www.ultimaratioregum.co.uk/game/2016/07/10/blue-wish-resurrection-world-record-and-analysis/ !
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Antsan on July 19, 2016, 05:38:26 PM
Wow, this looks absolutely awesome. Is this moddable?
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 20, 2016, 10:08:19 AM
Wow, this looks absolutely awesome. Is this moddable?

Common question, but I'm afraid not. It won't be moddable and I have no intentions of making it open source (except, possibly, in my will!). I'm always looking for feedback and suggestions though, and I very often take comments on board, so feel free to throw any ideas my way :)
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Antsan on July 20, 2016, 11:46:07 AM
I should have specified better: Is there going to be a way to add kennings? This seems like the kind of stuff that isn't spoilery and well-kept in text-files either way (or I'm missing some very important stuff here), so I wonder whether you are keeping kenning definitions in plain text files, which could be edited by players.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 21, 2016, 09:57:39 PM


Still probably not. I'm not really big on modding, from the perspective of my own game(s), anyway. I have a particular vision I want to realize, and that's really the goal. I'm totally open to all kinds of suggestions though!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Aleksanderus on July 22, 2016, 09:38:25 AM


Still probably not. I'm not really big on modding, from the perspective of my own game(s), anyway. I have a particular vision I want to realize, and that's really the goal. I'm totally open to all kinds of suggestions though!
Well, if you could make it open-source and encourage modding then modders could modify this game so much then it could even best the original!

And also modding can add SO much possibilites... It would be even possible to implement scifi, magic and much more!

I would love to see Cthulhu mythos mod to this game! (it may even work out because this game has detailed textures and if this game was open-source then modders could modify them! and also from what it looks like damage system is complex so it surely would be a good mod!)

This is the most important suggestion so far deciding on the path which this game will choose!  ;D
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Krice on July 22, 2016, 05:18:51 PM
Well, if you could make it open-source and encourage modding then modders could modify this game so much then it could even best the original!

This doesn't work like ever. Angband was easy to modify, but none of the mods were ever better than the original. It's how this stuff works. If something is easy (like modding), it attracts wrong kind of people.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Aleksanderus on July 22, 2016, 08:30:30 PM
Well, if you could make it open-source and encourage modding then modders could modify this game so much then it could even best the original!

This doesn't work like ever. Angband was easy to modify, but none of the mods were ever better than the original. It's how this stuff works. If something is easy (like modding), it attracts wrong kind of people.
I think it depends on the game. I didn't play Angband a lot with or without mods so I don't know about it but open-source can make bugfixing even faster because people can make unofficial bugfix and developer can "steal" it and use it in the next release officialy. (of course credits to the creator of bugfix should be given)
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Antsan on July 22, 2016, 09:43:43 PM
I think making URR OS is actually not up for debate. I assume the comment about openness to suggestions was in regards to game mechanics.
I mean, why are you guys even talking about this, it was already said that URR isn't going to be Open Source. It seems this has been discussed elsewhere quite extensively already.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Aleksanderus on July 23, 2016, 07:23:57 AM
I think making URR OS is actually not up for debate. I assume the comment about openness to suggestions was in regards to game mechanics.
I mean, why are you guys even talking about this, it was already said that URR isn't going to be Open Source. It seems this has been discussed elsewhere quite extensively already.
And who cares it's not up!?

And also it's not some fucking other forum! Your posts are becoming much more edgier than they should be, Ant-san...
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 23, 2016, 10:33:48 AM
Allow me to step in again here: yeah, making URR open source has been discussed numerous times, and I'm afraid it's always a no. There are various reasons, and maybe if there was only one reason I'd reconsider, but there's four or five reasons I normally cite which make it a definite no. Basically: 1) it would require HUGE code rewriting, 2) even the bits that wouldn't need rewriting are incredibly open-source-unfriendly, 3) I have a particular vision and don't want to allow multiple versions, 4) I'm just not motivated to do it. Like I say, though, I've taken on-board a huge number of player suggestions, and I'm sure I'll keep doing so, but the combination of those reasons is more than strong enough to discourage me!


In other news, I've been commissioned to write a four-part series on qualitative procedural generation for Rock, Paper, Shotgun! Societies, practices, cultures, beliefs, and so forth, and how to integrate them into gameplay. I think one part will be going up each fortnight for the next three fortnights, but here's the first one. https://www.rockpapershotgun.com/2016/07/22/future-of-procedural-generation-1/
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 24, 2016, 09:55:00 PM
Sentence Generation

This week I’ve been adding in a truly titanic amount of speech variation into the game. I’m only now beginning to realize the size and scope of this task, given the level of variety and interest and complexity I want to include, but at this point it’s close to around ~1/3rd of the default conversation options done. There’s a vast number of archetypes, a truly gigantic number of clauses and descriptive modifiers (a comment a character might make about the word “world” if they’re from a particularly isolationist nation, for instance, which might be something like “frightening in its size and distances”). I’ve already written several thousand of lines of speech, variations in those, templates, words, clauses, kennings, all kinds of stuff, and written the (actually remarkably simple) code that pieces them all together. I’ve reached the end of all the “default” questions which you can ask anyone (and their answers), and I’m now moving onto the class-specific questions (and their answers), and then after that onto the special answers that change their sentence structure, not just their sentence content, depending on the NPC. By this I mean, you can always answer the question “What is your religion’s most sacred relic?” with an answer of the sort “Our most sacred relic is X”. However, a question like “What is your opinion about the ongoing war?” cannot be answered with a single sentence with words switched out, so needs a more complex set of answers tethered to the opinions of that NPC.

There basically hasn’t been much new coding going on since last time, so below you’ll find two conversations I had with different people, and how different they turned out (so the same kind of thing I showed off last week). You’ll notice that certain words get “expanded” upon, such as that “in which we all serve and are served” bit of the first picture below; these are bits of flavour text heavily dependent of course upon religions, cultures, backgrounds, etc, and these are one of the major things that will give you a hint about the background of the person, when they elect to give you a bit of their perspective on an issue you’re discussing. By the end of this process there will be an *incredible* number of these little expansions; as above, I’ve only done about 1/3rd of the default conversation options so far (not to mention negative replies, replies that can’t have a default form, and other stuff) and already there are several hundred of these. Naturally some political beliefs are easier to find expansions for – consider how much of a conversation someone from a pacifist nation would comment on, compared to how much of a conversation someone from a planned economy nation would have a comment relevant to planned economy to make – but I’m trying to come up with expansions for even the less-obvious ideologies too.

Anyway, here’s two examples of one conversation again, and you can see these are already more complex than last week:



I love how distinctive these are, and how you can even in just a few snippets of conversation start to guess at some of the beliefs and backgrounds of the people and their nations. In that last one you can see that we need a scroll bar for the conversation window, which is coming shortly.

For next time, I’ll be continuing to put in the massive databases that underlie the sentence generation system. I’m also starting to put in the first parts of two next things, both designed to enhance the smoothness and realism of the conversation system, instead of reducing it to what can look like a question-and-answer session. Although I’m super-proud of the above screenshots, they ARE quite question-and-answery, and this needs to be changed, and that’s what these two new elements will help us towards (the “how interested am I in this conversation” meter will be coming later). These two new elements are:

Counter Questions: this is what I’m calling it when the character you’re talking to asks you something back! They’ll reply (or not) to your question, and then ask you a question back; sometimes the same question, sometimes a related question, and sometimes a more general “Why are you asking that”, “Why do you want to know?”, etc. You’ll then get a reply option (see below) that you can use, or not, depending on your preference.
Replies: you as the player can respond to a specific thing that another character said and question them further on a topic that emerges in the process of conversation. For instance, if they mention a person, you can immediately say “Can you tell me more about [person]”, if you want to. Alternatively, as above, you can offer replies to what someone asks you, and will have the option to tell the truth, lie, semi-lie, etc.
These do require a bit of work, and I want to get all the “default” stuff done first, so I won’t mention these for another week or two, but I wanted to note that I’m aware the structure and flow of conversations needs a little work, and I’ll be working on that soon.

See you all next week!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 27, 2016, 06:46:43 PM
And here's a little piece I wrote for Vice Gaming about PCG in RimWorld!

Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 30, 2016, 03:51:35 PM
After last week’s post, I was very pleased with the kind of variation in styles of speaking I was getting, but something just didn’t feel quite right. It took a bit of time and quite a bit of feedback to figure out what it was, and that then triggered a second realisation about something else that needed changing, and in turn, a third. And a fourth and a fifth!

First, length and clauses. Many of these are simply too long, and there are too many additional clauses. I think the extra clauses will become just a little bit annoying after a certain point, especially if you’re talking to lots of people from one civilization close together. As such, I’ve made some sentences shorter, and reduced the likelihood of clauses being added to sentences. This also meant a change to sentence complexity: I’ve decided to actually make quite a substantial change here and change sentence complexity from a value/modifier embodied in a civilization to a value embodied individually in each person you encounter. I realized that since you’ll spend a decent length of time in each nation at once, you’re probably going to be spending a while talking to a range of people from the same background, and so I want to boost variation between people more than I want to boost variation between civilizations. As a result, each person now has a sentence complexity modifier specific to them. This has five variations, which I’m currently just storing as 1-5; that’s an x/15 chance that each sentence they say might have a clause. This means even the most wordy person will add in extra detail clauses in 1/3 sentences, but for most it will be far rarer. I’ve tried this out a little and I’m much happier with the kinds of sentences it produces (along with the other changes). Equally, it means that that kind of extra info will come to the player more gradually, which I think is also beneficial.

Secondly, punctuation. The end of sentences now varies according to the mood of the person speaking them; a hostile NPC will end with “.” or “…” to everything they say, a neutral NPC will end with “.”, whilst an NPC very positively disposed towards you will end sentences with a mix of “.” and “!”. Again, a very simple thing, but it’s already making a big different to the ebb and flow of conversation.

Thirdly, and related to the above – formality. Many of the sentences were just too formal and rigid and didn’t have the kind of flow that you would expect sentences to have. To adjust this, I’ve made some changes to quite a few of the sentences, added in the possibility for things like “Hmm…” to appear at the start of sentences, or things like “Let me think”, or “That’s hard to remember”, or “I don’t know much, but I’ll tell you what I recall”, things like that – I’ve also added in more use of “I’m” instead of “I am”, “I’ve” instead of “I have”, etc, and so on. The combination of these various alterations seems to be working quite nicely, and gives a far more conversational feel to the whole thing.

Fourthly, visuals. I felt that using the skin tone for the sentences on both sides of the conversation is making the actual conversation window look a bit too thick and same-y; instead, the player’s comments will always be the same colour as their @ symbol, i.e. white, whilst those from other characters will change according to skin tone. This breaks up the visuals and seems to make conversations a little easier to parse, which is obviously very important!

Fifthly, stories – see below in the example for precisely what I mean by that.

As such, this is how conversations should look from this point onwards:


There’s still a lot more to be done, of course – like adding “Hmm…” and all the other stuff described above, but I think this is a great step forward.

More next week!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Untrustedlife on July 31, 2016, 03:51:30 AM
Much better prose then dwarf fortress. Good job.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Aleksanderus on July 31, 2016, 07:42:49 AM
Much better prose then dwarf fortress. Good job.
I was banned from bay 12 games... It was inevitable
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on August 02, 2016, 09:08:04 PM
Thanks - and ha! Good work. What got you banned?
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on August 16, 2016, 01:46:18 PM
To make up for last week’s rather short entry, here’s a bit one. I’m pleased to report that a very pleasing volume of new stuff has been done this week, and things continue to look very exciting indeed. Read on!

Default Conversation Options

At this point almost all the “default” conversation options are done! This means everything that you can ask every character, and also the class-specific questions (like “What are you guarding?”, “What nation do you represent?”, “How long have you ruled this nation?”, etc). This was a totally huge volume of work I’ve been putting together over the last fortnight and it’s great to see it all nearly done,. and it’ll certainly be all done by this time next week. Here are some examples of conversations with people from specific classes, in this case with a priest, guard, and diplomat:




Default “Expansions”

“Expansions” are what I’m calling bits of a sentence that certain NPCs will add to certain words in a sentence. For example, as we’ve seen rather than just saying “What is the greatest battle your nation has fought?”, someone from a particularly militaristic nation might be “What is the greatest battle, that glorious arena in which all are equal, that your nation has ever fought?”. Similarly, rather than asking “Are there any mountains nearby?”, someone from a particularly exploration-focused nation might ask something like “Any there any mountains, those peaks that inspire us to great deeds, nearby?”. Almost all of the expansions for the default conversation options are now in place, and wow, there are a truly huge number. There are close to a thousand expansions I’ve written for various ideologies with various words, and much like everything else, the inclination of a person towards using expansions is contingent upon their sentence complexity value – a higher sentence complexity means more expansions. As a result of making conversations more human as we discussed a fortnight ago, these are now far rarer, but here are some examples from the generation system, which gathers all possible expansions for a certain word for every nation into one place, then if a random number is rolled that is lower than the nation’s sentence complexity, it selects an expansion for that nation for that term and stores it. Again, by this time next week these will be totally finished.


NPC Personalities

NPCs are now generated with four personality modifiers that will structure how they behave. These will now be explicitly visible, although they will be noticeable from the kinds of replies you get, and also in some cases I suspect I’ll get other NPCs to tell you about the personalities of other relevant NPCs.

Sentence Complexity – this has been shifted from nations to people, and reflects how much people give in answers they’re willing to give. By this, I mean let’s say you ask someone about whether they know about any nearby towns, and they know about five towns. Will they tell you all five, or just one, or somewhere in the middle, and will they comment on what they think about those towns? This modifier will determine that, but it’s different from whether they’ll reply at all – replying is a binary, and then the detail of the reply will be structured by these metrics.
Education – this affects how much someone knows, i.e. how often they’ll wind up saying “I don’t know!” to a question. Naturally this will vary according to class, and expected educational levels, and so forth, and therefore certain questions will be more likely to give you an answer from certain NPC classes, because others simply won’t know the answer!
Patience – this is a modifier for how much an NPC is willing to speak with you. This will combine with modifiers for each civilization, and also for each NPC class and the player’s current status (so a guard will be disinclined to talk to a random person automatically, whereas a merchant will naturally be more inclined to talk to a random person in the hope of making a sale).
Privacy – this modifier affects how willing the person is to talk about their own personal details, and probably how willing they are to tell you information about their culture, religion, etc. This won’t vary too much, but some NPCs of the same class will certainly be more or less concerned about telling strangers their thoughts.
These four metrics are being generated for each NPC, but I can’t say yet whether they’ll make it into the conversation system in 0.8 – I’m really trying to get an absolute core conversation system done, with the kind of scope and variation I want, and then release that. It’ll probably be in 0.9, but I thought it was worth drawing attention to these elements now, as more ways to vary the conversation experience.

Conversation Scrolling

Added a scroll-bar to the main conversation window. I pondered for a while how best to do this. Firstly, I was going to have the scroll bar only appear to the left-hand side of the right face when the conversation gets long enough, but that would mean that the conversation window would then slightly resize itself (which didn’t look nice) and it could slow things down a little to have to measure the size of the conversation before printing it, and then altering the size of the printed conversation. I then tried having a scroll bar only appear on the right-hand side double-grey border when you needed to be able to scroll, but this was very inelegant and seemed disconnected from the actual conversation you were scrolling through. As such, my third try was to do what I’m now going to stick with, which was to add a dark version of the scroll bar always present on the right-hand side, and then have that scroll bar expand and light-up once the conversation is too long. See below:


(Though you’ll note just for testing purposes I asked the same question a lot, and they didn’t get bored – boredom still needs implementing!)

Next Week

Next week I’ll be finishing off the final parts of the elements above, and I’ll be working on the non-default responses. This means answers which are negative, e.g. you ask “What size is your army” and the reply is “We have no army”, and also special answers, like “What do you think about [nation]” which doesn’t easily fit into a sentence structure where you just switch out words, as they’d express positive/neutral/negative feelings very differently, so these need more complex answers. See you all then!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on August 21, 2016, 07:27:58 PM
All the remaining default conversation options, and all the remaining expansions, are now complete. I’ve also altered the expansion code such that certain expansions aren’t tied to certain words or sentences within a language and guaranteed to appear whenever that sentence or word is said, but instead they appear with a % chance for every instance of a particularly word or phrase someone in that dialect says, depending on their sentence complexity (as we discussed before, sentence complexity is now tied to individuals, not to entire cultures). Here’s a couple of examples, courtesy of our good playtesting friend, Orangejaw Moonblizzard, and some NPCs who may or may not have had their origins changed using admin commands for the sake of testing (as you’ll notice these replies could not be for the same nation!)…



Negative Replies

The big thing this week and weekend has been working on negative replies – so, for instance, if you ask “Are we near the desert?”, the default response is “We are near [desert] in [direction]”, or whatever, but obviously a valid option is “We are not near the desert” – and this obviously applies to loads of questions. What if the speaker’s nation has no army, or dislikes art, or have never travelled, or doesn’t know any other civilizations, or lives on a tiny island and knows nothing of the wider world, or doesn’t worship a religion, and so on? We therefore now have a body of negative replies for people to basically say “no”, “that’s irrelevant”, “I don’t know”, or “I don’t care”, in hundreds of thousands of interesting ways!

These negative replies effectively now split up into two categories, which we could usefully call “general” and “specific” negative replies. “General” negative replies include replies like “I don’t know”, “I don’t remember”, “I’d rather not answer”, “I’m not authorized to give you that information”, etc, which can apply to a huge range of NPCs in a huge range of situations. Since the player will run into these fairly often, I’ve made sure that there’s a lot of variation in these general negative responses – although in many cases, of course, there’s only so many ways that you can actually utter some of these things, but here are a few examples.


“Specific” negative replies refer to asking a question where the answer is still answering the question, rather than a general answer, but still a negative. For instance, if you ask someone what they think a particular policy in their nation should be, they might reply “I have no interest in politics”, or if you ask someone whether they know any distant cities you might want to visit, they might say “I know of no distant cities” – and so on and so forth. Each of these is often more specific and more varied than the above, so I’m trying to bias people towards using these wherever possible, although they are naturally dependent upon particular cultural/political/religious situations.


Crowd Disinterest

You’ll all recall the “conversation interest” idea that URR conversations will have implemented – that unless you ask relevant questions, NPCs will quickly lose interest in talking to you. This is to stop the player just going through every single question one after the other, and to encourage you towards asking sensible, logical and appropriate questions. However, I realized the other day that I can’t just limit this to a specific NPC getting bored; if you have a bunch of general questions you’re asking every soldier, for instance, then you could just go from one soldier over to the next soldier in the barracks and start questioning them, ignoring the questions you already asked Soldier 1, but assuming (quite fairly) that they will probably respond the same way, seeing as both Soldier 1 and Soldier 2 are just default soldiers.

Therefore, I need to implement some kind of “crowd disinterest” solution, and I think I’m going to do this on two levels. On the “local level”, NPCs within a building will see who you’re talking to and what you’re asking them about, and also within a map grid (within your line of sight, or nearby), and will take note of the questions. So if you question Soldier 1 about pointless stuff, and they tell you to go away, then you start asking Soldier 2 pointless stuff, the time it’ll take Soldier 2 to lose interest will be shorter than normal; Soldier 3’s will then be even shorter; and so forth. Then, at the global level, I think we need a system whereby information about the player slowly spreads through cultures/cities/religions/etc in the entire world so that people get some idea of whether they should respond to the player or not. Neither of these systems will be in 0.8, but they definitely need to be there.

Next Week

Remember those two new conversation features I mentioned a while back – replies and counter-questions – and also all those questions that have more complex replies, such as lists? Some combination of those will be coming next week – probably the complex replies, I would think. See you then!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: AgingMinotaur on August 21, 2016, 11:05:38 PM
I think Elona has a system for public performance, where a player who makes too many unsuccessful attempts at swaying the crowd, will ultimately get lynched.

As always,
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Aleksanderus on August 22, 2016, 08:22:26 AM
I think Elona has a system for public performance, where a player who makes too many unsuccessful attempts at swaying the crowd, will ultimately get lynched.

As always,
Getting killed by a crowd throwing rocks at you is always fun!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on August 30, 2016, 01:34:53 AM
Ha! I didn't know that, but that's neat. I'll have to look that up...
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on September 05, 2016, 07:59:16 PM
Two exciting realisations about in-game conversations this past fortnight! In the process of continuing with sentence generation it became rapidly apparent that in order to actually ensure conversational flow, and to boost the range of experiences that the player can actually have in talking to the game’s NPCs, several new additions would have to be made. As readers will remember, until now there have been basically three kinds of question – the kinds of question that anyone can be asked from the start of the game (such as “What do you do?” or “What are your religious beliefs?”), the kind of question that only specific people can be asked from the start of the game (such as “What are you guarding?” which would apply only to guards, but can always be asked), and the kind of question that can only be asked after a particular trigger is met (such as “What do you think of the novels of [author]?”, which requires you to have come across the author). There is another “category” of question, as well as a new kind of reply that both the player and the NPC will be able to produce within a conversation. These do not especially increase the required volume of sentence generation implementation, as the creation of an overall framework for sentences (in progress) will be equally applicable to all possible sentences, but they will substantially enhance the variation of in-game conversations, and also their realism and believability. Read on!


Counter-questions are, as you might expect, questions that the person you’re talking to winds up asking you, which then lead to a variety of possible replies. So, for instance, they might ask you about YOUR religion, in which case you can be truthful or lie and so forth, and the same will then apply for a range of scenarios. Questions of this sort will be particularly relevant when trying to get past guards, for instance, or when trying to enter particularly restrictive or xenophobic or militaristic nations, and the like. I think this will add a very strong extra layer into the conversation system and the ability for the player to “bluff” their way through certain areas, whilst also (like the above points) boosting the realism of the system by changing it away from a rather simpler question-and-answer system. Here’s an example of what counter-questions might look like based on some of the conversations from last week:



A “reply” in URR is something that can only be said in response to another person’s statement. When a reply is possible, the “Replies” dropdown list will appear, highlighted, right to the special options and to the left of the dialects. Clicking this option will then offer this special sentence/response; if you select another option that isn’t in the replies list, the replies will remain and can be returned to later in the conversation, so this isn’t just a one-off chance. This means that as particularly long conversations continue, the number of possible replies will grow, but it will never grow above half a dozen or so at the most, I would think, and some of the replies will actually be the same as other default questions that simply take on newfound relevance after a previous question. Here’s the same conversation with some answers and two different models: which do you prefer? In the first version the reply and the next question are apart, and the other person might make another comment, whereas in the second version, the reply and the next question are combined…



If you don’t select the reply when prompted, various things will happen. If they ask you a question and you just go onto asking them another question, they’ll likely be offended. Alternatively, some replies will be akin to “follow-on” questions, so they mention something, and you can then pursue that with them as a result of that conversation. These options will stay in your reply options for that character forever, and can be addressed (or not) whenever.

I’m going to implement this because as I experimented, it became clear that conversational flow in real life is obviously far more of a back-and-forth than a question-and-answer, and the system needed to reflect this. The reply will allow the player to get more depth about a specific question asked instead of moving onto another question, and should be especially relevant if the NPC being talked to winds up revealing something the player wasn’t previously aware of, and wants more information on.

In the process, though, I found myself wondering about the exact flow of the overall. Right now the system is that you select a topic, you select a question, then the questions window closes and you see it spoken and a reply given. This is largely from the inevitable constraints on the size of the screen, fitting in questions as well as images and topic lists, and so forth. I became briefly concerned that this might actually break up the flow of conversation, especially if you want to ask two questions from the same topic list one after the other. To help cancel this out, if you return immediately to a conversation topic you’ll be at the same part of it you previously scrolled into, and I also added in a system that will keep any letters typed in for the search function whilst you’re still in one topic. So let’s say you ask about Artwork X from Nation Y, and you found the question by typing in Nation X’s name into the “Art” menu, and that question is asked, and then you want to ask about another artwork from Nation X, going immediately back into the art list will keep the letters there, but changing to another menu will reset the letter tracker. I think this is quite a good compromise. Equally, of course, we should remember that the conversation system in URR is specifically designed to be a little slower and more thoughtful than the systems one gets in more RPGs where the player is encouraged to just exhaust conversation options. I think the current system (with these recent changes) will now work very smoothly, actually, and I’m happy with the balance between ease-of-access and possibly encouraging the player to think about other relevant options as a conversation progresses.

Next few weeks:

In the coming weeks I’ll be trying (see below) to continue the implementation of counter-questions and work on the implementation of replies, as well as adding all the “Hmm…” stuff and punctuation options into conversations properly, rather than having them only present as a placeholder to test how things look. The other big thing to handle now is that all the [religion] or [date] or [place] modifiers work; a few have been implemented, but again, just quickly and crudely to get a feel for the system. Another task for the coming weeks is to go to all of these, make sure they work, and to make sure NPCs already spawn with the requisite information for personal details – “I was born in [place] in [year]” – as well as civilisation details – “I am from [nation] and we worship [religion]”, and so on. There’s a pretty big selection of these,so it’ll take a bit.

Why no blog post last week?

Last week was the first time in several years I missed a blog update – this, unfortunately, is simply because I am basically working twelve hours, every day including weekends right now, and I’m totally swamped with my work at the moment. Believe me, folks, I am *incredibly* desperate to get 0.8 finally finished and out, but there’s just so much on my plate at the moment with strict fixed deadlines which has to be prioritised, and it’s hard to carve out any time (even at weekends) to do much coding. Just rest assured I am working as hard as I possibly can to get 0.8 released, and I’m really sorry it’s taking so long and I feel tremendously guilty about dragging it out, but things are really tough right now (due also to other life issues beyond what I’ve described here) and I’m deeply stressed out, but doing my best. There’s only so many hours in the day and I just cannot prioritise coding at this month/two-month moment in my life, but I’m trying to grab an hour here and there to just inch forward on conversation implementation. In the coming month, therefore, some of most of the blog entries are going to be other entries on general games topics of discussion/interest I’ve had written for a while and I think you folks will be interested in, and I’ll upload those instead if (as is likely) there isn’t really any URR update to put out. I hope you’ll enjoy these entries; people have always enjoyed these before, so I hope these will keep you all occupied until I’m out of this rough patch. I’m really sorry, I hope you all understand, and I promise 0.8 will be worth it.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on December 10, 2016, 10:04:45 PM
After several months where I just haven’t been able to find even a couple of hours to code, I am extremely pleased to report that I’ve managed to get through this incredible glut of academic work and emerge into the wonderful fields on the other side. As such, this coming week I am now officially resuming development on 0.8 in my spare time – which is still not extensive, but at least I have some of it now, with more to come as the start of next calendar year comes to pass – with the objective of getting 0.8 polished off and finally released in the next few months.

So: where were we, and what remains to be done?

The State of 0.8

0.8 is, by far, the biggest release I have ever done and the biggest release I ever intend to do. Had I known that I’d run into this unexpected delay towards the end of the release, I would definitely not have tried to develop the speech systems alongside everything else and I would released everything except speech as 0.8, then released speech and conversations as 0.9, but as it stands, there are several major parts of 0.8:


The current version available here on the site, 0.7, has a massively detailed world devoid of people. This has now been addressed, and there are millions of people – all procedurally generated, with the important ones stored and tracked, and the less important ones spawning and despawning to give a sense of the crowds the player moves through – that can be met in the in-game world. This, obviously, is one of the biggest changes to and developments in the game, and is the last major “system” that needs to be in place, and – via the conversation system – marks, finally, the beginning of actual gameplay! Although a lot of coding was required to keep track of NPCs at various resolutions, near the player, far from the player, inside buildings, outside buildings, inside or outside buildings that hadn’t been spawned yet, and so on and so forth, we finally got there. All NPC systems are finished, and only a few tiny bugs remain (found by my kind playtesters) to be fixed prior to a release of 0.8.



Clothing and Face Generation

Alongside these NPCs we have clothing and face generation. Clothing generation can offer many millions of variations of clothing styles, which the game then varies in four levels – “lower”, “middle”, “upper”, “ruler” – and distributes appropriately to NPCs. You can then view the clothing of anyone you run into, and the player of course now also starts with a set of clothing appropriate to the civilization they start in. Face generation, meanwhile, creates a set of genetic and cultural variations which can produce high hundreds of millions of faces, I believe, allowing you to make judgements about both the geographic and national/religious origins of people you encounter. Both of these systems are fully integrated and finished.


Buildings, Districts, etc

An entirely new, massively, and massively important class of buildings have been added: castles. The aesthetics of these vary according to their civilisation of origin (as do all buildings) whilst what is found inside varies according to the ideological and religious orientations of that nation; you’ll find altars, banners, barracks, torture chambers, dungeons, libraries, studies, and a million other things in there (alongside a relevant set of NPCs to inhabit them and move around within them). In districts, meanwhile, I’ve gone over and changed a bunch of the generation algorithms, fixed some unusual edge cases which could sometimes appear, made sure NPCs can always path to where they need to path to, and basically ensured that districts do function correctly in all the ways they have to. All castles and district changes are in place with the exception of a few tiny bugs to do with castle generation that need to be resolved before release.


Speech and Conversations

This is the final one, and the biggest one, since it marks the first meaningful element of gameplay being introduced into the game – which is to say, talking to people, questioning them, acquiring information from, presenting oneself in certain ways, deciding which topics to pursue, and all the other conversation mechanics and dynamics I’ve talked about in blog posts before this one. Speech generation is partly complete, and conversation mechanics are partly complete.


What next?

Therefore, there are basically three objectives left to cover before I can release 0.8, each of which is probably approximately of around equal size:

1) Finish Speech Generation

The primary objective is, obviously, finishing the generation of all sentences and potential responses. Now, you’ll remember from some of the final blog entries before I went on the coding break that I was introducing some more complex speech systems, but I’ve decided it’s more important to get 0.8 than it is to implement all the speech dynamics I have in mind. As such, I’m toning back some of these ambitions for the 0.8 release, and whatever kinds of sentences and comments don’t make it into 0.8 will make it into the (small and compact) 0.9 that should appear quite soon afterwards. Nevertheless, there are lots of sentence archetypes that need finishing, lots of sentence components, lots of variations for ideologies/ geographies/ cultures/ religions/ etc that need to be implemented, and then – most importantly – I need to make it all actually generates correctly! There’s so much content in there that some weird grammar mistakes are bound to crop up, and I’m sure some spelling mistakes have slipped in too, all of which need to be fixed.

2) Finish Conversation Mechanics

Right now actual “conversations” don’t really happen, since the AI you’re talking to just produces a response without, for instance, asking you something back. As above, since I’m not putting in every possible sentence form in this release, I’m also not putting in ever possible conversation mechanic into this release, but I still want things to flow quite well and to be quite interesting to deal with. Even though I hope to get 0.9 out fairly speedily, this is still going to be a version a lot of people are going to play for a lot of time, and I want to make sure there’s enough there to reward the wait, even if 20% of the mechanics I want will just have to wait until a later version when I can take the time to really perfect them.

3) Finish all Tweaks, Fix Bugs, Optimisations, etc

Not much to say here – I just have a list of things that need fixing, and I’m going to fix them. Now, some of these I’m going to leave for 0.9, which is going to be a far shorter release anyway, though it’ll only be the bugs that aren’t game-breaking, or are perhaps entirely aesthetic, that I’ll leave until then. Anything critical, or anything that is definitely going to be noticed, needs to be fixed now.


It has been very hard on me to have to stop programming for a period and cease, however temporarily, working on a project that I care so much about and means so much to me. I know some people will have drifted away, I know the blog has lost some readership in the last few months, and – chances are – some people will have seen this as proof that a big project like this is doomed to fail! But worry not: we’re back, and the ramp back up to the speed I was developing last summer will take a little while, but it’s going to happen. My schedule and my life more generally will be freeing up gradually over the coming months, to some extent Jan/Feb/March, and even more so April/May/June/July, and that spare time will be going into URR. Next summer (much like last summer) in particular will give me ample time to code, and I’ll certainly be taking advantage of it. I’m starting now to keep the code open, to check in on what needs doing, remind myself where I left off, and to start slowly but surely developing the speech content first and foremost, as that’s certainly the easiest thing to get back into the swing with. URRpdates in the coming weeks might be smaller than normal, but they will still have something to show. URR is back, and the final push towards the first gameplay release is now – finally – on.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on December 18, 2016, 03:50:02 PM
As you may have seen last week, the development on 0.8 is finally ramping back up again. It has been a long road here, and a far longer one than I would have liked, but I now finally find myself with enough time on my hands to actually re-open that famously lengthy Python file and finish off this gigantic release. Last week I put out something of an overview of where the game stands at the moment, and what needs to be done: which is to say, basically, finishing off the content for speech generation, finishing off the most basic version of the conversation system I would actually feel comfortable releasing, and then dealing with whatever bugs and minor issues remain that cannot wait unil 0.9 (which is to say, crash bugs, or other kinds of serious errors).

The easiest thing to resume work on is the content of conversations. All the data structures and whatnot are present for me to put this stuff in; I just have to actually write it. That’s what I’ve been tasking myself with this week, and I realised that this wasn’t really finished, and that there were quite a few new kinds of variation I could add – with only the tiniest alterations to code – that would bring a lot of extra variety to the whole thing. Therefore, for the last few days in my spare time I’ve resumed fleshing out, and adding more detail to, the conversation system. This basically means ensuring that for all the possible political ideologies, and the various religious orientations that might come up, and so forth, people will have something appropriate and reasonable to say which will (in some cases) hint back towards their backgrounds and beliefs. The central part of this was filling out all the possible “expansions” – where an NPC can say a little something extra about a particular topic, as informed by their background. I thought I had done so previously, but I now recognise this wasn’t the case and there was a lot of valuable (and easy to add) extra content I could include. These are now all complete!


I also went to the list of alternatives for certain words in sentences – where one is selected at random for each word for each civilization – and finished this list off as well. As with the above, there was definitely more to be added here, and doing something relatively coding-simple, but content-heavy, has also helped with getting me back into the swing of things.


Lastly, I also finished off another segment of the game’s conversation system, which is ensuring that multiple phrases with the same meaning, but slightly different contexts or grammatical structures, are consistent. Which is to say, if is a civilization might use the phrase “put to death” in place of “executed”, then “execution” should also be “putting to death” – see what I mean? In this case the game randomly selects the way of expressing the “base phrase”, in this case “executed”, and then cycles through all the possible derivatives of that phrase and ensures that they are all combined with the original base phrase, such as “executed”, “executing”, and so forth. In some cases this is trivial, and in some cases more complex. For example, the word “produce” might be rendered for different civilizations as “produce”, “create”, “cultivate”; to render them in the past tense, it simply needs to add a “d” onto the end. However, if the words were also “make”, “yield”, and so forth, these have different rules to be transformed into “made” and “yielded”; I’ve therefore implemented a set of fairly simple but quite comprehensive grammatical rules to ensure that different tenses and uses can be handled, and that the game will also use the right one for a particular civilization when it has someone from that culture say a particular word.

So, that’s now all there is to say this week. However, I’ve had several comments that have stressed the importance of keeping updates rolling now that development has resumed, even if things start out slow and quite minimal. As such, I would expect some of these updates to be quite brief (like this one), but I think it’s better for me to put out short updates than to save them for longer updates and do other pieces in the interim: it’s important to me that it’s clear to everyone that development is moving again, and to gradually regain the momentum I had until around last September or so. In the coming seven days I’ll be looking at the set of conversation variables that have to take account of potentially-changing external factors, and be generated in particular sentences, which are currently as follows…


These need to be always able to draw on the relevant bit of information being mentioned, and to “output” with an appropriate grammatical structure. So, for instance, [god] is the name and title of one’s deity or set of deities; [greatestbattle] is the name of the most important battle of that nation; and so on and so forth. This is probably the next big task in speech generation, I think, after which the conversation mechanics will be returned to. This week I’m hoping to implement a basic framework for these elements, and start to get characters drawing upon their backgrounds and life information to fill them out correctly.

See you next week!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: huw2k8 on December 25, 2016, 11:40:36 PM
In my opinion the most promising roguelike currently in development, the depth it aspires to is incredible and I hope with all my heart this game is built to mark's vision because if so we are all in for one of the greatest games of all time, no doubt!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on December 26, 2016, 06:57:26 PM
In my opinion the most promising roguelike currently in development, the depth it aspires to is incredible and I hope with all my heart this game is built to mark's vision because if so we are all in for one of the greatest games of all time, no doubt!

Hey - thanks for the very nice comment! I'm so glad you think so (and I hope so too). Do let me know what you think of 0.8 once I finally get it out there!


This week I’ve finished off the generator for greetings, farewells, compliments, insults, threats, and giving thanks; each of these can produce easily over tens of thousands of variations, and then when you factor in elements outside the sentence generator itself – the name of a god, the title of a ruler, and so forth – we readily push well up into the millions. In this entry I’ll talk a little about how these generate, give some examples, and look at the kinds of roles I want these elements to play within the conversation system.

In working on the speech generation, it quickly became clear that having a set of phrases distinctive to each nation will be an easy and quick way to potentially identify the national origin of a character you’re talking to (and an easy way to fake your own, if you know all the common phrases…) and so I’ve tried to break these down into appropriate groupings. In the end I decided that there were six major categories I could vary from culture to culture: greetings, farewells, insults, compliments, threats, and thanks. Each of these will be generated for each culture, and will also vary each individual time anyone says one, so one person from Culture X might say “So long for the time being, and may our great military leadership lead us ever forwards”, whilst another from the same culture might say “Goodbye for now, and let us hope our grand military leaders lead us forever onwards” – and so forth. This has required another large table of syllables, of course, but since these are very regular and common sayings I thought it was extremely important to make sure these varied even within cultures and between individuals, rather than (as with most phrases) having them vary only, or primarily, between cultures and religions and backgrounds, and so forth.


For greetings I wanted to make sure that these would be sentences that wouldn’t be too lengthy and therefore potentially annoying to see repeatedly, but should also contain at least a little bit of detail in them (this applies to most conversation elements, but I think greetings are particularly relevant in this regard). I went through several iterations of how these might be generated until I was able to settle on one that hit these two requirements (brevity and detail) reasonably well. At this point, therefore, greetings tend to be of the structure “[Greetings] [from] [X]”. The first element will vary between cultures and between individuals, such as “Greetings”, “Good [time of day]”, “I greet you”, “My greetings”, and so forth. These can sometimes be pushed to the back, so you might get “From X, Greetings” or “Greetings from X” – some variations are grammatically correct in both variations, whilst some are only correct in one variation, and this is all coded in. The second element will vary in the same kind of way – “from”, “on behalf of”, etc – and so will the third, which is inevitably the most varied element. This third element will look at who the individual is and the kinds of beliefs they have, and then generate or select an appropriate greeting as a result. In most cases they will explicitly mention their nation of origin (e.g. “Greetings from the brave soldiers of [nation]”), though in some rare case they will mention their religious belief in their greeting instead of a national or cultural origin (“My greetings on behalf of the zealous defenders of [god]”). As you can see from those two examples, in the first case it seems reasonable to assume the speaker is proud of their army – perhaps a standing army, or perhaps an imperialist nation? – whilst the latter is clearly strongly religious, so perhaps they come from a theocratic or religious zealous nation? Here are a bunch of examples – see you can take some guesses about the political / religious / cultural / geographical / etc backgrounds of the speakers…



So, farewells once more needed to be something that could vary sufficiently much and sufficiently often for them to not get boring when somebody might be talking to the player multiple times, or the player might be talking to numerous people in the same civilization or who worship the same religion. This varies by being broken down into polite, neutral, and sharp farewells. A polite farewell would be of the form “[1]” + “[2]” + “[3]” + “fond_farewell” + “specific_farewell” + “!”. So, this might be something like “I’m afraid I” + “have to” + “take my leave.” + ” Now I bid you goodbye, and” + “may you find enlightenment in study” (for a monastic nation). Or, alternatively, “Alas, I” + “must” + “depart.” + “I say farewell, and” + “may all of your hunts bring trophies and glory” (for a venatic nation). A neutral farewell does not contain the first section, and does not contain the “Now I bid you goodbye”, so whereas a polite farewell might be “I’m afraid I have to take my leave. Now I bid you goodbye, and may you find enlightenment in study!”, a neutral farewell would be “I have to take my leave. May you find enlightenment in study.”, whilst a sharp farewell uses the same earlier components and a different end component – rather than a culture or religion-specific end point, you would get something like “I have to take my leave. May all be well” – a generic, general departure which is sharp and not especially friendly. Again, here are some examples, which should give you clues about the speakers…



Next up, a pair of related elements – compliments and insults. Each of these will come up less often, but I still naturally wanted these to be very distinctive for each nation, and each example will be worded differently on each generation. “I wager you are as wise and far-sighted as a hawk”, or “I believe you are as clever and sage as the hawk”, or “I know you to be as smart and far-seeing as a great hawk”, and so on and so forth; it’s clearly the same greeting, but each person says it in a different way and will say it in a different way each time, too, to ensure that kind of variety is maintained. These again generate according to ideologies and religions and so forth, and I think they yield a very pleasing level of variation. Examples:



Insults were slightly tougher. Whereas compliments can work quite well if saying pleasant generic things, insults have to be relevant to a range of reasons why they might be insulting the player – refusing a trade, stealing from them, challenging them in combat, being a worshipper of a forbidden religion, or whatever. You wouldn’t want a character to kill somebody in an arena, and then someone from a pacifist nation praises them for their pacifistic tendencies. I’ve mixed things up to therefore create broader, and more sweeping sentences that should be applicable to a range of possible situations, whilst still allowing the character to say a logical compliment. Originally my plan was to make insults and threats fairly interchangeable, but just alter the first few words. So an insult would start “May you”, or “You should be”, “You ought to be”, or whatever, whereas a threat would be “I will see you”, “You will be”, “I will have you”, and the like. In the end I decided not to go with this model and to introduce variation between the two and thereby more overall variety into the conversation system (the kind of decision I’ve usually made!) and I split these into two. It was much easier to build appropriate threat generation than insult generation, actually, but the insults have come out really nicely and have a rather unusual sense to them; they’re quite distinctive, and run through quite a range of different ideas and concepts. Examples once more:



Threats, then, are similar to insults, and the variation is best illustrated simply by showing some examples:



Last, but not least: we have “thanks”. These start with words like “As”, “Being”, “Speaking as”, and so forth, and then something to do with their background, and then a form of thanks. For instance, someone from a conscript nation might say “Being a conscript proud to serve [herhis] [homeland], [thanks]”, or someone from a zealotry background might say “Being as one with the great light of [god], [thanks]”, and so forth. These are shorter and snappier than some of the other generated sentences in this set of six, but they work very well, and again get the point across snappily and effectively, whilst being relevant in a lot of situations. Whereas insults and threats were tricky because they were dependent on what the player had done to merit the insult/threat, thanks are dependent on the speaker who is relating what particular traits or characteristics they find especially valuable. Examples:


Next Week

By next week I should have these actually implemented into the game, rather than Python’s output log, and these will come up during conversations. I’m still deciding how exactly things will work with regard to when you say greetings – perhaps they will be automatic, or perhaps they will come up as a default option, or something like that – because I want these to be present to make conversations appropriate and smooth and realistic, but also not add unnecessary work greeting every time. Right now I think the best solution is for the game to automatically give you the greeting options when you open a conversation, rather than having you enter the greeting options manually, but I’ll try a few options and decide on which runs the best. Aside from that, I’ll be continuing work onto speech generation, and slowly moving towards the conversation system – the former is easier to get back into, so I’ve been working there so far, but I’ll now be slowly transitioning into handling the conversation system elements. See you all next week!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on December 31, 2016, 02:46:15 PM
Meanwhile, here's this week's blog entry, "2016 in Review", with a summation of URR development and everything else I've found myself up to in the world of games in the last year:

Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on January 10, 2017, 11:44:16 PM
This last fortnight has been extremely productive for finishing off the development of URR 0.8. It has been really great to properly get back into the swing of things and see, and be able to play, major changes to the game at the end of each night. I’ve produced three substantially new things this week – the first initial steps towards NPC personalities, the set of answers to questions that have a range of distinct options rather than only one possible reply with words being switchable in and out, and lots of extra detail for insults and compliments. I’m also about half-way through the establishment of a comprehensive baseline for conversations, meaning that the player can now successfully have a Q&A-esque conversation with any NPC they encounter on any topic, which is the biggest and most important first stage towards the full conversation system that’s being developed here. That will be finished by next week, and will be focus of next week’s blog post! For now, however, read on…

(Warning: due to the nature of this update being entirely programming, the adding of new content, and developing elements that aren’t yet finished and ready to show off, I’m afraid there are no images. Hopefully some screenshots will be back next week!)

NPC Personalities

Firstly this week, in the process of filling out the “options” responses (see below), I needed to actually come in and add some of the personality modifiers for NPCs. In some cases these apply to all NPCs irrespective of whether they are important or not, and in some cases they apply only to the important NPCs that game tracks independently as the player moves around the world, and then in other cases they are relevant only to important NPCs of particular classes (for example, only a gladiator needs to have a fully-formed opinion about the crowds who watch gladiatorial combat). There is now a pretty large set of personality traits that NPCs possess, which affect their actions and their responses – and as with everything, should give the player hints about their origins, backgrounds, allegiances, and so forth. There are definitely too many to look at them all in depth here, but there’s a few particularly interesting ones which I’ll recount here. These include:

like_of_other_countries: This personality trait, somewhat obviously, determines what individuals think about other countries beyond their own. As with many of the traits here, this trait is modified by a range of factors. These include the NPC class and background of the individual person, and the wider ideologies of their nation, and their religion, alongside a small random component throw in to ensure that two NPCs with the same demographics will not always match up exactly, but will still generally be within a logical variation on either side of a set of beliefs. For example, an “explorer” from an “internationalist” nation is likely to think very positively about the rest of the world; a “jailer” or “officer” from an “imperialist” nation is likely to think very negatively about the rest of the world; and so on across all the NPC classes, and potential modifiers for national and religious preferences. Taken on a broad scale, you’ll be able to identify commonalities and overall feelings in a culture, but individuals will still vary significantly according to their individual life experiences.

like_of_art: This trait determines what kind of interest the person has in artistic outputs (paintings, sculpture, etc – there is an equivalent for “literature”, which will cover books, poetry, etc). This is affected once more by the kind of NPC you’re talking to, and to the ideologies of the nation in question. For example, a nation with a strong cultural interest in aesthetics will naturally produce those who like art a lot more; whereas a nation with a strong intellectual interest in mathematics or mechanical engineering will likely be less interested in works of art. This will affect how much people are willing to tell you about the artwork of their homeland, how much they know about it, and give you some hints about the place of artwork in that culture and therefore where (and what) artwork you might be able to find, which might yield clues in your central quest.

religious_zeal: This is a trait affecting quite a range of responses. This will affect how NPCs respond to you if it becomes apparent that you belong to a different religion, what NPCs think about heresy, how friendly and well-disposed they are towards inquisitions and other religious rules and strictures, how they act towards priests, what kinds of money or resources they give to their church, and so forth. Although most obviously living in a theocracy will boost the average religious zeal, this still varies a lot between individuals, in large part from their status in society, their contact with other nations and religions, and their personal history and relationship with the religion in question. There’s a wide set of speech replies that draw on this particular trait, and I’m very happy with how these have all turned out.

policy_acceptance and X_preference: There is a set of nine related traits: the first is policy_acceptance, and the others are X_preference, where X is foreign, military, leadership, and so forth, for each policy grouping in each culture/nation. The first of these refers to the overall contentment of the individual with the general policies of their homeland. Leaders and regents will, naturally, be extremely positive about the policies that they themselves have implemented and oversee; nobles and lords will generally be very positive, but may express small amounts of concern about particular elements of policy; and so on and so forth across the full set of NPC classes, with some classes having much higher chances to have serious issues with the policies, and some classes having particular issues with particular policies – a jailer will almost always think building prisons is a great idea, a prisoner will almost always disagree, and so forth. The second of these, the set of eight preferences, refers to what policy the NPC would like to see implemented instead of the current policy in each of the eight areas. The number of “other policies” an NPC likes is dependent on their overall policy acceptance, and then what alternatives they like vary according to their NPC class and a range of other elements. For now these just lead to a wide range of interesting conversation replies, but in the future I’m hoping to do much more with these personality traits and individual/personal preferences.

leadership_like: This trait refers to how much the NPC likes the leadership of their nation. This is not to say the leadership policy of their nation, as above – theocracy, monarchy, etc – but the individual personality/personalities of the person/people at the top. There are a lot of elements which go into this particular decision for each NPC, and as with the above set, I’m hoping to later tie this into the potential for social movements, conspiracies, and the like…

fellow_soldier_opinion: For those who are within the military, this determines what they think of their fellow soldiers. This varies by rank, by leadership, and by the individual histories of particular soldiers. I’m not quite sure what else this variable will affect yet – beyond a couple of possible conversation replies – but I think it could be a nice way to build up a sense of how different military forces function in the URR world.

There are many others beyond these, but these should give a good idea of the kinds of personality traits that URR NPCs have. As with much of the game, these numbers will not be explicitly visible to the player, but rather should become apparent by the behaviour of the NPC, which – hopefully – should be rich and detailed enough that one can actually draw these kinds of conclusions, and then use this kind of information to make informed strategic decisions about your relationship to that NPC. In turn, all the sentences that NPCs can say which draw upon these elements have been finished, and offer a massive variety of comments and observations that NPCs can make through drawing on their perspectives, understandings, and past experiences.

Insults and Compliments Revisited

Secondly this past fortnight, I took the feedback from several people on-board about the insults and compliments, and decided to revisit these. Although the greetings and farewells vary substantially in length and detail – and, of course, one will never see lots of these in quick succession as we do in these blog posts – the same wasn’t quite true for insults and compliments, so I’ve adjusted these. There are now a range of shorter and snappier insults and compliments, and these have been added appropriately to the game’s databases of possible statements.

I also this week took all the farewells, greetings, thanks, insults, compliments, and threats out of the demonstration file and implemented them into the main game. This took a while because these sentences are generated in a unique way to give a particularly high amount of variation compared to other sentences (because they are so common) and they need to vary both overall between cultures/religions, and in individual moments of speech, so that two people from the exact same background will themselves offer different farewells at different times. This seems to be all in place now, however, and NPCs can now give these statements at appropriate times!

Option Responses

The third major body of work completed this week was what I’ve taken to calling “option responses”. Some questions are easy to answer, since the answer will always take the same form with a word or two exchanged – these are “basic responses”. Other questions are harder to answer, which split into “option responses” (where responses are very different depending on the nature of the answer) and “list responses” (where a response will always take the form of a list). This week I’ve been working on the option responses. Some of the questions that have these kinds of responses include:

What do you think of the leadership?
What do you believe your foreign policy should be?
What do you think of your culture’s art?
What are the religious policies of your nation?
How widely spread is your religion?
What is your job?
What is the history of this monastery?
In all of these cases the game can’t just take a default sentence and then vary it, but it has to instead select a sentence from a wide set depending on the data available, and then create that sentence anew each time. There are substantially more possible “base” responses for option questions than there are for all the basic sentences combined, which gives some idea of the kind of variation that some of these need to have. With this fortnight finished, I’ve now finished these off, and I’m very happy with the kinds of sentences they create – they’re varied, detailed, and will take far longer than the basic sentences before the player will ever come around to seeing the “same” sentences again.


This fortnight has seen some major progress in sentence generation and the conversation system, and we’re almost at the point where the player should be able to have a full – if thus far a little basic – conversation with every NPC you encounter. Stay tuned!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on January 24, 2017, 01:17:14 PM
Lots of major developments (and some minor ones) in URR this fortnight! Firstly, all the content I added last week meant that a whole new set of words and phrases had to be added to the lexicon; the best part of a thousand in total, if I’m counting correctly. I’ve now implemented all of these, and the game can correctly vary the words from all these new sentences by drawing on these new additions to the central lexicon. Secondly, I’ve now almost finished what I’m calling the “standard” or “basic” conversation system, which is ensuring NPCs can reply to every question they are asked; this should be done by this time next week. Thirdly, a wide range of further variables for individuals and the cultures they hail from have been implemented, and are now having an effect on what kinds of things NPCs will say. Another very, very text-heavy post this week – although next week’s will contain a lot of screenshots, this week continues to be lots of under-the-hood programming and content addition that cannot, yet, be reflected in screenshots, but is getting pretty damned close. Read on!

More Variations for New Words

Firstly, as above, there was a huge set of new words and phrases that needed to be varied for each culture, as with all the others. These entered the game because I was writing the new “option” answers (see last week’s entry), and needed to be written up. This was one of those tasks that isn’t especially intellectually challenging or needs a lot of programming experience, but mostly just involves adding a massive chunk of “content” which the game will then deploy in the appropriate situations. With this finished, I’m very happy with those look, and the sentences read really well and really nicely. Here’s a screenshot from the new set – I’m sure you can see how/where a lot of these fit in…


I also went through the existing words, and decided to statistically bias some of them back towards slightly shorter variations, and therefor slightly shorter sentences, as a response to the feedback I regularly get about some of the sentences being too wordy. You’ll see the same in the earlier example, where we have some sets using the same short word twice to boost the chance of that word being selected (this is of course not an especially elegant way to do it, but let’s be honest: my programming is not known for its elegance). This should ensure that sentences will tend to be just a little shorter and a little less wordy, and I’m going to continue this trend of chopping out irrelevant words whilst maintaining sentence variety – though this is a tricky balance to strike.

Nearing Completion on Standard Conversations

The development of the game towards what I’ve been calling the ability to have a “basic conversation” – i.e. the traditional question-and-answer session that one gets in most games, where the player asks something, the NPC responds, and this pattern continues until all conversation options have been exhausted – is now extremely close. NPCs respond correctly for all the “basic” questions (about 1/2 of all questions), and for the “options” questions (about 1/4 of questions), and are in the process of being programmed to respond appropriately to the “list” questions (also about 1/4 of all questions). This is the final step to them being able to ask any NPC any question, and get a response. For now these responses are all truthful, and they always answer, but this will still be a huge milestone once finished. As such, by this time next week, I’ll be able to show off the basic conversation system working universally, for all possible inputs and outputs, even if a few placeholders like “[holybook]” will still be in place, rather than the appropriate text itself. From my current trials with it, it looks amazing, and the experience of being able to select any question from this gigantic list and get an appropriate and sensible response is really something. It has been a long time coming, but I’m very confident that 0.8 will be worth the wait.

New Individual and National Variables

This week I also found myself needing to implement a large number of additional variables for both individuals, and in some cases for nations and religions and cultures, which NPCs would need to draw upon when they give their responses to particular questions and sets of questions.


A range of new variables were implemented this week for mercenaries, along with quite a complex formula to decide on how much mercenaries cost to hire. There are four elements here – how much training a mercenary has had (counted in years, generally as a soldier, or in an arena, or they simply became a mercenary immediately and learned on the go), how much experience they’d had (how many years they’ve served as a mercenary, and also some specific stories/information about what they’ve done during their tenure), and then a list of benefits and conditions each mercenary brings. For each mercenary, the game develops a possible list of each according to their  background. For instance, a particularly zealous mercenary might refuse to fight their own religion (a condition) but be especially keen to fight other religions (benefit). This system is naturally comparable to a lot of modern roguelike games where you have PCG characters with selections of “traits” (or an equivalent term) that mix positives and negatives, and task the player with interesting strategic decisions. The game then figures out how much “true money” a mercenary costs to hire (a secret number converted into in-game currencies whenever it’ll appear on screen), which goes by a formula I’ve developed. Broadly speaking, better-trained and more-experienced mercenaries will naturally cost more, and the more benefits they bring the more they cost, but the more conditions they bring, the less they cost. There’s a bit more to it than that, but some initial testing has shown that this attends some very satisfying results.

National Voting Rights

Here’s an interesting one – the question of national voting rights. At the moment when each nation generates, a die is rolled to decide whether women, men, or both are allowed to hold the throne (or whatever the equivalent of the “throne” is). It then considers who is allowed to join the military – if only one sex is allowed to hold the throne, then that sex will always be able to serve in the military, and sometimes the other one will be too; if either is allowed to hold the throne, then both will be allowed to serve (generally). I’ve now extended this to voting right; if either can hold the throne, then both can vote, but if only one can hold the throne, then normally only that sex is allowed to vote, but sometimes the other sex is allowed to vote at a “reduced vote”, e.g. one quarter of the other. There is no real-world bias here so it’s totally randomised between F/M/either, and all variants are equally likely, although certain ideologies make “Only one not the other” decisions more likely than others (Imperialist nations are more likely to restrict, democratic nations are less likely to restrict, and so forth, although this is not absolute or guaranteed).

Nomadic and Tribal Relations

There are now variables to determine how much particular NPCs like tribal and nomadic nations. This draws upon the general feelings of individuals about other nations, which in turn of course draws on a range of ideological and historical factors, but also then modulates this further according to particular ideologies (if these are a close match with lots of tribal/nomadic states), and the individual classes of the NPCs. These will therefore be generally close to a more general feeling about foreign lands, but also quite different in particular contexts, and will affect what NPCs say about their nations, what they’re willing to tell you, what they themselves have “bothered” to find out (if they care), and so forth.

Delegates and Parties

This week I also implemented the first half of the system that will determine what kinds of political parties exist in democratic nations, which parties hold power, and how these parties will have shifted over time. To assess the political leanings of each nation, the game first goes through all of their ideological preferences and develops a set of overall political leanings for the nation, going by some axes that the majority of real-world political parties go by: are they primarily globalist or nationalist, are they liberal or conservative, are they religious or atheistic, are they collectivist or individualist, and so on and so forth. For instance, the “Isolationist” ideology will naturally add a lot to nationalist, and some to conservative, and a little bit to conservative; the “Aesthetics” ideology will promote individualism, but also nationalism, but also a little bit of globalism, and might also support religious iconography… and so on and so forth. Then, if there is a strong specific religious belief in that nation, it checks what political leanings that religion has (is it very peaceful towards others? Does it enjoy holy wars? Etc) and adds that into the mix where appropriate. The game then ranks these overall national political leanings, and then selects a number of parties, before going through each party and having the central tenet of that party be one of the leanings, starting with the biggest leaning and working down. So a nation that is first and foremost “liberal” will have its biggest party adopt a broadly liberal position, with smatterings of other political tendencies lower down the list for that nation. Once that is done, the game then looks at whereabouts delegates come from in that nation – do they come from districts of the capital, from towns, from monasteries, from farms – and distributes delegates appropriately to each party, depending on its political leanings (and generates a procedural name for the party, although this isn’t finished yet, but I’ll show some off soon). This party affiliation will allow delegates to comment on the current political situation according to their own allegiance – which was the only reason I implemented all of this now! But it’s nice to have it in place, and it makes the democratic nations just a little more fleshed-out, even if it’ll be the small 0.9 release where we really see this more visibly.

There are also about another thirty new variables added in this week alongside the ones listed here, but I decided to mention these four as they struck me as being some of the more intriguing examples from the selection. As noted last week, these variables are entirely hidden (or rather, the numbers in each variable are hidden) and are always going to be represented instead by who people are, how they act, how they dress, what they say, where you find them, who they worship, who they serve, and so on and so forth…

Next Week

The completion of the standard conversation system, all questions/answers for all possible questions, and a lot of screenshots to show it off! It has been a while since we’ve had any proper in-game screenshots, so it’s definitely time to actually give you all a look at how (incredibly neat) everything is looking now. See you then!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on January 31, 2017, 11:43:14 AM
Another big update this week! (Isn’t it great to see URR development actually moving fast? At least, I think it is). As mentioned last week, I prioritised getting the basic conversation system totally finished this week, which is to say the ability to ask any question to any NPC, and get a logical reply, or at least the outline of a logical reply with some variables (like “[nation]”) that need to be filled in later. We had a lot of progress, and almost, but not quite, got there. But don’t worry! Other essential stuff for this release has been done instead of focusing 100% on the basic conversation system; we have still moved much closer to release in the last seven days, albeit in a slightly unexpected direction, by adding a range of other world detail that NPCs will shortly need to draw on when they reply to the player. I can also now finally announce some pretty big and very exciting changes to my life coming in the next six months, some projects ending, some new projects on the new, and what this all means for URR in the next half-year. Read on!

Basic Conversations Almost Finished

Basic conversations have been developed further this week, with NPCs now responding correctly to almost 100% of the large number of “option” queries they can be asked – which is to say, questions that need to draw on some other information and are fundamentally different depending on the outcome of that information, rather than simply being sentences which say “My homeland is X”, in a context where all NPCs will always have the same basic answer to that question. Option queries need to draw on a range of traits in most cases (within the NPC) and a range of broader cultural and religious elements (outside the NPC), and most of this code needs to be hand-written for every possible question, making it a fairly substantial piece of work. From these screenshots you can see that some bits of wording still need tweaking, but I want to stress, these are totally random selections from the hundreds of possible questions; although they aren’t perfect, I’m still extremely pleased with how these look right now, how much variation there is, and the fact that only some fairly minimal tweaks remain to be done to some minor typos, plurals, that type of thing. (Both of these is me talking to the first character I find, hence why I’m clearly talking to people from the same civilisation as me for the sake of these tests):



Irrelevant Replies

This week I have also begun implementing “irrelevant” replies – meaning things like “I have no religion” as a response to “What is your religion?”, and so forth – which apply when an NPC is asked a question they have no valid answer to, or is entirely irrelevant. This means a massive range of potential answers, some of which are specific to the question – such as “I have no siblings” – whereas others are more puzzled. An NPC might be asked about a painting they couldn’t possibly know of, for instance, in which case they would say “I do not know of that painting”. There’s close to a hundred of these irrelevant replies, all of which (like everything else) need to vary between cultures and individuals. Some of these require quite complex sentences, although others are relatively simple, but this has definitely need a substantial task. I’ve now put about fifty percent of these in place, and NPCs do correctly use them, too! Of course, in some cases NPCs can’t yet give the correct responses – the coding for siblings isn’t in there yet, so everyone just says they have no siblings – but the code for generating a sentence once siblings are present is in place. Dealing with these kinds of familial relationships and the answers to some of the more complex questions will come partly before the release of 0.8, and partly in the speedy 0.9.


Added some new traits this week, with a focus on four elements that will influence substantially what NPCs know (and what NPCs can tell the player) about the world around them. These are all affected by the individual classes of NPC – generally speaking someone who is likely to be wealthier and better-educated is likely to know more, but there is also significant variation written into the system, and the knowledge of individual NPCs (regardless of their NPC class) is then varied further by ideological preferences of their homeland. For instance, people from an internationalist nation will tend to know more about foreign matters; people from a nation with a system of vassalage will know more about their own nation than average; those from a bartering nation will know less about history, as few records are kept; those from a free trade nation will know more geography, as they travel to trade; and so forth.


How much the NPC knows about the surrounding area. This doesn’t mean the nations and peoples and so forth, but rather purely a question of physical geography – nearby mountains, nearby roads, coastlines, deserts, animals, plants, and the like. Affected


How much the NPC knows about the history of the world (inevitably heavily, but not exclusively, focused on their own nation). This means their ability to talk to the player about the historical events they are familiar with, how many events they are familiar with, and also knowledge about historical artworks, people, places, and so forth.


How much the NPC knows about their own nation – where things are, who lives there, where towns and monasteries and mines and so forth are and what’s within them, information about important people, etc.


How much the NPC knows about other nations; their locations, capitals, ideologies, religious beliefs, leaders, famous people, practices, etc. As with all the above, this varies across NPC classes, and is then modified by ideological beliefs of the nations in question.


I’ve implemented the first part of the generation system for religious relics, which needed to go in now so that NPCs could actually talk about them. Naturally the image generation for these will take place at a later date, but for the time being the game can generate the names of religious relics, a little bit of information about them, and who they were originally owned by. Each religion will only ever create two kinds of relics, depending on their beliefs, and these fall into a randomly-chosen “major” and “minor” category. For instance, a religion might primarily produce “Crown” relics, but sometimes have a small number of “Bone” relics; or a religion might focus on “Book” relics with a small number of “Weapon” relics; and so on and so forth. Each has a unique generation system for selecting its name, and we can now end up with relic names like the following:

Twisting Key of Monn’morra
Slender Ring of Saint Ynnop
Wooden Garland of Grey Fox Running the Sacred
Orangejaw Moonblizzard’s Holy Engraved Locket
Fi-Un-Gat’s Pitted Skull
Consecrated Pointed Sceptre of Ibimmom, Sly Rose

The game also now keeps track of how many relics need to spawn in each church (which varies across different kinds of religious building) and ensures that an appropriate number will always appear. Generating the images for these is going to be a lot of fun, but isn’t going to come until 0.10 or somewhere beyond. Anyway, these are now in place, so NPCs will shortly be able to talk intelligently about relics, and specific relics will now be tied to specific reliquaries in specific churches and cathedrals!

Laws and Punishments

Three of the “list” questions (questions where the answer is often of the kind “A, B, C and D are examples of the X”) relate to the particular laws of a particular nation regarding various topics – currently “violence”, “trade”, and “religion” are the three listed in there. This means that nations now generate laws in each of these categories, and a set of punishments, and then assigns punishments to each broken law depending on the severity of the crime (as the nation sees it). Laws and punishments on trade are determined almost entirely by trade policy, but a nation’s perspective on smuggling is also affected by a range of other ideologies; “violence” laws are determined by a wide range of ideologies from across the eight main categories; “religion” laws are naturally primarily determined by the religious policy of the nation, with a few inputs from a couple of other policies.

To take trade as the example, there are now five possible laws that a nation can enact:

District Entry: how much money (if any) it costs to enter a district in the capital.
City Entry: how much money (if any) it costs to enter the capital city.
Foreign Goods: how much extra taxation is put on foreign goods (light, middling, heavy).
Black Markets: whether black markets are tacitly accepted or not, and if not, the punishment for using one.
Smuggling: the level of punishment for those caught smuggling/with smuggled goods.

Each of these then, if appropriate for the ideologies of that nation, has a value assigned to it. When punishments come into play, punishments now vary according to the five possible justice ideologies. I’m not quite clear on how the “Ordeal” justice policy is going to work out, so I haven’t really developed that element yet, but the other four now work nicely. The Frontier policy imposes fines on those caught breaking the law; the Vigilantism policy will see those breaking the law hunted by the general public, who for lesser crimes will demand items in recompense, or injury, or will hunt to the death in the case of severe crimes, the Penitentiary policy imposes a range of prison sentences, and the Gladiatorial policy involves battles to first blood for lesser crimes, and fatal battles for greater crimes. There is also something of the god system from DCSS here; I wanted to develop these in such a way that they would seriously affect the player’s actions in the future, and which nations they choose to take actions in, when they keep in mind what the potential ramifications are. Justice policies should now have a substantial effect on player decisions once implemented –  and, of course, NPCs can now talk about them, listing all the policies that are worth talking about in the area in question.


Next Six Months

In other news, some big changes are happening, which are going to lead to some very exciting things. Firstly, I’m leaving my position as a postdoc at the Digital Creativity Labs at the University of York – although keeping my current secondment as a Researcher in Residence at the UK Digital Catapult – and taking up a new six-month postdoctoral position at Goldsmiths, University of London, to study paper puzzles (crosswords, Sudoku, etc), and those who play them, design them, implement them, with a view to developing a new set of paper puzzles that might one day be able to challenge Sudoku in national and international print newspapers. Such an outcome is obviously an immensely ambitious goal, but that’s one of the many things that attracts me so much to this project; the potential to make such a big impact into the game-playing lives of so many people is incredibly exciting. I’ll keep you all updated on this goes as time goes by; this might lead into further research in this area, though I also have a range of other irons in the fire for the longer-term future.

Secondly, during this summer, I’ll be taking up a range of visiting fellowship positions at numerous institutions around the world. Firstly, the University of Alberta in Edmonton, where I’ll be giving talks and running and contributing to seminars on professional gaming and the intersections between video games and gambling practices; secondly, the Chinese University of Hong Kong, where my focus will be very much the same; and then the University of Nevada at Las Vegas, where I’ll be researching the histories of professional gamblers, specifically with a focus on how professional gamblers are represented and talked about in news media, films, literature, and so forth. Somewhere in the middle there I’ll also be giving a few talks at Nanyang Technological University in Singapore on my research, and potentially travelling to two other countries I’ve never visited before as well to offer guest lectures and further develop my Esports and live-streaming research, although those are still in discussion with the relevant parties. If you live in any of those areas, let me know – maybe we can meet up! The few times I’ve met fans in person has always been awesome, and I’d certainly be keen to do so again.

What does all this mean in practical terms? Well, firstly, my brain is going to be a lot clearer to focus on URR 0.8 and finishing my first book in the next four months. Travel has always been something that galvanises and focuses me tremendously well, and these, combined with a new position more closely aligned to my research interests, will do a lot for me. People who read this blog regularly will know the last few months have been tough for a range of reasons, and these new positions are going to be a big help with some of those issues. Onwards, to bigger and better things!

Next Week

Having really pushed on URR this past week, I need to focus on my academic work this coming week, so next week will be a games criticism entry; then by the week after I’ll be aiming to actually finish off the Basic Conversation system by fully implementing the answers to list questions, and making sure that the range of “irrelevant replies” are all implemented and functioning correctly. See you in a week! When we will be talking the notorious “P.T.”, or “Playable Teaser”, and its clever implementation of environmental puzzles…
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Zireael on February 01, 2017, 06:12:21 PM
We'll be getting a Playable Teaser? Great!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on February 04, 2017, 12:50:41 PM
We'll be getting a Playable Teaser? Great!

Haha! I might do a standard trailer at some point...

In the mean time, crunching on a piece of academic work this weekend, but I recently got a chance to play the infamous "P.T.", and I was impressed by how many puzzles and how much gameplay it packed into such a small environment. Thi week, here are some thoughts: http://www.ultimaratioregum.co.uk/game/2017/02/04/p-t-cryptic-puzzles-and-small-spaces/
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Aleksanderus on February 14, 2017, 06:04:36 PM
I see that you're doing some progress with generated personalities. Nice!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on February 21, 2017, 01:40:04 PM
I see that you're doing some progress with generated personalities. Nice!

Thanks! It's complex and slow, but it is coming together...


This week (well, fortnight) we have some laws, some new list questions, some political parties, overall a reasonably large entry to make up for silence last week, and a paper, so let’s get to it:

Semiotics of Roguelikes

Firstly and briefly, the paper I wrote a couple of years ago now on the semiotics of various ASCII roguelike games has moved from being published online to being published with in actual edition/volume of Games and Culture. To mark this momentous event, I’ve uploaded a pre-submission version of the paper onto my academia.edu account, so if you’re interested in reading the paper – the abstract is below here – then click here and give it a read, and do let me know what you think.


This article explores the semiotics of the “roguelike” genre. Most roguelikes reject contemporary advances in graphical technology and instead present their worlds, items, and creatures as American Standard Code for Information Interchange (ASCII) characters. This article first considers why this unusual graphical style has endured over time and argues that it is an aesthetic construction of nostalgia that positions roguelikes within a clear history of gameplay philosophies that challenge the prevailing contemporary assumptions of role-playing games. It second notes that the semantic code for understanding the ASCII characters in each and every roguelike is different and explores the construction of these codes, how players decode them, and the potential difficulties in such decodings. The article then combines these to explore how such visuals represent potential new ground in the study of game semiotics.

Violence Laws

The game now generates a full set of laws for violence in each nation. These are not done in quite the same way as the other two sets of laws. Whereas “religion” and “trade” have a set number of values and each value always create a law in every nation, not all nations will even have some of the violence laws. It depends on the ideologies of the nation in question, and what they consider to be a meaningful violent event, and how severe they think it is. The game selects a set of laws, ranks them, and then distributes punishments according to the ranking of the crime, not the crime itself. Here is the sequence by which the game selects laws for violent acts, where the ones that a nation cares about the most come first, and the less important ones come later. As a result, you’ll see some very different values at play here, and what counts as a severe punishment in one nation will be far less severe in another, because it will be much further down the crime list, as a result of the nation being more concerned by other things:


If I’ve calculated this correctly, this means the shortest set of violence laws is five, and the longest possible set is thirteen, with most nations naturally falling somewhere in the middle. In each case the top crimes merit a “Punishment 5”, which is the highest level of punishment – such as three arena battles to the death, or a lengthy imprisonment, or a severely damaging physical ordeal – and the bottom will merit a “Punishment 1”, and the others in the middle will be distributed appropriately. I’m confident this will again generate an interesting and unique set of consequences for your actions in each nation, and when coupled with the wide variation in punishments, and the kinds of punishments that your character might or might not be able to withstand depending on your build, items, etc… I think some very interested decisions will emerge from this process.

More List Questions

Parents, Siblings, Grandparents, Children

NPCs are now able to talk about their parents, siblings, grandparents and children, in a pretty wide range of ways. For instance, if you ask about parents, they might simply answer that their parents are nobody important (if they feel you’re disinterested, or of a much higher social status), or might name only one, or both; alternatively, if their parents are consequential people recorded by the game, or they are important, then they’ll probably have some more info they’ll (proudly) be willing to give out. For the longer lists, the game also takes account of the sex of the people being mentioned, so they might say “My two brothers are X and Y and my sister is Z”, or “My maternal grandparents are X and Y, my paternal grandparents are A and B”, which will also vary based on any particular bias towards either sex present in that nation; for extremely long lists, lastly, such as children or siblings, they can now reel off a full list that is always grammatically correct. These lists also include titles, too, so you might get “My mother was Queen X the 1st, Keeper of the Brass Casket, and my father was Prince Y, Consort to Her Majesty” – or whatever.

Trade, Violence, Religion Laws

We covered these briefly in a previous entry, but NPCs are now able to tell the player about everything in these categories. Some of these require different lines of code, as in the case of trade and religion laws there is a finite set of “things” that each nation will have laws on, whereas for violence, some potential violent acts simply won’t be recognised or won’t be relevant to particular nations, and therefore won’t be there. Either way, people now give you a nicely detailed list of these laws; and as with everything, how much people tell you will be modified by mood, and their knowledge of their own nation…

Nearby Things

I’ve started to implement the code for NPCs replying to questions of the sort “are there any X nearby”, where X might be cities, towns, nomads, tribal nations, mountains, coastline… you get the idea. There’s a pretty wide number, and some of them have to request information from different parts of the game’s databases, but this code is now being put into place. There are also now appropriate sentence structures here for people to word things appropriately; for instance, if there are individual things, such as towns, you’ll just get a list. By contrast, mountains do not take up individual map tiles but stretch across mountain ranges, so someone might say “There are mountains far and very far to the northwest, far to the north, and somewhat far to the northeast”, which should give the player a decent impression of what the mountain range looks like. (The same then applies to deserts and coasts and so on).

Political Parties

Returned to political parties and developed names for the parties, which will soon be matched up delegates, and we should be able to get some kind of political system actually working. The game first selects a number of parties for each nation, which is semi-random and partly influenced by several ideological factors (outside of their commitment to a democratic form of government), and then (as we discussed before) ranks the various overall trends in the nation, such as individualism or collectivism, nationalism or globalism, and so forth. It then creates parties for the dominant trends, and sometimes with a secondary ideology from lower down in that chart, and now it finally creates names. As such, we can now find NPCs who might be willing to tell you about parties such as:

The Liberal Sovereignty Party
The Party of Enlightenment
The Conservative National Party
The Devout Singular League
The One Reformist Party
The Association of Independent Selfhood

And so on and so forth. As with most things in URR, you should be able to extrapolate some reasonable guesses about the commitments of these parties from their names. In a later version I’ll connect these to delegates, and get the political system in democratic nations working properly.

Next Week

As you’ll have noticed, we’ve slipped back to a fortnightly update this time – although I’m generally back to a post every weekend, this last week has again just been absolutely jam-packed, and I had to push things back. However, hopefully, updates will resume the weekend model from next weekend moving forwards, and I promise lots of screenshots next week. I must apologise for this, but leaping back into the weekly blog posting has been quite a bit new pressure on my time, and although I thought I could go from sparse blog posts to every week: it hasn’t been quite that easy. Things are ramping back up, but maybe just a little more unevenly than I’d hoped. I am also working on finishing my first book at the moment, which is of course taking up a lot of my time, as well as planning how best to get around the world and take up three visiting positions in three countries in the coming months, so there’s a lot of admin in my brain at the moment. I’m desperately hoping to get 0.8 before April, as otherwise that’ll be a ridiculous two years between release… and that’s just too damned long, however much detail I’m putting in to this major version. Nevertheless, normality should resume again next week, with hopefully an even more significant URRpdate. See you all then!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Aleksanderus on February 21, 2017, 02:10:17 PM
I will finally be able to make a fascist party in a roguelike!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on February 27, 2017, 01:05:01 PM
I will finally be able to make a fascist party in a roguelike!

Well, maybe not MAKE, but certainly FIND! There is a pretty wide selection of possible parties in the game, and I'm sure in the future I'll add more detail in there; for now I'm only really focusing on putting in enough details so that NPCs can talk intelligently about them.


This week I’m doing something slightly unusual. A huge amount of coding has been done this week, but I’m not yet able to produce screenshots from this progress; some of it is slightly buggy, and I need to test a few new generation systems to ensure that the NPCs I want to talk to, in order to take the screenshots, correctly have the information I actually want them to have. Succinctly, though, we now have a huge set of new list questions generating, various elements such as punctuation and slight meandering to make conversations seem more human, political parties even more fully implemented, a geographical search system put in place, greetings vary massively based on the relationship between you and the NPC, and even a procedural alcohol-name generation system so that innkeepers have something to talk about, and the beginnings of systems for modifying what people will say to you based on their mood (personal), the “local” mood (what people in that area think of you), and their knowledge of the particular matter (geographical, historical, etc).

All of these are finished, on the cusp of completion, or well into development; but because I’ve just been coding like mad, I haven’t really stopped to polish everything and get things to a position where I can take screenshots. As such, I’ve decided just to put this up this week, to signify: lots of coding is happening, and there will be lots to show off soon, but I’d rather show it all off once I can implement screenshots. I know some of the recent updates have been screenshot-lite, so I really want to have a solid volume of screenshots in place once I can show things off.

As such: hopefully, we’ll have a nice set of screenshots next week!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on March 12, 2017, 12:55:48 PM
A big update this week, summarising everything from the last three weeks of coding work. Succinctly, the game now has NPCs who can reply to even more “list questions” than they were previously able to, adds in what I am calling “meanderings” into speech from time to time in order to make everything feel and read more realistically, boasts a rather more developed international relations system which NPCs can draw on when making comments to the player, and procedurally generated alcohol is now present in the game. This last one is, obviously, the most crucial of the bunch. Oh, yes, and I’ve also expanded and finished the system for generating the names of relics, although their procedurally-generated images are of course not yet present. So without further ado, read on:

More List Questions

I have now finished off almost all the “list questions” – which is to say, questions where the answer often takes the form of a list, such as “What towns are nearby?”, or “What animals are sacred to your people?”, and so forth. Here are some examples of the recent additions:

Animals and Plants

You can now ask people about the animals and plants that are local to their homeland, and whether any animals or plants are considered especially important in that homeland, as part of your conversation. They’ll now give you a list of the local flora or fauna as appropriate, which is always grammatically correct, and also lists these things in a fairly logical order. The number is never too high, either, so you never find yourself reading through a gigantic list of things. Although not currently implemented, in the very near future these animals and plants will be spawning, and should be found referenced throughout a culture, and are designed to be another clue the player can potentially use to find out about the world.



International Relations and Geography

The game can now generate appropriate and logical sets of relationships between nations, based on their ideologies, religions, proximity, and so forth. You can now ask people about their relationships with other nations, what they think about other cultures in general, what kinds of cultures are nearby, what tribes and nomads can be found nearby, and so on. The same system is then used for overall geography, so you can now ask a range of questions about things that are near to where the player and an NPC are having their conversation. For example, you can ask whether there are mountains (or mountain passes) in the proximity, and so forth. These questions then redirect to a function which chooses an appropriate area for the NPC to have knowledge of (more educated NPCs will have a wider area, and NPCs more well-disposed towards you will think about giving you a longer response). This system needs expanding to all kinds of conversations, which I will talk about more in the future, but for the time being, people can tell you quite a bit about the surrounding areas:




Also, here are the law responses from last time:


You’ll notice the first of those is rather long. This is an example with a nation with a lot of laws on violence, and talking to someone who is well-disposed to you, and is therefore willing to actually talk to you. I think I need to find some way to chop this down; for such a long potential answer, maybe even people who like you the most will tell you the top laws or bottom laws, or maybe they’ll say “Do you want to know punishments for the worst crimes or the most common crimes?”, or… something. I’m not quite sure yet. Either way, it’s pretty clear that a reply this long isn’t really workable, and is very hard to read, and will probably lose the reader’s interest part-way through.


Secondly, I added in a set of what I’ve now taken to calling “meanderings”. As part of making conversations as realistic as possible, I felt it was important to add in code for people thinking for a moment before they reply, or being semi-reluctant to quickly reply, and just generally having the umms, ahhs, and oks, that characteristic real speech. At the same time, of course, having too much of this would quickly get annoying. To balance this out, there are two elements. Firstly, people will only start to use these phrases if they begin to get annoyed about the conversation, and they’re starting to lose interest in you. When their full interest is on you they won’t falter in the conversation, but this might change as time goes by. Secondly, they will not use it too often; an NPC that has just used one will definitely not use it on the next sentence, and beyond that, it is randomised, but becomes more and more likely the less and less interested in the conversation the NPC becomes. If you look at the conversations above, you’ll see a few of those present here and there.

International Relations

As noted above, the game now generates appropriate relationships between each nation in the game, whether feudal, tribal, or nomadic. In essence, the game looks over the ideologies of each nation, and looks at where they match, and where they clash. In some cases a pair of ideologies could be seen as a match or a clash; for instance, two monarchies might get on well because they have the same system of leadership, maybe the families are related, and so forth; or they might hate each other and have a rivalry between their ruling families. In these cases the game chooses at random whether these are “good” commonalities or “rivalry” commonalities. Equally, some shared ideologies will always cause conflict – two theocracies or two especially religiously zealous nations which do not share religions are never going to get on, and likewise two imperialist nations – whilst others will always generate friendship, such as a shared commitment to religious tolerance, or a shared appreciation of gladiatorial combat. Then, in turn, various religious beliefs, geographical distributions, and so forth, further affect matters. These are then categorised into nations that are close allies, friendly, neutral, disliked, or firm enemies; these five categorisations then affect speech, whilst the more specific like/dislike values will play into other elements later on. This is basically akin to the kinds of systems one sees in the recent Civilization games, but somewhat more complex and with many more factors at play determining what cultures think of one another.

Along the civ.relations dictionary, there is also a civ.trade_relations dictionary. This is similar, obviously, but actually somewhat distinct. Whereas relations simply tells you what one nation thinks of the other, in the case of trade_relations, we’re talking specifically about how much trade passes between two nations. Of course, trade is not going to be passing between nations that loathe each other, but two nations that share a massive border and are somewhat friendly are likely to trade more than two nations that are the best of friends, but half the world apart (bearing in mind, of course, that we are talking about the renaissance rather than the modern day here). Trade_relations therefore tells you the volume of trade going on between each nation and each other nation, and in some stores the player will therefore be able to sometimes find the items of other nations for sale. The reverse will actually happen in black markets – if X and Y hate each other, the goods of X might secretly appear in the black markets of Y, and vice versa. In this way I’m aiming to make the potentially someone “abstract” idea of international and trade relations much more concrete; it shapes who appears in each nation, what items appear where and under what conditions, and will also – of course – affect where the player can safely go.


For a fun little diversion for an hour this week, I also implemented the system for procedural alcohol – I’m sure we’ll all agree, a truly vital component of any procedural world. Each nation now selects an archetype of drinks that they tend to enjoy drinking, which can be beer, spirits, or wine; these are designed so that a full world will not have a completely equal distribution, but some generations should have a high volume of beer, spirits, or wine drinkers; much as in the real world, we don’t see these equally distributed. It then generates an appropriate set of alcoholic drinks for each nation, with words drawing on the terrain and climate types enjoyed by that nation, a wide set of default words for each alcohol type, and names – a class of alcohol might be named after the particular monastery where it is brewed, a particular town where it is particularly favoured, and so forth.



The player can also now ask innkeeps about the kind of alcohol they sell, and they’ll give you an appropriate list! Taverns stock a high percentage of all the alcohols drunk by one nation, but will never stock the full collection; equally, I’ll shortly implement a system so that taverns particularly near the border with another country will (assuming that is a nation with a particular set of alcohols, so not a tribal nation) sometimes carry one of the alcohols from “across the border”. Later on I will also add actual “breweries” in the locations where the various alcohols in a nation are brewed; these will have minimal gameplay value, so I certainly won’t spend more than a few hours on that, but for the sake of completeness I think they need to go in to make the world look just that little bit more complete, more varied, and so forth.



In the last fortnight I also finished the generation system for relics, and here are some example debug logs, where “RT” means “Relic Type”. Some of these do have rather lengthy names, because the names of the people associated with the relic can be quite long. It’s a little unwieldy, but honestly, I think it’s fine. I’m extremely happy with how these work and how these look, and I don’t think I’ll make any more changes here before the 0.8 release, beyond making sure everyone in the game can speak about relics of their religion correctly.


Blog Update Speed

So, once again, this has been a fortnightly update. As such, I’m just going to stop commenting on this for now or trying to predict when the next update will be, and I’ll just say to everyone: I’ll update as soon, and as rapidly, as I can. I am developing URR actively again, as you can see from the above, but I am also changing jobs, taking up two visiting positions in two other continents, and finishing my first academic monograph… so we’ll see how it goes. See you all next wee-… er… next time!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on March 29, 2017, 08:58:35 PM
This fortnight I’ve been working on getting the entire basic underpinnings of the conversation system finished; I’ve made a lot of progress, not quite enough to show off all the screenshots I’d like, so like last time, I’d rather wait until I can do a nice screenshot-heavy update, which will be next time (whenever that is!).

Instead, I’m going to talk a bit about the second thing I’ve been working on. I’ve now started developing the system by which NPCs will make judgements about you, the player, and where you come from. There are five elements to this: your clothing, your jewellery (meaning what rings and necklaces you are wearing, if any), your skin tone, your facial appearance (scarification, tattoos, headscarves, turbans, that sort of thing), and how you talk. The last one of these I’ve talked the most about in the past, but in this entry I’m going to do a little bit of an overview of how I see all of these functioning, and what it’ll do for the game. Equally, however, I now find myself faced with a big problem: what if all five elements of a player’s appearance suggest different origins or statuses? How should the NPC respond? I have a few notions, but I’m very open to suggestions.

Anyway, without further ado:


Other NPCs will make a range of judgements about the player based on the clothing they wear (and, later, the armour they wear, and weapon they wield). I think this will have three elements: what nation they seem to be from, their potential wealth, and whether their clothing denotes any kind of special affiliation, such as a religious order or military organisation. Most NPCs will likely treat you with more deference the more impressive the clothing you wear, but of course wearing the clothing style of a hated nation is likely to have the opposite effect no matter the wealth you’re showing off. For religious clothes, I’d like to have NPCs assume you’re a priest or a monk if you’re wearing obviously religious garb, although such garb will obviously have significant negative effects in certain areas of the game world; at the same time, though, it might encourage a particularly zealous shopkeeper to give you a discount, for instance. However, if people ask for religious advice and your character doesn’t know anything about the religion they are masquerading a priest of… that might be a little suspicious. Once armour is in the game that will also affect people and how they respond to you, probably with a little fear, a little deference, but again depending on the specific situation. Wearing unknown clothes should also elicit some kind of response depending on the nation/people; friendly and inquisitive if a very open and cosmopolitan nation, scared if isolationist, etc…



Jewellery will appear at some point in the near-ish future, and will consist of rings and necklaces. These will be similar to clothing: there will be cheap, middling, and pricy rings and necklaces available for each nation, and special/unique rings and necklaces for religions, religious orders, various other factors, various ranks in various organisations, and these sorts of things. Right now, I think special jewellery will be available for religions, houses/noble families, monarchs/rulers, but that’ll probably be it (and then more generally, as above, across cultures). I therefore see these as having a very similar set of relationships as clothing, but also denoting several things (such as family affiliation) which clothing does not; although most will be standard jewellery items for the culture in question.

Skin Tone

Skin tone varies very widely in URR, and is inevitably a central method by which peope might make judgements about the origin of the player character. This has only one element, which is to say a geographical assumption: NPCs will consider your skin tone, estimate how close/far from the equator you originate, and then look at their knowledge of nations and take a guess at which one you might be from. As such, there will also be some way to temporarily alter and mask your actual skin tone and make it lighter or darker as part of trying to blend in in other societies; and, of course, with some skin tones you’ll be able to “pass” for a citizen of many countries, most likely, whereas a clothing style would only allow you to pass for one. Hopefully the intersection of these (and the other elements below) will allow for some interesting combinations and strategic decisions.


Facial Appearance

Facial appearance, meanwhile, is a binary element: it denotes the overall culture someone comes from, and that’s it, although in a small number of cases it might also denote rank, slavery, and so forth. Again, if people recognise the markings they will suspect you are from the appropriate culture; if they don’t recognise the markings, the same range of responses mentioned earlier might play out. Again, I’ll be introducing ways to fake some markings (though probably not others?) as a means of further disguising yourself.


How you Talk

We’ve discussed this several times before on this blog, so I’ll keep it brief here, but the way in which you speak is going to be crucial. NPCs will make judgements about your origin based on what you say and how you say it, whilst you’ll be able to fake speaking in other dialects to a greater or lesser extent based on your knowledge of that dialect at the point you’re having the conversation. This will often be a make-or-break point for any player/player character attempting to “fake” their way into/through a particular culture or particular social situation, and is one of the aspects that’ll appear in 0.8 – NPCs won’t respond to it yet, but you will be able to change dialects, and see the results.



These are the five major elements I see as contributing to how other NPCs see the player – the first four being literally how they see the player, and the last one of course only coming into the equation if you start talking to the NPC (or the NPC starts talking to you, which is a feature that definitely needs to be implemented in the near future). I think these will give the player ample methods for crafting an image useful to them at that moment,

But what happens if 50% of your elements suggest you are person A of rank B from culture C and religion D, but the other half of your clothing suggests you are person W of rank X from culture Y and religion Z, which is the absolute opposite? Should they take an educated guess? Should they comment on how you are dressed, and that you are dressed strangely? What if they have particularly strong feelings towards/against A/B/C/D/W/X/Y/Z? Or what if 90% of your visible elements suggest X, but then you have a single element suggesting Y? Should the NPCs focus entirely on Y? Should they assume you are X and just treat Y as a strange element? Does that depend on the nature of X and Y and the context in which you are meeting another NPC? My point from all of these questions is that it’s proving very difficult and complex to decide, in essence and in one sentence, how NPCs should add up the elements of “you” they are presented with and how they should subsequently come to a judgement. This is what I’d love any and all of your thoughts on below; this system isn’t going to be implemented in 0.8, because I’m really trying to get only the core essentials of the conversation system done before release, but it’ll be a crucial element of the fast and much shorter 0.9 which will be finishing off the conversation system straight after. What do you think?


As I’ve said before, I’m crunching on finishing my first book, and about to travel for six weeks through various visiting fellowships; I am hard at work coding, but right now I’m finding fewer blog updates is really helping me with game developments, so we’ll be sticking to uncertain update schedules until my book is finished and submitted (May 31). I know this is rubbish, folks, and I wish I had some more time, and I hate how long URR 0.8 is dragging on for, but I’m doing the absolute best possible in the present situation. Next update: asap!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on June 24, 2017, 09:02:53 PM
Cross-posted from my blog: http://www.ultimaratioregum.co.uk/game/2017/06/24/burnout-and-the-future/

So… this is what burnout feels like.

I’m almost now ready to submit the manuscript for my first academic monograph. It will have taken two months longer than anticipated, which was a great disappointment to me – it’s the only piece of academic work I’ve ever had to ask for an extension on. There were many factors at play there, some within my control, and some outside of my control, but the bottom line was that had I taken on less than I wound up taking on (and had the circumstances I was working within been different), I would have been able to get it submitted on time. Although I’m very happy with the final product, and I’m confident the work will be a valuable contribution to the study of unpredictability in games (of all its forms), I find myself reflecting specifically on the process by which the final parts of it – the crunch, if you will – were written. From around the start of March until the start of June, I can truthfully say I did effectively nothing with my spare moments except writing the book. All day on both days of every weekend was book writing; every evening was book-writing; every train journey and flight and coach trip was book writing. During this period I spent effectively no time with friends, no time exercising, and no time whatsoever doing any programming, much to my chagrin.

During this period, I began to experience for the first time what I believe is called “burnout” – my appetite dropped, I developed some anxiety (a deeply new experience for me), I developed some depression (similarly), and it felt at times as if there wasn’t really any point to what I was doing; that was I just speaking into the void because nobody else would read it; that I was letting everyone down by not working on URR (which I still feel quite acutely); and other feelings I’m not going to share here. Although certainly not the darkest time in my life, it has been, in many ways, a deeply unpleasant three months. Travelling a lot in this period helped me, and finding some times to engage with nature – whether meeting wild bison and wolves in the frozen tundra of Northern Canada or meeting wild tropical birds and lizards in the equatorial jungles of Hong Kong and Singapore – helped my mood a lot, but it only stemmed the bleeding, without addressing the underlying issues.

Academia, especially early-career academic before one secures a tenured faculty position, is notoriously stressful and time-consuming. One is always in competition with vast numbers of recent PhD graduates for a ludicrously small number of postdoctoral or junior faculty positions; one is constantly bombarded with requests and obligations and things that need to be done; one is strongly encouraged to submit only to top-tier journals, and yet doing so leaves one waiting for potentially years until publication, damaging one’s employability in the short term. The other crucial element of academia is that there is always more one can do. As academics, we don’t really have working hours, as such – just contracts that say we must “fulfil the expectations of the job”, or some equivalent language, using however many hours across however many days per week that takes. Many contracts even explicitly state we are expected to use evenings, weekends and holidays to meet those requirements where necessary – and that, assuming one wants to spend one’s academic career actually doing research, will always be true.

Up until now, I’ve always been able to field this and maintain the other things I want in my life, but in these last three months, I am not exaggerating when I say every spare moment has gone into the book. For the three months before that extreme compression of my time, almost every spare moment went into the book, and looking back, I can see my free time shrinking into a smaller and smaller gap with every passing day. Something inherently enjoyable – and I do enjoy academic work tremendously – quickly ceases to be enjoyable when it is something one must do, and when it is the only thing one is spending one’s time doing. Because of this the book became something of a chore, which itself made it harder to write, and which itself made it more of a chore, and made more painful my inability to spend my time on other things, and so forth. As a result of the stress leading up to and during the book-writing, I screwed up. I made two serious errors of judgement – one being a different but major piece of academic work I submitted, and another being a piece of work I submitted elsewhere. In both cases I made poor judgements about what I wrote, and over-estimated my knowledge of those domains, and was – quite appropriately – brought down a rung by those who do know those domains. They were both humbling experiences, which really brought home how much my judgement had been impaired by the stress of finishing the book.

But now, the book is basically finished, and I’m on my final visiting position of the year, having also just been offered an amazing new two-year postdoc opportunity in Canada where I will be able to drive my own research and make my own hours. However, as I sit here for now in a cafe in Nevada, trying to take stock of things, I realise that there are four things I must make time for, and a fifth change I need to make overall, from now, moving forward, no matter what, in order both to be the kind of academic I want to be, and to have the life I want beyond the academy.

Firstly, I need to make time again for programming, starting now. It’s something I enjoy tremendously, it’s creative work which forms a crucial balance to the intellectual work I make my income from, it’s something a lot of people are following and counting on me for, it’s something absolutely tethered to my online presence, and it’s something I simply deeply want to start doing again, and which gives me valuable balance in my life. It makes me deeply sad that I wasn’t able to get 0.8 out before I went into this period of total time compression and book-only-focus, and I want to put this right and get 0.8 released as fast as possible, and certainly before my new position starts later this year. Once 0.8 is out URR will be more than half-done, and psychologically, that’s an important marker I need to hit. Therefore, starting next weekend, I intend to devote a day per week to programming, no matter what else might be looming over me or might be requiring my attention. Either Saturday or Sunday each week, but probably I think Sunday, my intention is to always spend that day – as a minimum – programming. Despite the long hiatus, URR is not cancelled, but has certainly been on hiatus, and it’s finally time for that hiatus to properly, and truly, end.

Secondly, I need to make time again for fitness and exercise. I haven’t exercised once in the last three months, with the exception of hiking up and down Victoria Peak in Hong Kong and a couple of hikes in Alberta and Nevada. Normally I would exercise for at least an hour at least four or so days a week, but the book has simply dominated my time and my thought to such a degree that I’ve let this slip completely, down to zero. I can tell and feel that I’m less fit now, I’m less strong now, and less healthy now, and I don’t like it. It’s an unsettling and disturbing change from the state of being I’ve become used to, and I want to get back to my previous level of fitness as soon as possible. I’ve now managed to get this back to exercising twice a week, and hopefully I can push that back towards four as I decompress in the coming months. As I’m moving to Alberta, I’m keen to do lots of hiking there, too, and I have some interesting future travel plans which should also help with that.

Thirdly, I need to make time for a personal life. The fact that I am likely moving to a new country/city in a few months feels like a good time to make this kind of resolution – both to renew existing acquaintances in the UK and elsewhere, especially important now that I’m no longer in physical proximity to my friends in the UK, but also to go out there and find new friends and new colleagues. I’ve always been someone with a small group of close friends instead of a far wider social circle, but this, also, has shrunk to nothing in recent months, and my personal relationships have definitely suffered for it. I’m making amends to those I have unintentionally hurt, which I believe to be an important first step, and from this point onward I’m going to make a lot more time with friends and family in the coming months. It seems that the importance of this to one’s mental health only appears after it is lost, and that’s a lesson I don’t want to have to repeat again in the future.

Fourthly, I need to make time to actually play games. I got into game design and game scholarship and game writing and competitive game play because I love games; because I’ve played hundreds, probably thousands, and certainly own thousands; and I’ve been playing them since I was as young as I can remember. But I no longer find myself with the time to actually play any; in the last year I’ve played only two games for pleasure, which were Bloodborne and Dark Souls 3. Both were incredible experiences, but that’s only a fraction of the time I would normally spend playing games. Even in other periods of stress – such as when I was simultaneously finishing my PhD and dealing with a life-threatening illness – I still found far more time to play. It’s fun (most crucially), but it’s also important for my ability to be a good game designer and good games scholar. As such, my goal is now to at least double the number of major games I play each year for starters, and hopefully increase this number as time goes by. Right now, The Witness, Demon’s Souls, Shadow of the Colossus, The Bridge, Antichamber, and perhaps even returning to playing roguelikes all look very appealing, and that’s where I plan to start.

Fifthly, and lastly, I need to focus. Forgive the cliched phrase, but I now realise I need to work smarter, instead of working harder. I’ve been trying to be a game scholar, and a competitive game-player, and a game designer, and a game writer, and all the other things in my life outside games. This is just too much. As a result, I’ve decided to permanently “retire” any competitive gaming from my life. I want to really focus on scholarship/writing/coding, and in turn, to present myself specifically at the intersection of those three things. My background in poker remains a major informing element on my academic career – especially as I move toward studying gambling more seriously as a topic of study – but I think I’m spreading myself too thinly, both in terms of my effort, and in terms of how I appear. I want to focus in on my strengths, instead of trying to be everything, and do everything, when it comes to games.I think this will, without a doubt, be for the best, and strengthen my ability to work in my core domains without “distracting” myself with others.

As for the wider future, academia certainly remains my career path of choice. I take tremendous satisfaction from the unfolding of intellectual ideas on paper; I love travelling around the world to do research, to attend and present at conferences, to meet colleagues, and to experience new parts of this earth; I enjoy the freedom of working hours that academia (generally) gives one, even if that same freedom means working a lot of those hours, and the ability to largely work where and when I want. But these last three or four months have shown me what can happen when I take on too much – I make mistakes, and my ability to do anything else with my time beyond academia gets reduced down to a minimum, and then disappears altogether. This is not a “New Year’s” resolution, but this is certainly a mid-year resolution: I need to adjust my life back toward the kind of life I want to have, and I am confident this will have benefits both within and beyond my academic work. So with this written, and with this posted, I’m going to head to the gym in this hotel and work out for an hour, then head back to my hotel room and play something, anything, on Steam, then do some programming in the evening. The change starts now.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Krice on June 24, 2017, 09:34:59 PM
Maybe you are still trying to do too many things at the same time. I know what it is, but I'm possibly different kind of personality, because I don't need to get results fast and I know it's not going to happen fast. Roguelike projects are deceiving, because it feels like you should be able to finish one in some countable amount of time, but it's often not that easy. So many developers have found it out the hard way.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Tzan on June 25, 2017, 12:32:45 AM
So… this is what burnout feels like.

You seemed super human in your output before. Any long term project gets you to this point eventually.
Good luck with readjusting your work/work/life balance. The second work is the game.  :)
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on June 25, 2017, 04:17:07 PM
Maybe you are still trying to do too many things at the same time. I know what it is, but I'm possibly different kind of personality, because I don't need to get results fast and I know it's not going to happen fast. Roguelike projects are deceiving, because it feels like you should be able to finish one in some countable amount of time, but it's often not that easy. So many developers have found it out the hard way.

Thanks for the message Krice. I do understand what you're saying about still trying too much, but I think this reduction, and this change, will be what I need. I do understand what you mean about not "needing to get results fast" - but both in my academic life (because I need to secure future positions) and in URR (becaues 0.8 is *so* overdue) I do feel some pressure for results, and I think that's inevitable; but I'm working to push that out of my head and take things a little more slowly, and to allow myself the time to get ideas and work develop a bit more fully.

So… this is what burnout feels like.

You seemed super human in your output before. Any long term project gets you to this point eventually.
Good luck with readjusting your work/work/life balance. The second work is the game.  :)

Haha, thanks my friend. Yeah, any long-term project does that. I definitely had a "small" version of this feeling towards the end of my PhD, but that was a) lesser in intensity and b) shorter, lasting only around a week; this is still a very new experience. And I really appreciate the good luck wishes - I'm confident I can make it happen :).
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Krice on June 27, 2017, 09:39:31 AM
but I think this reduction, and this change, will be what I need.

We'll see it. I'm obviously more talented than anyone on this planet, but I made a mistake for not concentrating on -one- area of interest. It's enough for any individual, because we are just human, a species that has only recently left the jungle. Now it's too late for me, so I don't have to worry about it anymore. I missed my opportunity to become 100% good at something, at least in age that would have done something good for me.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 03, 2017, 06:51:15 PM
Firstly, I’d like to express my sincere and heartfelt appreciation for the outpouring of kind wishes after last week’s blog post, both here, and on Reddit, and Twitter, and by email, and elsewhere. They are deeply appreciated and deeply felt, and are a real credit to what a supportive bunch of people the roguelike community (and those who read my blog for the non-roguelike posts!) are. I don’t think there are a lot of games communities that would have responded so positively, and it really means a lot to me. I won’t disappoint you all; we’re back to coding, and 0.8 is back in development. I’m also going to get back to weekly updates, which will mostly be development logs/patch notes in style – however short they might be – with some longer pieces interspersed.

So, as mentioned in last week’s entry, my objective is now to devote one full day – either Saturday or Sunday – each week to programming until 0.8 is released, and beyond. As such, this weekend has been the first weekend of that new pattern (I’ve actually been coding both Saturday and Sunday), and for the first time in months I opened up URR’s files (or rather, file…) and took a look at where everything was; I also took some time wandering around the game world to see how everything was functioning and what still needs to be done. My first feeling, I must be honest, was a deep satisfaction at coming back to the project and wandering around the game world. Having slightly forgotten where I was up to before the monograph crunch/burnout began, I was pleasantly surprised to see just how many topics one could talk to NPCs about, and how intelligently (I think) they responded; how alive with activity the cities and towns were; and just how different the world felt to anything else that I’ve played, something in its texture, or the potential to fall down a rabbit hole of conversation, or ‘l’ooking in detail about the world. It was a tremendously motivating return, and one long overdue. So, without further ado, here’s the changelog for this weekend:

- The second I loaded up and tried to ‘s’peak to someone, we saw the first problem: the speaking crosshair seemed able to traverse the entire length of the screen, which was deeply puzzling. I discovered this only happened when the player was near the edge of one of the 200×200 grids the player actually walks around in, and this was because of a piece of code designed to prevent the crosshair from slipping off the screen; in this case it was registering that the player was near the edge, but thinking the player was using an infinite-length crosshair (e.g. the ‘l’ook crosshair) instead of one which is supposed to be contained to a 3×3 area. A quick fix took care of this, and told the game to handle edges differently depending on the crosshair the player is using.

- Then discovered that if the relationship between your nation and another nation was classed as “Unknown”, then one particular piece of code relating to greetings wouldn’t work, because it was looking for a friendship_value which didn’t exist. Instead, encountering an “Unknown” civilization now sets the friendship_value to a number determined by the ideologies of the nation in question, so a more outward-facing nation will be more friendly to total unknowns than an inward-looking nation.

- Have added the start of NPCs commenting when you ask the same question twice, and also forgetting after a lengthy period when you last asked something. In the first case, NPCs will give a new response if you ask or say the same thing a second time, and a third time, and then a final response at the end when you’ve asked over twice. The final response will be more or less exasperated depending on the mood of the NPC. Also, asking the same question over and over again will cause the mood variable of the NPC to drop. In some sensitive topics – e.g. talking to an inquisitor about a heresy – will cause mood to drop extremely quickly, and they might even get suspicious about why you keep asking…

- In the second case, all NPCs now have a hidden “forgetfulness” trait, which is influenced by a small number of other factors and determines how quickly/slowly they forget when you last asked them a specific conversation. In all cases, though, it’ll take at least days, and potentially weeks. As noted in a previous entry, there also needs to be some kind of “geographical memory” function to prevent you just asking Person 1 Question 1, then asking Person 2 Question 1, and going on and on in that manner. Instead, people will know when you’ve asked many others the same questions – they “heard on the grapevine” or whatever – and will refuse to answer. This is an important element to prevent tedious grindy gameplay, and I’ll implement this a bit later.

- Fixed some issues with asking people about their parents, grandparents, children, siblings, etc, which sometimes led to crashes when the game couldn’t construct a sentence properly. Will need to also come back to this later when special NPCs have relationships to other special NPCs.

- I’ve also done a lot of fixing of grammatical and spelling errors, which are (as expected) significant in number given the complexity of the conversation system. I had it print out every possible sentence stored for every civilization in a particular world generation – well over one thousand – then went through them all, found every typo, found where in the sentence generation that typo had arisen, fixed it, and moved onto the next. I must have fixed at least a hundred possible errors. I think I’ll do this again, to get another set of sentences, and go through those, and I’ll do this once or twice more before 0.8’s release. Should get the number of errors down to a tiny number by the end.

- I also discovered that fifteen of the “negative replies” – e.g. when you ask “Do you have X” and they say “I do not have X”, or whatever – were returning “This is a placeholder” instead of an appropriate hand-crafted response. This took a little bit of hunting down, but in the end I discovered this all just came down to fifteen typos in the thousands of words/phrases the game now stores! Things like “unimportant” being accidentally written down in another location as “unimpotant”, and things like that.

- Also made a list of questions which need special replies if you appear to be of the same nation/religion as the person you’re talking to (“Why are you asking me that?”, “Shouldn’t you know that”?, “The same as you, surely?”) or a particularly hated nation (“Why do you want to know that?!”, “There’s no way I can tell you that!”, etc). This will connect to the function that allows NPCs to estimate what nation/religion you’re from, which I’ll be working on soon.

- Added a ton (100 or so?) of new words that can be varied across nations, allowing nations to say even more things in a greater variety of ways than they could before. I also found a few cases where a culture would choose a way of saying X1 (e.g. “interested”) but wouldn’t always transfer that to ways of saying X2 and X3 (“interest” and “interesting”), so you would wind up with a culture whose people said “interested”, “intrigue” and “fascinating”, instead of “interested”, “interest” and “interesting”, the latter of which is far more logical and consistent for a single given dialect. I think I’ve now fixed all the cases where this could happen, and the differences in dialects should now consequently be just that little bit sharper.

- Started to think about how to implement what I’ve taken to calling the “metaquestions” that player can ask, e.g. “What do you think about [artwork]” where [artwork] can be replaced by the title of any artwork. I’ve put in general responses for NPCs on these questions now, i.e. I don’t know what this is, I have no opinion, I’ve already told you about this, etc, with more detail to come soon.

So: for a first week back, I’m incredibly happy with this progress! In the coming weekdays I’ll be focusing on my current academic work and continuing to put the final touches and edits to the book, then next weekend, I’ll be back to coding for at least one of the two days. I really feel incredibly invigorated by this weekend, I have to say – I’m really excited to continue pushing the conversation system to point where I can release the first version of it in 0.8. Lastly, and very briefly, here’s a little debug of some sentence generation and whatnot; you’ll see the sentences (on the right hand side) are almost entirely grammatically correct (they are the generated versions of the default sentences on the left); I really like letting these run and just seeing what the game can produce, and the different ways the game can utter the same sentence. And now, to conclude this entry on a sentence I’ve been wanting to say again for months: see you all next week for another URR 0.8 update!

Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Avagart on July 03, 2017, 11:11:18 PM
It's nice to see you back into URR development :) Good luck!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 04, 2017, 03:16:52 AM
It's nice to see you back into URR development :) Good luck!

Thanks my friend - it feels damned good to be back!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 10, 2017, 07:46:09 PM
Lots more progress this week! Still feels so great to be back into coding, and make solid and rapid progress on the conversation systems too; it’s striking how much can be done in a day when one really focuses. In keeping with our new method of rapid blog-entry-writing which is something akin to a changelog, here we go:

- Finished off all the possible “annoyed responses”, which fall into four categories, which I’m calling “general responses”, “class responses”, “default responses” and “special responses”. When you ask someone the same thing twice or thrice, they give increasingly annoyed or puzzled responses; then, when you ask again, one of these comes into play. 50% of the time when you ask someone the same question over and over, they’ll give a response similar to the responses they gave when you’d asked the same question twice or thrice, i.e. “why are you still asking me this?”, which will sound more or less annoyed depending on their mood (“general”).

- However, sometimes instead of a general response they will give a “class” response, which is a response tailored to their class. For instance, a ruler will specifically scold you for wasting their time; a torturer or a gladiator might make veiled threats about wasting their time; monks will express anxiety about the fact they aren’t getting on with their studies; and so forth. These give a nice little bit of flavour; roughly half of all the NPC classes have “class responses” of this sort when you get on their nerves, but they don’t always come into play. These will also later on appear when you ask irrelevant questions, as well repeated questions.

- Then, the other 50% of the time (when general/class responses are not triggered) the game will look to see if there is a special response for being annoyed about that particular topic, which might be annoyed after giving a positive response (the NPC answered you, yet you keep asking) or a negative response (the NPC didn’t answer you, yet you keep asking). Some questions have special responses for positive/negative original answers, others just for one. If one exists, it then picks one; for instance, if you asked an inquisitor about heresy, and they didn’t answer, and you repeatedly ask, they might say “At this point, I begin to find your fascination with heresy concerning…”, or if you asked them about nearby volcanoes, and they answered, and you keep asking, they might give a snide response like “I’ve said all I can – these things are hard to miss”. If a special response exists, it is chosen 75% of the time.

- Then, if there is no special response coded for the question and the specific positive/negative modifier in question, the game then goes for a “default response”. If they responded positively, they might say something like “I’ve told you everything I know about [topic]”, or if negatively, something like “I will not speak about [topic], can we move on?”. The [topic] in this case will be drawn from a large library of phrases, like “buildings”, “my health”, “my homeland”, “weapons”, “fighting”, “these tombs”, “noble houses”, or whatever makes sense for the topic.

- These also vary according to mood, so an NPC who still likes you after your constant questioning might say “What interests you so much about X” or “I’ve already told you about X”, whereas an NPC annoyed with you will give sharper “Why do you persist in asking about X” or “I have got nothing more to say to you about X”.

- What all of this means is that the responses of NPCs when you get on their nerves is tremendously varied according to their mood, their background, their NPC class, their origins, what you’re asking about, how many times you’ve asked them, a wide range of other factors. It would take a tremendously long time for anyone to come close to seeing all the possible annoyed responses in the general/ class/ default/ special response categories.

- Some questions being asked repeatedly cause a bigger mood drop than others. For example, if you ask about sensitive topics, they get miffed much faster; if you ask about particularly mild topics, there is now a small chance they will not lose 1 mood; in general, though, asking a question twice will, 90% of the time, cause mood to drop by 1 (for those who don’t recall, “mood” is on a nine-point scale, and if it drops to 2, there is a 33% chance they end the conversation; at 1 there is a 66% chance they end it; if it’s at 1 and should drop again, they will always end the conversation).

- Also, asking people from more hostile or more closed nations the same question over and over comes with a die-roll for an extra mood drop alongside the default “1”.

- What all of these points mean is that (in the extreme cases) asking someone from a friendly nation about a neutral topic will take a while to annoy them if you repeat the same query; asking someone from a much more hostile nation about their work as an inquisitor is going to tire them out extremely quickly; and all other interactions fall somewhere in the middle of that spectrum.

- Lastly, some NPC classes will always have their mood drop faster if you annoy them: this means rulers of various sorts, top-tier military officers, inquisitors, archivists… basically any high-rank NPC will get annoyed with you far more rapidly.

- I’ve also coded in what NPCs say when they want to leave a conversation with you; for now, this only happens if you ignore them. There are a wide range of default goodbyes that any class can potentially use, and some classes can only use because they don’t have special goodbyes. Other classes do have special goodbyes, where they will explain that they need to go and do X, or talk to Y, or handle Z, or otherwise that your inane blather is generally less important to them than whatever else they might be doing. They then conclude with a “goodbye”, “farewell”, or similar.

- Note that these are very different from the goodbyes you get from NPCs if you say goodbye first and they echo the goodbye; they will give you at least a reasonably nice response back, even if their mood value is getting quite low. These goodbyes only happen if the NPC decides on their own account to end the conversation because whatever the player is saying is too annoying/irrelevant/distracting to continue the conversation.

- On some goodbyes where appropriate, NPCs might mention the time, e.g. “Good day to you” or “I bid you good night”, etc, and the word used will be appropriate to the time of day, i.e. morning/day/evening/night.

- Also, of course, made sure illogical goodbyes cannot be said – for example, a prisoner will not say “I must attend to other matters now!” and then just go back to walking around their cell; whereas free NPCs might say that, a prisoner might instead say “This conversation has become too trying”, or “Your tedious questions have become too much”, or whatever.

- Added another 100 words/phrases that can be unpacked and spoken differently in each nation, and made sure they can conjugate all the other versions of the phrase sensibly; so “say” can be “say”, “utter” or “speak”, then “said” could be “said”, “uttered”, “spoke”, and “saying” can be “saying”, “uttering” or “speaking”, and so on and so forth. Also added new conjugations of existing phrases or words which hadn’t previously been put into the database.

Next week? I’ll be playtesting all of this stuff, and once that’s all working fine, working on some other aspect of conversations. As mentioned before, I am actually not trying to do everything needed for conversations per se for 0.8 – the “metaquestions” (“What do you think of [artwork]”, etc) are being omitted until 0.9 at least, for example – but just enough to get the release off the ground and let people explore the central elements of the conversation system. As well as playtesting these elements, I want to start going through all the questions you can ask people, and check those work – I’m sure there are some bugs or typos in there I haven’t spotted yet. I’m confident by the end of next week I can have all that done, after which I’ll start working on having things like “[god]” or “[nation]” or “[house]” or “[officertitle]” or whatever correctly appear in speech. Those are a complex set of variables which will have to draw on a lot of different parts of the game, and I don’t want to tackle that until everything here, and the standard Q&A, are all implemented. See you all next week!

Some of the new word variables/extensions, where the comments remind me which other conjugations also need to be covered:


The general words people will use when they ask things like “why are you still asking me about X”:


As you can tell, a large part of this week has been writing massive lists! At least next week it’ll be back to playing the game itself and seeing how things play, so hopefully some in-game screenshots will come your way next time…
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Avagart on July 10, 2017, 10:11:17 PM
writing massive lists

...and dictionaries? Didn't you fall into *massive* performance problems? Python is just fine for roguelike development, but lists and, especially, dictionaries are really slow and eats memory like a monster.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 11, 2017, 12:36:39 AM
Hmm, nope, never had any problem with them! I know people say Python has issues for this kind of thing, but personally, I've never had any issues whatsoever :)
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Krice on July 11, 2017, 09:15:14 AM
Do you still have only 1 source file? I had problems with my Level class file which had I think nearly 6000 lines. Splitting it has been a good decision, now each class is about 1K lines which is much more manageable. And not only that, they are arranged to logical parts from simple to complex. Managing 6000 lines of code in one file is hard if you have different tasks in that class. But then again your decision to keep everything in one file must come from some kind of stubborn decision some smart people often seem to do.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Musaab on July 12, 2017, 07:01:39 AM
Is there combat in URR?
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Avagart on July 12, 2017, 08:07:16 AM
A bit offtopic, but @Krice I always wonder why most people say that managing 1 big single file is hard (and bad practice), but managing hundreds-to-thousands small files is the only good approach, because it's simple and easy to manage...
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Krice on July 12, 2017, 08:41:39 AM
wonder why most people say that managing 1 big single file is hard (and bad practice), but managing hundreds-to-thousands small files is the only good approach, because it's simple and easy to manage...

Try it sometimes yourself. Of course if you have modular source code then it's even better to put them to their own files, because you can work from low level routines to high level (in best case scenario anyways). In a single file it's simply harder to find stuff, no matter how you look at it. And finding stuff in large projects is actually quite important. Not to mention keeping track of everything, I don't even know how people remember what they already have programmed if there is only one file.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Avagart on July 12, 2017, 09:00:34 AM
In my personal projects, I'm working with one main (bigger) file and bunch of auxiliary files usually. But
Try it sometimes yourself.
I worked in such a projects, and it's why I asked about that. For me, it's much harder to find specific stuff withing ~1200 files (every class had own file), especially when simple feature needs tinkering with about a dozen files. Don't know, maybe it's matter of taste, but I had problems to work with that kind of codebase.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Krice on July 12, 2017, 07:05:58 PM
For me, it's much harder to find specific stuff withing ~1200 files (every class had own file)

It depends on stuff. Classes don't need to have their own file, but it's a good rule. Sometimes you can group classes that are in the same category etc. I'm using IDE to arrange files/classes to virtual groups with proper titles so it's easy to find stuff no matter how many files there are. However Kaduria (my biggest project) has "only" 364 files which in C++ is divided by 2, because each class has a header and source file. So it's not that many files and I'm estimating there could be something like 400 files in the final version.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: AgingMinotaur on July 12, 2017, 07:17:58 PM
For me, it's much harder to find specific stuff withing ~1200 files (every class had own file)
Perhaps there is a golden middle. In LoSt, I have 20-odd script files (ai, name generation, event handling, graphics, etc.) For me, at least, that makes things more orderly.

As always,
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 16, 2017, 06:03:04 PM
Do you still have only 1 source file? I had problems with my Level class file which had I think nearly 6000 lines. Splitting it has been a good decision, now each class is about 1K lines which is much more manageable. And not only that, they are arranged to logical parts from simple to complex. Managing 6000 lines of code in one file is hard if you have different tasks in that class. But then again your decision to keep everything in one file must come from some kind of stubborn decision some smart people often seem to do.

Haha, I do, yeah. Wasn't intentional; it just kind of... happened. And now I'm disinclined to change things; it hasn't caused major issues. If it does start to cause problems, then of course I will, but until that time I'm not planning on making any changes.

Is there combat in URR?

Not yet; and once there is, it won't be the "primary" play method. You know how lots of games have combat as the "intended" play style, but you can also play with stealth, or with conversations, or with other stuff? Flip that on its head, where talking and exploring are the intended play method and combat is the harder more obscure alternative, and you'll have a good idea of what I'm going after!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 16, 2017, 06:11:20 PM
I am pleased to report another productive week of coding for the books. Instead of playtesting everything I did last week, I decided to add another large body of new code, then playtest everything from the last three weeks next week instead. So, here’s the new code implemented this week:

- Most importantly we have three new elements that influence how NPCs respond to conversations: sensitive topics are “tagged” as such, NPCs are more or less inclined to respond to those sensitive topics, and they have three kinds of basic responses when explaining why they don’t want to respond to something you’ve said for personal reasons (as opposed to not knowing the information, which is factored in elsewhere, and isn’t a case of “not wanting to reply”, but rather “being unable to reply”).

- Every possible question now has what I’m loosely calling a “conversation tag”, which denotes whether it might be a sensitive topic on any of seven possible axes – “individual”, “political”, “national”, “religious”, “military”, “cultural”, “geographical”. Some of the questions will be potentially sensitive on more than one count. For example, if you ask about the politics of an NPC’s nation, that will naturally be flagged under both the “political” and “national”. Most questions have no tags, then it looks like around a third have one tag, and then a very small number have two tags or more; the most tags are questions asking people about the ideologies of their nation, which might be “political”, and “national”, and then “religious” or “cultural” or whichever other applies. What this means is that when you ask someone a question, it will check whether this is a sensitive topic, and the answer to that question will influence whether or not they are willing to give you an answer at all.

- Then the next part is inclinations – how inclined are people to tell you about potentially sensitive topics? Each NPC has a rating for religious topics, for political topics, and so forth, which varies hugely across NPC classes. This is on an internal scale of 0-4; at 0, they will rarely talk to you about a sensitive topic (of the sorts listed above), at 4 they will always talk to you (extremely rare: only national and religious leaders, and then one NPC class per category, will always tell you about X). All other classes are spread out along 1-3 (default “humans” are almost always on 0, or if not, they are on 1 instead). If you ask a non-sensitive question, whether or not they answer will be dependent on other factors (how much they like you, etc) – if you ask a sensitive question, it will check which conversation tags are listed for that question, and compare their rating.

- This might seem incredibly complex, so here’s an easy example. You ask someone about their religion. The game checks how inclined that NPC class is to talk about religious matters; a priest is very inclined, your average innkeep doesn’t have much time for religious matters, and so forth. An appropriate die is then rolled for the question; if successful (and other tests are passed, e.g. the NPC likes you enough), you get your answer. So what happens if they say they don’t want to talk about X?

- Well, I’ve split the “I don’t want to talk about X” into three categories, I’m calling “stupid”, “uninteresting” and “suspicious”, which are the reasons NPCs will give you for not wanting to give you a reply. The “stupid” option means that the NPC is baffled why you are asking them about that particular topic: for example, asking a monk about military matters, or a farmer about sculpture, or an officer about plant life, is likely to elicit this response. The “uninteresting” options is the default, and simply means the NPC doesn’t want to talk about it right now, for which they might give a bunch of reasons. The “suspicious” option means that the NPC refuses to talk on the topic, and is puzzled, concerned, worried, anxious, or most obviously suspicious about why you ask – this happens most often when happening about military matters, but can crop up for any conversation topic except the “cultural” ones.

- In some cases NPCs will give you a specific reason for not wanting to continue the conversation. If you asked about a religious topic, and they don’t want to reply, and they are from a particularly zealous nation, they might say something like “That knowledge is only for loyal followers of [god]”; or if you asked about a political topic, and they are from an isolationist nation, they might explain a dislike of talking to strangers about the politics of their homeland.

- So, a “I don’t want to reply” looks like the following. If “Uninteresting”, they say “[Sorry, I don’t want to talk about that]. [Cultural reason why not]”. If “Stupid”, they say “[Am I really the person you want to ask/I dislike that topic/why are you even asking this?]” (without cultural reason). If “Suspicious”, they say “[Cultural reason why I can’t answer. And why are you even asking?]”.

- I noticed very few questions have the “Cultural” tag – I’ll have to add some more in later versions.

So: these were the things that last week I wanted to get done this week, and they’ve been done. Very please with the week’s coding! You’ll also probably note there are a lot of elements going into how and whether NPCs reply to you. What is their mood? What culture are they from? What culture do they think you are from? What topic are you asking them about? How has the conversation previously played out? What NPC class are they? And if you’re thinking this is a lot… it is! But I think this is what goes into making a reasonably realistic, and hopefully gameplay-interesting, conversation system. When you “fail” to get a reply, for any of the above reasons, the “failure” messages are all being designed so that you know why you didn’t get a response. If the NPC didn’t reply because they don’t like you, because you’re asking about a sensitive topic, or because they dislike the nation you seem to be from, it should always be clear, and allow the player to learn what it takes to find people who are willing to talk to them, and to talk to them in an appropriate way to actually get an answer.

Next week: playtesting and screenshots!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Aleksanderus on July 17, 2017, 12:29:09 PM
Oh, now I have a big question. Will it be possible to have a job and be able to work to get money and possibly advance in the ranks (like being a soldier and slowly becoming more important in the army)?
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 17, 2017, 01:18:25 PM
Oh, now I have a big question. Will it be possible to have a job and be able to work to get money and possibly advance in the ranks (like being a soldier and slowly becoming more important in the army)?

I don't think so. I certainly have no plans in that direction; I see the player's character more as a roaming, ever-adapting traveller, rather than someone who will stay in one place long enough for something like that!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 30, 2017, 05:57:29 PM
Here's last week's blog entry:

This week I’ve basically been playtesting everything that I coded in the previous three weeks since development actively restarted: this meant playtesting the mood system, playtesting NPCs becoming annoyed with you, making sure NPCs can say a tremendous range of things when you ask repeated questions (as ever, variation and believability are central here, and the two go hand in hand), and then seeing what happens when you ask NPCs all the questions you can ask, and making sure they can give some kind of logical response to them. NPCs should also be able to end conversations, make appropriate comments when they don’t want to respond something, choose what to not respond to, and so forth. I’d say pretty much everything in this selection seems to be working now! Here are some nice screenshots, all taken with one person from one civilisation for each demonstration. You’ll note the [thing] sections remain ambiguous, which is one of the tasks for the coming weeks, but hopefully here you can begin to see how NPCs give you reasons for not responding in various ways, or commenting when you say the same thing too regularly:







Some more work still needs to be done on the “naturalness” of what people say, and ensuring variation of all sentences, and so forth, but you can immediately get some idea from these about how things are shaping up with some of their more detailed responses, and the variety in responses, and there’s also of course a vast amount shown here with unique responses for certain classes, certain questions, certain questions asked to certain classes, asking certain classes from certain nations about certain topics, and so forth. As above, my goal is always to ensure the player might be able to see a new kind of statement in a new context, something that makes the conversation system feel truly deep and open-ended and potentially-infinite, whilst also being able to understand the many factors and many elements encouraging the NPCs one meets to respond in the ways they do. (One might also note a strange name for one NPC – need to fix that! I also got one NPC called “Son of Sluts”, which was pretty great – I’ll be sure to add that to the list of excluded terms). These screenshots have also shown me I need to find a way to add more facial variation to people from the same racial background; although in a global sense the variation is still huge, people will be spending significant blocks of time in one area, and that needs to vary more. I won’t be doing that in 0.8, but probably in 0.9. Next week: more conversation programming! Will be focusing on expanding “uninterested”, “stupid” and “suspicious” responses, people giving political or religious reasons or whatever for not answering things, and how to handle repeated insults and repeated compliments. See you then!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on July 31, 2017, 06:55:31 PM
Lots more coding this week! Let’s get to it:

I’ve implemented what happens when the player repeats compliments and insults over and over again (I have previously implemented the repeating of “general statements and questions”, i.e. almost everything, and repeating greetings, which are handled differently). When one says a compliment over and over, the NPC will appreciate it, and express their appreciation, but if you do it too much, they will begin to be a little bit puzzled; there are also some unique responses for repeated greetings being offered to particular classes of NPC. In the future I want to enable some greetings to be met with less positive responses if one greets repeatedly someone who might come from a culture which doesn’t especially like or appreciate the greeting in question.

If you repeat the same insult again, the NPC will quickly become even more annoyed than if you had simply said the insult once (which is itself a guaranteed mood drop) and will tell you to stop saying it, threaten you, become exasperated and ask why the hell you keep saying that, and so forth. Given that insults are unequivocally, well, insulting, this was a pretty easy group of phrases to code. I have also made it so that three or more insults in a row always has a 50/50 chance of ending a conversation: so be capable who you have a go at!

There was a bug with repeated comments; sometimes the game would seem to forget that you’d just asked something ten times, and if they answered, then said “why are you still asking this?” nine more times, on the eleventh time they would suddenly reply again. That was from the simplest of typos where the game was decided what kind of “why are you still asking this?” response it would give, where very rarely the game would select one which didn’t actually exist, and therefore default back to the previous sentence. This is now fixed.

The game previously only checked if someone’s mood had dropped to 1 or 0 to decide whether or not to end a conversation; this meant that if an NPC’s mood dropped from 2 or more to -1 or less, the game wouldn’t catch it, and they would go on talking and hating you, but not ending the conversation. This has also been fixed, and NPCs will end the conversation with you regardless of how low it drops. (It should be noted, the conversation does not literally “end” at this point; I need to add a dialogue box saying “This NPC has walked away” or whatever, and “Press Enter” to then end the conversation. I’ll be doing this before 0.8 is released, and shouldn’t really be too difficult; I’ll also need to add something when you talk to an NPC who has rejected you again, such as “I’ve told you, I have other things to do”, and the like).

I’ve given each civilization a list of reasons they might not want to respond to questions about particular topics. So people from an Isolationist nation might be disinclined to answer national or political questions because they are very wary of outsiders; someone from a theocratic nation might be disinclined to answer a religious question because that’s a matter for the state; and so forth.

Fixed a range of grammatical errors with the construction of sentences ,and discovered that in some cases, sentences were going through the system that varies each sentence for each culture twice, which was a big problem. That has now been fixed, shifting the “sentence varying” part of the process to something which only takes place once, and before. Before release I will need to spend quite a bit of time talking to every NPC I can find and dealing with every grammatical error I can possibly hunt down, but it’s a work in progress; the speech generation system is so complex, and so much varies, that it’s hard to pin down too much in any one sweep.

If people don’t want to respond to the questions you’re asking for personal reasons, there is now a set of responses in place for them explaining that they don’t want to respond for political reasons, or for religious reasons, or whatever. There are also some unique responses if you’re asking particular classes, so an inquisitor might mention it’s particularly suspicious if you keep asking about heresy. What this means if that there are many, many layers of questions and answers that the player will rarely, but sometimes see, and should provide a lot of variety. In this case, you need to ask someone something, it needs to be a topic they would be willing to reply to, and know something about, but they don’t want to talk about, and they decide not to talk to you about it, and they’re of a particular class and asking a particular question, you’ll get a unique response. I want these chains to be as long as possible, to maximise the chance of the player encountering a new response, no matter how long they’ve played the game.

I’ve put a lot of work into these responses, which take three forms: “uninterested” (the person doesn’t fancy talking about the topic), “stupid” (they think it’s a dumb question to be asked), and “suspicious” (they are troubled by you asking something).

In the case of the “Uninterested” response, they will begin with a sentence along the lines of “I don’t want to answer that” or “I don’t feel like talking about that”. After that, they will follow up with a comment that might be a general comment, or a class-specific comment. If it’s a general comment, they might say “It doesn’t really interest me”, or “I don’t think about such things”, or “Aren’t there other more interesting matters to discuss?”, and so forth. Class-specific, meanwhile, might be something like a miner saying “I should really get back to the seam…” or a priest saying “I would really prefer to speak to you about [god]”, or things of that sort. These have a nice variety, and I was able to think of at least three options for every class, as well as many general variations, all of which will of course vary across culture as with all sentences, so there’s a huge amount of variety here in the kids of responses one will get out of NPCs.

With the “Stupid” response, NPCs will instead open with something like “What a weird question” or “What a strange thing to ask me”, and then proceed to again, either give class-specific or general responses. General responses might be something like “Am I really the person to ask about this?”, or “That makes very little sense”, or “Why are you even asking?”. For the class-specific responses, they will reply in a way that emphasises why this was an especially daft question to ask that NPC class. If you ask a jailer about geography, they might say “My work is in here, and always will be”; if you ask a Concubine about war, they might say “What could I possibly know of battle from in here?”; if you ask a doctor about politics, they might say “Diseases and ailments care not for one’s political allegiance”; and so on. These should help the player to think about what kinds of things they should be asking different kinds of NPCs, what classes and questions make sense together – as well as what classes and questions definitely do not make sense together – and, as ever, dramatically increase even further the variety of things people might say to you in the URR world.

For “Suspicious” answers, they start off the same as the “Uninterested” answers, by saying “I don’t really want to speak on that” or whatever, but then things change. For each tag (“political”, “religious”, “geographical”, etc) some NPC classes have special responses, and all have a set of general responses. For example, asking about politics to a concubine might have them ask if you if you’re only asking because of their closeness to a ruler; for other classes, they might say “Politics is a strange topic for you to be asking me about…”, or equivalent. If one asks an individual question, a clerk might emphasise their personal life has no bearing on their work, or an inquisitor emphasises that their purpose is simply to pursue heresy, not to think about themselves. If one is asking about military matters, an officer might question why you want to know about potentially classified material, whilst someone from a militia questions why you’re interested in the defence of their homeland. There are then also some responses based on national ideologies, too, which will sometimes be thrown into the mix. Again: maximising number, maximising variety and difference, maximising the potential for the player to always be discovering new possible responses.

For this week’s sole coding screenshot, here’s a bunch of the “defaults” for the uninterested answers (which are picked at random, then varied for each culture according to procedurally-generated constraints and norms, as usual):


Next up: in the coming week, my objective is to finish fixing any remaining bugs to be found in the above set of points, and then start – I anticipate this taking several weeks – putting into place a structure for filling in the “[god]” and “[nation]” and whatnot parts of sentences, i.e. the parts that vary every time they get uttered and cannot be stored, but have to call reference to a wide range of different saved elements of the game world. I have no idea how fast/slow this will go, but all I can do is get started, so I’ll be doing that next Saturday/Sunday. See you all next week for the first steps into this crucial part of the conversation system!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on August 08, 2017, 08:10:22 PM
Only a short update this week, I’m afraid; this week I’ve been busy putting some of the final touches to my book and haven’t had as much time to program as I wanted; only half a day rather than a full day. As such, this week’s update is very short, but next week’s should be longer. However, in light of my new decision to have a gradual update log, I’m still going to do this post and then next week’s, instead of compressing both updates into one longer update. As such, this week:

- Most centrally, I’ve finished the task of moving the code that exchanges default words for the preferred word of a given civilization. In some cases this was being called twice, and in other cases not at all, and even though in some cases it was correctly being called once, the range of situations this was being used in were making it all rather unclear. I’ve finished making this shift, which required moving around quite a bit of the sentence generation code and adding some new code to re-handle things like punctuation and capitalisation, but I think that’s now done and working correctly.
- I’ve been going through and removing a lot of phrases, and a lot of word orders, which sound strange. As several people have pointed out, sentences could sometimes come out rather strangely; I’ve tried to fix as many of these as I can. At the same time, though, some of the interesting but logical sentences are generated from the same sources as the interesting but illogical sentences; it’s tricky to strike the right balance here. As ever, I think this will just need lots of playtesting.
- Just stated sketching out (on paper) a list of the bugs and small issues that need to be resolved before 0.8 is released; I had a bunch of smaller lists of this sort, but I hadn’t really collated them into one place before. For some of the bugs I’ve decided they don’t need fixing until 0.9, and some of them I decided it was easier to simply remove the thing that caused the bug (temporarily) than to fix the bug now; as I’ve said several times, I’m really trying to do the absolute minimum now required to get 0.8 released, and putting some of this stuff off until 0.9 is definitely the way to go.

I’m afraid that’s all for now, folks. Should get a full day to code next week, so should be back with a larger update next time around. See you all next weekend!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on August 18, 2017, 08:23:08 PM
This week has been a week of consolidating everything that was in place so far, continuing to test and refine and test and refine over and over the speech generation and the flow of sentences, moving around some of the code so that it can be handled more efficiently, and thinking about handling sentence variables in the future, which is to say, the parts of sentences which are things like “[god]” or “[nation]”, and therefore have to vary every time the same sentence is uttered. As such, here’s this week’s fairly substantial update:

- Thanks to some great suggestions left in the comments list in the blog post from two weeks ado, I’ve added in a number of new responses. If you’re asking someone about a potentially suspicious topic, and you’re in a region with guards, they might (if they really like you) say something like “You shouldn’t ask such things, the guards will think you’re a spy!” or something of that sort.
- Equally, if you’re asking a particularly “academic” rather than “practical” topic – the difference between “what is the nearest mountain range?” and “what is your religion?” – they will sometimes, very rarely, say “I don’t know, but you should go and ask [expert]”. I think these are both great changes, and again, add even more speech detail to the potential library of sentences the player will actually encounter. However, again, to prevent farming, there’s now basically a hidden counter, which varies significantly from iteration to iteration, and affects how often people will recommend that you go and talk to somebody else about the topic in question; equally, you need to be talking to people who both a) have the knowledge and b) have the inclination to recommend an expert, which will be a fairly small number of NPCs.
- I then spent quite a bit more time developing the above in order to maximise the detail that people can offer the player, the variation in the sentences the player will read, and integrating all of this will knowledge and mood modifiers. So, now, if you hang around in a shop, and then a random person comes in, and you ask that person about the currency of their nation, for example, if they don’t want to respond they will point you towards the merchant in that shop, knowing that a) they and you are in a shop and b) you are asking a question that it would be relevant to talk to a merchant about and c) there is also a merchant in this shop.
- These responses also vary depending on whether you’re in the nation or church relevant to the person you’re speaking to. So let’s say you ask someone something, and the relevant answer would be “You should ask a noble”. If you’re in the mansion of a noble from their civilization, they’ll say “You should ask a noble, such as the one in this mansion” or whatever; but if you’re elsewhere, they’ll say “You should ask one of our nobles, who dwell in accommodations like these”; if you’re right nation but outside and in the right district, they’ll say “You should ask a noble; several have their mansions here”, or in wrong distract, they’ll say “You should ask a noble; many dwell in our richest district”. Equivalents in a foreign nation would be “You should ask one of our nobles, who dwell in a district much like this”, or “You should ask one of our nobles, who inhabit the richest part of my home city”. The game can therefore now generate appropriate sentences both based on the player’s location – right building, right district, or just overall right region, or overall incorrect region – and the relationship between the person you’re talking to and the area you’re talking to them in (especially relevant when you run into people who aren’t native to the state they live in, for example).
- I have to be honest and say that I’m extremely happy with how this context-specific recommendation system has developed; I’m really hoping this will produce some strikingly specific procedurally-generated sentences for the player to encounter in appropriate situations, and as ever, just generally provide greater variety in the conversation system. There are also a bunch of sentence possibilities which might be generated that I know are currently impossible, but might become possible later once the potential actions and schedules of NPCs expands further.
- Going back to repeating questions, if you ask X, and then you ask X again, sometimes on the first repetition people will now be confused rather than annoyed or bothered; they’ll say “Didn’t we just discuss this?”, or “That’s strange, didn’t I just answer that?” or something like that; the potential mood drop will be the same, I think, but it’s just another little bit of detail for some NPCs.
- Thanks to an outstanding suggestions left on the Bay12 forums, there is now a little bit of extra conversation detail in there which I hadn’t thought of. If you ask something, and get a positive response (they answer your question), when you say the next thing you say, it’ll normally start your next question with “Thanks” or “Understood” or “I appreciate you letting me know” or things of that sort; equally, if they didn’t reply, your next thing will often start with “Apologies” or “Ah, okay” or things of that sort. This adds a nice little bit of extra flow to the conversations; naturally even more flow will be added once they can ask you questions back, but for the time being, putting these in 50% of responses definitely makes everything look a little more human once more.

Next week’s blog entry will be a little different: I’m in the final fortnight of the extension period on my first book, and this week’s absolute priority is finishing that off. Next week I’m going to have the first non-URR entry since development restarted and write up some reflections on writing such a long piece of work about games, what I’ve learned from it, my future writing plans, and so forth; there’s just no way I’ll have more than a little time in the coming week for programming, and I’d rather return with a blast the week after. See you all next week!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on September 03, 2017, 05:09:07 PM
I’ve now started work on speech variables, which is to say the parts of speech – such as “[god]” or “[rulername]” – which cannot be stored and simply reproduced, but needed to be generated each time they are called in a conversation, and will vary significantly based on context (reply, question, talking about oneself, talking about somebody else, and so forth). These are a pretty crucial part of the conversation system, since it is often through these that the player will get information about the specifics of the game world they’re exploring, and these will enable the player to ask questions about specific artworks, specific nations, and so forth, whilst ensuring that NPCs give logical replies to these kinds of enquiries. Most words are stable within one civilization: which is to say, everyone from one civilization might say “make” instead of “create”, or might be “homeland” rather than “nation”, and so forth. These give every culture a distinctive way of speaking, and in testing thus far they do come across in very unique ways. However, there are always going to be words in their sentences which have to be selected anew every time they are used, and it is these we are now tackling:


For example, “[holybookauthor]” would refer to who wrote the holy book of a particular religion (if known); “[monasteryfield]” would refer to what particular kinds of books a monastery produces (when we have books implemented!); “[mercyears]” refers to how long a mercenary has been a mercenary (that is “merc years”, not “mercy ears”!); “[armyrole]” refers to what a particular soldier the player is talking with does in the army; and so on. Whenever anyone tries to say one of these, the game needs to be able to look up what exact phrase it should use, which means a unique set of look-ups in the game’s databases for every single one of these. It might mean checking something to do with that particular NPC – such as their age or simply what religion they worship – but it might also require the dredging-up of information from a religion, a culture, a geographical location, a series of historical events, and so forth. Given the central role of the speech system to the game and to the player’s abilities to actually gain access to the information they need, it was clearly going to be vital that these systems are detailed, comprehensive, and sufficiently varied to maintain interest over what can be a long playthrough. Equally, as above, almost all of these are going to need unique bodies of code designed to pull out the correct bit of information – and it is this I’ve worked on this week.

The most challenging task this week was, frankly, reminding myself of how the code for sentence generation works, and finding the right “place” in the code to switch out “[god]” for “the Grey Goddess of the Mountains”, or whatever. Whereas for all the last few weeks I have been primarily or entirely adding more content to (or on top of) existing systems, here I was developing some new systems. I had a bunch of comments, and most things have quite logical labels, but there was still a certain bemusement looking at the sentence generation code again and working out how everything actually slots in. Once I’d figured all this out, however, it became clear how I needed to implement these elements, and what elements should be stored and retrieved from which places in the code and the game’s data structure. Last week, I shifted the code that I vaguely call the sentence-converter, which is to say the code which takes a default sentence and then makes it sound different for each nation. This week I’ve also shifted the code which handles these new variables away from where it originally was, which didn’t make a huge amount of sense, and put it alongside the other. Now, when the game cycles through each word in a sentence to choose the correct cultural version, it will also find the sentence variables in the same process, and decide what each one should become at the appropriate time. This is a good foundation for building on next week, and I’ve already begun to sketch out some of the functions that will select the appropriate words and terms for relevant parts of sentence generation.

I have also decided that the system whereby an NPC looks at you and draws judgements about you – see this entry for more – is something that will appear in 0.9, not 0.8. This is because although one can add and remove clothing at this point, one cannot actually gain access to the clothing of other NPCs yet, because a) we have no shops or currency and b) there’s no way to ask people for clothes, have people give you other clothes, even attack people for clothes, etc. So, for now, everyone will just (correctly) believe you are from your home nation. I’ve therefore implemented a placeholder function with space for a full assessment of who they think you are, which can be easily expanded in 0.9.

Lastly, as part of this, some different NPC classes will also give you different greetings; this is part of the placeholder above, and will be expanded in 0.9, but there are now some variations in greetings according to what kind of NPC you’re talking to. A priest, therefore, is likely to comment on religion when they say hello; a servant or slave will be especially shy when they greet you; and so forth. Again, this will be expanded in 0.9 to integrate with the NPC’s judgements about who you are when you talk to them.

Next Week

Next week: with the system in place, I’ll start working on handling the variables themselves, and drawing on the appropriate information, in appropriate contexts, to complete these square-bracketed parts of NPC speech. See you all then!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Krice on September 04, 2017, 11:13:34 AM
The most challenging task this week was, frankly, reminding myself of how the code for sentence generation works

I remember this used to happen when I was programming in C (procedural). C++ is too structured for that to happen really, if you are using self-explanatory names for classes etc. And keep classes/member functions small enough.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on September 27, 2017, 10:53:54 PM
Interesting! Maybe I will one day learn another programming language...

And now, finally, an update:


Just a short one this week, to say: my apologies for the silence over the last month. A combination of an unexpectedly high workload (five different paper revisions to complete in a short time-span), along with caring for an extremely ill relative, and preparing to move 4200 miles across the globe in around three weeks, has been quite challenging. I also managed to send myself on a trip to the Accident and Emergency part of my local hospital, which was all totally excellent, but has put me in bed recovering for quite a few days. And, to top it all off, a side-effect of the far more serious illness I got several years ago has just manifested; it’s not life-threatening, but it’s intensely dispiriting and depressing. I’m still alive (barely) but just absolutely swamped under everything right now; the injury and the new medical issue are both just extra things I could really, really, do without. I thought the past couple of months would be the proper restart on URR’s development, but apparently that isn’t going to happen just yet.

Nevertheless, I’ll be back to 0.8 as soon as possible. Things have to stabilise sooner or later… right?
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Avagart on September 28, 2017, 07:46:13 AM
Things have to stabilise sooner or later… right?

Yup, you're right :) Take care, good luck.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on September 28, 2017, 12:49:44 PM
Things have to stabilise sooner or later… right?

Yup, you're right :) Take care, good luck.

Thanks, my friend :).
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Krice on September 29, 2017, 06:28:54 AM
Interesting! Maybe I will one day learn another programming language...

Although of course bigger concepts can become messy, like what often happens in random dungeon generation. It sometimes becomes hard to keep track what is happening and why, but it's more like "generic" problem. Still I think making code more modular helps in that case, too.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on November 04, 2017, 06:57:16 PM
Hello everyone! It has been a little while since the first Interlude, so I thought it would be appropriate to post a sequel.

Firstly, thank you all so much for the amazingly kind words on the other blog entry (and which I’ve had through email, Facebook, etc) – they really mean so much to me, and they are deeply deeply appreciated.

Secondly, I’ve now successfully moved to Canada, found a flat (or rather, an apartment), signed the contract, and done the majority of all the admin and bureaucracy stuff that comes from moving to an entirely different country; I still need to get a mobile phone that functions in this country, and there’s one or two University-admin things I need to complete, but otherwise I’m settled, moved, I’m “in the system” in the Canadian bureaucracy, and I’m getting ready to officially begin this job just a couple of days from now. This has been a pretty huge task in the last fortnight, but it’s now coming to an end.

Thirdly, on the health front, the physical symptoms are improving, and the psychological symptoms are (more slowly) also improving. Things are still tough, but I’m making some good choices to improve the newfound psychological difficulties this complication from my older illness has dumped on me. In the short-to-mid term, I think things might be on the up (slowly), but it’s always so hard to know.

Fourthly, here’s the cover for my upcoming book with Bloomsbury. I’m so happy with the design! I should have more information soon about an exact publication date, but there’s lots of roguelike-y goodness in there to be had.


Fifthly, any of you folks who are interested in Twitch and live streaming might want to read this paper I recently published about it – you can find a paywall-free version here - https://tinyurl.com/y8adblsk. In it we explore the backgrounds of live streamers, the everyday work and labour of being a professional live streamer, and their hopes and fears about the future of their practice. This is part of a larger project on Twitch I’ve been developing alongside my colleague Jamie Woodcock in the last year, and we should have some more exciting stuff on this front to announce soon. Stay tuned.

So yes, that’s everything for now. I’ll hopefully be able to post more again once I have some kind of stability. I’ve also been thinking over some pretty fundamental questions about the website, how I blog, how often I blog, my general online visibility, these sorts of things, so there might be some big changes coming in the future (once I feel a little stronger). In the mean time, take care, everyone.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on April 08, 2018, 01:27:09 AM
After rather a long while, here's an update for you all...

Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Krice on April 11, 2018, 06:40:50 AM
Is that book interesting or is it boring? It's on adlibris (also in finnish version of the site) but it wasn't available yet.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Krice on January 15, 2019, 10:38:15 AM
The development has stopped at 0.8 I guess. You know what, this is what I suspected from the style of game and lack of gameplay. This is a typical case of engine/world generation scheme first and then not knowing how to create the actual gameplay or it more or less sucks. I myself am not better in this, in a way Kaduria was in this state for a long time and you surely can focus too much on world generation etc. and forget that it should be a game above all.
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: UltimaRatioRegum on January 26, 2019, 09:37:04 AM
Hello everyone! Long time no see.

Firstly, 0.8 is back in development, finally, and things are being finished off now! Just some tweaks to go until it's ready to release; been putting in consistent coding hours regularly for the past month or two, really "back into it", and things are coming together. I'll have more to say on this soon.

In other news, my book is out, where I talk about lots of PCG stuff! You can read about it here...

https://www.markrjohnsongames.com/2019/01/23/the-unpredictability-of-gameplay-is-out/ (https://www.markrjohnsongames.com/2019/01/23/the-unpredictability-of-gameplay-is-out/)


...including a sample chapter. It would be awesome to get any thoughts on this! A big URRpdate is coming next month, and I'll be back with that in a couple weeks :). Hope everyone is otherwise doing well!
Title: Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
Post by: Krice on January 26, 2019, 01:22:30 PM
A big URRpdate is coming next month

So the development didn't stop?

About that book.. I found it from Adlibris, but strangely the e-version is 104€ and physical book is 79€. Eh? That has to be some kind of error? Anyway both are too expensive.
Title: Re: Ultima Ratio Regum (0.8 back in development!)
Post by: UltimaRatioRegum on February 12, 2019, 09:34:49 PM
It is with immense pleasure that this month’s blog entry is going to be a long and pretty thorough update on what I’ve programmed into URR in the last little while. As many of you readers will know, the latest version – 0.8 – has been about 90% done for over a year, until I restarted development, slowly, a month or two ago. It is now sitting at somewhere around 95% or so, I would say, although I have also reduced the scope of the remaining 10%, so that I can just get it released as soon as possible – if there is a 0.9, I’ll return and fill in the blanks then with a much smaller release.

Nevertheless, here’s a rough log of the things I’ve done since resuming development, quietly, slowly, in the background:

– Names of artworks now generate, and NPCs can talk about them.
– Names of books and poetry now generate, and NPCs can talk about them.
– Names of relics now generate, and NPCS can talk about them.
– Everyone can name and talk about the rulers of their nations.
– Friendly NPCs will warn you to be wary when asking potentially sensitive questions.
– Rulers have appropriate titles and sets of roles and responsibilities.
– Asking a soldier or officer about their job no longer results in a crash.
– Removed the ability for the player character to change dialect; if implemented, this will be a 0.9 feature.
– Monks and abbots can tell you about the history of their monasteries and what they produce.
– NPCs can tell you appropriately about their past, their upbringing, etc.
– Servants and slaves correctly discuss whoever they serve.
– Officers tell you about their histories and how they were promoted.
– Shopkeepers will tell you what they have in stock (for, er, once they have items in stock!).
– Removed the possibility of NPCs recommending you talk to someone else (i.e. an expert on the topic you’ve asked about) instead of them; again, if implemented, that’ll be 0.9.
– The mood of NPCs talking to you declines more slowly than before, even if you ask them daft things.
– NPCs can talk about their current and past jobs, and their backgrounds and origins.
– Guards will tell you about what they guard, who they guard it for, who is allowed in, and so forth.
– Mercenaries will give you ample information about their skills and abilities if asked.
– Relevant NPCs have lots of information about their religions, holy books, festivals, and so forth.
– Military figures will tell you about their armed forces (if appropriate).
– Mercenaries, military figures and other relevant NPCs can tell you about weapons, armour, how their people fight, etc.
– NPCs can talk about travel, where they’ve visited, where they were born, where they grew up, etc.
– Farmers can tell you about farming (which, I’m sure we’ll all agree, is absolutely vital).
– Innkeepers and jailers tell you about their jobs and the histories of their taverns or jails.
– Various titles for rulers and religious leaders and the like are handled correctly whenever an NPC needs to talk about them.
– Prisoners will tell you all about their crimes (which they may well insist they didn’t commit, of course), when they were imprisoned, and when they will get out.
– NPCs can tell you about the plants and animals found in their areas, and what plants/animals (if any) might be sacred to their people.
– Handled a number of broad answers for big questions, which now serve as placeholders until more detail can be added.
– Checked that a number of bugs relating to speech patterns have been fixed.
– Added a lot of new information about civilizations and religions that NPCs can talk about, mainly preferences for/against certain things.




Where does this leave us? Well, the conversation system is more complete than ever, and more bugs have been fixed. As before, I’m now not giving deadlines or anything, but the 0.8 version of this mad sprawling worldbuilder is finally on its way in the not-too-distant future. More soon!
Title: Re: Ultima Ratio Regum (0.8 back in development!)
Post by: UltimaRatioRegum on April 12, 2019, 05:42:09 PM
More URR progress! I am now down to the final two things before URR 0.8’s release, which are 1) check every line of dialogue as comprehensively as I can, and 2) deal with some strange issues regarding game speed and optimisation which are bothering me. In the mean time, though, the fact we’re now at that point is because I’ve managed to get done all of the following:

– Fixed an issue with leaders failing to generate correctly at night; leaders of civilisations temporarily disabled.
– Fixed a number of issues with synonyms for words in certain dialects producing some very strange linguistic outcomes.
– Fixed some word variables not correctly being replaced with the right words or phrases because of where in the code those particular sentence are generated.
– You now cannot talk to NPCs when asleep; if 0.9 happens I will likely implement a simple process for waking NPCs, but angering them in the process.
– NPCs who have special things you can do with them, besides talking, such as smithing (with a blacksmith) or worshipping (with a priest), no longer crash the game when you select them.
– Guards and soldiers and the like now spawn with armour (although the armour has no pictures – again, if 0.9 happens, that will be a priority).
– A few issues with farmhouses are now fixed.
– NPCs of a certain sort – who are finite in number, but not always important enough to be generated when the world is, such as some priests, some monks, most prisoners – no longer display a range of bugs when they are “normal” rather than “special” versions of those NPCs.
– Fixed (I think) issues with some buildings in tribal societies, and also hospitals in military districts should also now be issue-free.
– The guidebook has been updated with a number of new entries for this new release detailing language, speech, and so forth.
– NPCs can now properly end conversations when they say they’re ending the conversation, instead of just saying they’re done talking, and then continuing to talk by just repeatedly saying they don’t want to talk.
– Fixed a wide range of issues and minor bugs with language generation, grammatical structure, the correct “calling” of other pieces of information, and so forth.
– Resolved a bug where certain kinds of religions didn’t generate backgrounds for their holy books, and then relevant NPCs asked about those books caused a crash when they couldn’t work out what to say.
– Fixed an issue with certain kinds of NPCs spawned in rare circumstances not being able to respond to the “What was your previous job?” question.
– Some guidebook entries no longer display incorrectly in rare circumstances.
– Certain name generation techniques no longer (I think) mix up the genders of the characters they are trying to produce names for.
– Many more questions can now be answered completely, and a handful of others have been given acceptable placeholder responses for the time being.
– NPCs are now generally more willing to talk to you, as until now this was definitely balanced too much in favour of NPCs keeping information private.
– A couple of rare world generation issues have been fixed, primarily involving the creation of names for things like relics (primarily), artworks, books, and the like.
– Fixed issues involving guard schedules within military districts, and the guards not knowing where to go or what to do.
– All ranks of soldiers are now much better at telling you what they actually do.
– Some ranks of soldiers (and some wandering soldiers in cities) didn’t have the “Soldiering” conversation option; this has been fixed.
– Resolved issues with armour for NPCs from nomadic civilizations.
– Fixed a problem with substituting certain words in certain conversation responses if the word was followed by punctuation marks, specifically “!”, “,”, “.”, and “;”.
– Fixed a major and long-term bug involving too many servants or slaves trying to spawn into a mansion if you first set foot in the building at night when everyone is sleeping.
– Clerks and diplomats in embassies now correctly have appropriate old jobs to talk about.
– You can no longer force someone into talking to you again after they end the conversation – they will instead now ignore you.
– Asking people about nearby nomadic or tribal civilisations no longer just involves them telling you about nearby feudal societies…
– Fixed an issue with entering parliamentary buildings sometimes causing clerks to spawn off the map, and therefore have no way to path, and consequently result in a crash.
– Many more linguistic fixes.
– Characters can now accurately tell you what embassies from other nations, if any, are nearby.
– Solved a gigantic bug which took me a long time to figure out, where sometimes there weren’t enough guards being able to spawn in castles. It took many hours to trace it back, but it turned out the game was registering a passing guard outside of the castle as being one of the castle’s guards (incorrectly), and then that cascaded through the rest of the code to tell the castle to spawn fewer guards than it should, and then some places were not being filled up, and so the game collapsed. This was probably the hardest bug to find since resuming development – and had a guard not been passing through the castle district while I was testing other, completely unrelated things, I would never have even known this one existed!





Title: Re: Ultima Ratio Regum (0.8 back in development!)
Post by: UltimaRatioRegum on April 17, 2019, 05:40:52 PM
Continuing to chop down the list of URR stuff to be checked before 0.8’s release! Here’s what has happened in the last couple of weeks:

– Resolved some strange issues with churches, especially if you approach them at night. Priests weren’t sure where to spawn or where to sleep, and random worshippers kept appearing off the map and finding no way to path in to the map, rather than being where they should be. I’m not entirely sure what the cause was – and, indeed, I feel this was working fine a while ago – but these strange behaviours have all now been fixed.
– Fixed a number of conversation options not working correctly when talking to nomadic speakers.
– Fixed a number of conversation options not working correctly when talking to speakers from tribal civilisations.
– Merchants were not always spawning correctly in their shops in town; this has been fixed.
– Merchants also could not always describe to the player what kind of product they sold – the problem was different for merchants in cities, towns, and fortresses, but all three kinds can now correctly tell you about their wares.
– When you insult or compliment someone several times, they no longer say you “asked me that” several times, but instead say “you told me that” (or some close equivalent).
– Asking about laws on violence has distinctive answers now for nomadic and hunter-gatherer civilisations, with particular kinds of concerns and laws relevant to them.
– Asking about laws on trade has different outcomes for nomadic and tribal civilisations.
– Asking about laws on religion has different outcomes for nomadic and tribal civilisations.
– Helmets do not appear correctly when you select someone who is wearing a helmet (no picture yet, but relevant text).
– Tribal people respond correctly to questions about money; all peoples respond correctly to religious questions, especially if they don’t have a specific religious belief; and NPCs correctly state when they aren’t wearing a necklace, rather than trying to tell the player about a necklace that doesn’t actually exist.
– Starting to ask an NPC stuff before saying hello will get them to say something like “Oh, hello there”, or “Oh, good morning”, before they give you the full response.
– All guards (there are at least twenty sorts of places a guard might guard) definitely now correctly talk about their respective charges correctly.
– Fixed obscure bug with some feudal NPCs being unable to remember the correct punishment for certain religious crimes.
– Resolved an equally obscure bug where game would sometimes choose “Monastery” as the word to describe the church of a certain culture (a la “Church”, or “Pagoda”, or “Priory”, etc), thereby potentially generating confusion with actual monasteries.
– Farmers no longer sometimes possess access to teleporters when they really, really, want to get to bed quickly.
– Fixed a number of issues with random NPCs in buildings (other than religious buildings) sometimes spawning at -1,-1, and therefore being unable to path or do anything.
– Fixed a problem with some church generation algorithms which didn’t produce interiors containing sufficient options for NPCs to always work out where to go.
– Improved the generation of insults, greetings, farewell and compliments by removing a number of weird grammatical mistakes (still more to do here).
– Fixed a strange bug where unseen NPCs very very rarely fail to complete their scheduled tasks at the right time in another part of the world map and instead crash the game – this is another where I don’t understand the cause, but it has definitely been resolved.

So, the list continues to shrink, and I’m now basically just checking out schedules and fixing bugs in the conversation system. I must say, though, that it is a little dispiriting that I keep encountering new bugs while trying to fix the old ones, but I take a lot of reassurance from the fact that the speech system has gone from “almost every possible question might lead to the game crashing” (a month ago) to “no question causes a crash, and just a handful of questions are still a bit inaccurate or strange in their responses” (now). Progress is continuing to happen at a pace I’m very comfortable and very pleased with, and I should have more to show in, again, some time later in April. I’ve been travelling a ton for work lately (week back in the UK, week in Sydney, and soon another week travelling in Canada), which has stretched this update out a little, but things are still moving at a nice speed. Thank you all for reading, and see you all soon!
Title: Re: Ultima Ratio Regum (0.8 back in development!)
Post by: AgingMinotaur on April 21, 2019, 12:32:23 AM
Mark! Glad to see you are back in the saddle 8) All the best.

As always,
Title: Re: Ultima Ratio Regum (0.8 back in development!)
Post by: UltimaRatioRegum on April 24, 2019, 11:43:53 PM
Mark! Glad to see you are back in the saddle 8) All the best.

As always,

Thank you my friend! It is great to be back...
Title: Re: Ultima Ratio Regum (0.8 back in development!)
Post by: UltimaRatioRegum on April 25, 2019, 05:02:25 PM
Things slowed down a little in the past few weeks due to a lot of unexpected travel and some job negotiations (more on this very soon), but here’s another set of fixes and corrections:

– Fixed a complicated bug which spent a long time to hunt down, and involved guards trying to exchange positions with other guards. Normally if you enter a map grid, relevant NPCs will spawn and play out an appropriate number of actions before you gain control of your character. For example, if a guard entered the map grid twenty turns before you enter the grid, then the guard needs to catch up with those twenty turns in the real grid rather than in the abstract grid. Normally it is possible for a guard in that “interim” period of movement to find the guard they should exchange positions with and exchange positions with them;  however, in some cases this wasn’t happening, and both the new guard and the old guard were standing on top of each other once the player properly entered the map. This, er, shouldn’t have been happening. I eventually discovered it was because in very rare situations, the “old” guard would spawn later than the “new” guard, and so the new guard would walk to where the old guard should be but not find the old guard, then the old guard would spawn on top of them. The new guard is not then programmed to detect being on top of the old guard (as that should never happen!) and so the two would just stand still doing nothing. This has now been fixed! Upon moving the new guard into position, if the new guard is where the old guard is shortly going to spawn, the new guard just takes two steps back; then once they’ve spawned the new guard will meet the old guard properly, and everything will work correctly.
– Resolved an issue where sometimes a set of guards or equivalents, upon returning to a building after leaving that building to sleep, would not be able to figure out where to put themselves if the player entered the map containing that building long after they switched back over with the previous set of guards (I know, it’s a complicated one). I’m not entirely sure what the cause of this was, and I actually think there’s a good chance this was caused by my own playtesting (and fiddling around with saving/loading to test other things) rather than a bug in the game itself, as I’ve never encountered this issue before, and the save file I was testing stuff on I had been playing around with a lot before this bug emerged. Nevertheless, redundancies are important, so I have now implemented a system whereby a generated building stores the initial locations of all guards or equivalents, and if a later guard ever cannot figure out where to return itself to for whatever strange reason, then the guards will look at this master list, find a location which matches their class (Guard, Knight, Sodier, whatever), and an x/y/z coordinate set which hasn’t yet been occupied by a different returning guard, and put themselves there. Sorted.
– Found another issue related to the above where sometimes you would get two guards trying to go to the same location if you returned to a location after a long period away, because one of them would have recognised it was where their guard “partner” was stationed, while the other would see it as a free spot. This has also been fixed.
– Resolved a minor issue with NPCs selecting homes in appropriate districts under certain conditions, particularly if the player has previously been in that map grid.
– Fixed quite a few points where words could be duplicated, such as “that is not a question I want to give an answer to to”, and I’ve now hopefully got to the bottom of the last of these.
– Handled a bug slowing down NPCs who were trying to find a path to staircases in larger buildings, yet spent most of their time dithering around and examining walls in great detail.
– Fixed issue with some soldiers being unable to properly about their ranks with appropriate grammar.
– Handled a very strange issue where iron bars, such as those in jails, dungeons, or between an audience and an arena, very rarely become invisible.
– Handled a problem where Tellers don’t spawn correctly in banks if you first enter the bank after the first day of world generation.
– Changed the name of the speech category “Past Life” to simply “Life”, as this is far more descriptive (since you can ask them about their current job and things like this).
– Fixed issue where plants could not spawn inside a nomadic citadel, and crashed the game.
– Resolved a problem with NPCs who spawn in town halls in towns not having any idea where to go, and getting stuck in an infinite loop of uncertainty.
– Resolved a problem involving NPCs in barracks in towns, not knowing what to do when they decide to go for a wander (unlike in military districts in cities, where there is always something for them to do). These NPCs can now always find something relevant/sensible to do when they decide to move.
– Fixed an issue with some NPCs in taverns being unable to find their way to the door when they’re done drinking (and I do appreciate that there is an obvious comedic interpretation of this particular bug).
– Soldiers in castles no longer crash the game as a result of not knowing what to wear.
– NPCs are now even less likely than they were before to clog up a doorway and thereby block you or anyone else from going through it (I thought this was completely fixed before; it wasn’t; I now once more think it is completely fixed…)
– Wandering versions of important NPCs like priests and the like can no longer be asked questions which would make them crash, such as “what relics are there here?” while they’re walking through the streets and therefore nowhere near any relic of any sort.
– Finally, resolved a bug where sometimes reloading the game, going immediately to fast travel, and taking a particular path (NE or NW after moving N, SE or SW after moving S, etc) will take an infinite amount of time, and the game will attempt to perform 9999999 turns before giving up. I am not entirely clear why this happened, but it no longer does. No infinite hikes for anybody!

So: more progress, getting closer and closer! My list of buildings and conversation possibilities to check is getting shorter and shorter as time goes by, and it has now been well over a week since I found any large bug. This means I’ve almost exhausted everything I know I need to playtest, and once that’s done, I’ll be onto polishing things like menus, displays, information, and the like. More coming in early May!



Title: Re: Ultima Ratio Regum (0.8 back in development!)
Post by: UltimaRatioRegum on May 21, 2019, 05:23:39 PM
Welcome to May’s URRpdate! Things are still moving along, and rather pleasingly, it has now been a full month of coding since I discovered any more major bugs. Now, maybe that’s tempting fate, but I choose instead to read it as a very encouraging step forward. It does actually seem now that only small bugs remain, and many of these are not even crash bugs. Nevertheless, in the past couple of weeks I’ve manconqaged to resolve more issues, and I feel like we are very nearly now at the stage where I’m just polishing the front-end of things like menus tooltips and the like, in preparation for the final release. It’s all very exciting! But without further ado, here’s the latest:

– You can now properly talk to non-religious NPCs from all kinds of civilizations about their beliefs, and none of those conversations cause the game to crash. Individuals from “free religion” civilizations can also intelligently give different answers depending on their preferences.
– Priests no longer always spawn (for some reason) on the same tile as the altar within their religious building, thereby making it hard to find the altar unless you know the priest is standing on top of it.
– Prisoners can now properly tell you that they are prisoners when asked about their “job”.
– Prisoners can tell you everything about their past crimes, their sentence, when (if ever) they expect to get out, and so forth, without ever trying to generate a sentence they can’t figure out.
– Jailers no longer crash the game when you ask them about whether any particularly important or interesting prisoners are interred at their jail.
– Jailers no longer sometimes just decide they fancy a career change, wander out of the jail they are in charge of, and immediately crash the game because they have no idea what to do once they get outside.
– Entering a building which will (in a potential 0.9) house a regional representative in a democratic nation no longer crashes the game from time to time.
– Mints and Banks no longer sometimes crash the game when you enter them at night (I think?).
– Fixed a few more double-word issues (yep, I hadn’t actually caught all of these last time, but now I think I have… again).
– Handled a bug which made world generation, in extremely rare cases, get stuck in an infinite loop of trying to generate certain aspects of a civilization’s culture.
– Found an extremley rare issue where sometimes an NPC can sometimes find themselves off the road in a city district and fail to figure out what to do or how to get back onto the road. I’m not entirely clear what causes this issue and I’ve only encoutered it once, and this was just because the NPC in question was screaming in the debug log  while I was playing. As such, I’ve added in a new bit of “catch-all” code at the end of NPCs deciding where to walk next, which – if they somehow find themselves in that situation – will encourage them to walk back onto a road and resume normal behaviour. I also inserted a catch-all after that which states if finding their way back is also for some reason impossible, then once the player leaves their line-of-sight, they will just despawn.
– Handled a few more buildings where it is possible for furniture to spawn in such a way that someone sitting on a chair, for example, can block a door and then all the people who in the building can no longer find their way out. For any 0.9 I will definitely implement a more general solution here allowing NPCs leaving or entering a building to walk “through” someone sat in a chair, but this solution will do for the time being, and should deal with the issue.
– Removed a handful of special NPCs who were being generated at world generation but not spawned in the world; this shouldn’t have caused any issues (famous last words), but it’s better to be safe than sorry for the time being.

This is a slightly shorter update than last time because I have also been hard at work on a chapter for a forthcoming book (alongside a number of world-building luminaries!) about world-building. In it I talk about how important I think social, political, economic and cultural detail is to creating a convincing and “breathing” fictional world, looking at Ultima Ratio Regum but also other game series which have always stood out to me in this regard, such as the earlier Command and Conquer games (the Tiberium series, that is), many of Paradox Interactive’s games, the Deus Ex universe, and several others. Although I’m really enjoying writing this – and the book about world-building it’ll be a part of will, I think, be something quite special – this has taken up some of my coding time in the last fortnight or so.

Now, the rest of May is pretty busy at this end – I’m going down to Washington DC to talk at this year’s International Communication Association conference to chair a panel on live streaming and talk about Twitch and the games industry. As such, the next update will be some time in June. See you all soon – and the journey is nearly at its end!


Title: Re: Ultima Ratio Regum (0.8 back in development!)
Post by: UltimaRatioRegum on June 23, 2019, 05:07:55 PM
Here’s June’s big update. The bugs and fixes continue to get smaller and smaller with each passing fix, and they’re generally taking less time, being more and more obscure, and often involving text or grammar for sentence generation rather than things which actually cause the game to crash. With that said, some new crash bugs around pathfinding have arisen, but – see below – I think they are now all fixed, and hopefully no more will appear as bug-fixing and tweaking continues. Without further ado:

– Fixed some more crash issues surrounding people not being able to tell you they are not currently wearing any jewelry.
– Monasteries can no longer spawn on rivers, thereby preventing some very strange generation of their local maps if the player decides to explore one.
– Fixed an issue where one of the guidebook entries was too long, and consequently “leaving” some of its text on screen even after the player navigated away.
– Non-religious NPCs can now definitely always correctly respond to religion-based questions.
– NPCs from a religion not based in the nation they currently live in no longer tell you their cathedral is in their current nation / city, rather than the place it genuinely is.
– NPCs without armour no longer sometimes tell you they have armour and then crash because they can’t find information about it, and NPCs with armour no longer sometimes tell you they don’t have armour. AND NPCs with armour no longer sometimes tell you they do, and then in the next sentence (from the same NPC) tell you they don’t.
– Asking certain NPCs for their perspectives on religious heresy no longer leads to a crash if they don’t really care about it.
– Fixed an issue with clerks who spawned at random in places like parliaments incorrectly thinking they were important, and thus behaving in a manner inappropriate to their station.
– Resolved another strange issue with banks at night and tellers appearing when they should be asleep, and similarly, an issue with tellers not appearing in the day time.
– A rare bug with NPCs attempting to leave the grid the player is on, while the player is also leaving the grid, has been solved… I think?
– Relatedly, fixed a very complex and strange issue where if two or more guards are moving off a grid at the same time, then sometimes they get confused about where to go because they look at each other as potential guard exchange partners (i.e. the guard they switch guard duty with), and then they freak out and don’t know what to do. Pretty sure this is fixed now.
– Fixed a timing bug which could trigger if you left a grid and then returned before the predicted time it would take, in the abstract, for an NPC to reach its next objective; this would cause the game to just lock up as it tried to figure out the NPC’s movement.
– Similar and related to the above, also resolved a problem where sometimes an NPC couldn’t make it to where they were supposed to be (hypothetically, in order to estimate how long a particular path would take), and now the game notices if they’ve got stuck one tile away from their target, and ends the counter there, just adding “1” to whatever the total was to represent what the final step would actually require (for example, if an NPC is currently blocking the way, but will not be in the future).
– Confirmed that a wide range of buildings – such as taverns, churches, cathedrals, jails, and others – do not crash when you spawn them in day then return at night, or in the next day.
– You can no longer travel into the ocean; I will shortly be adding quick alternatives for getting across the sea.
– Fixed a bug where an NPC already on their bed will try to find their bed, and without thinking to look underneath them, will cause the game to lock up as they search, desperately, for somewhere to sleep.
– Fixed a similar bug where sleeping people were sometimes being transported through walls; this must have been rather distressing.
– Talking to someone in a tribal civilization about religion, laws and money no longer leads to a crash.
– Fixed some name generation things which made certain items of clothing too long.
– NPCs now properly tell you what is special about their armour (which is to say, nothing, because I haven’t coded that yet).
– Added information about policies which haven’t previously had clear effects or impacts.
– Fixed a bug which I had not noticed until just a couple of days ago, but now I see it would have actually affected a huge number of religious buildings in city centres and potentially elsewhere as well: guards for archives are no longer selected at world generation if there is no archive beneath the cathedral, which is almost always the case, and so this bug would have applied to almost all cathedrals when the game later tries to find a place for this guard, only to discover there is nowhere for them to go…
– Removed a bunch of irrelevant chaff from the “Load Game” screen.
– Hunted down and resolved a pretty large bug where, again, guards might be sitting on top of each other and the one who was supposed to go home wasn’t sure what to do. I’m not sure why this bug was still sticking around, but I’ve put in some catch-all code in case this ever happens, and this should really never be a problem again.
– Fixed an issue where servants or slaves, in a mansion that had been spawned or previously visited at night, wouldn’t know quite how to get back to work in the daytime.
– Resolved a rather complicated issue, whose cause (again!) I don’t fully understand, where after walking around for a long period of time and then returning somewhere guards had previously been spawned, one of the guards was on the roof. Of a different building. I have absolutely no clue how this person got up there, but I’ve now implemented a system which checks for guards (or equivalents) who are on rooftops (???), and then looks at guard locations on that map grid, finds the empty one belonging to the appropriate civilisation, and moves the guard there before the player gets a look at their strange behaviour.
– Related to the above, the game can now notice any guard out of position and put them back in their rightful place, which should catch any potential future errors of this sort which I’ve never even observed (if they exist).
– Fixed a bug where certain conditions would try to remove a bed as an option for an NPC to move to, but if the bed wasn’t already in their list of valid movement targets, it would crash trying to remove it (since it wans’t there). Again, not entirely sure what caused this, but it has now been dealt with.
– Made sure that priests in castles which contains priests of multiple religions (with particularly open-minded rulers) all behave correctly at night and in the day.
– Servants or slaves in castles, when you have spawned the castle in the day but then return at night, now correctly spawn in / move to the appropriate beds instead of becoming paralysed with indecision on the ground floor.
– Handled issue with priests not turning up correctly in their beds in districts containing multiple religious buildings.
– Fixed a problem with buildings in hunter-gatherer settlements sometimes being spawned just a little too close to each other, and thus potentially blocking off an entrance.
– Handled an issue in religious districts with some random NPCs, at night, not really knowing how best to worship in the religious building they have selected.

At this point there are only two “major”(ish) bugs I haven’t fixed: one involving multiple ambassadors trying to sleep in the same bed (although one imagines this would do wonders for diplomacy), and one involving mints still crashing if you go back into them later. These both seem to be fairly big tasks, but I aim to tackle them in the coming days; I believe the former will be easier to deal with than the latter, but we’ll see how it goes.

So, that’s everything for this month. The rest of June is pretty clear at this end, aside from one academic paper I need to finish writing (about Super Mario Maker: this has become a rather exciting side project I’ve been working on for a couple of months now, particularly focused on troll and “kaizo” levels and the communities of players who both design and play these monstrosities / masterpieces). At this point, however, I’m really trying to push URR 0.8 out. There’s so little left to do now, so little left to check: of course I’m going to miss some bugs, and I fear, maybe even a couple of crash bugs, but I’m doing my absolute utmost to make this as stable, complete, and finished a product as I possibly can. Next update hopefully soon!





Title: Re: Ultima Ratio Regum (0.8 back in development!)
Post by: UltimaRatioRegum on July 23, 2019, 06:18:00 PM
Hi everyone - I have some awesome news to share this month which isn't completely game-dev-related, but is pretty life-changing for me. More URRpdates next month!

Title: Re: Ultima Ratio Regum (0.8 back in development!)
Post by: UltimaRatioRegum on August 24, 2019, 06:10:03 PM
Here’s the URRpdate of the last two months. A lot of travel and my laptop breaking while abroad has slowed things down, but a lot of progress has been made both on finishing off the last remaining bug-fixes, and adding the final small “feature” required for 0.8. The game is becoming increasingly stable, as well as increasingly polished, with each passing week. So, here’s what I’ve been up to in the last two months:

– Handled a puzzling issue where sometimes two general (i.e. “unimportant” and not saved by the game) NPCs would sometimes be on the same place with the same objective, and wouldn’t know what to do; if this happens, the game pushes one of them to one side, and then gives them a new objective.
– Fixed a range of grammatical issues with people talking about nations or cultures.
– Resolved a problem where certain kinds of buildings didn’t always generate correctly if they were building on ice as well as snow within a polar biome.
– Made sure that a few more buildings couldn’t possibly generate with furniture in the way of a door, which might therefore wind up blocking that door for NPCs who need to get through it.
– Altered and improved a few of the guidebook entries to make certain aspects of the game much clearer, and to stop a bug where looking at a certain entry caused a crash.
– Improved handling the names of relics, especially when people talk about them, and NPCs should no longer add in extra words at random times to describe them or their names.
– Put in some groundwork for future NPCs of classes that do not currently spawn in the game, such as inquisitors, royals and various other sorts of leaders, high-ranking soldiers / officers, and so forth. (This is a 0.9 thing if I develop a 0.9, but doing this also helped me clear up some of the code for existing NPCs)
– Resolved a weird and very rare bug involving saving the game at a certain point on the travel map after a particular set of moves, and then reloading the game, which would cause the game to crash when you tried to move again.
– Dealt with a problem where sometimes all the buildings required in a town didn’t correctly spawn if it took a while to place them intelligently.
– Handled a couple of remaining problems where wandering versions of certain classes, such as priests, would find themselves unable to talk about the things they should be able to talk about, by virtue of not being attached to a particular religious building (or equivalent for other NPCs)
– A couple of buildings which sometimes had weirdly high or weirdly low numbers of NPCs present seem to no longer run into this problem, although this is something I should keep an eye on.
– Without doubt, all problems around NPCs discussing the armour they might or might not be wearing have been fixed, and likewise all problems regarding NPCs telling you they are not wearing a necklace, nor any rings (as these have yet to be implemented in the game)
– Discovered that over time guards in certain districts tend to disappear, which I think must be due to some issue in how they move in unloaded areas when the player isn’t present. This doesn’t seem to cause a crash, which is great (and indeed it was coded precisely in this way, so it’s pleasing to see this works), but obviously this shouldn’t be happening. I’ve put in some new code to try to resolve this and “catch” guards before they somehow disappear into being stored in some place the game can’t retrieve them, and hopefully this will have improved matters.
– Checked a few buildings I originally missed when seeing whether buildings generated in one period (day or night) still work correctly and have the right NPCs when you return later, and I’m now very confident this is working correctly for all buildings (except embassies and mints, which I am aware of and need to resolve)
– Improved the grammar and listing when an innkeeper tells you about the (procedurally generated and region-specific) drinks they have on offer.
– Resolved a couple of remaining issues with certain questions being asked to either nomadic or tribal NPCs, who were unable to give sensible answers.
– Slaves and servants in castles were sometimes getting mixed up when the game tried to generate them, and thus causing confusion about which floors each should be sleeping on (the servants tend to sleep on the ground floor, but slaves sleep in subterranean floors) – this should now have been fixed.
– Very rarely a non-“guard” guard, by which I mean an NPC which isn’t of the “guard” class but was carrying out guarding actions (such as soldiers or knights in certain civilizations) didn’t function correctly, precisely because they were not “guards”. I believe I have fixed the last few places where this either caused a bit of NPC confusion (at best), or the game to crash (at worst)
– Fixed an issue with certain kinds of buildings in towns sometimes causing the generation of houses to stop weirdly early, leaving a strange eerie town almost completely devoid of actual homes and people, yet filled with roads.
– Spread out some of the loading symbols on the world generation page so it doesn’t look like the game might have crashed (when, in fact, it did not).
– Handled further issues with religious districts at night time, in particular people struggling to figure out how to worship, and priests behaving strangely when they can’t figure out how to get to a bed.
– I have also added some important new content! Since you can no longer, er, walk across the water, entering a “Dock” district in a city, or a new “dock” building in a town, now allows you to be transported to another city or another town! There are screenshots of this down below. This also causes time to pass – not much time right now, but that’s fine for the time being.
– Even better, when you get into a ship it now gives you a little story about your travel! This mentions something about the ship, the destination, your fellow travellers, what you see on the voyage, and so forth; these elements draw on a range of information about relevant nations, cultures, and locations, to generate a unique little paragraph for the player to read while the player is transported to their final destination, and while the required time passes for that journey to occur.
– For the time being you can reach any place with a dock via any other place with a dock, even if (as in the below map) there are different oceans; this will be changed later, but for now, it significantly helps with navigating the game world.

So: the last two months have brought much more polish, more bug-fixes, and some quality of life changes, such as allowing you to move quickly around the game world through the use of docks and the like. I’m really excited by how this is all coming together. Aside from URR updates, in the last couple of months I’ve also done almost all the remaining work for making my move to the University of Sydney at the end of September, finished writing a journal article about Super Mario Maker I’m excited to share in the near future, presented a whole bunch of work at this year’s Digital Games Research Association Conference in Kyoto, talked about Twitch and disability at the European Sociological Association, and spent some time with the family back in the UK. That said, though, it’ll be nice to get back to Canada for one final month to catch up with friends and colleagues before the move itself…

So: with all of this done, in a week from now I’ll be back in Canada and back to being able to work hard on the game, so I hope to have another solid update some time in September. The list of remaining tasks is pretty much only resolving two long-running bugs (involving ambassadors and mints), handling a few more issues around sentence generation, adding a little bit more polish here and there… and then… that’s it?! See you all soon!