All of the above. Construction is done where engineers find works best. This will factor in labor, construction costs, available land, regulations, relations with the local government, access to water, and so on.
Most of these things improve near civilization. Often, cities or at least towns also form around major economic engines like a large powerplant.
Latest Answers