Finishing up 0.5

We’re now just a week away from releasing version 0.5! This version sees the addition of feudal cities & towns, nomadic fortresses and hunter-gatherer settlements to the world map; the creation of colonies by civilizations so inclined; an encyclopedia function that tells you everything about the world you’ve so far learned; a number of generated in-game histories which hint towards NPCs, items and plot points of interest; several tens of thousands of possible family sigils along with family trees for important houses; distinct flags for each type of civilization, and symbols for religions and cults; and various other small fixes, tweaks, memory/speed optimizations, etc etc. This week’s entry is going to be a summary of what’s happened in the last week, then next week – on the 12th – I’ll be releasing 0.5!

First off, for those who didn’t see this on Facebook, Twitter or elsewhere, this week the game really surprised me for the first time in a while by producing this rather tremendous city upon a small island (with a single slum just on the outside) and only accessible by docks:


This in turn raised several things I’ll need to take account of for the next release, 0.6, when I’ll be generating the interiors of cities, towns, fortresses and settlements! Which is – what if a city has no roads? Or what if a town is completely enclosed by mountains? I’ll need to have the game recognize that and ensure the former can only be accessed by docks, for example, or ensure a mountain pass is generated to access the latter. It shouldn’t be too tricky to do that, but I’m glad this brought those possibilities to my attention.

I’ve also updated the “choose a save” screen, so it now looks something like this. For this release it just lists every civilization, but in the future it will naturally only list those you have actually encountered:


And now some other more general notes:

- There will only be three cults visible in the in-game histories for this release and in the encyclopedia; these are the cults that will relate to the three early-game areas. Others are being coded in the game but will remain hidden for the time being. Likewise, only certain languages will show up in the “discoveries” list, but this will expand as versions go on.

- Although you can view nomadic fortresses and hunter-gatherer settlements in the encyclopedia, there is (as of yet) not a lot of information about these. I’m still working on precisely how they’re going to be structured, so there will be more on that in the near future.

- The resources map has been changed to the “resources and trade” map which displays roads as well as mineral resources, and will later show naval trade routes, mountain passes, etc (passes will show on the normal map too, but they’ll just be highlighted on this one).

- I’ve adapted the ziggurats to feature the correct language – though in this version you can still auto-translate the clues – and I’ve also begun some work under-the-hood for displaying other languages, allowing you to keep track of your information on languages, etc.

And that’s pretty much everything. See you next week for 0.5’s release!

We Are History

This week I’ve been working on the in-game histories. These can be viewed in the encyclopedia, and can either be looked through in one long list or according to the category they fall into. As you can see from the pictures here, histories currently fall into eight categories – colonies, conflicts, cults, disasters (natural disasters, plagues, etc), discoveries (languages, technologies), individuals (rulers, important soldiers, religious figures, etc), religions and settlements (although the term “Settlement” is used in a specific term in the game to mean hunter-gatherer settlements, as opposed to feudal Cities and Towns and nomadic Fortresses, in this regard settlement just means all population centers). Each category has its own associated icon.


All the histories you see here are procedurally generated to a greater or lesser extent. Some build upon archetypes that vary game-by-game, whilst others have a huge range of different sentences that build up into a coherent story. The above screenshot also showcases one important aspect of the histories – any NPC mentioned in a history who is still alive will spawn in game (NPCs will be spawning in a few releases time – we’re getting close!), any weapon mentioned will appear somewhere, any and every town/city will be on the map, and so forth. As well as giving hints towards the story and – I hope – just being generally interesting/varied tales to read, the histories will also highlight potential items, people or locations of interest. In later versions histories will only “unlock” in the encyclopedia once you reach a logical location – a city’s history will only appear once you discover it, the history of a language’s discovery when you find the appropriate book that records the initial research, etc. I’m still working on the precise triggers, but when you begin the game you’ll only start off with the history known to your civilization (and also histories from the perspective of your civilization). For this release, however, all histories will be visible except for cult histories (which will remain hidden), most discovery histories (because a lot of those hint towards hidden parts of the later game) and individual histories (because I’m still working on how those are going to function, and those may stay absent until NPCs are added a few releases down the line).


