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!


Be Sociable, Share!

16 thoughts on “First look at City Districts

  1. Pingback: DevLog Watch: Gastropoda, Gangster Tactics, M.I.N.T. | Rock, Paper, Shotgun

  2. I like this a lot, just the idea of running around through the different cities, catching sight of graveyards that link to great battles in history and having it all be random every time you start a new game is amazing to me.

    • Thanks! Even though only a few of the districts are generating so far (and without any special buildings) it’s already really exciting to walk around them and grasp some of the size and scope of the game. I’m massively looking forward to putting this release out there!

        • Ah, the Ultimate Question. Hmm. Well, I’ve been working on this release for around a month and a half now and I’d say less than half is done, but I’ve been travelling a lot recently – a good 30% of the last month I haven’t had any days to really sit down and code. I’d therefore say some time in July is an accurate guess. I’ll be aiming for the first half of July, but especially with the edits for my thesis coming up in June, I can’t see it being earlier than that. Definitely before August though!

          • Awesome sauce, really looking forward to it. Good luck on your thesis!

  3. This looks awesome, I’m just curious how you will keep the variety with the huge number of buildings in each district. I know NPC’s come later but would you be willing to clarify a bit on how you want to handle populating areas with people and things to look at? How are you going to keep every NPC from saying the same few things?

    • Cheers! Ah, well, you raise an interesting question. Two questions. For the first one, there will be standard buildings and special buildings, and special versions of special buildings. So take a lower-class housing district – naturally lots of not-very-impressive houses. There will often be other buildings like prisons, asylums, sewage works, etc (though not buildings that I cannot find gameplay value to, like mills, for instance). Rarely there will be a huge unique version of one, like a prison that takes up most of the district and is otherwise surrounded by lower-class housing. Re: NPCs, there’s so much to be said that it deserves a full blog post rather than just a reply, but I’m working on an interesting model for both populating the city and, as you rightly say, trying to prevent everyone from saying the same thing. Sorry to keep you on a cliffhanger, but it shouldn’t be too long until I do a full piece on NPCs!

      • Sounds amazing.

        Just thought I would mention, as cool as this all seems, I wish that the arrows in cities to show that the walls are above the player weren’t displayed. It would look much nicer if the walls were just the same brick used in dungeons. Also, wood doors, it looks like the low class district is a bunch of prisons!

        • Ah, interesting – I have to admit I actually rather like the effect as you’re walking around, but I see what you mean (and maybe that’s just because I’m so used to it!). Ha – the “barred door” symbol is used for all locked doors (apart from gates, they have different symbols), but I’m using white instead of wood colours for everything. I previously used different colours for doors, but people reported difficulty visually identifying them, so I decided it was best to just make them all white.

          • Ha, no worries: alas, there is no update this week as I’ve been travelling so much I just don’t have enough to merit a full update. Should have a big one for next week though : )

    Where are the updates?!
    Don’t even think about leaving the Develop, you beautiful motherf*cker…

Leave a Reply

Your email address will not be published. Required fields are marked *