As a (retired) sci-fi roleplayer, I used to dream up vast, self-contained cities on far away planets. My ideas were: throw an asteroid into the crust where you wanted the city and create an artificial uplift and or crater, and start city construction there, where you have dug a vast crater, exposed ores and churned the surroundings. Beautiful structures could be built quickly by using rapid-growing bacteria that excrete limestone into columns and other structural latticework. The center of the city would be a geothermal tap, and it would be surrounded by a moat for water reclamation and agriculture. Water would drain into boilers at the geo-tap, steam would provide energy, condensation at the top of the city would flow in a helix of pipes through the city so that there would always be working water mains and sewer lines. The outside of the city would be covered in parkland. Later, I learned about the concept of arcologies.
I did not realize until recently that people are building elements of arcologies already: hydroponic farms occupying old industrial buildings. It is a very clever solution that reduces the food mile, provides local agriculture, and stimulates local economy.