Military Districts

Until today three districts remained without generators: docks, military districts, and city centers. I knew how I wanted the centers to generate but hadn’t worked on them yet, whilst docks I’m leaving until I actually implement ships and naval travel, but military districts needed to be done this releae and were proving very challenging. I didn’t just want to have huge regions of endless barracks – I wanted something much more varied – but at the same time I wanted to try to only add things that would have gameplay valuable if/when you gained access to a military district. I’ve settled on a middle-ground between the two – some areas are just for decorative purposes and to make the world feel consistent, coherent and real (akin to farms, for example), whilst other parts have clear gameplay goals, will contain important NPCs, etc.

So, military districts (like upper-class housing districts) are split into four parts. Each of these has a number of features which slot together in a fairly complex manner, and in a range of different orientations. These can be: Barracks, Parade Grounds, Archery Ranges, Siege Weapons, Armouries, Officer Quarters, Hospitals, and Stables. These combine in a range of different permutations to produce military districts. Each military district is also guaranteed to include two special combat NPCs – these may be able to raise a stat, or train you to use some of the more complex moves for a weapon. More on this in a few versions time when we’re doing weapons and combat. Here’s a labelled example:


Archery Ranges and Siege Weapons are self-explanatory, and (currently) for decoration only (you can’t raise stats by using the ranges or anything like that). All the others, however, will have gameplay use. Barracks contain troops, their beds, possessions, etc, and therefore may contain important NPCs. Parade Grounds are self-explanatory, and once we have NPCs in two versions time, you may be able to see soldiers marching around there in times of peace, or actively drilling in times of war (not sure how much variation it’s worth thinking about here). Armouries are most certainly not decoration and will contain huge numbers of weapons if you can gain access to them, but will be well-guarded. Officer Quarters will contain high-ranking military officials, and possibly some expensive items too. Hospitals will contain a range of healing items and those able/willing to heal you for a price (or if you are a close ally of the civilization), and Stables, funnily enough, will contain lots of horses (though I am still working out how exactly riding is going to integrate with the rest of the game). There will also presumably be patrols moving around the outside ring road of the district in the future.

I tried hard to make each building recognizable by shape, which is something I’ve already been putting a lot of emphasis on with the different kinds of special building that spawn in housing districts (banks, theaters, arenas, etc). In this case stables are all right-angled shapes, barracks are a 9×7 grid, hospitals are more uneven, organic-looking lines and branches of building, officers quarters are a loop than encloses an area within it (or sometimes two areas), armouries are either octagonal or a number of octagons with a large gate at the front, while catapults and archery targets have distinct characters by which they can be recognized. The circular buildings – there is one in the top-left near the central fort, and one within a loop of road in the bottom-right – are the buildings that house training NPCs.

However, military districts have two restrictions on your entry – they are expensive to enter, and you must be very friendly with the civilization in order to gain access (or be playing as the player class which allows you to try sneaking into districts, though I am still figuring out the exact mechanics there). Starting in a civilization with a military district will therefore be a significant early-game boost, though I will try to balance this by giving significant value to non-militaristic civilizations too. I’m currently working on the lookup images for these new items. We already have archery targets:


And I’ll get siege weapons done soon enough. Along with city centers and upper-class housing districts, I want entering military districts to be a significant investment that makes you think about whether it’s worth it for what you may find inside. However, these – along with markets – will be arguably the most valuable districts to explore, although market districts are deliberately free to enter. If you’re low on money you can always check out a market district (assuming you can get to it within the city), but you’ll have to think harder about entering those other districts. So, all that remains to be done here is siege weapon lookup images which I’ll probably draw this week, and then as everything else we need some appropriate door graphics, but otherwise they’re done for this release. Once I’ve got them finished off I’ll be working on city centers, at long last. I’m anticipating a 0.6 release somewhere around mid November, which is also when I hope to finally start my full-time development year. In the real world I’m currently house-hunting (at last!) and hoping to move at the start of November, and once I am settled in the new place, that’s when the full-time year starts. Updates as and when…

