-
Notifications
You must be signed in to change notification settings - Fork 13
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
"remote" dijkstra map #98
Comments
I've thought about a bit more afterwards and came to a conclusion, that it'd be a real bitch to implement. Here's a description of how I imagined it would work: We would have a central You could have multiple The way it would work in GDScript is something like this:
In places where you need the dijkstramap (for example in script of some unit)
Now, if the The There are a couple of other things we might want to change. The optional parameters are rather inconvenient. We should make them fields of the
We also might want to add
We will also need to add The reason I've said this will be a bitch to implement is because every DijkstraMap needs to hold a reference to the DijkstraMapGraph. We would have to make sure the reference is alive. We presumably would have to do it through Godot's references, because who the hell knowns how Godot would respond to I have originally considered that |
I'm starting to understand a little bit what you mean, there is at least two problems here : struct RecalculateOptions {
origins: &[PointID],
read: Option<Read>,
max_cost: Option<Cost>,
initial_costs: Vec<Cost>,
terrain_weights: FnvHashMap<TerrainType, Weight>,
termination_points: FnvHashSet<PointID>,
}
pub fn recalculate(
&mut self,
options : &RecalculateOptions
) accessed in this manner via gdscript (by exporting the RecalculateOptions structure as well, via the interface (if think its best) or a second interface also exported (maybe a lot just for a little struct): var map = DijkstraMap.new()
#setup of map
...
#map is setup
var options = map.get_default_options()
options.max_cost = 5.0
map.recalculate(options) would already solve the problem of the interface |
I don't think exporting it to godot is useful. We would still need to store the last
|
Okay I'm going to start working on this for funsies let dmap = .... // your initialized DijkstraMap
let dmap1 = dmap.remote()
dmap1.disable_points(...)
//perform a search and get different results
// modify dmap
// perform same search on dmap1 and see that the result changed Objectives :
|
Hey @MatejSloboda , you mentioned a few time that when you got time you'd like to implement a kind of "remote" dijkstra-map. I've never quite understood what you meant by that but i happen to have some time, so if you happen to provide some example from the gdscript size for instance, I'd like to try to implement it ;).
The text was updated successfully, but these errors were encountered: