You can also achieve this by using "game scripts". Check out the site at https://nogo.openttd.org/api/trunk/. By utilizing the GSTown class you should be able to generate towns in any way you want to a large degree of flexibility.
Say you want towns in the "desert" climate that are about 300-500 population. A typical house in this climate is 10 people or so. So you would like 30-50 buildings.
Note that the occupancy of buildings (as well as how much cargo is generated) will largely depend on the newGRFs you use. So if you have a 'target population' in mind you may have to experiment to find out what the average building occupancy is. There is a more exact way, but this requires time*.
First, generate a map that is devoid of towns and industry (using map generator custom options you can specify less towns). Then, write a game script that creates some random 'small' towns and a bunch of industries.
Finally, iterate over the towns, looking up their population. Add extra houses by using the "ExpandTown" function to expand each town by however many houses it's 'missing'.
*To generate your buildings more exactly, you want to build a few buildings, then wait 3 months (until they complete building) and then check the population of the town. Once it hits your randomly generated 'target population' you can stop building. There's a bunch of statistics that comes in to minimize the number of rounds you need to add/remove buildings until you hit the target or get 'close enough'. What you could do is e.g. exponential approximation: build half the extra amount you think you need, wait 3 months, then repeat. In 10 iterations (let the script run for 3 years before you start building) you'll be able to get very close.