This week I’ve been working on two major things – religions and cities. I haven’t totally finished off religions yet so I’m going to leave those for next week’s update, and focus now instead on cities. For a couple of weeks cities have been generating names based on how their civilization likes to name cities (there’s a huge variety of possibilities in this regard – not all city names are just “X+Y” “Winterhome”, “Axehearth” style) but the cities have only appeared on the world map as outlines, produced by the city’s reasonably-organic growth after several centuries of simulated time.
Although generating the interiors of cities for the player to work around are going to happen in the release after the one I’m working on now (currently 0.5, city interiors will see the light of day in 0.6), I decided to work on generating the rough outline of those interiors so that I could begin to fill up the “Cities” section of the in-game encyclopedia with some meaningful information. Thus, cities are split into districts. I’ve done this for several reasons. Firstly it will aid the player in knowing approximately where in the city they want to go for a particular objective by splitting the city into distinct parts; secondly it is arguably more realistic when one considers the kinds of layout post-medieval cities had; thirdly it allows for various mechanics involving the player either being allowed into certain districts, or being able to sneak/fight your way in, rather than having the city as a single huge map; and, fourthly, it allows for some rather aesthetically pleasing city maps. There are currently a range of districts planned. Here’s an incomplete list of what will generate in each district:
Docks: Ships. (Blue ‘D’)
Market: All types of item shop. (Yellow ‘$’)
Recreational: Arenas, pubs, gambling. (Purple ‘R’)
Upper Class Housing: Noble houses. (White ’1′)
Middle Class Housing: Guilds? (Light Grey ’2′)
Lower Class Housing: Jails, keysmiths. (Grey ’3′)
Medical: Gardens, Apothecaries, Hospitals, Fountains, physicians. (Green ‘+’)
Military: Barracks, weapon/armour traders, smiths. (Red ‘[‘)
City Centre: Cathedrals (and equivalents), libraries, government, universities, courts, mints, etc. (Blue Diamond)
Castle: Dungeons, ruler (if Monarchy/Stratocracy), weapons/armour, treasury. (Grey ‘#’)
Religious: Many religious temples, smaller altars, etc. (Lilac ‘^’)
Once I’d settled on this, I needed to get the game generating the districts in sensible layouts. This took a bit of working out because there were a range of variables. Firstly there were some districts cities had to have – such as city centres, and castles, and so forth. Secondly I had to order additional districts, like military or medical districts, in an appropriate order and probability weighting to get them appearing at the kind of frequency I want; thirdly, and most trickily, I needed to make sure districts that could sometimes be viable – such as docks if near a cost, military districts if the civ isn’t pacifist, and religious districts if the civ allows freedom or religion – generated in the right cities, knew which districts they were “more important than”, and generally were integrated into the lists of the generic districts well. Once this was done, I then worked on getting the cities to show in a zoomed-in map the player will be able to view both in the encyclopedia, and when moving between districts. I’m very happy with how these have come out:
Castles and city centres are *generally* close to the middle of the city, but you can get significant variation if the city has grown in a strange shape, existed near a coast where it couldn’t necessarily spread out a lot, or simply if the 1/9 chance (I think) for a castle or city centre to not be at the geographical centre of the city comes to pass. I’m still deciding what other information the encyclopedia should display for cities, but this will be one key part. In later versions city districts will be unknown until the player either explores them for the first time or learns information about that district from some other source, but for now I’ve just got it showing all the districts. Next week I’ll be talking about religions, their icons/symbols, how they generate, what benefits/disadvantages they give you, and what agendas religions may want their followers to pursue.