2
\$\begingroup\$

I am making a FPS/RPG exploration game (first person shooter RPG, think first person Zelda with guns), and one of the main focuses is a large city.

Due to the fact that I am an indie dev, and don't have the time to make an entire city, and also the fact that I have previous experience with procedural generation (not cities though), I've decided that I'd like to use it to save time.
I was reading this post, and it said to make a city you need:

  1. City centers: Pick some points of the still empty map as main traffic nodes. They should be evenly distributed around the map
  2. Highways: Connect the main traffic nodes to their neighbors and to the outside world using major roads.

(And the rest from the post.)

An example of what I’d like is this: city.png

My question is:
How do I calculate which city centers to connect to each other, to provide a realistic city?

By distance?
Add a weight or size to each one?
Only allow each centre to have 2 connections?

\$\endgroup\$
7
  • \$\begingroup\$ Some illustrations of what you have and what you want to achieve would be nice. \$\endgroup\$
    – Kromster
    Commented May 30 at 11:36
  • 1
    \$\begingroup\$ It matters what kind of city you want to emulate. North American cities usually have underlying rectangular grid patterns, while European cities often have more radial/hub-and-spoke structures. If I recall correctly, the city in the game Infamous has a hexagonal grid structure because it helped limit sightlines to cut down on how much needed to be loaded/rendered at once. Try to identify a specific target look, and get some maps of real cities that have that character, then try to doodle on those maps, visualizing how your algorithm might have built them, to learn what choices it has to make. \$\endgroup\$
    – DMGregory
    Commented May 30 at 12:07
  • \$\begingroup\$ @Kromster ok. I will edit now. \$\endgroup\$ Commented May 30 at 12:30
  • \$\begingroup\$ @DMGregory, I’m thinking of it being a mix between the two you examples you provided. Let me explain: I do want the radial centers, but I also want a (more) grid like system in between. Like I said to Kromster, I will edit the post to provide more details. \$\endgroup\$ Commented May 30 at 12:32
  • 4
    \$\begingroup\$ This looks like a Delaunay triangulation with a step taken to remove selected edges if two adjacent triangles are "close enough" to a parallelogram. I don't have time to flesh this out into a full algorithm, but hopefully that can be a useful lead to someone who may. \$\endgroup\$
    – DMGregory
    Commented May 30 at 14:29

0

You must log in to answer this question.

Browse other questions tagged .