Glorious October Cities

I’ve spent most of this week URRing, which has been a nice break (I’m waiting on a lot of PhD feedback from my supervisors, so rather than twiddle my thumbs, it made sense to get some coding done). Hoping to start full-time year at the end of this month, or possibly the very start of next month, depending on how fast I’m able to move house. In the mean time I’ve been working partly this week on finishing off religions for this next release, but mostly on cities. As a whole I’m past the 3/4 mark on 0.6 (after which no release will ever be this large) and there isn’t that much which needs finishing off. The largest part of what still needs doing is city centre generation and military district generation which I haven’t even touched yet, and then a large number of smaller things – improving market generation, finishing off hunter-gatherer settlements, a few issues with world/map generation, etc. Docks are going to be closed this release since they require integration with a number of other factors – the movement of ships, ships docking (so handling multi-tile “creatures”), departure/trading schedules, etc – so they will appear probably in 0.9, as I don’t want to code part of them, leave it for half a year, and then come back and have to figure out how the hell it all works. Anyway, this week’s stuff:

Firstly, I added a lot of variation to religions based on the discussions in the previous blog post. Religions now have four special factors, and some religions will have none, one, or all four of these factors. These are a unique feature (festival, pilgrimage, animal sacrifice, etc), an exclusion (a particular type of weapon they consider heretical and cannot be used if you worship them), the punishment for leaving that religion (none, excommunication, open hostility), and then a list of other religions, if any, that they consider heretical, and whose believers they are hostile to. Here’s an example from the in-game encyclopedia:


Aside from that, the major thing I’ve worked on this week is the city exploration screen. If you’re on the world map and you move into a city, the screen changes from this:


…into this:


