Better path finding

Started by Sion, March 28, 2014, 03:11:37 PM

Previous topic - Next topic

Sion

There is something weird about the path finding for the colonists, they don't like to take the optimal route to their destination, they prefer the long way, here are a example:
http://rimworldwiki.com/Defence_Tactics#The_Death_Room
I use this room as my entrance to my base and the shortest way is obviously a line straight up, but the colonist always go in a V-shape to the left or right depending on if their final destination is to the right or left of the room.
But when you draft a colonist the path finding works great.
So many ideas... so little time...
Silence is the worst answer.

Tynan

Their pathfinding isn't perfectly optimal in the paths it generates. It's a little bit "greedy". This makes it take less computer resources but sometimes their path won't be the best it could be.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Thunder Rahja

I've also noticed they sometimes like to zigzag when walking down a perfectly straight road. Sometimes they'll even detour over debris on the way, slowing them down.

Sion

They also completely ignore roads, in the same room described above I tried to lay down a metal floor and clean it (100% walk speed) between the 2 doors, and everywhere else have the worst uncleaned dirt floor possible, it had something like 80% walk speed, they still walked in a V-pattern.
So many ideas... so little time...
Silence is the worst answer.

Sion

I also noised that when you draft a colonist the path finding works great, is there 2 different path finding algorithms?
So many ideas... so little time...
Silence is the worst answer.

Thunder Rahja

#5
Nope, they still zigzag when I draft them and tell them to walk a moderately long distance.

Actually, they do seem to walk in a straighter line when drafted, but they zigzag to avoid barrel cactus, etc, despite it having the same movement speed cost as the surrounding terrain.

Sion

That actually isn't so strange, would you want to march straight over a field of cactus's?  :P
So many ideas... so little time...
Silence is the worst answer.

Thunder Rahja

#7
Colonists will actually stand on the cacti if you tell them to. But what I'm saying is that colonists should always seek the fastest available route and prefer to walk in a straight line when practical. Walking one tile in an ordinal (diagonal) direction is 41% longer than one tile in a cardinal direction.

Sion

I knew about that you can order colonists to stand on cactus's and I think they should take a tiny amount of damage from that, like 1 hp/cactus or 1 hp/10second.

But I agree, I too would like them to walk in a straight line, or at least stick to the roads with 100% walk speed when possible.
So many ideas... so little time...
Silence is the worst answer.