• Register
Post news Report RSS First look at City Districts

The procedural generation of Ultima Ratio Regum's city districts, starting with lower-class housing.

Posted by on

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.

Roadmap

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. Until next time you can keep up to date on my devblog, Facebook page, or Twitter feed. The devblog is updated weekly on Saturdays (or sometimes Sundays), Facebook a few times a week, and the Twitter roughly daily. Any thoughts, please leave them in the comments! Stay tuned...

Post comment Comments
Roh
Roh - - 373 comments

Man, watching you release updates on this game is like watching someones odyssey happening. Much has happened. Much more to come. All of it interesting.

Reply Good karma Bad karma+4 votes
UltimaRatioRegum Author
UltimaRatioRegum - - 307 comments

Thanks for such a nice comment :). It's actually pretty exhilarating to be working on settlements now and seeing these huge things start to come into existence!

Reply Good karma+2 votes
LonelyKnightess
LonelyKnightess - - 841 comments

Oh man it 's beautiful, I can't wait to terrorize it.

Will districts have a difference in guard presents? Like wealthy ones will have well armored guards constantly patrolling and ensuring no beggars take hold while the slums have abusive drunkards or no guards at all?

And how far are we going down the ethical rabbit hole? Will children be represented?

Reply Good karma Bad karma+4 votes
UltimaRatioRegum Author
UltimaRatioRegum - - 307 comments

Haha, thank you! I hadn't considered that guard idea, but I rather like that. Once NPCs start to appear (a release or two away?) I'll think about how I want to depict that. Re: children, I haven't decided yet (of course DF has children), but I am leaning towards no. I'm cutting out a lot of things that have simulation value, but no gameplay value - for example, mills in cities, or schools, or food - so I think children will go the same way. Probably.

Reply Good karma+2 votes
LonelyKnightess
LonelyKnightess - - 841 comments

Happy to help.

Also I have to disagree with the lack of good. That means no real sieges, managing towns gets incredibly simple and worst of All, I can't play as a fat monk who beats people with a hunch of ham.

Reply Good karma Bad karma+1 vote
Cristiano.b.
Cristiano.b. - - 107 comments

Are u planning on adding jumps?
Because it would be very cool to jump from one roof to another (if they where 1-3 tiles close, of course)
(it would turn into an assasins creed ASCII but it would be very cool) XP

Reply Good karma Bad karma+1 vote
UltimaRatioRegum Author
UltimaRatioRegum - - 307 comments

Interesting question! I haven't decided yet. You can climb, currently, but I actually plan to disable climbing for cities (it was causing way too many level design issues that I just couldn't resolve). However, if you can find your way onto the rooftops by another method, then - maybe. We'll see!

Reply Good karma+2 votes
Bl4ckM4n22
Bl4ckM4n22 - - 7 comments

So will you be one person in this game or will you be controlling an economy like a simulator?

Reply Good karma Bad karma+1 vote
UltimaRatioRegum Author
UltimaRatioRegum - - 307 comments

You are the '@' in the top image :)

Reply Good karma+1 vote
Guest
Guest - - 687,512 comments

This comment is currently awaiting admin approval, join now to view.

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: