Towns are basically cities in all aspects, except that they produce less income and don't have a shipyard. So you can only build defensive buildings, but no airships or landships.
So here's the implementation:
Cities are placed like before on the map, nicely spaced out. Then, towns are added, spaced more closely, and mostly placed next to their parent city. Occasionally, if there's no space, a town will end up disconnected from the parent city, which adds some variety.
Then, all the towns and cities and monster nests get connected up with roads. I've been improving that code as well, making the game better at re-using existing roads rather than creating multiple roads that run parallel or intertwine in weird ways. I've also fixed a bug where you couldn't travel to a monster nest in another territory despite there being a road going through it.
This all worked pretty well, but when I started up a large map, some painful performance problems became apparent. The game would just... pause for several seconds at the start, and then stutter constantly. I dug out my trusty profiler, and found that the strategic AI was having some problems adjusting to the new situation. I'd written some code that basically went over all cities and for each of them looked at all combination of cities. So by quadrupling the number of cities in the game, this code now took 4 x 4 x 4 times - 64 times - longer.
All in all, I found around three places where I'd written the code assuming there'd be a handful of cities. I fixed the performance problems through a combination of rewriting and just using the code less often.
Finally, I had to think about how to display the towns. With so many places now on the map, it had become very cluttered. So I made the display of things more dependent on zoom level, with the names and arms of towns only popping in when you are zoomed in enough. I also spent some time cleaning up some other parts of the map display code, resulting in an overall nicer appearance.
So what's next? I need to spend a bit more time checking the AI behaves sensibly now. Then I'll get started on the other major new features, including strategic resources and research...