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:

NewS

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:

Target

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:

Transit3

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:

Transit1

…into this:

Transit2

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

Transit4

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 Value of Maps

In Alpha Centauri (and previous Civilization games) you are able to trade maps between players. These maps are effectively a list of tiles that the other player has already discovered; once the trade is complete, your map is updated and all those tiles become visible and roll back from the fog of war. Although normally a matter of trade, in AC a “Defensive Pact” with another player yields regular updates – in this instance acquiring a map from another player becomes more like a gradual incremental uncovering of the map, rather than a one-off discovery of their land and any exploration they’ve carried out. Regardless of the method, though, you are able to transfer information between players about the world, and I’ve recently been wondering about how these games try to quantify the value of these maps, and what this means for buying/selling/trading maps in URR in the future.

SMACx-DiploScreenshot1

When you trade with other players in AC you have a range of things you can trade. You can decide to exchange money, technologies, votes on the planetary council – and, potentially, your world map. The world map of you or the other players is an item just like any other. You can offer to trade your world map for two technologies, say, or see if they’ll agree to give you their world map for five hundred credits. Something that has always intrigued me is that this is the only case where player information – the location of their cities, disposition of their forces, etc – is traded on the same screen as in-game resources such as money or technologies. The world map doesn’t speed up your technologies or allow you to purchase more items, but it does give the player, not the army you play as, important information. It is as if you give the AI some in-game items and in exchange they give you a hint, or a tip, or a clue towards solving a puzzle.

This raises the fundamental question of this post – how can we value a map? Can we try to quantify the kind of information given by a map? In Civ/AC games, to the best of my knowledge, the value of the map is determined according to how many tiles have been discovered. The more tiles, the more valuable the AI considers the map to be, and thus the more they will demand in exchange. Naturally, one could consider a dozen other metrics - perhaps a map that shows a lot of coastline should be valued higher, given the strength of naval warfare in almost all Civ games to date? Perhaps the value of trading the map should be modified by international relations; trading a map to an enemy should, presumably, cause the AI to demand much more than giving a map to a trusted friend?

Equally, though, this still requires the map to be quantified. One thing I think that impacts the value of this map is something that cannot be defined within the game’s code, and this is the skill and knowledge of the player. I would suggest the more skilled the player, the greater advantage they will be able to gain from acquiring a map of enemy territory. The more they understand about the game’s mechanics, the more useful the map is. Consider two players: for one player, the map might only have the value of telling them where on the map the enemy empire is, and they just charge their units into the breach; a second player, on the other hand, may take the time to figure out where they can attack from, how best to move their units in, chokepoints, which cities are weakest, etc. The more the player knows the potential value of what they’re looking at, the more value that map obviously has, but the computer can’t account for this.

ACmap

The default AC map – for an advanced player, playing on this map makes the world predictable, and negates the value of map data to an extent.

On one level, therefore, the value of the map depends on the skill of the player. This is obviously true to anything in a game to an extent – an item will be of more use to a player who really knows what to do with it – but I think it is particularly relevant with a map. The map doesn’t support your character or your faction, just the player, and that makes it a rather unique trading item.

So what does this mean for URR? I’ve a long-standing fascination with old maps and I’d like to reflect this in the game; if you’re in Civ A and buying maps for Civ B, the distance between the two will affect the accuracy of the maps. Some maps will be spot on, some maps will be somewhat less so. Most maps will have an accurate representation of who lives in those lands, but perhaps some maps will speak of entirely fictional lands, or rulers who’ve never existed, or lands where strange creatures roam?

Prester

A map supposedly of Prester John’s “abyssinian” empire, i.e. roughly about modern-day Ethiopia.

You’ll probably be able to purchase maps in stores in 0.8 or 0.9 once NPCs and conversations and whatnot are implemented. My current intentions are:

- A range of different types of map. You might be able to buy maps for districts, for cities, or for nations or chunks of land. The different scales will be reflected in the prices of the map, and the proximity to where you are buying the map for; you can presumably buy maps for City X when you’re close to City X, but distant nations are unlikely to sell them (unless the trader happens to have found such a map). I may also add some unusual types of “map” that show you a full road, for example, or highlight a mountain pass or a naval trade route, but we’ll see.

