Markets, Farms, Towns, Settlements

I’m thoroughly back into the swing of coding now and have been making significant progress on 0.6 this week. Today’s update is therefore very screenshot-heavy, and focuses on four things – market districts, farms, towns and settlements.


Market districts are now finished. They generate a large number of shops, a warehouse for each of those shops (each of which will have a key located somewhere, or in someone’s possession), and an auction house and a currency exchange (the ‘+’-shaped building and the octagonal building respectively), though I am still figuring out the exact mechanics for auctions. They can now also handle rivers and various road layouts correctly, and all the shops spawn with shop signs on them so you know (assuming you can deduce the meaning of the symbol!) what kind of shop it is. Here’s one without a river and with the warehouse districts quite spread out…


… and here’s one with a river. Note that only the largest roads are turned into bridges for crossing the river, and due to the placement of the major roads, the warehouses are clustered in the upper-left corner.


I’ve also taken the graphics for shop signs out of my graphics file and integrated them into the game, as well as finishing off a few final signs I hadn’t sorted out (like those for auction houses and currency exchanges). Each market contains a lot, but you won’t be going back-and-forth to the same district over and over; once the story is implemented and you know your objectives, I wouldn’t expect you to visit the same market more than a couple of times at the most, but therein lies another strategic decision about returning to the same market for an item you couldn’t afford last time, or pushing onwards. Anyway, with this graphical integration you can now look at the shop sign and get a symbol depicting the use of that shop, as in this screenshot with the player wandering around a desert city:



I’ve finished farms. All graphics for crops and fruit trees are implemented, the generator is now more varied, farmhouses and other appropriate buildings spawned (which will one day be connected to the “sidequest” generation – perhaps a wanted criminal is hiding out in one?) and a few remaining bugs with them have been fixed. Farm generation has also been tweaked a little to make things more appropriate for different terrains and climates, and I’ve started to put in the appropriate data structures required for later handling things like animals in climates where crops might not grow so readily. Needless to say, farms are not exactly a core part of the game, but I think it’s important that even tangential parts of the world are highly detailed. So many fictional worlds (games and otherwise) fall apart on their unexplained aspects, and it’s hard to imagine empires being sustained without some kind of food source…



More progress on hunter-gatherer settlements. They now spawn with an appropriate kind of building material for all their buildings. The settlement below is built from stone, but these materials include wattle & daub, wood, stone, mud bricks, blocks of snow (in polar regions), and many others. In the middle of this settlement you can see the house of the Wolf-Chieftain who ruled this civilization, the town hall (the long building), and also a ‘?’ within a walled-off area. I’ll be talking more about that ‘?’ next week, since as long-time players know, a ‘?’ is always something that can be viewed and read – an inscription, a shop sign, or in this case, a standing stone.



Lots of progress on towns. They now spawn actual buildings rather than lava placeholders (though I am sure some will be saddened by this news), doors spawn everywhere needed, shops now spawn (there’s only a very small number with a limited potential set of shops that can be chosen upon generation), and various other important buildings like town halls, barracks (if the civ is sufficiently militaristic), taverns, small graveyards and the like also generate. One of the things I need to work on next is getting religious buildings to generate, since each civilization’s religion will have a unique generated layout for its churches (or abbeys, chapels, basilicas, mosques, rectories, pagodas – whatever term that civilization prefers). I’ve also handled towns that spawn at the end of a road or spawn on no road at all (very rare), as those were causing a few issues with generating appropriate road patterns when there was no “core” road pre-existing on the map grid to go by.


I’m now going to renege slightly on my promise from last week to  “never predict the next update”, and state that the standing stones mentioned above will definitely be included, though beyond that I’m not sure what else. Possibly some graphics, or another city district if I’m feeling like it. I’ve been doing a lot of draft work on paper to think about how docks and upper-class housing districts are going to generate, so it’s possible one of those will be coming next. Anyway, thanks for reading, and let me know what you think!

Settlements, Crops, Prisons

