foundryvtt-drag-ruler
foundryvtt-drag-ruler copied to clipboard
Pathfinding through the fog
Players can drag their movement around to get an idea of what the layout is under the fog of war. Is there any way to mitigate this? (left is GM view, right is player view)
There is currently none. This is the main reason why the GM has to enable pathfinding before the players can use it
No worries, the benefit far outweighs the downside.
The sight layer (unique to each client) has a method to test visibility (canvas.sight.testVisibility({ x, y })
). Unfortunately I'm not seeing a same thing for something like "test has been revealed". The sight layer has the pixi container for the revealed areas so it probably wouldn't be too hard to make a method that checks that. It would be a lot simpler than the testVisibility
method because that has a lot of extra stuff that relies on, well, that relies on things actually being visible
The fog exploration is stored as a bitmap, which means that there are quite a few pixels to check per grid cell, which could easily become a performance issue. That's my main concern with implementing such a feature
I think testing 3 pixels per square should be good enough (middle pixel, as well as the two pixels on the corner/edge where the token is passing through).
https://github.com/dwonderley/lib-find-the-path/ offers a "configuration to enable non-omniscient path planning", which sounds like it may give some hints about not planing paths within fog?
I might be wrong, but it seems to me that the only thing "non-omniscent path planning" offers is the ability to prevent pathfinding through ethereal walls.
Hard to say with the wording. Since both sentences start with "Added", it seems to be two separate things, but I could be wrong.
that library probably doesn't have that feature, but, I agree that this should be not too difficult to implement - the one obstacle is how exactly to get the fog pixel at a specific position.