So, what does all this mean for you, the player? Well, for starters, it means an early release! This is going to be my fastest release yet (surprising, given the first two months were very academia-heavy); I’m currently expecting to release – at the very latest – in the middle of April, thereby making this between a 3 and 3.5 month release, as opposed to my others which have ranged inconsistently between 4 and 6. This has come down to my general improvement as a programmer and also, in part, my attempts to “standardize” and optimize my coding practice a little more (thereby speeding up development times) in the lead-up to something I’ll be announcing soon after this release. As for 0.5, all that now remains is tidying up the encyclopedia a little bit then a whole range of small optimizations and bug-fixes for unusual situations that can occur in world-gen such as handling unusual angles were territories meet, speeding up the placement of roads, limiting the number of towns a civ can spawn, ensuring the game never runs out of feudal flags to generate, adding some more variety to religion names, etc etc. Within a week from now I would hope to have a build that is pretty much finished, assuming all goes according to plan. I’ve also worked on upgrading the “Choose a Save” page to give much more information about each world you might have saved, whilst at the same time hacking down saving and loading times even further (because those can never be hacked down enough), and on a rather snazzy new world gen screen that’s a great improvement over the old one. See you all next week, when I’ll be talking about Something Else.

Addendum: the blog title refers to a very witty British comedy from the early 2000s. I recommend it.

Religions and Cults

I’ve pretty much finished all the work on religions. These take three forms – monotheistic, polytheistic, and “spirits”, which is the under-the-hood classification for animist/shamanistic beliefs, ancestor worship, and so forth. Hunter-gatherer civilizations are highly biased towards the third category whilst feudal civilizations have a roughly equal chance of producing monotheistic and polytheistic religions. Nomadic civilizations, meanwhile, never have official state religions – made up as they are by peoples from a wide range of places, and given their fluidity as civilizations whose people are generally in near-constant transit, I decided it would be more interesting if they were to often serve as “hubs” where large numbers of religions might be represented, as opposed to their feudal equivalents who may be more restrictive in the religions they’ll allow.


As in the above image, feudal religions have agendas and rewards. I have tried to design these so that you cannot build your game plan around pursuing them – since there will be an overarching “clock” in the game (not a food clock, something else) you will not be able to farm for the rewards that your religion offers, but rather these are things that in the process of playing you might be able to work towards and thereby gain the religion’s rewards. Many religions have agendas that you can pursue by exploring the world, getting access to multiple cities and the like, but carrying out one religion’s wishes may turn others against you. As with most good things in roguelikes, the religious agendas are meant to be a middle-ground between things you can plan for – “I’m going to focus my gameplan around doing X and Y that my religion wants” – coupled with things you cannot plan for, such as which religions might be close to you, which religion you start with, how easy or difficult its agendas will be to carry out, etc. Religions will be one “faction” you can assist, and gain rewards from, or not, depending on the situation and your preference.


Religions can all now be viewed in the in-game encyclopedia once you’ve discovered that religion. Monotheistic and animist religions can fit all their information on one page, whilst you can use Tab to cycle through the gods in polytheistic religions (as below). For monotheistic and polytheistic religions, the symbols or items that individual deities carry are dependent on what their worship entails; an agriculture god may have a sheaf of wheat, a war god an axe, and so on and so forth.


The last part of religions I need to finish off for this release are the spread of religions, but I think this might need a reasonably sophisticated mechanic. In the end it would be interesting if you could view the spread of each religion on the world map (i.e. switch between religions, as many may overlap) so that you can see where in the world you might meet with a positive response, and where else you might meet with a rather less positive one. However, depending on how complex I want to make that system, that might get relegated to a future release or not. Currently hard to say. Some religions appreciate the player spreading their religion to other nations – setting up altars, encouraging nobles to allow the religion to exist within their borders, etc – so such data about the spread of religions will be important for that, though I still need to desire exactly how that mechanic is going to work.

I have also begun work on some of the hidden cults in the game – their names/functions will be fixed, though their locations, how you access them, who leads them etc, will be changed each game. I wonder what purpose they serve?


Civilizations, Families and Guidebook Entries

This release is moving a lot faster than expected. Although the first two months of this year only allowed me to spend a small amount of time coding, I’ve probably got through around 80-85% of the content for this release. You can see our current progress on the development plan page and I’m very nearly at the point of bug-fixing and optimization. The final remaining large chunk of content I need to add is the generation of relevant components of world histories should as the construction of cities, major battles and wars, discoveries, uprisings/civil wars, plagues and natural disasters, and the like. In this release some small glimpses of the plot will be visible through-out these histories and these will inform the conditions that certain civilizations and NPCs start the game in. Last week I posted about city districts, so for starters I wrote up the Guidebook entry for city districts – as ever, my focus is to give the player mechanic information, but very little “What am I meant to do?” information.


However, for the most part this week I’ve been working on filling out the remaining parts of the worldbuilding required. I firstly wanted to finish off what remained of civilizations, and have all the relevant information display in the in-game guidebook. The guidebook civilization entries currently show a number of things. They show the flag of that civilization, the religion that civ follows (if any) and a 7×7 image of their capital city (along with its name). Down the left side it quickly summarizes the policies that civilization follows, then tells you information on the right about their leadership. It starts with the term they use to describe their leader, which depends on policy and civ-type: a monarchic feudal civ might be led by a “Czar” or an “Emperor”, while a chiefdom-focused hunter-gatherer civ might be led by an “Ice-King”, or a nomadic civ by a “Great Sultan”. Most civs will use different terms for those who rule. It then lists the important houses in that civ, followed by other information which differs according to civ. If feudal, it shows the towns in that civilization (and later mines and other structures); for nomadic civs it lists their fortresses, whilst I haven’t fully decided yet on what information will show for hunter-gatherers. It lastly states whether the civ allows slavery and/or gladiatorial combat, and if slavery is allowed, how slaves can be easily identified (e.g. missing little fingers, facial tattoos, brands, collars, etc). In the image below you can also see on the left of this image some of the potential names for civilizations, such as “Nation of X”, or “Descendants of X”, or “Brood of X”, of “Wanderers of X”, and so forth. These reflect different types of civilization and also, in some cases, their policy choices about leadership, producing a wide range of different naming conventions for civilizations. A player should come to recognize what each denotes in time, but I think they – like the myriad other name generators in URR! – do a lot towards my goal of building a world of complexity, ambiguity, and non-uniformity.


I have also finished up most of the information on noble houses in the encyclopedia. Each entry (all guidebook entries will only appear when you discover the civ/ family/ religion/ whatever in question) shows their name, what civ they belong to, their coat of arms and their motto on the left, and then the flag of their parent civilization and the family tree on the right. Getting the family trees to work well was surprisingly tricky, but I’m very happy with how they’ve worked out. The oldest members are the top, the youngest at the bottom. The oldest member of the family that wasn’t someone who married into the family will be the unofficial “head” of the family. The key to understanding the diagram is as follows: double-lines show someone from the house itself; dotted lines someone who married into the family; white shows someone alive, grey someone deceased; gold denotes the ruler of the civilization the house belongs to (so in this case, Tol Malake is the ruler of Utokaqu); whilst a blue colour will denote the player in whatever house the player belongs to (not shown here). Also, I’ve somewhat altered the rules of succession from the real-world of the (roughly) 17th century. Family names are not carried according to the men in the family, but rather by the status of the family. In the case below, some of the people who married into the family (the dotted lines) may be of either sex, but the noble family name was the one that “won out” and was used for any children.


