CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.11k stars 4.11k forks source link

You can see what is on top of rooftops from below with 3D FoV #69973

Closed Golfavel closed 8 months ago

Golfavel commented 9 months ago

Describe the bug

You can see the top of roofs whilst e(x)amining from lower than them with 3D FoV.

Attach save file

Etta-trimmed.tar.gz

Steps to reproduce

  1. Go to a crossroad
  2. e(x)amine
  3. Go at least one z-level higher than the desired rooftop's level
  4. Know exactly where the birds lay their eggs

Expected behavior

e(x)amining upwards doesn't reveal something above you just because it's lower than where you're looking.

Screenshots

From z-level 1 and upward z-level1 z-level2 z-level3 z-level4 z-level5 z-level6

Versions and configuration

Additional context

No response

fairyarmadillo commented 9 months ago

This is intended. See: https://github.com/CleverRaven/Cataclysm-DDA/pull/67434

Golfavel commented 9 months ago

This is not intended; even if it was, it's nonsensical and not how vision works. You can't see what's on the opposing side of a building's rooftop just by looking higher up. It appears to just be an oversight with e(x)amining that causes it to "see" things below the camera's z-level's position that would otherwise be obstructed.

Qrox commented 9 months ago

I thought this was fixed: #66040. @Rewryte could you look into this?

fairyarmadillo commented 9 months ago

This is not intended; even if it was, it's nonsensical and not how vision works. You can't see what's on the opposing side of a building's rooftop just by looking higher up. It appears to just be an oversight with e(x)amining that causes it to "see" things below the camera's z-level's position that would otherwise be obstructed.

You're right, I was misreading your screenshots.

Rewryte commented 9 months ago

I am unable to reproduce the issue on a new world or my existing worlds. Only the one included seems to be affected. Save file issue?

Golfavel commented 9 months ago

No; I can reproduce it consistently in any world (I even tried it in the world provided by #70081, still occurs). Fresh install (settings adjusted ["Experimental 3D field of vision": false>true] ["Vertical range of 3D field of vision": 4>21]), fresh world: Escalante-trimmed.tar.gz

CoroNaut commented 9 months ago

I was also able to reproduce, (if I understand the issue correctly). I followed the above comments steps. I can see the tops of these buldings despite never being above level 0 in this area. I just used the 'look around' view to go up and down z-levels. image

CoroNaut commented 9 months ago

I also see this weird thing happening where I can see the roofs of some buildings, other buildings I cant, and some weird phantom lines above just grass. On the buildings where I can't see the roof, it still completely outlines the roof, I'm pretty sure you shouldn't be able to see the other side of the buildings roof-edges. These pictures are with "Vertical range of 3D..." set to 4, though I'm not sure that entirely matters. Here is the save file from exactly the spot in the pictures below: testinggg-trimmed.tar.gz

image image

Rewryte commented 9 months ago

Disregard my previous statement, I've misunderstood the issue. It does seem that an invisible non-memorized tile would appear as visible when a character from a z-level below examines a visible tile on a z-level above it. Because the wrongly visible tile is memorized when this happens, this issue only happens the first time said tile is examined.

I could work on a fix if it isn't already being worked on.

Golfavel commented 9 months ago

I presume no one has taken a look, feel free.

Rewryte commented 9 months ago

Working on it. I'm now fairly certain that this has something to do with how draw_points in cata_tiles.cpp are generated. Even though previous fixes to 3D vision allowed these draw_points to recalculate visibility variables each z-level, it does not account for the fact that in certain situations, a draw_point on a specific z-level should not exist in the first place. I could add a variable that would invalidate a draw_point that should not be there, but I'm also exploring other options that could help improve code maintainability in the long run.