Advertisement

Designing a road network for a city builder game

Started by April 09, 2022 06:08 PM
0 comments, last by YesBox 2 years, 8 months ago

https://i.imgur.com/x7hCtS8.png

(image: small yellow squares are lane nodes, small green squares are edge nodes, large blue squares are intersection nodes, large yellow squares are pseudo intersection nodes, pointing to the main node. Pixel width colored lines show edge connects, but not lane connections (they do exist though))

I'm developing a city builder game, currently working on road tile placement, graph creation, and path finding. I'm nearly done with the heavy lifting, but want to peruse existing resources to make sure I didn't miss anything important. Any general feedback (if you have experience in this area) will be super helpful too!

Some things I am considering doing:

  • Using edges as location groups so I can quickly do collision detection for cars. This way I can implement acceleration and deceleration. (Currently it's grid base movement, non-floating point).
  • Combining the sidewalk graph to the road graph. I designed an algorithm that stores all possible paths using relatively little space so path finding is constant time. Having two separate graphs would mean double the memory footprint.
  • Should I look into quad/octo trees?

This topic is closed to new replies.

Advertisement