Further AI Agony

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

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:

Tellergoes

And the same from outside:

Toddleoff

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.

Telhouse

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

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

Cath

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

Goodpriests

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

the kraken awakes

Merchants

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

hot merchant action

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:

Problemcity

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.

Problemcity

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

LAST BUT NOT LEAST

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.

Final Bugfixes

Welcome to 2016 everybody! This is going to be a fairly substantial post, since with the last two entries being non-game-dev ones – announcing my first book and 2015 in review – a lot has built up. I was originally going to do two posts, one on bugfixing and pathfinding/scheduling (this one) then another on finishing clothing generation (next week) but pathfinding/scheduling has been such a huge and challenging task that, actually, I’m going to keep them as three entries, simply because I haven’t finished it yet despite basically working on it all day every day for the last week. So my goal by the end of January is to get all of those things finished, and the addition of a few other required elements, and after that we’ll be moving onto conversations, dialects, speech and the like, which is the last component of 0.8! Though it is also a fairly sizable one. Nevertheless: this week we have the the fixing of a truly momentous list of bugs and minor issues that have arisen in the 0.8 development process up to the present date (some of which are rather amusing).

Bug Purging

So: as far as I can tell, all the remaining significant bugs of 0.8 have been dealt with (excluding of course bugs that are arising in the process of handling the scheduling/pathfinding on thousands of important NPCs across a massive world map of varied saved/loaded/unspawned areas and buildings, but those are being dealt with as I go). Here’s a run-down:

  • People in banks now only sit once and then go straight back out, rather than sometimes moving from chair to chair for no apparent reason.
  • Fortress people actually go to the right houses/barracks instead of soldiers rarely wandering into a house and vice versa.
  • Fixed a minor issue where there was a tiny, tiny chance for tiny portions of roads to generate incorrectly and result in dead-ends (I have seen it literally only once in the last 100+ world generations I’ve done for testing purposes, but I think it is now sorted).
  • Resolved a weird problem in fortresses where people would bounce back and forth between guards; this was due to certain tiles requiring permissions that shouldn’t have required permissions.
  • Diplomats no longer just wander out of their embassies as soon as you go inside, and then have no idea where to go.
  • A huge range of issues with castle generation have been resolved, and as far as I can tell, all castles generate correctly regardless of aesthetics, cultures, religions, inhabitants, etc. Hurrah!
  • Monks and abbots no longer sometimes all decide, collectively, to run around like headless chickens for a few minutes upon entering their monastery.
  • Graveyards have been disabled, pending a significant redesign in the future to aid in clarity and the player finding what they’re actually looking for (this will associated with redone history/family generation).
  • Delegate housing in monasteries in democratic nations is no longer sometimes squished up against a wall.
  • Stopped abstract NPCs who move between grids to perform an action from finishing that action one grid early.
  • The “troll churches” (where there are multiple staircases to multiple parts of the same floor) have been removed, partly because they were proving deeply infuriating, and partly because it added a lot of unnecessary AI pathfinding confusion. I’m sorry for ever including these bloody things.
  • Fixed yet more issues involving the numbers of guards to be spawned for various buildings in city centres – I think this set of problems are finally all resolved now.
  • Fixed an issue with hunter-gatherer houses containing more than two doors, the entering of which tended to yield a crash.
  • Middle-class districts can no longer generate layouts of houses that resemble swastikas. This was… unfortunate.
  • Fixed a rare issue where gardens would take precedence over more important things in city centres, leaving some NPCs with nowhere to go/live/work.
  • Fixed a rare issue where the leaders of groups of NPCs would sometimes “bounce” against the end of a road and turn around.
  • Ensured that groups of NPCs don’t sometimes just run into dead-ends, but path to some other road just like any sensible person would.
  • Fixed an issue where guards for an embassy would rarely fail to spawn.
  • Fixed an issue with crowd NPCs disappearing upon save/load.
  • Discovered an issue I thought long-fixed in middle-class houses placing their internal doors in weird places, and resolved it.
  • Slum houses that are 3×5 or 5×3 in tiles now generate correctly.
  • NPCs entering generated slum houses are able to find the appropriate place to go and find their way back out again, rather than freezing due to “thinking” the slum house is a lower-class house.
  • Certain shops no longer cause a strange crash in towns.
  • Town roads are no longer sometimes at a strange height compared to the surrounding area, and can now only be one z level above or below their immediate nearby tiles. This looks far more sensible.
  • There are no longer issues with the road systems in middle-class districts… I think.
  • Delegates now actually work in middle-class districts and don’t freak out from the massive range of homes they can choose from.
  • Delegates now work correctly in upper-class districts, and most challenging of all, they work correctly in religious districts too – you can now find delegate homes in all appropriate places and go inside, and find what is basically a more ornate version of a middle-class house (unless the delegate lives in some other more specific place).
  • Flags outside mints that contain delegates are now placed correctly.
  • Resolved a problem with single-tile islands of territory.
  • Fixed weird bug with delegates in districts that contain both “district” delegates and “other” delegates, and they didn’t always spawn in the right place…
  • Fixed yet another middle-class issue where houses would sometimes combine with one another to form a massive uberhouse that stretched across a significant portion of the district. Bizarre.
  • Fixed a minor issue with the territory map that would sometimes show settlements where there weren’t any.
  • The player is now actually assigned to the right civilization!
  • Clerks and diplomats have been elevated to the status of “important NPCs” and will therefore be able to gain unique identifying information.
  • I thought I had fixed this last time, but now for sure – entering certain buildings does not encourage all the servants/slaves to bolt out the front door.
  • Resolved a significant suite of bugs involving stairs, NPCs, the player’s location, pathfinding, moving between floors, etc, that lead to a whole host of crashes when NPCs tried to path to their own location, or stepped onto stairs where someone else was already using them, etc. The only tile where multiple people can stand is now a staircase, which can hold an infinite number of people, although realistically this will almost never be above two, and should absolutely never be above three.
  • Fortresses now contain merchants and outdoor shops – they have a larger number normally than city markets, and can contain multiple shops of the same type (whereas cities/towns cannot).
  • Vassalage nations always have enough towns to make being a vassalage nations worthwhile, and if they don’t and the game cannot fit in enough towns, their military policy is changed away from vassalage.
  • Roads always have a black backdrop on the territory map.
  • Fixed an incredibly rare bug with religious districts that also contained rivers by ensuring that a bridge can always spawn to give access across the river.

What’s next?

Next week could be a lot of potential entries; either a run-down of the second bullet hell world record I picked up a week or so ago, or a look at a bunch of new graphics for 0.8 in the form of tribal and nomadic clothing, or the conclusion of NPC scheduling (if we’re really lucky!), or something else. I’m also sketching out both how the dialect generation system should work, and how the actual conversation system will work, and I’m really looking forward to discussing these with you all in the coming weeks. See you next week for AI, clothing, bullet hells, or something else!

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!

Democracy

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

Castles

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:

NewS

Sigils

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:

Newminors

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!

Next?

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):

Mansions

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.

Delhow

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.

Townhalls

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.

NewS

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!

The Physicality of Ideology

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:

Religious
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.

 

Military
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.

 

Foreign
Exploration: 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 nationsSecret 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.

 

Intellectual
Traditional: 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.

 

Leadership
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.

 

Trade
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.

 

Cultural
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.

 

Justice:
Vigiliantism: 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:

diamondtown

NewS

diasp

marketshapes

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!