A short update this week – although I’ve returned from Canada and have no intention of going to any other seven-hour jetlag conferences ever again in the near future, it’s taking me a little bit to get back into the swing of coding once more (and I’ve had a lot of doctorate correspondence and the like to catch up on). So this week we just have a few small updates on a few things, and hopefully next week a much larger one again. I think a fair estimate for this release is towards the end of July or the start of August – it is going to take slightly longer than 0.5, but that’s due both to all the travel of the last few months and this being the final start of my doctorate, but it’ll be worth it. Walking around cities even in their early form now gives an impressive sense of the scope and size of the game-world.

Settlement Patterns

I’ve started early drafting work on hunter-gatherer settlements. They all appear as ritualized patterns of building-placement – you might get one which looks like a spiral, as the one below, or any one of several dozen other shapes (which themselves vary between playthroughs, but broadly confirm to a preset archetype). Each will contain some crucial buildings such as a town hall, housing for their chieftain and a shrine (if their religion has outside worship), and then various others like forms of burial (pyres, crypts, graves, excarnation platforms, etc), later probably some enclosures for animals, etc. They have no “shops” as such – those who trade are simply individuals who will do so from their own homes. I’m still deciding if all hunter-gatherer civilizations will have a barter system, or have their own forms of currency (shells, certain types of pebbles, etc) they use instead. I think a mix could be interesting, but we’ll see. Each also has a different form of building construction – some use mud bricks, some wattle and daub, some blocks of ice (if located in tundra), some use thatch, some use stone, and so on. Here’s an example of one possible layout, though so far lacking much detail beyond just standard buildings and one or two special ones near the core:


One thing I struggled with what a distinct thematic role for them compared to cities, towns and nomadic fortresses. I’ve now settled on something I’ll talk about in more detail in a later entry, but it focuses on the historical myths and legends of the world, and giving out particular kinds of information that might only be available from them. As with all other settlements, of course, they will be connected to the world histories – if a historical entry mentions a great cavern beneath the settlement, that cavern will indeed be there…

District Buildings

I’ve started to add special buildings to city districts. This is just a very early example but should give a decent impression. This is a lower-class housing district which has had a prison, an asylum, a graveyard and some slave quarters spawned in it. Naturally each will have a huge number of designs (with some randomized aspects within those designs), and these designs are just a placeholder, but you get the idea. As mentioned before there will also be some rare, unique, larger special buildings that take up the entire district and are world-renowned (“the world’s greatest prison”, etc), which I hope to show off soon. Although I haven’t yet begun work on them, I’ve figured out how I’m going to get upper-class housing districts to spawn, and I have some ideas for docks and making appropriate room for ships to appear and dock in later releases, so I might work on those in the near future.


Development Plan

I’ve updated the development plan (on the top sidebar). I’ve been thinking for some time about the correct order to do the four releases after this one, and I have settled on what is undoubtedly the most logical sequence based on the dependencies each may have with the other. The next release will focus on building interiors and redoing the interior saving/loading system to make it far more efficient (part of the gradual efficiency-improvement of the overall game as talked about last week); then I’ll be adding NPCs, and then moving onto a release I’m particularly excited about which was basically heavily focus on the strategy layer of the game – currencies, movement on the world map, etc. Depending on how long the NPC release takes (it might be much easier than expected) those might be combined into one. After that, we’ll be onto generating weapons and armour and various other items, and implementing combat for the first time.


On one of my first and most-jetlagged days back I didn’t feel up to any coding, so I threw together the procedural graphics for most of the crops that can show up on farms, and also added fruit to fruit trees. THIS IS CRUCIAL.


Concluding Thoughts

So, things are moving once more, and hopefully will pick up a little bit more speed from here on in. I’m balancing my coding at the moment between settlements and city districts, so it could be either of those next week, or something totally different. From now on I’m not really going to try to predict what I’ll post on next week because, as time and experience has shown us, I basically never get it right.

Shops, Housing, Special Buildings

