• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Hugh Mann Bean

Corporal
38 Badges
Apr 8, 2017
47
1
  • Stellaris: Synthetic Dawn
  • Stellaris: Galaxy Edition
  • Cities: Skylines Industries
  • Age of Wonders
  • Age of Wonders II
  • Cities: Skylines - Green Cities
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Age of Wonders III
  • Stellaris: Megacorp
  • Imperator: Rome
  • Cities: Skylines - Campus
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Stellaris
  • Europa Universalis IV
  • Majesty 2
  • Victoria 2
  • Warlock: Master of the Arcane
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Age of Wonders: Shadow Magic
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • Crusader Kings II
  • Cities: Skylines Deluxe Edition
My guess is that you are using A* pathfinding, and if so, here are some optimizations – which you might already know and have evaluated, but I don't know what you know so I'm going to risk making some potentially redundant suggestions:

* Searching from start and destination avoids some unnecessary branching in the path.
* Precache paths up to a certain number of intersections away, either based on a fixed number, or a maximum total RAM used, or both. This allows skipping some pathing calculations.
* Precache paths to the most frequent destinations (special industries, school buildings, perhaps garbage collection? or maintain a dynamic list). This works by flood-filling a map, starting from the destination, and subtracting the road distance between each intersection.
* Merged pathfinding for vehicles with the same routes. If everyone on a bridge is going to end up at the same intersection, they can probably share some of the same calculations. I'm not sure how to do this.

Some of these would require recalculation every time the player changes a road, though.
 
  • 1Like
Reactions:
Upvote 0