vgstation-coders / vgstation13

Butts
GNU General Public License v3.0
260 stars 541 forks source link

more accurate and consistent grue light detection #36580

Closed CrazyAmphibian closed 1 month ago

CrazyAmphibian commented 1 month ago

[consistency] [tweak] [gameplay] [balance]

What this does

changes the light detection code so that the stored light level is increased upon entering a new tile, as well as on mob life instead of only on mob life. This has a side affect of making the grue less powerful due to this preventing the grue from timing life ticks to not worry about light

Why it's good

makes the grue play more consistently for both sides.

Changelog

:cl:

boy2mantwicethefam commented 1 month ago

The light-related loop already checks light conditions every 0.2 seconds without having to worry about Life() ticks.

CrazyAmphibian commented 1 month ago

blame @falcon2346, he's the one who complained about it

smashedandslammed commented 1 month ago

Will this mean you wont be able to destroy lights without getting damaged?

Dacendeth commented 1 month ago

The light-related loop already checks light conditions every 0.2 seconds without having to worry about Life() ticks.

https://github.com/vgstation-coders/vgstation13/assets/26881007/05feb7f7-8fb8-4bcd-89bd-85b9e0a35f98

this is how it currently is, this is not okay.

falcon2346 commented 1 month ago

The light-related loop already checks light conditions every 0.2 seconds without having to worry about Life() ticks.

gruelights.mp4 this is how it currently is, this is not okay.

This won't actually change this. Grue's apparently have a resistance to light that lasts long enough for then to run through the radius of an entire floodlight and then some without taking damage, however this resistance is why I initially assumed they only checked on life ticks because resisting light for this long is obviously absurd.

Yes they should be able to resist it long enough that running up to a light and breaking it does not present a real risk, but they can practically run into the middle of a main hall and break every light there before taking damage.

west3436 commented 1 month ago

Can you explain how this is doing what you say it's doing in the OP? The proc you've modified doesn't damage the grue as that's done in time_limit_in_light_loop() which already calls ddl_update(); so it looks like you're just adding a needless proc call to Move() which isn't have any effect...

ErrorsWindows commented 1 month ago

aw man why shouldn't we be able to run into a fully lit chapel at TG meth speed and maul a hapless jobbie and eviscerate their body to the point of round removal, perpetrating the killing so quickly that we don't even have to move them into maintenance to avoid the light damage or light slowdown while feasting on the fresh toddler

CrazyAmphibian commented 1 month ago

Can you explain how this is doing what you say it's doing in the OP? The proc you've modified doesn't damage the grue as that's done in time_limit_in_light_loop() which already calls ddl_update(); so it looks like you're just adding a needless proc call to Move() which isn't have any effect...

well, i saw sleep(2) in time_limit_in_light_loop, and, me being the reasonable, normal human being that i am, assume this means 2 seconds, since the only other reasonable value that it should ever be is milliseconds or ticks. if this is not the case please enlighten me. This assumption led me to believe that this code is only ran every 2 seconds, and thus, adding this code into the move proc would call it more frequently and therefore improve the light detection accuracy.

boy2mantwicethefam commented 1 month ago

Grue code was changed so that it didn't rely on Life() ticks anymore for life-checking, and as a result the grue has a window of about 2 seconds to deadly light exposure before it gets roasted and slowed down. Basically it builds up a meter and once it reaches a threshold it does the damage and movement effects, which empties the meter and then does the process again, and if enough time passes (on a separate timer that is frozen when exposed to strong light) the movement is restored back to normal and the increased damage from continued light exposure resets. The meter drains at twice the rate when in darkness rather than just reset completely so that a grue doesn't cheese the system by instantly dipping once in a dark tile to instantly go back to normal. Sleep(2) is in deciseconds, so it's like sleep() once every 0.2 seconds. I do admit it's annoyingly heavier on the calculations than I'd like but at the time I was pursuing improving the grue experience by not having the grue need to time its Life() ticks for whether it can either run out to smash a light or get incinerated the split second it is on a bright tile due to the Life() tick timing.