-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix visible tiles revealing invisible tiles below #67997
Conversation
|
Main post updated with optimization details. Currently fixing visual bugs resulting from the removal of map cache and visibility cache calculations from |
fixes segfault during tests
experimental fix for Cataclysm-test-vcpkg-static-Release-x64 timeout
Is this intended to still be in draft? No stress if yes. It just reads as if it's ready to go possibly. |
It's more or less done. Tests are passing on my end (MSYS2). Just pushed out one more fix to prevent cache bloat during tests. I'll likely bring it out of draft soon. |
FYI, this resulted in a massive increase in test run times #68154. |
Summary
Bugfixes "Fix visible tiles revealing invisible tiles below"
Purpose of change
The way 3D vision currently handles tile visibility is by calculating visibility variables for the current z-level and have every z-level underneath inherit the same values. In cases where a tile on the current z-level should be visible but the tile underneath should not, the player will be able to see both tiles due to the non-visible tile underneath inheriting the visibility variables of the visible tile above it. Correcting this will fix #66040. Also a prerequisite for the lightmap changes in #67434.
Describe the solution
There are two parts to this solution:
Naturally, these make processing visibility somewhat more CPU intensive. To compensate, map cache and visibility cache are no longer calculated every draw. Any event that alters these can simply call
map::build_map_cache
andmap::update_visibility_cache
instead. This involves the removal of the temporary fix introduced in #15868. The issues targeted by the fix (#15842 and #15854) are not reproducible.Overall, these changes have a positive effect on draw performance leading to an 11% decrease in draw times.
Describe alternatives you've considered
Testing
Compiles ok.
Confirmed that invisible tiles no longer show as visible when viewing visible tiles on a higher z-level.
Before:
![before](https://private-user-images.githubusercontent.com/129854247/265273491-e5629116-fe83-49af-9bfb-df5605167f14.PNG?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4ODUzNzYsIm5iZiI6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