- Their value will vary (which brings us back to the questions posed by Alpha Centauri). Naturally this is one of those things that requires playtesting, but the larger map = higher cost is a logical opening point, and different price ranges for world, city and district maps. I will also be implicitly assuming that the player is aware of the value of maps and pricing them accordingly; the strategy layer implemented in a few versions which will focus around navigating your way around the world will be greatly assisted by maps, and this makes their value significant.

- You will not inherently know WHERE a map fits into your world map. By this I mean if you get a 7×7 map of land, you don’t know exactly where that land fits into your world map. Maybe the trader tells you that land lies to the west, but how far to the west? And are they even right? There’s thus a tiny “minigame” (for lack of a better word) in recognizing when you stray onto land that is depicted on a map you have, and it also allows for an interesting class trait (once these are implemented) – the Cartographer class will automatically know where on their world map an acquired map item should be located, which is in keeping with my desire for classes to give you one unique and significant ability that isn’t to do with combat, stats, etc.

- As above, some maps might be inaccurate. The more distant a map you buy, the more likely it is that some falsehoods will have crept in. Given the emphasis of the game’s themes on truth/fact/reality/falsehood etc, I think this will be interesting, and lend an added impact to discovering the world – is this what I thought it would be? How certain can I be of the nations that lie in the undiscovered shroud of the world map?

I’m very much looking forward to making maps; I think they’ll be very interesting in terms of both gameplay and the kind of procedural graphics I have in mind for generating them. Their future implementation is what got me first thinking about how to try and quantify the value of something like a map in a game, and it’s certainly possible I’ll wind up rethinking this before maps are implemented. Until next time, internet friends.

Early August Update

This is the first development update in a couple of weeks. I’m still primarily working on my thesis in the hopes of finishing before the end of September, at which point I’ll be starting the full-time development year. Nevertheless, I’ve managed to snatch a little bit of time here and there to code and keep things ticking over.

Fortresses

I’ve done a few more fortress archetypes. As mentioned before, there are twelve “shapes” fortresses can generate in total; each civilization chooses one, and there can never be more than five nomadic civilizations, so it’ll be a long while until you see each archetype (not to mention, obviously, that each instance of each archetype will generate differently). I’ve thrown together the “Pentagon” and the “Double Fort” algorithms, and here are a bunch of screenshots. Fortresses are really interesting to walk around – they definitely evoke a very different feel to towns or cities or settlements. One thing I’ve found to be a very good idea is to really emphasize difference in procedural generation – sure, in the real world, a “castle” and a “fortress” may be very similar, but by placing one at the core of cities and giving the other to nomads, I’ve emphasized the differences in each one to create two totally different kinds of structure. Even though they lack NPCs yet, walking around the four different types of population centre (cities, towns, settlements, fortresses) all feel totally, totally different (which was exactly the goal) and I can’t wait to see what everyone else thinks once this release is out. Some fortresses are more or less militarized than others; some have larger or small markets, or housing, or defenses; some are more open, some are more closed and more challenging to navigate. There’s a great amount of variety, and they all also handle rivers in different ways, leading to some really interesting maps (which have been challenging to make ensure walkable generation on)…

Double

Double2

Hunter-Gatherer Buildings

I’ve thrown together the generators for the textures of all the different building materiasl hunter-gatherer civilizations might use. Whereas feudal civilizations use variations of bricks and nomadic civilizations sometimes uses bricks, or stone, or drystone walls, hunter-gatherers are forced to be a little more resourceful. There are currently sixteen different materials, each civilization will choose a different one (a couple are tied to particular climates) and they won’t repeat, so you’ll have a wide variation every game. Here’s an example of the outcomes of each of the generators for the different materials. Going left-to-right and top-to-bottom, these are “logs”, “leaves”, “wood”, “stone”, “bones”, “mud bricks”, “snow bricks”, “interwoven sticks”, “mud”, “drystone”, “thatch”, “wattle and daub”, “rope”, “bamboo”, “leather”, “fur”:

HG Building

The materials have no particular gameplay difference, but they do lend a nice variety to the hunter-gatherers, especially as the way they are displayed in-game varies according to the colour of each texture. HG civilizations are now looking rather more complete than they were before, and the other reason for this is the introduction of standing stones.

Standing Stones