…which is quite a complex screen when you first see it, but there’s a lot of information that needs to be stuffed in there without compromising on clarity (as much as possible). It displays the nature of each district (the characters in the corners, [, $, 1, etc), whether you are currently in it (displayed by a lighter shading, the @ symbol, and the arrows on the edge of the screen), and most importantly, the cost for entering that district. This is the first aspect of the strategy layer of the game and the use of the player’s time and resources. The cost is shown in this picture in the nation’s currency – some nations only have a single currency, whilst others have two levels of currency like most real-world coinages. The “this city is not populated” message will only be there until coinage and NPCs are implemented, of course, but I thought it was important to be clear for 0.6 on this point.


The sidebar display a load of information about the city. The top text will describe your relationship with that nation, and therefore whether you are given discounts or charged extra for movement, and below that how much of the appropriate currency you have. Movement within your capital is totally free, however, as is any nation you are closely allied with. Then it tells you what district you’re in, and lists all the buildings you know of within that district. All districts within your home city will start explored, whilst you will be able to purchase maps to other cities, or ask for directions to specific buildings when exploring abroad. For the next release or two currencies are not implemented so your movement will be free, but in either 0.8 or 0.9 currencies, and currency exchanges, will appear. I’m looking forward to generating the images for the currencies too, as there’s a very cool selection of possible coins in there.

Other stuff:

– All castles, graveyards, crypts (below either graveyards or cathedrals in theocratic nations), taverns, arenas, jails, theatres and asylums now have full (and pretty awesome) name generators. Fancy visiting Blackwish Bastion, Whispering Orchard Necropolis, the Sepulcher of the Golden Bones, the Tankard and Dragon, Boneblade Fighting Pit, Slate Palisade Lockup, the Theatre of the Choleric Faces, or the Tranquil Gate Sanitarium?

– Some cities which don’t have enough roads going into them now gain extra gates so that you can always access them from various directions, and these are shown on the world map.

– Player stats have been updated to reflect the upcoming combat mechanics – you now possess strength, dexterity, endurance, perception, finesse, and marksmanship, two of which will determine your skill with each of the six types of weapon (slashing, long, heavy, short, bows/crossbows, and gunpowder).

– Marshland is fully implemented and hunter-gatherer settlements, towns and city districts all generate correctly on them, allowing for pools of marsh water without jeopardizing pathfinding.

– An early draft of religion-spread mechanics has been implemented; any civ that believes in “Religious Freedom” as their policy will have the religions from all neighbouring civilizations reflected, including those they neighbour with a colony, rather than their main body of land. This then determines which buildings spawn in religious districts, and they are described in the city view screen appropriately – “a Stupa of the Six of the Leaves”, “a Church of Her of the Mountain”, “a Chapel of The Thousand Divines”, etc etc.

– I fixed a bug causing towns to generate large circles of road in the middle of the ocean.

The Thousand Religions of URR, Part 2

Kept working on religions this week in my spare time. I abstracted out the religious-building-generation into its own function, and can now be used wherever I need it. In addition to these rare religious districts in “religious freedom” civs, I’ve also figured out how religious buildings are going to be distributed elsewhere in feudal civs (nomadic civilizations never have a state religion, whilst hunter-gatherer civs always have their own unique beliefs). There are five religious policies, and each places religious buildings differently (in addition to having other specific buffs for the player character, but those aren’t relevant just yet):

Religious Freedom: cities have a single, well-organized district for religious worship; towns will have a single random religious building chosen from all the religions within that nation. This means finding a religious freedom civ early in the game might give you a chance to encounter a lot of other religions earlier than you otherwise might.

Cultism: These civs have no religious buildings in them whatsoever, but the secretive cults (which will be making more of an appearance later) will be much more likely to have a presence around their cities/towns. Religious worship wouldn’t be banned within the home, however.

Collective Faith: I decided to make this and “Organized Religion” into opposites; collective faith religions have a religious building in every town, but only a small number in their main city. I wanted to get a feeling that this was slightly more of a ground-up religion, perhaps without too much wealth at the top, so it’s distributed well through-out the nation.

Organized Religion: By contrast, Organized Religion civs have a religious building in every middle-class or lower-class district within their capital, but no churches out in the far-flung reaches of their nation (causing those people to probably result to quiet worship, idols/shrines in the home, etc). Wanted to emphasize the centralization of this religion in this case, and that it’s a religion very focused around the nation’s capital.

Zealotry: Civs with the “zealotry” religious policy go all-out: they have a religious building in every housing district and in every town, and no religious buildings from other civilizations are allowed anywhere within their borders.

Here’s an example of a town with a religious building in:


…and, since I’ve been working on it, a town in the marshland (though totally unrelated to all this religion stuff, I just wanted to show off this new and very rare terrain type)…


…and a lower-class city district with a religious building, a tavern and some slave quarters…


…and a middle-class district from the same city with a park and a religious building (in this case with a road around it, and some flower/vegetable beds):


As an aside: I intend to have it spawn trees in the “gaps” where it cannot fit middle-class houses, but I just haven’t got around to it yet.

There’s also now a bunch of variables for religious buildings, primarily whether walls spawn around them, whether roads spawn around them, and whether vegetable/flower beds spawn within their walls/roads. Currently in a religious district they have walls, in middle-class districts they will have roads, in lower-class districts they will only have roads if they intersect a main road, and in towns they will have roads; they will have vegetable/flowerbeds in middle-class districts and religious districts, but not in lower-class districts or towns. This means that even though the church structure for each religion is the same each time (picked from the 1000+ variations mentioned last time), each actual iteration will always look a little different. My objective now is to finish off adding some variety to religions – in the comments in the previous entry it was suggested I add unique identifiers like festivals, likes/dislikes of other religions, pilgrimages etc, and I love these ideas, so they’re going in – then religions will be pretty much done for this release. I’ve also been doing some bug-hunting this week and a lot of bugs to do with placing city gates, handling roads and slums/graveyards, towns generating on rivers and handling unusual cases of combinations of coasts and cities have been resolved. Until next time, internet friends!

The Thousand Religions of URR

Made some big thesis progress this week so decided to give myself two days off. Half of this time was spent making something that will have to remain secret for now (but holy crap guys, it’s awesome), and the other half was spent working on religious buildings. I’ve been putting these off for a little while because the method I wanted to use to generate them was a little bit daunting, but I decided the time has come.

So, in keeping with my objective to give everything in the game a totally unique generation algorithm and therefore make my workload infinitely greater (and, y’know, make the game look better), I decided to try something new with religious buildings. They are created in a modular manner. Each religion chooses a unique layout for its religious buildings (and also a unique name, so you’ll get churches, stupas, pagodas, monasteries, convents, etc) and this consists of a central component and a number of peripheral parts to the building. The central part of the religious building has a number of points where extra parts can be “attached”. There’s somewhere in the range of fifty cores to these buildings (each of which will have unique generated interiors in the next version), and around fifty attachments. Some attachments can only go on some cores, so there’s a little over a thousand possible religious buildings. Each religion will always have the same type so the player may come to recognize them as the game goes on. Whereas most cities have their religious buildings scattered around, some cities have religious districts like this one:


So, in this case we have nine religious buildings; this is from a nation with a lot of religions. Only nations with the “Religious Freedom” policy will have such a district, so it’s pretty rare. Other nations will place their religious buildings in other districts – a “Zealotry” nation will have a religious building in every district and have no room for other religious buildings (much like those with “Theocracy” leadership), whilst some might have religious buildings in city centres, or in a small number of districts, or throughout the countryside in towns.  In a “Collective Faith” or “Organized Religion” civ, for instance, you’ll have religious buildings around most districts, though OR will be a little more centralized/organized than CF. Some nations will therefore have many religions represented, some will only have few, and in 0.7 you’ll be able to walk around inside these modular buildings and steal the holy cheeses, or whatever one may find inside. The district is not 100% finished – some of the edge roads need shortening, for example, and I need to work on generating some things within the religious building walls –  but it gives a good impression of the final product.

The last thing to do on religions for this release is to handle the spread of religions so we know which are represented in which cities, and therefore which religious buildings should appear where. I’ll probably implement a simple version of this for this release, and then in later versions possibly allow you to the spread of each religion on the world map, or at least give the player more information about it. I also fixed a bunch of bugs to do with roads I hadn’t really noticed before, stacked up a bunch of other things to fix closer to release, and started to seriously think about how docks were going to work before realizing I needed to do a lot more research first on how the hell 17th-century ships actually docked.

Speaking at ProcJam 2014

Just a quick one this week. I’m an invited speaker for a series of talks on the first day of the Procedural Generation Game Jam happening this year, headed up by Michael Cook!

This day of talks is on the 8th of November and the current plan is to have it streamed on Twitch. Tickets are going to be available soon, so if any of you live in London or can make it down, come along! You can read more about the game jam here, and the tumblr blog for updates is here. The jam is a week-long and there are seven or eight speakers lined up; one of the other speakers who hasn’t yet been announced will also be very familiar to those of you who follow your roguelikes…

The working title for my presentation is “Managing Size, Scope and Scale in Procedural Generation” – I’m going to talk a bit about how to manage a project of URR’s size in regards to two main themes. Firstly, the programming side – what kind of data structures can you use to handle all these different scales of information, from the histories of entire civilizations down to what items people have in their homes? How can you have the game link everything together from a battle between two civilizations, to who fought in it, to what weapons they used, where they were buried, where you might find that weapon, and what meaning others might attribute to it? The second half of my talk is going to be about this same issue but from an artistic/creative standpoint – what’s the value of having a game which holds data at all these scales, and what kind of interesting gameplay mechanics can you create with it?

In other news, still aiming for next month for beginning full-time development. New obstacles are arising as ever, but we’ll see how it goes, and PhD-finishing-work is proceeding at a damned good pace now. More updates as and when…