As above, the remaining major chunks of content are finishing off religion generation and then beginning to work on significant historical events. After that I need to make a few changes to the world-gen screen to incorporate the new history/civ gen, update the start/load screen with information about the player’s civilization, house, religion etc, improve map data storage (I should be able to hack down map load times again with this new change) and then it’s bug-fixing and optimization. Next week we’ll probably be talking about languages or religions (the latter of which I know last week I suggested would be this week, but coding has gone in a different direction in the past seven days), though it is equally possible I’ll write up a non-URR games criticism entry and save more updates for the week after. Stay tuned!

City Districts

This week I’ve been working on two major things – religions and cities. I haven’t totally finished off religions yet so I’m going to leave those for next week’s update, and focus now instead on cities. For a couple of weeks cities have been generating names based on how their civilization likes to name cities (there’s a huge variety of possibilities in this regard – not all city names are just “X+Y” “Winterhome”, “Axehearth” style) but the cities have only appeared on the world map as outlines, produced by the city’s reasonably-organic growth after several centuries of simulated time.


Although generating the interiors of cities for the player to work around are going to happen in the release after the one I’m working on now (currently 0.5, city interiors will see the light of day in 0.6), I decided to work on generating the rough outline of those interiors so that I could begin to fill up the “Cities” section of the in-game encyclopedia with some meaningful information. Thus, cities are split into districts. I’ve done this for several reasons. Firstly it will aid the player in knowing approximately where in the city they want to go for a particular objective by splitting the city into distinct parts; secondly it is arguably more realistic when one considers the kinds of layout post-medieval cities had; thirdly it allows for various mechanics involving the player either being allowed into certain districts, or being able to sneak/fight your way in, rather than having the city as a single huge map; and, fourthly, it allows for some rather aesthetically pleasing city maps. There are currently a range of districts planned. Here’s an incomplete list of what will generate in each district:

Docks: Ships. (Blue ‘D’)
Market: All types of item shop. (Yellow ‘$’)
Recreational: Arenas, pubs, gambling. (Purple ‘R’)
Upper Class Housing: Noble houses. (White ‘1’)
Middle Class Housing: Guilds? (Light Grey ‘2’)
Lower Class Housing: Jails, keysmiths. (Grey ‘3’)
Medical: Gardens, Apothecaries, Hospitals, Fountains, physicians. (Green ‘+’)
Military: Barracks, weapon/armour traders, smiths. (Red ‘[‘)
City Centre: Cathedrals (and equivalents), libraries, government, universities, courts, mints, etc. (Blue Diamond)
Castle: Dungeons, ruler (if Monarchy/Stratocracy), weapons/armour, treasury. (Grey ‘#’)
Religious: Many religious temples, smaller altars, etc. (Lilac ‘^’)

Once I’d settled on this, I needed to get the game generating the districts in sensible layouts. This took a bit of working out because there were a range of variables. Firstly there were some districts cities had to have – such as city centres, and castles, and so forth. Secondly I had to order additional districts, like military or medical districts, in an appropriate order and probability weighting to get them appearing at the kind of frequency I want; thirdly, and most trickily, I needed to make sure districts that could sometimes be viable – such as docks if near a cost, military districts if the civ isn’t pacifist, and religious districts if the civ allows freedom or religion – generated in the right cities, knew which districts they were “more important than”, and generally were integrated into the lists of the generic districts well. Once this was done, I then worked on getting the cities to show in a zoomed-in map the player will be able to view both in the encyclopedia, and when moving between districts. I’m very happy with how these have come out:


Castles and city centres are *generally* close to the middle of the city, but you can get significant variation if the city has grown in a strange shape, existed near a coast where it couldn’t necessarily spread out a lot, or simply if the 1/9 chance (I think) for a castle or city centre to not be at the geographical centre of the city comes to pass. I’m still deciding what other information the encyclopedia should display for cities, but this will be one key part. In later versions city districts will be unknown until the player either explores them for the first time or learns information about that district from some other source, but for now I’ve just got it showing all the districts. Next week I’ll be talking about religions, their icons/symbols, how they generate, what benefits/disadvantages they give you, and what agendas religions may want their followers to pursue.