About Store Forum Documentation Contact



Post Reply 
Pathing Weights
Author Message
fatcoder Offline
Member

Post: #1
Pathing Weights
In the project we are working on, it would be very useful if weights could be set for tiles for pathing. Then when the pathing algorithm works out a path, it finds the cheapest path rather than the shortest path. So for example, a tile with a weight of 2 costs twice as much to move across as a tile with a weight of 1. By default all tiles should have a default weight of 1.

I assume the pathing uses an A* algoritm, which can easily be extended to accommodate this by simply adding the weight onto the distance across the tile.

In addition to this, it would be extremely useful if the pathing tiles could be adjusted at runtime. In other words, if you could expose some methods for blocking/unblocking a tile as well as adjusting a tile's weight at runtime.

In our game, the player can place static objects on the terrain that need to block character movement. In addition, the player can also place roads that characters should give preference to when determining a path for movement. With the above two mentioned features, this would all be easily possible.
03-13-2010 07:24 AM
Find all posts by this user Quote this message in a reply
EvilNoodle Offline
Member

Post: #2
RE: Pathing Weights
Agreed. This would be extremely useful.
03-15-2010 04:24 PM
Find all posts by this user Quote this message in a reply
Post Reply