Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Pathfinding solution - Room designation.  (Read 634 times)

Liamar

  • Bay Watcher
    • View Profile
Pathfinding solution - Room designation.
« on: January 01, 2016, 09:52:29 am »

Simple solution that I think might be the ultimate cure for pathfinding-related CPU fever.

Add generic room designations. Each created room designation paths to all other room designations it has access to. So corridor paths to all the bedrooms and main staircase it has access too, knowing how to get to each one, or where the "connecting point" is. So when a dwarf tries to get to his bed in one of the rooms, he doesn't path the entire fortress straight to his room, he knows in which room his bed/job/item/target is, and he knows which rooms connect to which rooms, so he doesn't go to his destination directly, he first creates a big path made up of rooms, and then only paths from the entry point of the corridor to the connecting point of the bedroom, and then from entry point of the bedroom to his bed.

This could even be easily automated by designating all new rooms and path creation on door/bridge/wall creation, so that the players don't have to go through the meticulous process of designating the rooms and so that the invaders/animals could also use this system.

Also as a side note, a one-way traffic designation would also do wonders to avoid collisions and make wider corridors more useful.
« Last Edit: January 01, 2016, 10:02:21 am by Liamar »
Logged