A fortnight has passed since the last update, marking the first time in quite a while that I didn’t update every week. I’m pleased to say all this travelling is now over and we’ll be sticking with the weekly updates from here until the end of time (or the end of the game, whichever comes first). I haven’t had time to code much this past fortnight but today I’ll be showing off a little more about city districts, talking a bit about special buildings, showing off how markets are currently looking (though there is a long way to go), shop signs (another example of trying to convey as much as possible visually, not verbally), and lastly the Powerpoint slides from my talk at the Canadian Game Studies Association conference I’ve just returned from. So, without further ado:

Housing Districts: I’ve worked on the standard building distribution for middle-class housing districts. Much like lower-class housing districts (and every other) these will be populated with special buildings as well, which I’ll talk a bit about below, but these are the standard looks for this kind of district. Compared to their lower-class brethren, I wanted to make some pretty obvious changes to the algorithm here – more roads and a clearer road system, larger buildings, fewer connected buildings, some more open spaces (especially near main roads), and more trees. I’m now working on deciding what rare buildings should spawn in these areas, and I’m hoping to finish the districts I’m working on currently before moving onto any others, though I confess working on docks generation – especially given its future link to sea travel – is rather exciting too.


I’ve also begun integrating rivers into city districts, which is proving to be an interesting challenge. In some cases it needs to account for where a river is coming through in order to move the doorways between districts; the gates between each sector can be placed in the middle of a wall or on the left/right side (or the top/bottom if a vertical side) and if there’s a river, the river has to take priority. Here are two examples of rivers; as you can see, the in the top picture it needs to figure out how to place bridges intelligently, which I’ll get on to dealing with soon, though the bottom picture works quite nicely. More on this once I’ve got rivers sorted.

TerrainTest TerrainTest

Special Buildings: Housing districts will contain a range of other buildings. Lower-class housing districts, for example, may contain prisons, asylums, sewage works, arenas (if the civilization supports gladiatorial combat), slave quarters (if the civilization keeps slaves), etc. I’m not sure yet what middle-class districts will have, but I’m working on it. Maybe things like theaters, opera houses etc, might be fun if I can think of some clear gameplay value for them and integration with the rest of the game. Rarely a district will have one massive special building – the world’s largest prison, or asylum, for example – which will have significant representation in the world’s history and other information. Next week I should be able to show off both the normal-sized special buildings, and some of the larger, unique ones too (which will not spawn every game).

Markets (early version): One of the next districts I want to work on is the market district. Each city will only have one of these (and will be tied to the strategy layer in a way I’ll talk about some other time), and consists of a range of different things. It firstly places various shops along the main paths through the district – these may be any one of currently thirty-two different types of shop, ranging from a helmet shop to a cartographer, from a gunpowder shop to a botanist, and from an antiques shop to a general store. Some of these shops will also be closed or abandoned, and as time passes in the game other shops may open and some may close. I am still working out (in my head) the exact mechanics that I want to use in terms of shop stocks, restocking (or not), etc, but I think I have a good idea of how this is going to look. It then places some market squares where there will be several shops in the centre, in this case heavily biased towards general stores and certain other kinds of common, useful shop (but again, some may be closed). I’ve had a few very interesting ideas from people about what else I could include in market districts (since you can only have so many shops!) and these will include warehouses with large stockpiles locked away, currency exchange buildings, auction houses (still working on how exactly these function), and possibly guilds in the future if I decide to add them as another form of “faction” one can align to, along with religions and cults. So, in the picture below you can see the shops spread out along the main path through the area and the start of a market square in the bottom-right; next I’ll be adding the shops to the square and then adding the other buildings listed above, and should have a finished market district to show next time.

Market early

Shop Signs: Shops have signs next to their doors to show you what kind of shop they are. These are all depicted with shapes and symbols instead of words (though I confess, the antiques shop is depicted by an ‘A’ symbol). I haven’t yet finished varying the metal part of the sign, but here’s a decent impression of how the signs are looking. The shape of a shop sign is dependent on the civilization and the wood types are connected to what forms of wood grow in that area (so you won’t get taiga-only trees being used for shop signs in a desert, etc). There are currently thirty-two different shop signs, and I may have another seven or eight planned depending on how exactly I decide to distribute information and items between the different shop types.

