Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upNew crouching mechanics for hiding and stealth #29092
Conversation
Wokko1
added some commits
Mar 26, 2019
Wokko1
changed the title
New crouching mechanic for hiding and stealth
New crouching mechanics for hiding and stealth
Mar 28, 2019
This comment has been minimized.
This comment has been minimized.
|
I have no idea why the builds failed. There weren't any errors in the code, I think? |
Wokko1
added some commits
Apr 4, 2019
ZhilkinSerg
removed their assignment
Apr 4, 2019
This comment has been minimized.
This comment has been minimized.
|
Crouching should most certainly take into account player's size (maybe not right now but eventually). A tiny mouse mutant can hide much better than a hulking car-sized cattle mutant. |
This comment has been minimized.
This comment has been minimized.
|
Should close #20431? |
This comment has been minimized.
This comment has been minimized.
|
Should I include something like "closes #xxxxx" in the description? I'm afraid that issue is not the only one about stealth, and finding all of them, analyzing, and deciding "is this PR relevant for them?" would be tedious. About the player sizes: surely size should matter for stealth, but I won't be able to code for 1-2 weeks. I'll probably add sizes after those two weeks, or if this PR gets merged, I will make a new PR with size-dependant calculations later. |
This comment has been minimized.
This comment has been minimized.
Mouse mutations have |
This comment has been minimized.
This comment has been minimized.
Yeah. |
This comment has been minimized.
This comment has been minimized.
Shibimon
commented
Apr 9, 2019
|
Probably not in the scope of this PR (maybe) but monsters should have this too. |
This comment has been minimized.
This comment has been minimized.
|
Update: player sizes are taken into consideration for stealth. |
This comment has been minimized.
This comment has been minimized.
|
does dexterity or perception influence this? It'd be nice for strength-heavy characters to finally be meaningfully garbage at something and make strength not the objectively best stat for once :P |
This comment has been minimized.
This comment has been minimized.
I don't know how stats should affect this, you are just crouching. Strength can't give penalties for stealth because "stronger" doesn't mean "bigger". Propose something if you have good ideas, please. |
This comment has been minimized.
This comment has been minimized.
|
Needs styling |
Wokko1
added some commits
Apr 16, 2019
This comment has been minimized.
This comment has been minimized.
|
This is good to go, but it's going to need some follow-up.
|
kevingranade
merged commit 69dc10f
into
CleverRaven:master
Apr 18, 2019
This comment has been minimized.
This comment has been minimized.
Probe1
commented
Apr 18, 2019
|
It's too late to point this out but putting crouch on the same binding as run/walk was a poor choice. |
Wokko1
deleted the
Wokko1:Crouching
branch
Apr 18, 2019
This comment has been minimized.
This comment has been minimized.
adamkad1
commented
Apr 18, 2019
|
well maybe you can find a better binding |
This comment has been minimized.
This comment has been minimized.
|
This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there: https://discourse.cataclysmdda.org/t/crouching-looks-new/19722/3 |
This comment has been minimized.
This comment has been minimized.
suddenly-cuddlebiscuit
commented
Apr 20, 2019
|
Bug/unwanted behavior: Please return out of stamina while running behavior to default. Interesting addition otherwise, though it should be a movement modifier, rather than a movement speed, as noted by others. |
This comment has been minimized.
This comment has been minimized.
This is definitely a bug deserving a separate issue. |
This comment has been minimized.
This comment has been minimized.
evankimori
commented
Apr 23, 2019
|
Does this crouch mechanic affect noise made as well by footsteps, character footwear, noisy traits etc? |
Wokko1 commentedMar 28, 2019
•
edited
Summary
SUMMARY: Features "Add ability to crouch and hide behind furniture, terrain, vehicles."Purpose of change
The game needed some stealth mechanics, not only darkness, but also LoS and sound dependent.
This PR adds ability to crouch (now on the "toggle move mode" key), which decreases your speed, but makes you quieter and allows you to hide behind furniture, terrain, and vehicle tiles.
Describe the solution
Added json "coverage" value to most of the furniture and terrain.
Added ability to crouch by pressing "toggle move mode" key. It's a separate move mode (along with "Walk" and "Run").
Sound made by the player is reduced while crouching, and increased while running.
When the creature::sees() is checked, the last check is player's crouching. If there's a furniture or terrain tile with "coverage" value on the line between the player and the creature, then the coverage value is used to calculate the distance at which you will be seen. The cover has to be adjacent to player. The distance at which you can be spotted modifies creature's sight only if it's the smallest range available (e.g. no monster will see you behind a bad cover if it's dark).
Coverage >=60% will fully protect you from being seen (counters, sofas, etc) when you crouch. Coverage >80% is usually unpassable, and added for future PR with gun fight mechanics.
Coverage <60% will partially cover you, if a creature comes close to your cover - you will be spotted.
The distance at which you can be spotted is modified by coverage.
Monsters can still find you by smell if you hide in one place for too long. If you start crouching after being spotted, monsters will come to your last known location.
If you stand on furniture or non-flat slowing-down terrain, you won't be able to hide.
You can hide behind cars too.
Size modifiers for visibility calculation.
Describe alternatives you've considered
Making something more complex is out of my power, as I still lack skills. I consider this solution being fun enough and not too complex.
Additional context
I was heavily inspired by Evil Within 2's stealth mechanics, where you crouch behind crates and cars to hide from zombies. Wanted to make something simillar for Cataclysm.
Closes #20431