Here’s the thing. I could write about 7 pages of information on how to generate a city, right now, from the top of my head. Then I could spend a month or two implementing them.
What I used to do was to write a massive post outlining methods and ideas about every such topic. But recently I’ve stopped as I realized that the most interesting, open-ended questions come from people who don’t have the experience to use the knowledge. People reading it later might, but as I never see people use the information, I get very little satisfaction from writing it down.
That said, here we go again.
***What is a city?
Let’s start from the very beginning. We’re trying to replicate something that exists. If we look at a road-map of a city we see that it isn’t just a massive grid (except for dunedin), but there is a definite ‘grain’ where roads tend to travel perpendicular. You could almost say that every intersection is right-angled.
But if you zoom out, you’ll notice that cities have a grid-like central city, and further away it turns into a spider-web: the roads running away or perpendicular to the center of the city.
So let’s start with the center of the city. We’ll generate a grid, and remove some connections to create interest. Then we’ll move each node slightly. Apply a smoothing operation and we have:
Looks a little like a central city. Maybe those empty spaces are parks or something.
Now let’s make the ‘web.’ Take a couple of those edge roads and extend them outwards, randomizing their points joining things here and there. And now we have:
Starting to look like a city, isn’t it? The transitions a little harsh though. With a bit of tweaking you could sort that out.
So, is this procedurally generated? Yup, we followed a procedure. It’s be easy enough to get the computer to do all that for us.
We want our player to be down at street level, walking around so obviously we need buildings. I’m not going to go into generating buildings, I’ll just assume there’s a pack of them and it picks them, actually, let’s assume there are a couple of packs such as residential, industrial, comercial. Then we can place them seemingly realistically. The central city will be purely comercial in the middle, with a couple residential blocks around the edge. Further out it will remain residential but with a couple clumps of industrial.
If I had bothered to implement this as a script, figuring out how to place those buildings would be very easy.
***So there you go, one hour of time, $20 by the going standard (at least where I live). I’ve suggested a method for creating street layouts. If you want me to implement it in a script, you’ll have to convince me that I should. Otherwise, have a look at scene city generator. It’s intended for rendering, but I imagine with a little tweaking you could get it running (minus some features) in the game engine.
For interest’s sake, let’s take your billion dollars. Let’s say we have a company of 2, just me and you. To start off development we spend 5000 on really good hardware, some good rigs for us to work on and a few to bake images. Let’s rent a premise in central city while we’re at it, and pay our wages too. Let’s be modest, $20 an hour. $2000 for the both of us for a week, plus 1000 a week for power and office space. Now we’ll spend the first week planning our city generator, deciding on what we mean by a ‘city’, bam, 3 grand gone. The next month we spend implementing it in python and twekaing it to get a road-layout we like, and placing stand-in blocks. Now, because we don’t want to step on too many toes, let’s start building models. First off we have to tweak our city generator to make proper roads and intersections, that takes a week. Then the time-consuming bit begins, building buildings. I’d guess nearly 3-4 months of this (remember that extra hardware?) Finally we get our city generated, buildings and all.
Time to add in street-lamps, fire hydrants, and a thousand other details we forgot.
We then discover that we have a framerate of 0.5fps - on our really good hardware. So we start optimizing, generating the data on the fly rather than all at the beginning. A seeded number generator ensures that things remain the same for each city. Call it a year total work.
How much money has been spend? Probably 500,000 or so. At this rate we can keep working for 20 years. Bear in mind we don’t have a game yet, just a city.
We now start on the actual game, adding in half-a-year for the menu system, a year for the character animations+models, a couple months for detailed planning + concept work (that should have come before the city generator really). Maybe 5 years after we started, 2,500,000 later and we have a game. Let’s hope it sells…