Market early

CGSA Talk: One of the reasons I managed very little coding this last fortnight was due to travelling to Toronto for the Canadian Game Studies Association conference. This was fantastic – and some people even knew me as the URR person, which blew my mind – and I gave a talk I mentioned in a previous post about the semiotics of roguelikes. I still intend to write this up into a full paper, possibly with a shorter-than-full-paper-but-longer-than-abstract version in the middle, but here’s the presentation slides I used for it. I’m afraid I never write notes for my presentations, but I think you can broadly guess what I was talking about from the context on the slides. Enjoy, and feel free to drop any questions in the comments! The last set of feedback was really useful and helped me correct a few mistakes and focus the talk a bit more. Disclaimer: a small number of colours for a small number of monsters were changed just for ease of viewing on a projector screen. FORGIVE ME, INTERNET. Hit the button to download it:

Next week I will either be talking about city districts some more – probably with a focus on way more special buildings, and maybe finishing off market districts – or hunter-gatherer settlements, since I’ve done the initial stages of generating those but have yet to actually implement it fully, so we’ll see how that goes. Until next time!

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…


… 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):


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!


Slums and Keys

Where last week’s update was focused squarely on graveyards, this week we have a variety of new things. Firstly, I’ve begun work on slums. Some cities will have a single slum tile next to one of their walls (just as some cities will have a large dedicated graveyard in addition to any smaller ones within the city limits) which will contain a huge number of small buildings jammed into a single map grid. Whilst the cities may contain “lower-class housing”, this will be one step “below” even that – those the city does not officially acknowledge, or those who are not even affluent enough to move within the walls. In the picture below you can see an early version of a generated slum. Do please note, however, that there are a) currently no doors to the buildings and b) there will soon be part of the city wall at the top of the image to which the slum will connect. However, from the image below I’m sure you can get an idea of how slums are eventually going to look. It should be impossible for an area of the slum to generate in a “closed off” manner (I think) and some areas are slightly more sparsely populated with buildings than others. The area inside the slum is generally soil – all vestiges of plant life having been long-since trampled down – whilst there are sometimes a few small fragments of roads. As many buildings are connected I’ve had them vary in shade a little in order to make it a lot simpler to distinguish where one building ends and another starts (though obviously doors will help in this!).


I also did a little bit of work on generating keys. Although these will only be relevant from 0.7 onwards once I start to generate building interiors, I’ve been starting to implement small bits of the relevant infrastructure for it up-front. The inventory has changed to have a “Keys” section, for example, and I decided to work one day on generating keys. As with almost every other item the images for keys are procedurally generated, so each key should be unique. There are four “tiers” of keys – unique keys which will have their one special graphics (which I haven’t shown here) and then three levels of keys for all other buildings in the game. The top category of keys are for buildings in city centres, in castles, and other places of wealth and influence; the second category are the “middle-class” keys for buildings you’d find in markets, some parts of docks, medical districts, maybe military districts too; the last row are keys for lower-class housing, slums, many parts of recreational districts, and the like. All three tiers of key shown here have their own sets of possible handle designs (though the top/middle share one or two and the middle/bottom share one or two), while the top keys have their own unique set of “bits” (as the part of the keys that go into locks are apparently called!) and the middle/bottom keys share a larger set of possible bits. Lastly each set has its own possible colour schemes which will give you an immediate hint about the purpose and value of any key you should happen to find.

Keys Gromit

Now I must depart, for I have a flight to catch for the Roguelike Developers Conference; I’ll upload my slides (though they are lacking in text!) once I return. By next week I should have finished up graves and graveyards since they still need some religion-related graves, full integration with the in-game histories, and a few other tweaks (such as making sure trees cannot obscure the entrances, adding a few more entrances, etc) and have hopefully moved onto another aspect of 0.6. I think there’s a good chance I’m going to start working on hunter-gatherer settlements next, both generating the settlements (with another new algorithm) and working on the appropriate textures and graphics to display structures made of stone, wood, bone, etc. See you all then!