caewok / fvtt-elevated-vision

Adjust Foundry VTT vision, lighting, and token elevations based on terrain, wall, or token elevation.
MIT License
12 stars 5 forks source link

[Feature Request] Walls Below Tiles Should be Ignored #82

Open KKDavion opened 10 months ago

KKDavion commented 10 months ago

As per title. Having a multilevel structure walls below other "walkable" space causes those walls to be calculated for drawing shadows, but only if those walls are above height 0. Having a basement floor at a negative elevation w/ negative height walls will not show up.

Disabling shadows and letting levels/wall height handle vision is a solution, but I find that my players don't always understand why they can't see tokens obscured by wall height, despite telling them that the creature they're trying to see is blocked by the floor/walls around them, despite that location being "within their vision radius". The shadows provide a much clearer indicator as to how and why a token's vision is being obscured, & how terrain really affects their vision on a map.

Images below illustrate how negative floors are restricted to their level, but the walls of height 0-15 are still visible while above a tile on height 15. Ideally, those walls shouldn't cast shadows for the token as they're below the height of the floor (Note, I think the correct way to set up the walls would be height 0-14. Changing this doesn't change the shown behavior). Would be doubly nice if this was integrated with Levels, where toggling the "Allow Sight" option would toggle on the current behaviour. WallHeightBelowTiles01 WallHeightBelowTiles02 WallHeightBelowTiles04 WallHeightBelowTiles03

Iakudo commented 10 months ago

This is something I've been assuming is a bug, but if this behavior is baked into the current build, I think this module would massively benefit from implementation of the feature described by OP. Currently, to take advantage of Elevated Vision on multi-level maps, one has to tailor a map specifically to ensure EV doesn't actively disrupt the experience, despite having several wonderful features that otherwise significantly enhance battle maps for players and save GMs a great deal of time. I fear the complexity of this feature would require collaboration with other mod-makers, such as the author of the Levels module, which would likely require a lot of patience from us users as development lies at the mercy of schedules.

caewok commented 10 months ago

You have anticipated one upgrade I have been pondering for Elevated Vision! It may take awhile to pull off, but I do want to make this work.

Right now, the shadow shader does this for terrain if you use the WebGL setting. Terrain higher than the shadow at a given pixel will not be shadowed. Essentially, I need to do the same thing for each overhead tile, which will require a bit of work. It might be doable with some sort of masking, where each tile masks the shadows below and is in turn shadowed by what is above. So some conceptual things to figure out.

Alternatively, I could delete walls under tiles, but that would not be correct for all cases. For example, any time a wall is near an edge of a tile, the shadow should probably appear when the tile ends. Or if the tile has a transparent portion, the shadow should be seen below.

This would be a big step toward having something like Levels, but based solely on wall and overhead tile elevations in the scene.