Randomized pathfinding
Moderator: Moderators
Randomized pathfinding
Would minor randomization to the pathfinding be possible? Maybe so that one out of every 20 pathfinding decisions would be slightly different from another unit on the same path?
Not really important, I just thought it could help to eliminate the problem where every unit in an entire train will get held up by a single unit that's slower than all the others. Since they're all determined to follow the same route, they just keep bumping into each other.
With fewer collisions to gum up the works, pathfinding calculations might in my ignorant view possibly be sped up a little bit even.
Not really important, I just thought it could help to eliminate the problem where every unit in an entire train will get held up by a single unit that's slower than all the others. Since they're all determined to follow the same route, they just keep bumping into each other.
With fewer collisions to gum up the works, pathfinding calculations might in my ignorant view possibly be sped up a little bit even.
- SwiftSpear
- Classic Community Lead
- Posts: 7287
- Joined: 12 Aug 2005, 09:29
The 3 quickest routes are likely to be a segment of 1-2 total pixles off of each other... There are potentially infinite possible routes and the routes at the top of the bell curve in the weighted function will be virtually identical to the naked eye.ironized wrote:im not a coder either but i foresee it to be easy,
all you need to do is instead of it deciding on the quickest route, it decides on the 3 quickest routes then each unit picks one of the 3 randomly
I get annoyed that units moving close together constantly try to get around each other doing a lot of awkward turns. I'm thinking about trying some random small unit speed variations in the units script and see what that does.
For random pathing just make the unit go in the wrong direction by some varying random number from the planned path. Might just look like it's drunk tough.
For random pathing just make the unit go in the wrong direction by some varying random number from the planned path. Might just look like it's drunk tough.
- SwiftSpear
- Classic Community Lead
- Posts: 7287
- Joined: 12 Aug 2005, 09:29
It doesn't list out every failed combination, it just finds the most efficient path at the top of the bell curve and ignores everything else. In order to find another path you need to prioritize something besides efficiency in the algorithm. It's impossible to find the 100th least efficient path. There will be two, one tied with the other at the opposite side of the bell curve, if not more.ironized wrote:well then the easiest the 100th easiest and the 200th easiest
You have a very very poor understanding of the mechanics of path finding AI. Spring's pathfinder is not a simulated trial and error navigation system.
- Guessmyname
- Posts: 3301
- Joined: 28 Apr 2005, 21:07