You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem or limitation you are having in your project
The minimal value of a point in AStar2D class is 1. This is stated in the docs under add_point():
This is a problem because I would like some points to have a value of 0.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Civlization 3 has this grid of tiles. Each tile has a movement cost, mountains increase the cost, roads decrease the cost...
Rails reduce the cost to 0 (so one can move a unit across the continent in one turn).
I would like to have the option to set the movement cost of AStar2D Point to 0.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
The limit of 1 should be reduced to 0.
If this enhancement will not be used often, can it be worked around with a few lines of script?
Everything can be workaround, but I dont see why we have such a limit. There is no mathematical problem if some point has a weight cost of 0.
Is there a reason why this should be core and not an add-on in the asset library?
There is no reason to limit this functionality.
ADDITIONAL - it should not be possible to use 0 as is !
Right now using 0 like this: astar2dObject.SetPointWeightScale(index, 0);
gets SILENTLY converted to 1 which is horrible practice. It would be better if the function simply fails/throws an exception when 0 is recieved.
One should NOT simply arbitrarly feed a function values the programmer did NOT use !
I mean this could even be considered a bug.
Image calling some function: addition(-1, 3)
where -1 gets silently set to 1 (because minus numbers are not supported). So insted of result being 2, you get 4. as result
The text was updated successfully, but these errors were encountered:
Right now using 0 like this: astar2dObject.SetPointWeightScale(index, 0);
gets SILENTLY converted to 1 which is horrible practice. It would be better if the function simply fails/throws an exception when 0 is recieved. One should NOT simply arbitrarly feed a function values the programmer did NOT use !
The current 3.4.4.stable reports an error for this:
E 0:00:00.271 set_point_weight_scale: Can't set point's weight scale less than one: 0.000000.
And it's not converting 0 to 1, the function fails and the original value 1 is not changed.
Describe the project you are working on
Turn based strategy game (like Civilization 3).
Describe the problem or limitation you are having in your project
The minimal value of a point in AStar2D class is 1. This is stated in the docs under add_point():
This is a problem because I would like some points to have a value of 0.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Civlization 3 has this grid of tiles. Each tile has a movement cost, mountains increase the cost, roads decrease the cost...
Rails reduce the cost to 0 (so one can move a unit across the continent in one turn).
I would like to have the option to set the movement cost of AStar2D Point to 0.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
The limit of 1 should be reduced to 0.
If this enhancement will not be used often, can it be worked around with a few lines of script?
Everything can be workaround, but I dont see why we have such a limit. There is no mathematical problem if some point has a weight cost of 0.
Is there a reason why this should be core and not an add-on in the asset library?
There is no reason to limit this functionality.
ADDITIONAL - it should not be possible to use 0 as is !
Right now using 0 like this:
astar2dObject.SetPointWeightScale(index, 0);
gets SILENTLY converted to 1 which is horrible practice. It would be better if the function simply fails/throws an exception when 0 is recieved.
One should NOT simply arbitrarly feed a function values the programmer did NOT use !
I mean this could even be considered a bug.
Image calling some function:
addition(-1, 3)
where -1 gets silently set to 1 (because minus numbers are not supported). So insted of result being 2, you get 4. as result
The text was updated successfully, but these errors were encountered: