Crouch and Prone Controls

Nihal Singh

Member
Contributor
World
Hunter
I've been working on adding the Crouch and Prone functionality to the game. After some discussion with Cervator, we felt the need to have this thread for discussion of what key seems right for this purpose.

Do we want toggle or hold buttons?

Toggle!
  • Press c for CROUCH and LCtrl for PRONE? 'c' is being used for char screen, now.
  • Keep LCtrl single tap for Crouch and LCtrl double tap for PRONE?
  • any other key combination?
Hold!

  • Press LCtrl for Crouching.
  • While pressing LCtrl, Toggle between crouch and prone using LShift
  • any other possible solution?
Reply with whatever you would feel best to play with :)
 

manu3d

Active Member
Contributor
Architecture
I like single tap/double tap the best. But if I think accessibility and making it the easiest to use c for Crouch and LCtrl for Prone would probably be best. Anything requiring players to hold keys (when they are holding other keys already) will impact people that are less dextrous, such as younger children or people with some form of disability.
 

xtariq

New Member
Contributor
Hmm, usually on FPS titles which have both, I assign LCtrl for prone and Z for crouch.

Otherwise, I think this a great idea.
 

AvaLanCS

Member
Contributor
Can't we have toggle and hold? I really like games where you can decide which one you want to use. It could be either a checkbox whether it should be hold or toggle, or in some games you have crouch (toggle) and crouch (hold) as a separate entry in the bindable keys section.
 

Nihal Singh

Member
Contributor
World
Hunter
I personally feel that toggles would work better. A simple 'c' to change stance. Single tap to crouch, double tap to prone.
But yes as AvaLanCS pointed out, we could have both toggles and holds. If that is the case, I would keep it as:
  • While Standing: Single tap c to Crouch. Double tap c to prone.
  • While Crouching: Single tap c/space to Stand. Double tap c to prone.
  • While Proning: Single tap c to Crouch. Double tap c/space to stand.
  • Hold LCtrl for crouching, press c while holding to toggle to Prone.
Also another interesting question: Do we want to allow jumping while crouching? That would let the player enter small doors which are at a height, etc.
 

manu3d

Active Member
Contributor
Architecture
Regarding crouching+jumping: I don't feel is a priority, but if you have the time to make it happen, why not!;)
 

Nihal Singh

Member
Contributor
World
Hunter
The biggest problem I am facing now is that I have to disable standing up when you have a impenetrable block above you. Otherwise I recreate the collider capsule and end up partly inside the block above.
Using worldProvider.giveBlock(Vector_position), I can find the block at a position. I used this to find the blocks right above by capsule axis. But this is a bad method as it does not account for my capsule width. That is, if I am just slightly left to a door, there may not be any block above me, but there will be a block above my right shoulder, and standing up, my shoulder could end up partly inside that block.
If I were to check this, looping through all the coordinates my capsule is going to occupy, if an impenetrable block is present, it would have a high complexity. This seems like a bad idea. There should be some other solution.
 

AvaLanCS

Member
Contributor
Maybe you could keep the original collider (the one when the player is standing) and ask it whether it is colliding with something (with the exception of the crouch/prone collider)? That could be the "you cannot stand up" flag. I haven't seen the code for collisions, but asking a bullet collider seems less complex then iterating over points.
 

Nihal Singh

Member
Contributor
World
Hunter
Alright, so I am using the collider to detect collisions while rising and it works great! :D

Update on the PR:
  • Crouch works temporarily with LCtrl
  • Toggle stance to Stand -> Crouch -> Stand using 'c'
  • If an obstacle lies above, a "Cannot stand here!" message is displayed in the chat panel
  • Jumping while crouching works (so if my crouched height is say 0.7 block, I can get inside 1 block holes in a wall)
Outstanding:
  1. Speed toggle works with crouch. Do we want this?
  2. Crouch height is 0.5 * standing_height. What should be the default value?
  3. Speed while crouching is 0.5 * walking_speed. What should be the default value?
  4. Toggle stance happens with 'c' now. But the Equipments module uses c for character screen. What should be the key assignment?
  5. Falling off ledge prevention (mc functionality). Can wait probably.
  6. Complete Prone mode addition.
Need inputs on 1, 2, 3, 4 in outstanding.
 
Last edited:

manu3d

Active Member
Contributor
Architecture
1. does this means you can crouch and run at the same time? If so I'd say no, you shouldn't be able to run and crouch at the same time. Perhaps we could have walking speed while crouching 0.4 of normal speed and running speed while crouching at 0.75 of normal speed.
2. 0.5 * standing height sounds good to me.
3. see 1.
4. I don't know
5. I wish we didn't wait, I find it very useful in games with big, potentially lethal drops. But it would be ok to create a separate issue and eventually a PR on this specific matter.
6. Sure, that can wait.
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Functionality works and feels great! Well done :)

I think the keys will end up the most controversial. Double tap sounds tricky and is probably out. The unrelated modifier for run/walk by default on caps lock has always been in an awkward spot, and was once upon a time moved away from 'r' which seemed an oddly valuable key to burn on it.

So thinking overall on the keys involved (including walk/run as similar):
  • hold shift to reverse the walk/run default (which at present is to run by default, as in you don't need to hold shift to run in the first place)
  • toggle caps lock to switch the walk/run default - not a fan of this, it messes with text (like old school mmo numlook auto-run). Probably move this.
  • we lack auto-move which might eventually need a key
  • proposed: hold ctrl to temporarily crouch (could be a bit more like shift and simply reverse the default - if you crouch toggle then press ctrl you stand up but do not return to a crouch when you release ctrl)
  • proposed: toggle c to switch the crouch default permanently (which by default is to not crouch)
  • possibly pending: prone key hold
  • possibly pending: prone key toggle
  • conflicting: toggle c to open Character Screen (in the Equipment module)
That's a lot of keys, especially if they all need to be in the hot zone near WASD.

Purely from a personal perspective (not forcing this on the project) I'm a fan of holding ctrl to crouch, using z to toggle prone (the rare time I might be playing an FPS), and opening a char screen with c. I'm also likely at the project level to eagerly save open keys in the hot zone (we seem to have r, z, x, f, and v still open) for future purposes like they're precious potions in a game then I then never end up actually using :)

I'd like if we simply pick a single button for each function (crouch, prone, auto-move) then offer a modifier of some sort on a secondary key. I don't think there's much of a use case to have both keys separately available (one to crouch temp, one to crouch permanently) just there are some that prefer one or the other.

The secondary key could match a mode also configurable in the input options, much like other games like Elite Dangerous that offer Continuous / Toggle variants and such for different functions. We just have to pick a decent default then let the player vary the key, the secondary key, and the mode as they see fit.

The secondary key could be somewhat out of the way since you won't need it often. I wonder if we could actually use a combo key rather than a regular one and end up with something like
  • CTRL = crouch key. Default mode: Hold. Secondary key for switching mode: ALT-C
    • Should the secondary switch CTRL between hold/toggle or switch default stance between crouch/not crouch, leaving CTRL to reverse?
    • Edit: Default could be Toggle instead, for consistency / preference. Hold is just my personal familiarity sneaking through again
  • z = prone key. Default mode: Toggle. Secondary key for switching mode: ALT-Z
  • r = auto-move (usually "auto-run" but really you could also have auto-walk..). Default mode: run. Secondary key for switching walk/run: ALT-R (old caps lock)
Benefit there is gaining all the desired options via in-world hot keys, without taking up a "full" key for each. We give up only CTRL and z for crouch/prone, and avoid caps lock being weird. I'm really not sure though. Just wanting to move the conversation forward to consider more options :)

I could be talked into giving up on CTRL entirely in favor of a more consistent c and ALT-C moving the character screen somewhere else. But CTRL is crouch by default in many settings, in particularly in MC (although really more of a sneak/don't fall off things there?) - no perfect option.

Drawback: We don't actually seem to support modifier keys in the input bindings at present. Whoops. Will submit an issue for that. I suggest temporarily moving the c crouch variant to x until we decide, just so the Equipment module conflict won't be an issue (any Omega zip version of the game will fail to set c as Equipment for whatever reason gets it first). Could merge in that case and worry about prone, consistent modifier keys, auto move, etc later :)
 
Last edited:

AvaLanCS

Member
Contributor
Well done!
I wanted to suggest 'v' for prone, since I use that key for toggling actions that come rather often than continuously. But whatever works :)
 
Top