-
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
Reimplementation of slipperiness. #74950
Comments
It's a fairly straightforward process, make a list of the floor surfaces in game that have a chance of becoming notably slippery, i.e. smooth concrete (notably, not asphalt) and wood floors, and figure out how slippery they would be in the presence of different fluids. I'm going to assert that coefficient of friction is pretty much not what you're looking for here, many more surfaces are going to be disqualified due to porosity and roughness than due to inherent coefficient of friction of the material. I.e. "dirt" or even more so "grass" isn't going to become slippery with the application of any reasonable amount of fluid. Asphalt is less absolute, but you need a lot of very slippery fluid to make much impact because of the macro-structure of the asphalt creating channels for the fluid to settle into, not to mention asphalt structures generally being designed with drainage in mind. I don't think there's any combination of flags on terrains that you can use to infer whether a particular terrain is going to be subject to this, and I don't think adding enough such traits is going to be worthwhile, so I'd recommend that once you have your list of potentially slippery surfaces we can discuss what kind of tiers of slippery potential we need. |
My rough list from the terrain floors jsons:
A viscous enough fluid could make porous surfaces slippery, the obvious example being mud, but of course water, blood, bile, etc don't meet that requirement. |
This was all in my original PR to some degree, so you could probably reuse most of that code. It also factored in the character's stats, athletic skill, and balance score, replacing these with some more basic checks for monsters (namely move speed, dodge skill, and a penalty for having the STUMBLES flag). Not sure how you'd best differentiate the flatness/smoothness of tiles. It doesn't seem worth making a new json entry for, and seems kinda frivolous for more than one flag. |
Looking at this list it seems to break down into: "mostly flat but still rough on a small scale". I.e. these don't get "slippery when wet" signs, but a particularly slippery fluid would be problematic. Very flat and smooth. i.e. these DO get "slippery when wet" signs just based on a basic water spill. These are very much "it depends" Also the not-in-the-game "smooth ice" terrain would bear mentioning as being always slippery. I think this boils down to "slippery when wet" surfaces and "slippery when lubricated" (better name welcome) surfaces, this can be a pair of JSON flags. The impact of said slipperiness and mitigations to it are another issue. Potentially different lubricants would be free to make things even worse, and then there are mitigations to consider. |
There are more factors besides the types of surfice that can make someone slip.
|
I just did some accidental IRL testing and slipped and almost fell on this embossed metal staircase in my dress shoes. It wasn't even wet. We could really get into the weeds on shoe grippiness and surface roughness vs porousness, but if players were randomly slipping on dry surfaces that would be a bit silly and they would definitely be questioning why. |
The crucial missing piece is footwear. It takes the footing limb score into account, which is correct as footing is defined as “a secure grip with one’s feet”, but rubber boots have an encumbrance of 30 - which means a significant footing penalty - and they’re made for walking through areas that have wet floor signs. Really, we can have footwear and terrain provide footing bonuses or penalties, and liquids on the ground too (conditional on the terrain they’re on), and have the effects of that propagate, checking just the limb scores to determine stumbles and falls. There are things like this in the code: if( you.has_effect( effect_shakes ) && one_turn_in( 75_seconds ) ) {
you.mod_moves( -to_moves<int>( 1_seconds ) * 0.1 );
you.add_msg_player_or_npc( m_warning, _( "Your shaking legs make you stumble." ),
_( "<npcname> stumbles." ) );
if( !you.is_on_ground() && one_in( 10 ) ) {
you.add_msg_player_or_npc( m_bad, _( "You fall over!" ), _( "<npcname> falls over!" ) );
you.add_effect( effect_downed, rng( 3_turns, 10_turns ) );
}
} That can be removed, as the |
If you want to have footwear that causes otherwise ok surfaces to become slippery, that's fine actually? Dress shoes are notoriously bad about this kind of thing. |
It can be broken into
Fields don't appear to have a flags JSON entry. I assume it would be a new optional field with these possible values:
|
I have never really understood the high encumbrances on footwear, and I feel like they are mostly relics from when all it affected was movement speed - and even that was a bit weird. I can run in boots just as fast as in sneakers, and every boot I've ever worn that didn't have heels was better for traction. Hiking an incline in Doc Martens is waaay easier than trying it in Vans, so maybe that all needs a look as a separate issue. |
This just looks like it'll be a major PITA to balance vs different survivors. |
The limbs system and other mutation reworks will handle that. |
I´m not sure if this is already part of the PR but a major factor I that hasn´t been mentioned is movement mode. You are far more likely to slip of you are sprinting than walking and slipping would be very hard to do if you are crouching (you can catch yourself with your hands). Slipping would be impossible when going prone as it is very difficult to fall if you are already lying on the ground. |
Rather than indirectly referencing attributes of the surface like smooth and nonporous, I'd prefer the flags to just say what they're doing, "slippery", "slippery when wet", "slippery when lubricated". That last one's not so great but it's growing on me. There are a number of attributes of a surface that come together to decide how prone to becoming slippery it is, so there could very well be not-smooth surfaces that nonetheless end up being slippery when wet. |
The method I tried was that running inflicted a penalty and crouching, running quadripedally, or lying down made you immune. This was not perfect as the checks were happening every second rather than when attempting to move and quadrupeds shouldnt be completely immune, but the system was a first draft and those seemed like solvable problems. |
That one's obvious. But instead of movement mode we can just use movespeed straight up.
|
Sounds like a bad idea to me. Move speed is boosted by things that are meant to suggest you're becoming more nimble, and hampered by things that make you clumsy. Move mode is a much better metric and doesn't get in the way of other systems that would naturally cause slippage like injury etc. For example, if it was move speed, then having an injured leg would both increase and decrease your chance of slipping, and that's just one example. Tons of stuff affects this, better to not involve it. |
Is your feature request related to a problem? Please describe.
#69555 by @fairyarmadillo added slipperiness from things like boomer bile and slime, that could cause your character to fall over. It was later reverted in #72172, like an earlier attempt at slipperiness from oil was reverted in #47851. I've seen some interest in this feature returning in some form, but more discussion is required.
Solution you would like.
Calculation of slipperiness:
Properties of the footwear, terrain, and liquids should all be taken into account, plus character weight, for calculating a "traction factor". Realistically, the liquids should be a factor in a larger equation rather than being the focal point. Someone wearing bowling shoes on a waxed floor can be slipping even in the absence of any liquids.
Effects of slipperiness:
The traction factor can serve as a modifier that provides bonuses or penalties to a variety of actions and a few limb scores, with a direct impact on footing, and an indirect impact on or checks against balance when moving.
When someone skilled is doing something like dodging or swinging a weapon, they have an ingrained idea of the distances required and the optimal footwork to reach those distances. Obviously moving on slippery ground would significantly interfere with one's ability to be precise and exact with those movements. In particular, "stumbling" would be a lot more dangerous.
What about falling flat on your face? Well, most often when someone loses their balance, they might stagger around for a couple seconds, but don't quite fall. However, if you are hit, dodging a hit, or missing a swing, then that's much harder to recover from. The chance to stumble or get downed could be significantly reduced when next to a wall or piece or furniture, or holding a long enough item. Obviously the traction factor, balance, and footing would all also play a role, as well as various traits and effects. Unit tests would be useful for ensuring reasonable outcomes under various conditions.
Describe alternatives you have considered.
No response
Additional context
Very conveniently, there are tables online for coefficients of friction between a variety of materials, alongside the coefficients of friction while lubricated. There are also the viscosities of a number of fluids, including gasoline and blood.
The text was updated successfully, but these errors were encountered: