-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Turn on 3D FOV by default and combine its two options into one #71306
Conversation
Fails before with filter `[vehicle], activity_interruption_by_distractions`, succeeds after
I believe #69053 remains a relevant hindrance. |
@PatrikLundell It seems the light map is only built on the player character's z level even with FOV 3D on, which caused NPCs to abort activities when the player character moves to a different z level. I worked it around by using the old behavior from non-3D-FOV mode, i.e. let NPCs continue activities when not on the same level as the player character. Building the light map for NPCs could be expensive, especially if there are multiple z levels with NPCs, so I didn't go that route. |
The test |
Light map is only built on the player character's z level even with 3D FOV on, and building the light map on all NPCs' levels might be too expensive, so simply let NPCs finish their business when not on the player character's z-level for now, like what was done for non-3D-FOV mode.
@andrei8l I changed the test to use the test cases from non-3D-FOV mode, but I think we can keep the test to ensure that no one changes |
…ed map Test arguments that reproduce the failure in npc_can_target_player: --rng-seed=1706562066 '~[slow] ~[.],starting_items'
Summary
Interface "Turn on 3D FOV by default and combine its two options into one"
Purpose of change
Closes #71185. Fixes #63276. Closes #69053. Closes #58601 since I cannot no longer reproduce it (but it may have already been fixed before this PR).
3D FOV has been working fine for a while and I finally managed to fix the unit test errors caused by turning it on, so let's do it.
The old colored blocks display of the level below can be restored by setting 'Vertical range of 3D field of vision' to 0, but I don't think it is worth supporting multiple-level vision with colored blocks display because the main reason for the colored blocks display is performance and multiple-level vision is going to affect performance anyway, and fewer options make it easier to maintain the vision code.
Here's a list of previous behaviors (from my memory, didn't bother to test so do correct me if I'm wrong) and current behaviors. Most of the previous behaviors are still supported.
Describe the solution
FOV_3D
option and code forfov_3d == false
. Unified handling offov_3d_z_range
in the process.FOV_3D
enabled.WEATHER_CLEAR
.Regarding 3; Turns out if the weather is changed due to previously run tests, the seen cache will be different. In this case the weather is
mist
, which seems to cause the player character to see through a wall column for a brief in-game second, which can also be reproduced in-game, and looks like #65205. The transparency cache also doesn't look right when the weather isclear
in the test; z-level -1 seems to be considered to have the same transparency as air, although this problem does not happen in-game. I did not bother to fix these problems in this PR though; someone with more experience with the shadowcasting code should probably look into it.Describe alternatives you've considered
Not doing this; Keep the FOV_3D option.
Testing
Ran the unit tests and they passed. Moved around in-game and the shadows looked reasonable. Tried to move character or cursor to z-level 10, they did not move and the game did not crash.
The filter that reproduces the player activity interruption test failure is
[vehicle], activity_interruption_by_distractions
.Additional context