Different religions worship in different ways; some have big idols, some might have small totems in the houses of worshipers, and so forth. Some hunter-gatherer civilizations have standing stones in the middle of their settlements as the focal points for worship. Each of these is a different shape, contains a symbol of the appropriate religion, and… some other text, in an ancient language. In future versions this text will be one of many clues around the world to help you find your way through the world’s mysteries, and will be one of several reasons you might consider visiting a hunter-gatherer settlement you pass on your way to parts unknown.

SSs

NEXT UP:

The next three entries will probably be the other games criticism entries I discussed before, then we’ll have a roundup of some more code at the end of August/start of September. By then I should have more of the fortress archetypes done (maybe all of them?) and maybe some more city districts too – military districts might be next on my list, though I think I also need to make some changes to market districts; playtesting them by myself suggests that they might need to be a little more contained and a little less open to make them more enjoyable and more understandable to navigate. The plan thus remains: I’m working hard to finish my thesis before I move house in late September, and then to start the full-time year of development in October, with the intention of releasing 0.6 – admittedly the biggest URR update ever, since it is generating every town, city, fortress and settlement – within November.

First look at City Districts

Although I planned to spend this week finishing off graveyards and beginning work on settlements, I found myself working on cities instead. For starters I’ve now got it generating city walls both on the exterior of the city, and between districts, and connecting these logically with roads and rivers outside the city (rivers inside the city may have bridges going over them). Exterior gates are now present which you can pass through to gain access to the district of the city they connect to. One this system was in place, I’ve started with generating the actual districts themselves, and decided to begin with the lower-class housing districts, partly because these were the most similar to slums so I could use some of what I’d learned there, and also because a smaller percentage of the buildings there are going to be special/unique, so it seemed the easiest start.

Below is a screenshot of the player wandering around a lower-class housing district, having just come through a gate from another district (the large white door below the player). You can see a number of connected buildings, each with a single locked door. I have to say, just walking around these city districts is incredibly exciting. Even though there are no NPCs wandering around yet and you can’t get into buildings, it feels very dense and very like you’re wandering around a game now, rather than a world where a game is being developed. As part of this I’m also carrying out a major overhaul of how saving and loading works – to prevent larger file sizes causing slower load times – and, in turn, of how doors and interiors work. The new system is almost so laughably simple I’m ashamed I didn’t create it a year or so ago, but there you go. This will allow interiors to be made and handled on the fly, so that these interiors don’t have to be made until you actually need them, and will create a far superior database structure for the future. It’s not exciting work, but this kind of optimizing I try to do each release goes a long way to preparing the game for the future. If I still had the data structure now I had two years ago the game would have slowed to a halt, and this big change is another step along that same path. Anyway, here’s the district as seen in-game…

TerrainTest

… and here is a debug screenshot of how the map looked after I’d explored roughly a quarter of this one district (click to view full, I think it is worth it):

145x90_Ex

I’m still working on the exact mechanics for moving between districts, but as mentioned in previous entries each district will be distinct. Some might spread over two or even three map grids, in which case you can move between them without going through a gate, but otherwise you need to find yourself a gate (on the edges in each grid) and pass through them. In later versions some may be guarded, or locked under certain conditions, and I hope to have the regions of the city you have access to partially determined by your relationship with different factions in that city.

The next picture shows a quick floodfill on all the tiles of the map that are not wall or buildings. As you can see we get some central alleys where the main roads are, and then a fairly complex web of pathways outside from them. Do note there is a difference here from the slums I showed a few weeks ago – the paths here are straighter and longer, and rather more regular, whilst the buildings are generally a little larger and there are generally two tiles of gap between buildings rather than just one. Also the map below does not show any special buildings that may spawn in lower-class housing districts – such as black markets, prisons, slave quarters (if the civilization is a slaving one), asylums, and other goodness. I’ve been composing quite a list of special buildings for each district that can integrate well into the dense world lore the game generates (and that serves as your basis for exploration and sidequests), and these are some examples of the special buildings that will appear in these districts.

RoadmapNext week… I have no idea. Probably more city districts, though it’s not impossible I’ll be doing some work on settlements or finishing off graveyards instead by then (the system for connecting graves to histories is working, but needs tweaking to ensure all histories are “caught” by the system). Equally, I might be doing a lot of under-the-hood work this week to implement that new saving/loading system, which is one of those coding tasks that should be relatively simple but will probably take a fair bit of time to complete. Or something else! I’m reaching the point in the release where the number of aspects I have ongoing are spiraling outwards, which will be the case for the next month or so before I start to bring all the strands back in. See you next week!