-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a way to change weight_scale on runtime #6531
Comments
I am still unconvinced about how it works with weight.
On Sun, Sep 18, 2016 at 12:29 AM, Mariano Javier Suligoy <
|
Well, in some cases you don't want weight to be related to distance, this was the case in the first time i used AStar, in a tabletop board game, i was doing the movement of the pieces around the table, and there was no weight on the nodes at all, except when there was another player in the middle. |
probably doing what Mariano suggests (a callback to get weight) might work On Mon, Sep 26, 2016 at 5:09 PM, Clint Fleetwood [email protected]
|
I wrote a long comment basically repeating when Mariano said and realized I just repeated him. Currently I add and remove connections before each units turn. But yeah.. what he said. |
another point on calculatin weights, right now weights are per node, now imagine a node in the top of the cliff, you probably want your AI to jump down the cliff (in other words, a one way collision) but not the oposite way, because he can't jump higth enought to reach the other side, this means it needs a one way connection, a way to solve it is using the function i described and use a raycast to check if it's possible to move from one point to the other. also imagine a map with a mountain, it's posible to move up and down the mountain, but maybe you want to have a bigger weigth if you are climbing up. |
Closing as fixed by #8146, feel free to comment/reopen if this is not the case. |
Today i've been using the AStar pathfinding class, and it works really well, but i found myself with a problem, i wanted change the scale of some points to prevent the player from moving over there, but there's no way to change it. Other way to do it was removing all the conections and add them back again, but chaging the weight scale is easier imo, besides, my game will most likely need to have different weight scales for every character (sinces some of them walks, other rides a horse and others flyes) and terrain weigth is linked to this.
So there are 2 things i'd like to be able to do:
func function_name(int point_from, int_point_to)
The text was updated successfully, but these errors were encountered: