-
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
3D vision of lower levels with distance fog #65738
Conversation
details in code comments
I'm not qualified to comment on the technical implementation, but are you aware of Kevin's previous concerns with similar features? (See: #61074 (comment)) |
@RenechCDDA Can't say that I am. Thanks for bringing this up. I'll look into it when I have the time. |
If I may chime in, curses lacks full color support so the best that can be done on curses is probably to darken the symbols and/or use the I'm not sure about the memory usage though, it could increase a bit due to caching and whatnot now that more sprites are drawn, but it probably would not be very significant because the current implementation, from what I can tell, draws the additional sprites with the existing tile context so at its worst it will be similar to the memory consumption when you zoom out. @Rewryte My concern would be with the time it takes to redraw though, so it would be nice if you could run the framerate benchmark in the debug menu and post the results before and after this change. |
Thanks for your reviews @Qrox. It might take me a while to go through them. Still trying to get my compiler to make friends with curses. I did a quick test on private working memory usage: Before changes: 1189460K Tried using the debug benchmark function but performance is capped to my framerate despite using exclusive fullscreen and disabling v-sync on my GPU. Any ideas? |
Co-Authored-By: Jianxiang Wang (王健翔) <qrox@sina.com>
it did not really achieve the intended effect. also futureproof it for isometric. Co-Authored-By: Jianxiang Wang (王健翔) <qrox@sina.com>
early work for isometric support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps the 3D FOV depth option should mention the new 3D vision in its description. Also I think this might be a great chance to enable 3D FOV by default, since it has been working without noticeable issues for a while and there has been complaints that it isn't enabled by default.
Co-Authored-By: Jianxiang Wang (王健翔) <qrox@sina.com>
reorders drawing so all tiles on the same layer are drawn at once. also lays down foundation for isometric support.
Looks like setting 3D FOV as default breaks tests. No error message, just an indefinite freeze. I'll take a look at the tests. Probably will revert the option if it is not something I can fix in quick order. |
setting FOV_3D as default leads to tests freezing indefinitely
This is looking good to me, does merging this without the tileset changes break the tilesets? Those as I understand it need to be made in the tileset repo / handled with the build scripts for the tilesets. |
Nope. They are for most part the same changes so these are just a temporary measure until the script built changes take over. |
Never mind, the thing below gutter is a wall anyway |
I think you can use connection groups to match the gutter sprite with the surrounding roof tiles instead. It might be possible to support non-open-air semi-transparent tiles by adding a flag similar to |
Pretty much any terrain that returns false on the dont_draw_lower_floor function can be made transparent. This is mostly the |
Summary
Features "3D vision of lower levels with distance fog"
Purpose of change
The current method of drawing lower z-levels removes plenty of visual information that should otherwise be assessible to the player character.
Describe the solution
Draw lower z-levels. Naturally, with the top-down perspective most tilesets use, a major issue would be that there is no way to tell which sprites belong to which z-level. To solve this,
t_open_air
and other transparent terrain can now be assigned a semi-transparent sprite to create fog or other effects that emulate distance. Tileset does not have a sprite? The fallback graphic for transparent terrain now includes a semi-transparent overlay. (The following picture uses clairvoyance for clarity.)It adapts its brightness to ambient lighting giving night lights some extra flair.
Number of z-levels displayed is determined by 3D vision settings. Setting vertical view distance to 0 will revert drawing behavior to that prior to this PR.
Describe alternatives you've considered
Testing
Performance test: #65738 (comment)
Modding example: #65738 (comment)
Additional context
This PR modifies tile drawing which indirectly affects the map memory system. I would appreciate it if someone familiar with the memory code could look through this to make sure it wouldn't cause any complications.
The following changes will be made to non-isometric tilesets:
t_open_air
is now used as the fog between z-levels so if it is assigned a blank sprite, it will be unassigned. Having a customt_open_air
is still recommended for a minor performance improvement.tr_ledge
is not assigned a sprite, it would be assigned a blank sprite, typically replacingt_open_air
. This is to prevent it getting replaced with an opaque placeholder.