Clothing, Characters, Inventory, Faces, Genetics, etc

Other stuff to read

Before we start this week’s entry, I have some other stuff you might all like to read! This week I had a piece published at First Person Scholar about the intriguing player-AI dialogue which develops in the danmaku game “Warning Forever”, and a piece in Memory Insufficient about the alternate history aesthetics of the Red Alert series. If you’re interested, do give them a read and support those other two sites!

Now, on to this week’s many attractions:

Clothes as Items, and Inventory Changes

Clothes have now been transported out of the file I use for working on the game’s graphics and added into the game itself, and turned into items (with a horrifyingly large number of variables – it took me much longer to integrate them than I expected). When you look at an item of clothing, it tells you nothing except the quality of the tailoring – “ornate”, “well-made” or “poorly made” – and what type of thing it is – “shirt”, “pair of trousers”, etc, and tells you nothing about the nation it is from, as that’s part of the learning/discovery process. Along side this implementation, the inventory system has been changed. Previously there were different keys for each action, so one would press ‘d’ to ‘drop’, ‘D’ to ‘drop several’, ‘t’ to throw’, and so forth; they’d then bring up your inventory, you’d select the item you wanted to perform the action with, and go ahead and do it. However, this meant you only saw the picture of the item when you pressed ‘i’ to simply look at your inventory, and that meant the images were (to an extent) being wasted. I’ve now changed it so that there are only two inventory functions: ‘i’ brings up your inventory, and ‘D’ allows you to drop many items at once (without looking at them). When you now press ‘i’, therefore, and choose an item, a line of text at the bottom of that item lists everything you can do with that item, so you always get to see the graphics, and the range of possibilities for each item is made a lot clearer (so things you can wear, or things you can use in some way, or eat, or whatever). I think this is a lot better, makes more use of the graphics, and tidies up the UI a little (given how many roguelikes use every damned letter on the keyboard). An example of a piece of clothing currently un-worn, and one being worn:

Options

Character look-up

The look-up window for any character (player or NPC) has now been significantly changed and upgraded, and faces have also been moved out of the graphical-testing file and fully integrated into the game’s code. The first page currently shows the face of the NPC you’re looking at (or your own), and lists everything that person is currently wearing (which is visible; rings are “invisible” if they have gauntlets/gloves). The second page will soon show health, but I’m still working (yet again!) on thinking through how health is going to work, so we’ll have to see, and for now it has been removed (and will probably stay removed for 0.8 unless I finally figure out how health will work, even though I know how combat is going to work). So here’s a shot of me (without a first name, so the name up there is my family name), and this time I happened to be in the “scarification” civ. You’ll also notice I’ve made all eyes into a light grey instead of white! The reduced contrast is far less jarring.

Blue man shirt

Browsing clothes

The coolest thing about the new look-up? You can now hit Enter and browse through all the things a character is wearing, using the arrow keys. As you move around the “grid” of things the character has on them, each image then appears on the right-hand side (the first time the right side of the screen has ever been specially used!). For now, therefore, you can look over the upper- and lower-body garments, and boots, but I’ll be working on all non-armour garments in this release, meaning that we’ll be adding gloves, and probably cloaks too, but armour will come next time, and necklaces and rings will come… whenever. Either way, here are some nice illustrative screenshots of this! (With some placeholder first names and surnames…)

Blue man shirt

Blue man shirt

Blue man shirt

NPCs are now spawning

This speaks for itself, really, given the above screenshot. They don’t move, think, react, converse or do anything yet, but they are there, and the game can handle them and draw them correctly, and the player can ‘l’ook at them and browse what they’re wearing. My objective for this coming week before the IRDC is to really crunch and try to get crowd mechanics working to the point that NPCs will spawn and despawn out of the player’s line of sight. As for line of sight and field of view, there’s something cool on that point later down this entry…

Genetics, Culture, etc

I’m pleased to say (and one might extrapolate this from the integration of the facial images) that we’ve now got a model for genetics and cultures spreading around the globe. Genetically the game now chooses large chunks of land for eye and hair colours (they bleed out around the edge, but these screenshots show only the dominant colour in each region; equally, although these are very geometric and unsmooth, that doesn’t ultimately matter, since populations of NPCs in-game will always blend and travel). The first picture shows eye colour variation, the second hair colour, in a generated world:

Eyecolours Haircolours

As for how these work for individual NPCs, basically, each nation has a “core” set of values for their skin tones, eye colour, etc, and that’s based on what values are present in their capital city specifically. Equally, they can also spawn NPCs who might have been born hundreds of miles from the capital, but are still within the same nation. The further you get from a nation’s capital, therefore, the more and more people you’ll see who are born according to the demographics of that particular area, and the closer you get to the capital, the more you’ll see people who look like the people of that capital city. Cultural norms will be maintained however far you go – so people in the capital and a distant colony have the same hairstyles – but visual/genetic markers (eyes, skin, hair colour, etc) will vary as you move around. So if you have a capital city on the far, far east, and a colony of that nation on the far west, and in that colony you might expect 25% to “look like” they came from the capital in terms of eyes/skin/hair colour, most to look “native” to that colony in eyes/skin/hair etc, but they will be visually unified according to their hair styles, other cultural markers, beard styles, clothing, etc etc. So we basically have two layers – the “genetic” and the “cultural” – and these blend and intertwine as you move around the world. Also, different types of civilization have different levels of cultural variety – the open and well-traveled nomads have the most variation within a nation, the small tribal societies have the least, and the feudal civilizations are somewhere in the middle.

Field of View Optimization (at last!)

People have been asking for this for years, so I have finally put some time into optimizing the field of view algorithm, and now you can see basically everything on-screen at one time. Buildings will still have a reduced field of view, and it’ll reduce at night, too, but here’s a screenshot and a gif of wandering outside in the daytime:

Grenery

URR fov

Next Week

Well, the IRDC is in a week’s time, and I’m crunching like mad to get some kind of NPC pathfinding/crowd mechanic simulation going there. It’s going reasonably well, and I think I’ll have something good to show off, but I’ve been running into some fundamental design questions – can NPCs push past each other, for instance, if one occupies a tile the other wants to get past – which have surprisingly far-reaching algorithmic implications for how pathfinding and gameplay will actually play out in the longer run.

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.