CityBuilder
This is one of my pet projects, where I’m creating a city builder in which players are able to construct infrastructure, housing and managing their realms inhabitants, through politics and infrastructural needs.
Road System
When designing the road system, I had some criteria to fulfill. The system had to be flexible, adaptive, and able to direct cars into lanes with as low complexity as possible.
I decided to create a node based system, where each intersection is represented by a node with weight and connections. This allows cars to utilize A* to navigate from their position to the closest node to a random position.
Once the road system was capable of simulating cars going between each node. Implementations of lanes could begin. I’ve started out restructuring the system from pathfinding on the IntersectionNode, to instead path-find on LaneNodes.
Each IntersectionNode contains a set of Id’s to each of its connected LaneNodes. These LaneNodes are then used to connect each road segment in the right-side traffic convention.
First Iteration of the RoadSystem with terrain terraforming