Let's say I'm developing a game where a city is generated and buildings are placed in a random manner. Methods to generate the roads are easy to find, it is akin to creating a maze but I can't think of a way to generate and place buildings.
There are constraints on how far buildings should be from the road, where balconies should face, where gardens or trees are placed near a buildings. More over, if there's a school its generation can't be all random. Play zone and basketball field should be in one direction and the building entrance should face that, too. A hospital have emergency and normal exit face one direction and the parking space is on the other direction where at a shopping mall have both entrances and parking spaces on the same side.
I'm yet to find a fitting solution. I thought of using physics simulations, stacking objects on the same place, giving volume to them and applying force towards where they should be and wait a short time until they settle. This would solve some constraints and prevent any overlapping but there may be downsides to this. I want to know if there's a simpler or more efficient algorithm to this problem.