-
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
Monster cameras, vision optimizations, and an implementation through Slime #56231
Monster cameras, vision optimizations, and an implementation through Slime #56231
Conversation
Currently the Ocularium cannot be created, this is intentional - Slimewave is still useful through slime minions from Omnicellular
This code is present in bombasticSlack's current draft PR, and this is technically a different feature.
Spell checker encountered unrecognized words in the in-game text added in this pull request. See below for details. Click to expand
This alert is automatically generated. You can simply disregard if this is inaccurate, or (optionally) you can also add the new words to |
Slime cameras, something I never knew I wanted in a game until right now, this sounds awesome. |
Makes cameras independent from player vision radius limits, dirties vision cache while cameras are active, and adds better vision falloff to cameras. In addition, removes recalculation of seen_cache during long activities except on refresh frames - an optimization that arose from camera needs.
Player was able to detect a monster existed, especially on the compass, but not see their location, when the mosnter was outside of sight_max range (usually 9999, but sometimes much smaller for certain mutations and effects)
Also upped MYOPIC vision radius, preventing an adverse effect of excessive blindness - and somehow making a much nicer vision effect for short-sighted characters.
This ended up rather sprawling, touching many parts of vision code. Not touching it again unless a bug is found, not even for the complete jsonification of sight_max that I will be doing in a different PR. EDIT: Right, bad vision is tested for. |
Mirrors were giving inaccurate vision ranges - also I nerfed mirrors because its now possible to nerf mirrors.
Co-authored-by: Kevin Granade <[email protected]>
Co-authored-by: Kevin Granade <[email protected]>
This reverts commit 52d991b.
This reverts commit 52d991b.
This reverts commit 52d991b.
Summary
Features "Monsters can serve as cameras, adds Slimewave, optimizes seen_cache usage"
Purpose of change
Heavily inspired by @bombasticSlacks wonderful PR #55625, this adds the ability to use friendly monsters as an additional source of vision. In addition, it adds a trait to Slime that allows for vision through Slimesprings (renamed to Slime Microbians) within 8 tiles, and through a new monster that cannot yet be created, the Slime Ocularium, within 32 tiles. The Ocularium is not yet creatable because it is created as part of a WIP mutation rework- it is the reason I made this change, to be honest.
While testing, I found that seen_caches were used in excess, and optimized their usage, allowing for more accurate vision on short term activities and faster long activities.
Describe the solution
Vision can be cast from any friendly monster, specified by a "moncams" array in any trait/mutation.
The monster's daytime vision is the maximum view distance, and the moncams array specifies the range at which it can "transmit" to the avatar.
Vision will be cast only on the Z-level the monster is on- as such, a monster cam on a different Z-level does nothing when not using experimental Z-level, and will only cast on it's own level, even when using experimental Z-level vision. This is because having monster cams cast full Z-level vision was found to be rather slow.
Vision from cameras is no longer limited to the player's maximum view distance, but is of course still limited to the reality bubble.
map::build_map_cache (called every turn) no longer rebuilds the seen cache, and instead, map::build_lightmap (a new function, called when player vision should update) handles that.
Describe alternatives you've considered
Testing
Mutated Slimewave, spawned Oculariums and Microbians and tested in a variety of situations, from vehicles to a limited usage in experimental Z-levels.
Tested long term resting and activities, found that incoming enemies were correctly detected, etc.
Additional context
I am on the second floor, in an enclosed room. There are two Oculariums on the first floor, represented by green capital I's.