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:
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.
Next 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!