The Unpredictability of Gameplay

A slightly different entry this week, as I’m very proud to announce that I’ve just signed the contract (the “Secret Project” mentioned recently) for my very first academic monograph! It’s a 100k-word scholarly work currently entitled “The Unpredictability of Gameplay”, and is going to be published by Bloomsbury Academic in a couple of years as part of their growing game studies collection. I’m not going to post the entire proposal, but here’s a quick synopsis (with added hyperlinks where relevant) of the goals of the project, the theoretical orientation, a rough outline of what the book will cover, some detail of what I hope to result from the work, and how it relates to URR and my work more generally! This is paraphrased from the formal proposal I wrote – hence the change in tone from my normally rather more conversational blog entries to something much more academic – but I think you’ll get the idea. Let me know what you think! I’m also working on securing future discounts or various other options for you, my wonderful blog readers, but more on this as we get closer to release. My goal is to have this released (or at the very least have it “in press”) before I conclude the third year of the current postdoctoral fellowship I’m on, and that’s definitely achievable, so you’ll be hearing more about it before too long.

v   Synopsis   v

This book explores the many forms of unpredictability in games and proposes the first ever theoretical framework for understanding and categorizing non-deterministic game mechanics. Rather than viewing all game mechanics with unpredictable outcomes as a single concept – whether map generators, randomized loot or the outcome of a die roll – this work develops a three-part typology for such mechanics. It proposes the use of randomness to define the unpredictability of pre-game conditions from the shuffling of a deck or generation of a dungeon level; chance as the unpredictability of in-game systems like randomized loot or unpredictable AI decisions; and luck as the extent to which player action cannot control the outcome of a given game. It also proposes a second axis, that of stability and instability, for defining the extent to which a game contains glitches, exploits, and unexpected unintended moments of gameplay, and where these factors intersect with the primary typology. The book then explores a range of game genres and concepts using these frameworks: procedural generation, skill and mastery in gameplay, replay value and grinding, and player-made practices designed to reduce the level of luck in non-deterministic games, such as exchanging random-number generator seeds between players. It demonstrates the importance of looking more deeply at unpredictability in games and game design, the wide range of ways in which unpredictability manifests across genres, and will offer an invaluable tool for both game scholars examining games with non-deterministic play and its impacts, and game designers seeking to integrate randomness, luck, chance or uncertainty into their work.

As the field of game studies currently stands, “skill” – whether in strategic/tactical decision-making, reflex/execution ability, the embodied experience of play, or competitive and high-level play – is far more studied than “luck”. Equally, by simply using the term “luck” for all non-deterministic outcomes and mechanics within games, we implicitly state that the map generation in a Civilization game, the drop rates in an MMORPG, and the win/lose outcomes in slot machines, are all “the same sort of thing” – they are all simply “luck”. Since these clearly yield very different gameplay mechanics, experiences and outcomes, a far more detailed framework is necessary for locating and defining these different forms of gameplay unpredictability. The book will therefore: 1) demonstrate that unpredictability in games is a significantly broader and more varied field than previously appreciated, and develop an innovative theoretical framework for considering games with non-deterministic characteristics (i.e. the overwhelming majority of games); 2) assist game developers in understanding what type of unpredictability they want their games to features – randomness, chance, luck, or uncertainty – and the impacts these each have on player experience; 3) assist game studies scholars in studying games with unpredictable or non-deterministic mechanics to a far greater depth than previously possible; 4) move the scholarly discussion around unpredictability mechanics away from the literature on gambling or simply being dismissed as coin-flips which are not integral to gameplay (drop rates in RPGs, for example) and towards a more detailed and theoretically complex understanding of the topic; and 5), lastly, form the foundation for a body of work on unpredictability in games to stand alongside the growing body of work around skill, mastery, high-level competition, etc.

Theoretically, the book will acknowledge prior foundational work by Roger Caillois (Man, Play and Games, 1961) into the understanding of non-deterministic gameplay and other authors who have explored the topic (and the assessment of unpredictable mechanics in fields including mathematics, game theory and gambling studies), and Greg Costikyan’s work (Uncertainty in Games, 2013, MIT Press), but will draw primarily upon Gilles Deleuze’s Difference and Repetition (1968). Utilizing his concepts of repetitiondifference and generality will form a highly original and incisive groundwork for developing our understanding of randomness, chance, luck, and instability. In terms of dissemination, I envisage this book as having a broad readership across a range of games-related disciplines, academics, designers and players. For academics, it will offer the first detailed critical framework for understanding unpredictability in games (a significant part of an immense range of games) and examining the effect of these systems on gameplay experiences and player practices which have emerged around that gameplay – I hope for the book to become a fundamental text to begin developing the study of unpredictability to stand alongside the ongoing developing study of skill, mastery and competitive gaming. It also examines genre from a fresh angle, considering how a single concept – unpredictability – has been codified, reflected upon and developed in a range of different genres, in many cases these forms of unpredictability becoming synonymous with the genres in question. Equally, the designers of video games and non-electronic games, such as board and card games, will be able to use the book to assess critically and closely the role(s) they want unpredictability to play in their own work. A significant number of game players and journalists interested in the fields of roguelikes and procedural generation more generally will also be interested in the book, including fans of my own game design work. Lastly, given its strong engagement with Deleuze and wider debates around identity, difference and related philosophical questions, I hope for a lesser but potentially broader humanities and/or critical theory readership alongside the core game studies, game design and game playing audiences.

^   Synopsis   ^

So there we have it. If the philosophical hyperlinks above seem daunting – don’t worry, one of the core goals of the work is to combine the densest game-relevant philosophy with the most practical and pragmatic of game design writing, and produce something new at that (in my opinion) extremely rich intersection. I’ll give more updates as things progress, but I’ve already drafted out twenty thousand words in very loose form and I’m extremely happy with how the work is coming together, even at this early stage. It’s very exciting to be finally contributing in a substantial way to game studies as an academic field and to be working with a publisher as substantial and respected as Bloomsbury. This is especially true since no book on this topic really exists at the moment, and I’m sure everyone can see how it will link closely in to my work as a game designer. Meanwhile, next week’s update will be 2015 in review! I have two other entries I could post this week and next – finishing NPC scheduling/pathfinding and the final major bug fix – but I’ve decided to save those for the start of 2016 instead (although the work on both is either in progress, or finished) and post this, and the 2015 review, in their place. So I’ll see you next week for a summary of the year in URR and the various other game-related pursuits I find myself involved in!

Castle Generation


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.

FIve 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).

Outy 1

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:

Castle 2

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:



FIve Castles

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!

Lots of bug purging

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.

Democracy, Castles, Sigils, Bugfixing

Before starting anything this week, I came to REALIZE that I should proof-read my blog entries a little better for close-homonyms, especially when there’s an error in the very first sentence of last week’s entry (since corrected). Sigh. Anyway: 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:

All delegates

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:


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)

Refining, Bug-Fixing, Optimizing

Before I started work on anything important-NPC-related this week, I came to realize 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.

MorecathTown 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!