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!

 

Graveyards

This week I’ve made a lot of headway on generating graveyards and have started to generate the graves as well. Graveyards generally have one main entrance (this can sometimes be two, with the other on a different side of the graveyard) then a selection of interconnected areas. As with everything in the game, this is a completely new form of generation that isn’t used again in any other kind of settlement or area – I wanted to give it a feeling that the graveyard had been built up over the time, and that different areas placed graves in different patterns in various eras (note the various patterns for grave placement), whilst farms/towns and everything else have their own algorithms behind them. In a way, I suppose I want to almost “hide” the fact the game is procedurally generated – I want each area to look sufficiently unique that one can be fooled into thinking a region was hand-made. I also have begun to fully implement the generation of architectural styles (brick styles, colours, etc) for each civilization, so the colour of bricks seen here will be unique to this civilization. The road does not yet connect properly with the graveyard, but that is being worked on, whilst the tiny closed-off section of grave in the top-left corner will be removed during generation once I’m finished. Anyway, graveyard:

TerrainTest

As for the graves, there are twelve different headstone styles, twenty different “base” styles, thirty different patterns (the little flourishes on the grave, like spirals or diamonds or whatever), and each headstone style may be undamaged, slightly damaged, or heavily damaged. A zoomed-out picture of all the headstone variations is shown before, but once you include the number of possible patterns and bases, there are over 20000 possible graves, more than enough to service any playthrough. I’ll soon be adding a little bit of moss and general overgrowth at the base for the older graves.

Graves

The graves note three things – the years the person lived to and from (the date of birth may not be known, and older graves are more likely to be damaged), their name, and – if appropriate – what they died of (so naturally with these three aspects, the permutations are almost infinite). Obviously things like “He died of a horrifying wasting illness” would never be mentioned, but things that most would think merit commemoration, like falling in battle, or a duel, or whatever, might be mentioned, along with graves relating to important historical events like disasters. Thus, importantly – and rather nicely I think - these now link up to the histories! If you see a civilization fought in a particular war, you can check out the graveyard by their capital (and likely the minor graveyards in towns) and, indeed, find people to died in that war within the years that war was fought. Ditto for diseases, civil wars, whatever. I’m still working on thinking about tombs, catacombs, ossuaries and the like for wealthier people, rulers, etc. There is a good chance that graveyards which have catacombs below (which may not be all of them) might connect to the subterranean regions of the game (in the future), but these are still early plans right now.

Equally, as with all the history stuff, this will later have gameplay repercussions – maybe you hear somewhere of something buried in a particular grave, or in a particular tomb or ossuary? Or possibly that a particular set of graves are in a particular pattern that has some deeper meaning? As with other things like this relating to the in-game histories, you’ll always be making a choice: do I have the time to explore this little side-aspect whilst you’re passing through a city, or do you need to continue? The overall global clock (which I know I haven’t said anything about yet in detail) will give you time for some side exploration as these explorations of the world will be key to building up your character, but it’ll be up to you to decide which you can/cannot risk.Graveyards as a whole will also serve other functions. Maybe particular cults, religions, smugglers or other individuals might meet there? Perhaps there is treasure to be grabbed from any remaining tombs?

So there you have it. Next week’s blog entry could be at pretty much any time since between the 8th and 12th I’m in Berlin for the International Roguelike Developers Conference! Thus, the next update will either be whilst I’m in Berlin, some time a bit before, some time a bit after, or SOMETHING ELSE. It will likely be on slums and the early graphical generation of keys, and possibly something about the system of keys/doors/civilians I’ve been thinking about for a little while now. See you all next week (at some point)!

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.

Cities

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:

Districts

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.