View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005892 | The Dark Mod | Feature proposal | public | 26.01.2022 10:16 | 28.09.2023 15:50 |
Reporter | Bikerdude | Assigned To | nbohr1more | ||
Priority | normal | Severity | feature | Reproducibility | have not tried |
Status | resolved | Resolution | fixed | ||
Platform | PC | OS | Windows | OS Version | 10 (21H1) |
Product Version | TDM 2.10 | ||||
Target Version | TDM 2.12 | Fixed in Version | TDM 2.12 | ||
Summary | 0005892: Cant mantle while carring a body | ||||
Description | I appreciate not being able to jump, but can we atleast mantle like we can in T1/2..? | ||||
Additional Information | Internal discussion: https://forums.thedarkmod.com/index.php?/topic/21550-5982-allow-mantle-when-shouldering/ Public discussion: https://forums.thedarkmod.com/index.php?/topic/21739-allow-mantling-while-carrying-a-body/ | ||||
Tags | No tags attached. | ||||
If this is not possible, this tracker can be closed. | |
I agree. Being able to mantle while carrying a body would feel more natural. I wonder why that was disabled. I've attached a patch. mantle-carry-body-v1-r10063.diff (643 bytes)
diff --git game/Player.cpp game/Player.cpp index 28decdb..df69a47 100644 --- game/Player.cpp +++ game/Player.cpp @@ -67,7 +67,7 @@ const int HEALTHPULSE_TIME = 333; const float MIN_BOB_SPEED = 5.0f; // shouldered body immobilizations -const int SHOULDER_IMMOBILIZATIONS = EIM_CLIMB | EIM_ITEM_SELECT | EIM_WEAPON_SELECT | EIM_ATTACK | EIM_ITEM_USE | EIM_MANTLE | EIM_FROB_COMPLEX; +const int SHOULDER_IMMOBILIZATIONS = EIM_CLIMB | EIM_ITEM_SELECT | EIM_WEAPON_SELECT | EIM_ATTACK | EIM_ITEM_USE | EIM_FROB_COMPLEX; const float SHOULDER_JUMP_HINDERANCE = 0.25f; // grayman #3485 - additional volume reduction when falling when crouched |
|
I might have to convert this to a cheat cvar. We need to verify that no current missions rely on restricting body relocation by surrounding the victim in a mantle trap. Internal discussion started. |
|
Can said cvar be added to a config file? I would use while mapping etc. | |
There is an ongoing discussion about cvar control in general. That is issue 5453. I had worked out a way to make mission specific cvar toggles temporary but it was a bit "Rube Goldberg" in nature so the proposed change was rejected. |
|
If there is a mission that has a mantle trap, that would hinder improving the movement system for all current and future missions? | |
The general notion is that we want to try as best as possible not to break multiple missions by making them too easy or changing the inherent tension and risk \ reward factors. That said, let's say that only one mission is impacted but the mission author is one of our most prominent contributors. Allowing their mission to be broken by this change could cause other less prominent mission authors to lose trust in the project. All this said, this discussion has provoked some interesting discussions about whether "low mantle" should allow this as a realism factor whereas mantling to high places would still not allow it. Even a change like that might cause some issues with existing missions but it may be worth the potential upheaval to make the game richer by partially allowing this behavior. |
|
Thank you for explaining that. I can see how that's a tough decision. I'd personally like to see at least a low mantle so that stepping up around knee/waist level would be possible, like stepping up onto a bed or a high step. Would something like a DML (from Thief) be possible for old missions? That way, the engine can improve but still have a way to "fix" some older missions to be as they were originally designed. I guess something like that can already be done with an autoexec.cfg file. Maybe have a cvar that doesn't get archived, which would be some kind of mantle override to disable mantle while shouldering. Is there a place where I can see that discussion? I think TDM is a really nice project and wonder how everyone collaborates. |
|
+1 on low mantle, you can do it in Thief 1/2. | |
@nbohr1more What's the status on this? What was the conclusion of the internal discussion? Has a single mantle trap been found in any of the missions already released? It would be nice to have this for 2.11, so Thief 1 & 2 players can have a better experience. I have been playing with the patch I provided above, and it's improved the gameplay a lot. No more frustrations. If a reason was found for not applying the patch as is, having a cvar for this at the very least would improve the game. |
|
None of the original participants have moved the discussion on this. Please submit a revised patch with a cvar and I will post about it for inclusion. It is pretty late in the dev cycle but we will consider it. |
|
@nbohr1more Thank you for considering this! Attached revised patch. Note: I set the default to allow mantling while shouldering. Feel free to change the cvar name and its default as you see fit. r10256-pm_mantle_while_shouldering.diff (2,580 bytes)
diff --git game/Player.cpp game/Player.cpp index 29014a8..6e84db5 100644 --- game/Player.cpp +++ game/Player.cpp @@ -4513,7 +4513,11 @@ void idPlayer::OnStartShoulderingBody(idEntity* body) // TODO: Also make sure you can't grab anything else (hands are full) // requires a new EIM flag? - SetImmobilization( "ShoulderedBody", SHOULDER_IMMOBILIZATIONS ); + SetImmobilization( "ShoulderedBody", + cv_pm_mantle_while_shouldering.GetBool() ? + (SHOULDER_IMMOBILIZATIONS & ~EIM_MANTLE) : + SHOULDER_IMMOBILIZATIONS + ); // set hinderance float maxSpeed = body->spawnArgs.GetFloat("shouldered_maxspeed","1.0f"); diff --git game/gamesys/SysCvar.cpp game/gamesys/SysCvar.cpp index cc1f3c1..859ee24 100644 --- game/gamesys/SysCvar.cpp +++ game/gamesys/SysCvar.cpp @@ -208,6 +208,7 @@ idCVar cv_pm_softhinderance_run( "pm_softhinderance_run", "1.0", CVAR_GAME | CVA idCVar cv_pm_weightmod( "pm_weightmod", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "Gets multiplied to the force applied to objects below the player model. Defaults to 1." ); +idCVar cv_pm_mantle_while_shouldering( "pm_mantle_while_shouldering", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "If set to 1, allow mantling while shouldering a body." ); idCVar cv_pm_mantle_reach( "pm_mantle_reach", "0.5", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "Horizontal reach of mantle ability, as fraction of player height. Default is 0.5" ); idCVar cv_pm_mantle_height( "pm_mantle_height", "0.2", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "Vertical reach of mantle ability, as fraction of player height. Default is 0.2" ); idCVar cv_pm_mantle_minflatness( "pm_mantle_minflatness", "0.707", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "Cannot mantle on top of surfaces whose angle's cosine is smaller than this value. e.g. >1.0 means nothing can be mantled; 1.0 means only perfectly flat floors (0 degrees) can be mantled on top of; ~0.707 means no surfaces steeper than 45 degrees can be mantled on top of; 0.5 means no surfaces steeper than 60 degrees can be mantled on top of; a large negative value (like -10) means all surfaces can be mantled regardless of steepness. Default is 0.707." ); diff --git game/gamesys/SysCvar.h game/gamesys/SysCvar.h index f8889c8..1ee73aa 100644 --- game/gamesys/SysCvar.h +++ game/gamesys/SysCvar.h @@ -165,6 +165,7 @@ extern idCVar cv_tdm_footfalls_movetype_specific; extern idCVar cv_pm_weightmod; +extern idCVar cv_pm_mantle_while_shouldering; extern idCVar cv_pm_mantle_height; extern idCVar cv_pm_mantle_reach; extern idCVar cv_pm_mantle_minflatness; |
|
Attached v2 of revised patch. The only change is the inclusion of comments referring to this bug, 5892. r10256-pm_mantle_while_shouldering-v2.diff (2,706 bytes)
diff --git game/Player.cpp game/Player.cpp index 29014a8..2dc7dab 100644 --- game/Player.cpp +++ game/Player.cpp @@ -4513,7 +4513,12 @@ void idPlayer::OnStartShoulderingBody(idEntity* body) // TODO: Also make sure you can't grab anything else (hands are full) // requires a new EIM flag? - SetImmobilization( "ShoulderedBody", SHOULDER_IMMOBILIZATIONS ); + SetImmobilization( "ShoulderedBody", + cv_pm_mantle_while_shouldering.GetBool() ? + // #5892: Mantle while carring a body + (SHOULDER_IMMOBILIZATIONS & ~EIM_MANTLE) : + SHOULDER_IMMOBILIZATIONS + ); // set hinderance float maxSpeed = body->spawnArgs.GetFloat("shouldered_maxspeed","1.0f"); diff --git game/gamesys/SysCvar.cpp game/gamesys/SysCvar.cpp index cc1f3c1..ad66563 100644 --- game/gamesys/SysCvar.cpp +++ game/gamesys/SysCvar.cpp @@ -208,6 +208,10 @@ idCVar cv_pm_softhinderance_run( "pm_softhinderance_run", "1.0", CVAR_GAME | CVA idCVar cv_pm_weightmod( "pm_weightmod", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "Gets multiplied to the force applied to objects below the player model. Defaults to 1." ); + +// #5892: Mantle while carring a body +idCVar cv_pm_mantle_while_shouldering( "pm_mantle_while_shouldering", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "If set to 1, allow mantling while shouldering a body." ); + idCVar cv_pm_mantle_reach( "pm_mantle_reach", "0.5", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "Horizontal reach of mantle ability, as fraction of player height. Default is 0.5" ); idCVar cv_pm_mantle_height( "pm_mantle_height", "0.2", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "Vertical reach of mantle ability, as fraction of player height. Default is 0.2" ); idCVar cv_pm_mantle_minflatness( "pm_mantle_minflatness", "0.707", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "Cannot mantle on top of surfaces whose angle's cosine is smaller than this value. e.g. >1.0 means nothing can be mantled; 1.0 means only perfectly flat floors (0 degrees) can be mantled on top of; ~0.707 means no surfaces steeper than 45 degrees can be mantled on top of; 0.5 means no surfaces steeper than 60 degrees can be mantled on top of; a large negative value (like -10) means all surfaces can be mantled regardless of steepness. Default is 0.707." ); diff --git game/gamesys/SysCvar.h game/gamesys/SysCvar.h index f8889c8..708363f 100644 --- game/gamesys/SysCvar.h +++ game/gamesys/SysCvar.h @@ -165,6 +165,9 @@ extern idCVar cv_tdm_footfalls_movetype_specific; extern idCVar cv_pm_weightmod; +// #5892: Mantle while carring a body +extern idCVar cv_pm_mantle_while_shouldering; + extern idCVar cv_pm_mantle_height; extern idCVar cv_pm_mantle_reach; extern idCVar cv_pm_mantle_minflatness; |
|
Rev 10257 | |
Thanks for sorting this chaps, its been a minor frustration for years. | |
This change has not happened yet, it's just a cvar for testing, which is not default. I would say mantling with shouldered body should be limited to knee/waist level. P.S. I also would be happy to see the discussion =) Could someone please post a link? |
|
Added this link to the description: https://forums.thedarkmod.com/index.php?/topic/21550-5982-allow-mantle-when-shouldering/ |
|
I've implemented a way to enforce knee/waist height checking on mantle while shouldering a body. Also, if the player is falling, do not allow mantle while shouldering. The max height is based on a table from The Painter's Wife at (831.86 -350.78 777.25). The table height is 40.41 units. Also, the max height can be adjusted using "pm_mantle_maxLowObstacleHeight". 1. When standing, max height is pm_mantle_maxLowObstacleHeight + 5, which is 41. 2. When crouched, max height is pm_mantle_maxLowObstacleHeight, which is 36; Perhaps, after this patch is applied, the "pm_mantle_while_shouldering" cvar can be removed and "EIM_MANTLE" can be removed from SHOULDER_IMMOBILIZATIONS (same as original patch above, "mantle-carry-body-v1-r10063.diff")? In other words, apply this patch, revert Rev 10257, and apply mantle-carry-body-v1-r10063.diff. This patch gives us something to discuss at least. Is this a good approach? What should the max height be? r10262-low-mantle-check-while-shouldering.diff (3,813 bytes)
diff --git game/Player.h game/Player.h index a51a589..b4f2fd5 100644 --- game/Player.h +++ game/Player.h @@ -825,6 +825,8 @@ public: void UpdateSkinSetup( bool restart ); + bool IsShoulderingBody( void ) { return m_bShoulderingBody; }; + bool OnLadder( void ) const; // Virtal override of idActor::OnElevator() virtual CMultiStateMover* OnElevator(bool mustBeMoving) const; diff --git game/physics/Physics_Player.cpp game/physics/Physics_Player.cpp index e610f28..c57a3c7 100644 --- game/physics/Physics_Player.cpp +++ game/physics/Physics_Player.cpp @@ -4283,9 +4283,33 @@ void idPhysics_Player::StartMantle EMantlePhase initialMantlePhase, idVec3 eyePos, idVec3 startPos, - idVec3 endPos + idVec3 endPos, + float floorHeight ) { + // #5892: While shouldering a body, allow mantling at roughly waist height. + if (static_cast<idPlayer*>(self)->IsShoulderingBody()) + { + const bool bIsCrouched = current.movementFlags & PMF_DUCKED; + const float fallingSpeed = current.velocity * gravityNormal; + const float endHeight = -endPos * gravityNormal; + const float mantleHeight = endHeight - floorHeight; + const float maxMantleHeight = bIsCrouched ? + cv_pm_mantle_maxLowObstacleHeight.GetFloat() : // crouched: 36 + cv_pm_mantle_maxLowObstacleHeight.GetFloat() + 5; // standing: 41 + + // must be standing on the ground (or not falling from a jump-mantle) + if (!groundPlane && fallingSpeed > 0) + return; + // must be doing a non-hanging, non-pulling mantle + if (!(initialMantlePhase == push_DarkModMantlePhase || + initialMantlePhase == pushNonCrouched_DarkModMantlePhase)) + return; + // must mantle at roughly waist height + if (mantleHeight > maxMantleHeight) + return; + } + // Ishtvan 10/16/05 // If mantling starts while on a rope, detach from that rope if ( m_bOnRope ) @@ -5120,7 +5144,7 @@ void idPhysics_Player::PerformMantle() || mantleEndHeight < feetHeight + cv_pm_mantle_maxLowObstacleHeight.GetFloat()*0.66f)) // Reduce allowed obstacle height mid-air { // Do a fast mantle over low obstacle - StartMantle(pushNonCrouched_DarkModMantlePhase, eyePos, GetOrigin(), mantleEndPoint); + StartMantle(pushNonCrouched_DarkModMantlePhase, eyePos, GetOrigin(), mantleEndPoint, floorHeight); return; } } @@ -5135,7 +5159,7 @@ void idPhysics_Player::PerformMantle() && mantleEndHeight < floorHeight + pm_normalviewheight.GetFloat()) { // Do a fast pull-push mantle over medium sized obstacle - StartMantle(pullFast_DarkModMantlePhase, eyePos, GetOrigin(), mantleEndPoint); + StartMantle(pullFast_DarkModMantlePhase, eyePos, GetOrigin(), mantleEndPoint, floorHeight); return; } } @@ -5144,16 +5168,16 @@ void idPhysics_Player::PerformMantle() // Start with pull if on the ground, hang if not if (groundPlane) { - StartMantle(pull_DarkModMantlePhase, eyePos, GetOrigin(), mantleEndPoint); + StartMantle(pull_DarkModMantlePhase, eyePos, GetOrigin(), mantleEndPoint, floorHeight); } else { - StartMantle(hang_DarkModMantlePhase, eyePos, GetOrigin(), mantleEndPoint); + StartMantle(hang_DarkModMantlePhase, eyePos, GetOrigin(), mantleEndPoint, floorHeight); } } else { - StartMantle(push_DarkModMantlePhase, eyePos, GetOrigin(), mantleEndPoint); + StartMantle(push_DarkModMantlePhase, eyePos, GetOrigin(), mantleEndPoint, floorHeight); } } } diff --git game/physics/Physics_Player.h game/physics/Physics_Player.h index ba17de1..712d81e 100644 --- game/physics/Physics_Player.h +++ game/physics/Physics_Player.h @@ -571,7 +571,8 @@ protected: EMantlePhase initialMantlePhase, idVec3 eyePos, idVec3 startPos, - idVec3 endPos + idVec3 endPos, + float floatHeight ); /*! |
|
I don't like the way it does not blend with the other mantling conditions. I think we should pause this until 2.11 is over, and then have more time for testing. |
|
It would be great for this to be finalized for 2.11, so mappers know what to expect and Thief players can enjoy the game more without frustrations. It'll be worth it. There are two separate issues: 1. What are the rules for mantle while shouldering? 2. Code and code organization. I think we should focus on (1) the rules for mantle while shouldering, because the final code and code organization can be beautified after 2.11 release if needed. I don't have access to https://forums.thedarkmod.com/index.php?/topic/21550-5982-allow-mantle-when-shouldering/. So, I don't know what's already been discussed. Who needs to be part of this conversion for consensus to happen about the rules (not code)? For us to finalize the rules, it would be helpful for us to answer the following questions. Do we really need to restrict mantling while shouldering at all? If we restrict the player while shouldering, what should the rules be? While shouldering, what's the tallest object that can be mantled? While shouldering, should there be different object height requirements between crouched and standing? While shouldering, can the player mantle during a fall or jump across to another ledge? While shouldering, what mantle types are allowed out of: push, pushNonCrouch, pull, pullFast, hang? (Are there other rules to consider?) |
|
My opinion is... Do we really need to restrict mantling while shouldering at all? No. Games are for fun and escaping reality. Let the player mantle while shouldering without restrictions and frustrations. This matches Thief 1 & 2. If we restrict the player while shouldering,... While shouldering, what's the tallest object that can be mantled? 41 units. That's based on a table at roughly waist height, which felt like the tallest reasonable object during my testing. While shouldering, should there be different object height requirements between crouched and standing? Originally, I implemented separate cases, because it didn't feel quite right to have a body and mantle up so high while crouched. Not having a difference reduces complexity and is more predictable for the player, so now I think treat both crouched and standing the same. While shouldering, can the player mantle during a fall or jump across to another ledge? No. The character is falling or hitting a ledge with force, which can be hard to handle while carrying a body. While shouldering, what mantle types are allowed out of: push, pushNonCrouch, pull, pullFast, hang? I think only push and pushNonCrouch. Don't allow pull, pullFast, and hang, because they require hands. (Are there other rules to consider?) None that I can think of. |
|
typo fix: Who needs to be part of this **conversation** for consensus to happen about the rules (not code)? | |
I suspend this until 2.11 is over. | |
Daft Mugi, thank's a lot for your contributions. This will be integrated into the mod, I am sure of it, but I agree with stgatilov. Beta phase is already taking way too long as it is and a major new feature like this needs to be thoroughly tested. Beta can be quite annoying, because it hinders every dev from actually implementing new things, so we would like to get this over with soon. Maybe we could consider a 2.11 hotfix to include your patch later. | |
Attached waist-height mantle while shouldering body (v2). This incorporates feedback given by stgatilov. Now, the mantling conditionals are blended. r10261-low-mantle-check-while-shouldering-v2.diff (3,251 bytes)
diff --git game/Player.h game/Player.h index a51a589..b4f2fd5 100644 --- game/Player.h +++ game/Player.h @@ -825,6 +825,8 @@ public: void UpdateSkinSetup( bool restart ); + bool IsShoulderingBody( void ) { return m_bShoulderingBody; }; + bool OnLadder( void ) const; // Virtal override of idActor::OnElevator() virtual CMultiStateMover* OnElevator(bool mustBeMoving) const; diff --git game/physics/Physics_Player.cpp game/physics/Physics_Player.cpp index e610f28..96cdf86 100644 --- game/physics/Physics_Player.cpp +++ game/physics/Physics_Player.cpp @@ -5107,9 +5107,37 @@ void idPhysics_Player::PerformMantle() } const float eyeHeight = -eyePos * gravityNormal; - const bool bFallingFast = - (current.velocity * gravityNormal) > - cv_pm_mantle_fallingFast_speedthreshold.GetFloat(); + const float fallingSpeed = current.velocity * gravityNormal; + const bool bFallingFast = fallingSpeed > cv_pm_mantle_fallingFast_speedthreshold.GetFloat(); + + const bool bIsCrouched = current.movementFlags & PMF_DUCKED; + const bool bIsShoulderingBody = static_cast<idPlayer*>(self)->IsShoulderingBody(); + + // #5892: While shouldering a body, allow mantling at roughly waist height. + if (bIsShoulderingBody) + { + const float obstacleHeight = mantleEndHeight - floorHeight; + const float maxShoulderingMantleHeight = bIsCrouched ? + cv_pm_mantle_maxLowObstacleHeight.GetFloat() : // standing: 36 + cv_pm_mantle_maxLowObstacleHeight.GetFloat() + 5; // standing: 41 + + // Must only be push or pushNonCrouched mantle phase. + // Note: Check to make sure that's the case in the mantle + // phase conditionals below, especially when editing them. + + // Must mantle at roughly waist height. + if (obstacleHeight > maxShoulderingMantleHeight) + return; + // Must be standing on the ground (or not falling from a jump-mantle). + // In other words, don't be going downwards. + // "!groundPlane" only works with dedicated mantle key. + // When the jump key is used to mantle, the player lifts + // ever so slightly off the ground before a mantle is + // detected. Using "fallingSpeed" here as an alternative + // way to ensure the player is approximately grounded. + if (fallingSpeed > 0) + return; + } if (cv_pm_mantle_fastLowObstaces.GetBool()) // STiFU #4930 { @@ -5127,9 +5155,8 @@ void idPhysics_Player::PerformMantle() if (cv_pm_mantle_fastMediumObstaclesCrouched.GetBool()) // STiFU #4945 { // Use floorHeight instead of feetHeight to allow this mantle also when jump-mantling medium sized obstacles - const bool bIsCrouched = current.movementFlags & PMF_DUCKED; - if ( bIsCrouched + && !bIsShoulderingBody // #5892 && !bFallingFast && eyeHeight < mantleEndHeight // When endheight lower than eyes, use the regular push mantle && mantleEndHeight < floorHeight + pm_normalviewheight.GetFloat()) @@ -5139,7 +5166,7 @@ void idPhysics_Player::PerformMantle() return; } } - if (eyeHeight < mantleEndHeight) + if (eyeHeight < mantleEndHeight && !bIsShoulderingBody) // #5892 { // Start with pull if on the ground, hang if not if (groundPlane) |
|
Attached waist-height mantle while shouldering body (v3). Restored "!groundPlane" check from v1. It may not make a difference, but it's better to be safe by ensuring what the game thinks is grounded is grounded here as well. r10261-low-mantle-check-while-shouldering-v3.diff (3,267 bytes)
diff --git game/Player.h game/Player.h index a51a589..b4f2fd5 100644 --- game/Player.h +++ game/Player.h @@ -825,6 +825,8 @@ public: void UpdateSkinSetup( bool restart ); + bool IsShoulderingBody( void ) { return m_bShoulderingBody; }; + bool OnLadder( void ) const; // Virtal override of idActor::OnElevator() virtual CMultiStateMover* OnElevator(bool mustBeMoving) const; diff --git game/physics/Physics_Player.cpp game/physics/Physics_Player.cpp index e610f28..cfff069 100644 --- game/physics/Physics_Player.cpp +++ game/physics/Physics_Player.cpp @@ -5107,9 +5107,37 @@ void idPhysics_Player::PerformMantle() } const float eyeHeight = -eyePos * gravityNormal; - const bool bFallingFast = - (current.velocity * gravityNormal) > - cv_pm_mantle_fallingFast_speedthreshold.GetFloat(); + const float fallingSpeed = current.velocity * gravityNormal; + const bool bFallingFast = fallingSpeed > cv_pm_mantle_fallingFast_speedthreshold.GetFloat(); + + const bool bIsCrouched = current.movementFlags & PMF_DUCKED; + const bool bIsShoulderingBody = static_cast<idPlayer*>(self)->IsShoulderingBody(); + + // #5892: While shouldering a body, allow mantling at roughly waist height. + if (bIsShoulderingBody) + { + const float obstacleHeight = mantleEndHeight - floorHeight; + const float maxShoulderingMantleHeight = bIsCrouched ? + cv_pm_mantle_maxLowObstacleHeight.GetFloat() : // standing: 36 + cv_pm_mantle_maxLowObstacleHeight.GetFloat() + 5; // standing: 41 + + // Must only be push or pushNonCrouched mantle phase. + // Note: Check to make sure that's the case in the mantle + // phase conditionals below, especially when editing them. + + // Must mantle at roughly waist height. + if (obstacleHeight > maxShoulderingMantleHeight) + return; + // Must be standing on the ground (or not falling from a jump-mantle). + // In other words, don't be going downwards. + // "!groundPlane" only works with dedicated mantle key. + // When the jump key is used to mantle, the player lifts + // ever so slightly off the ground before a mantle is + // detected. Using "fallingSpeed" here as an alternative + // way to ensure the player is approximately grounded. + if (!groundPlane && fallingSpeed > 0) + return; + } if (cv_pm_mantle_fastLowObstaces.GetBool()) // STiFU #4930 { @@ -5127,9 +5155,8 @@ void idPhysics_Player::PerformMantle() if (cv_pm_mantle_fastMediumObstaclesCrouched.GetBool()) // STiFU #4945 { // Use floorHeight instead of feetHeight to allow this mantle also when jump-mantling medium sized obstacles - const bool bIsCrouched = current.movementFlags & PMF_DUCKED; - if ( bIsCrouched + && !bIsShoulderingBody // #5892 && !bFallingFast && eyeHeight < mantleEndHeight // When endheight lower than eyes, use the regular push mantle && mantleEndHeight < floorHeight + pm_normalviewheight.GetFloat()) @@ -5139,7 +5166,7 @@ void idPhysics_Player::PerformMantle() return; } } - if (eyeHeight < mantleEndHeight) + if (eyeHeight < mantleEndHeight && !bIsShoulderingBody) // #5892 { // Start with pull if on the ground, hang if not if (groundPlane) |
|
Attached waist-height mantle while shouldering body (v4). Added dedicated cvar "pm_mantle_maxShoulderingObstacleHeight". r10261-low-mantle-check-while-shouldering-v4.diff (5,697 bytes)
diff --git game/Player.h game/Player.h index a51a589..b4f2fd5 100644 --- game/Player.h +++ game/Player.h @@ -825,6 +825,8 @@ public: void UpdateSkinSetup( bool restart ); + bool IsShoulderingBody( void ) { return m_bShoulderingBody; }; + bool OnLadder( void ) const; // Virtal override of idActor::OnElevator() virtual CMultiStateMover* OnElevator(bool mustBeMoving) const; diff --git game/gamesys/SysCvar.cpp game/gamesys/SysCvar.cpp index 0bc7994..0ce51c2 100644 --- game/gamesys/SysCvar.cpp +++ game/gamesys/SysCvar.cpp @@ -226,6 +226,7 @@ idCVar cv_pm_mantle_pushNonCrouched_msecs("pm_mantle_pushNonCrouched_msecs","550 idCVar cv_pm_mantle_pushNonCrouched_playgrunt_speedthreshold("pm_mantle_pushNonCrouched_playgrunt_speedthreshold", "120.0", CVAR_GAME | CVAR_FLOAT, "If the player speed exceeds this threshold, a grund sound is played when performing the mantle.", 0.0f, 100000.0f); idCVar cv_pm_mantle_fastLowObstaces("pm_mantle_fastLowObstacles", "1", CVAR_GAME | CVAR_BOOL, "If true, a faster mantle will be performed for low obstacles.", 0, 1); idCVar cv_pm_mantle_maxLowObstacleHeight("pm_mantle_maxLowObstacleHeight", "36.0", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE, "The maximum height of obstacles over which a fast mantle can be performed", 0.0f, 60.0f); +idCVar cv_pm_mantle_maxShoulderingObstacleHeight("pm_mantle_maxShoulderingObstacleHeight", "41.0", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE, "The maximum height of obstacles allowed for a shouldering body mantle", 0.0f, 60.0f); idCVar cv_pm_mantle_fastMediumObstaclesCrouched("pm_mantle_fastMediumObstaclesCrouched", "1", CVAR_GAME | CVAR_BOOL, "If true, a faster mantle will be performed for medium-high obstacles in crouched state", 0, 1); idCVar cv_pm_mantle_pullFast_msecs("pm_mantle_pullFast_msecs", "450.0", CVAR_GAME | CVAR_INTEGER |CVAR_ARCHIVE, "The duration it takes for a fast pull.", 0, 10000); idCVar cv_pm_mantle_fallingFast_speedthreshold("pm_mantle_fallingFast_speedthreshold", "360.0", CVAR_GAME | CVAR_FLOAT, "If falling faster than this threshold, no fast mantles will be performed.", 0.0f, 100000.0f); diff --git game/gamesys/SysCvar.h game/gamesys/SysCvar.h index 0d558ff..74b9b6c 100644 --- game/gamesys/SysCvar.h +++ game/gamesys/SysCvar.h @@ -181,6 +181,7 @@ extern idCVar cv_pm_mantle_push_msecs; extern idCVar cv_pm_mantle_pushNonCrouched_msecs; extern idCVar cv_pm_mantle_fastLowObstaces; extern idCVar cv_pm_mantle_maxLowObstacleHeight; +extern idCVar cv_pm_mantle_maxShoulderingObstacleHeight; extern idCVar cv_pm_mantle_fastMediumObstaclesCrouched; extern idCVar cv_pm_mantle_pullFast_msecs; extern idCVar cv_pm_mantle_pushNonCrouched_playgrunt_speedthreshold; diff --git game/physics/Physics_Player.cpp game/physics/Physics_Player.cpp index e610f28..d1cfabf 100644 --- game/physics/Physics_Player.cpp +++ game/physics/Physics_Player.cpp @@ -5107,9 +5107,41 @@ void idPhysics_Player::PerformMantle() } const float eyeHeight = -eyePos * gravityNormal; - const bool bFallingFast = - (current.velocity * gravityNormal) > - cv_pm_mantle_fallingFast_speedthreshold.GetFloat(); + const float fallingSpeed = current.velocity * gravityNormal; + const bool bFallingFast = fallingSpeed > cv_pm_mantle_fallingFast_speedthreshold.GetFloat(); + + const bool bIsCrouched = current.movementFlags & PMF_DUCKED; + const bool bIsShoulderingBody = static_cast<idPlayer*>(self)->IsShoulderingBody(); + + // #5892: While shouldering a body, allow mantling at roughly waist height. + if (bIsShoulderingBody) + { + const float obstacleHeight = mantleEndHeight - floorHeight; + + // While crouched, the max allowed shouldering mantle + // height is a bit less than while standing. + // Two reasons: animation and challenge. + const float maxShoulderingMantleHeight = bIsCrouched ? + cv_pm_mantle_maxShoulderingObstacleHeight.GetFloat() - 5 : + cv_pm_mantle_maxShoulderingObstacleHeight.GetFloat(); + + // Must only be push or pushNonCrouched mantle phase. + // Note: Check to make sure that's the case in the mantle + // phase conditionals below, especially when editing them. + + // Must mantle at roughly waist height. + if (obstacleHeight > maxShoulderingMantleHeight) + return; + // Must be standing on the ground (or not falling from a jump-mantle). + // In other words, don't be going downwards. + // "groundPlane" only works with dedicated mantle key. + // When the jump key is used to mantle, the player lifts + // ever so slightly off the ground before a mantle is + // detected. Using "fallingSpeed" here as an alternative + // way to ensure the player is approximately grounded. + if (!groundPlane && fallingSpeed > 0) + return; + } if (cv_pm_mantle_fastLowObstaces.GetBool()) // STiFU #4930 { @@ -5127,9 +5159,8 @@ void idPhysics_Player::PerformMantle() if (cv_pm_mantle_fastMediumObstaclesCrouched.GetBool()) // STiFU #4945 { // Use floorHeight instead of feetHeight to allow this mantle also when jump-mantling medium sized obstacles - const bool bIsCrouched = current.movementFlags & PMF_DUCKED; - if ( bIsCrouched + && !bIsShoulderingBody // #5892 && !bFallingFast && eyeHeight < mantleEndHeight // When endheight lower than eyes, use the regular push mantle && mantleEndHeight < floorHeight + pm_normalviewheight.GetFloat()) @@ -5139,7 +5170,7 @@ void idPhysics_Player::PerformMantle() return; } } - if (eyeHeight < mantleEndHeight) + if (eyeHeight < mantleEndHeight && !bIsShoulderingBody) // #5892 { // Start with pull if on the ground, hang if not if (groundPlane) |
|
Attached waist-height mantle while shouldering body (v5). I think this is might be the one or at least close. "pm_mantle_while_shouldering" default:"1" Which restriction for mantle while shouldering? 0 --- no mantling while shouldering a body (TDM original) 1 --- restricted mantling while shouldering a body 2 --- unrestricted mantling while shouldering a body (Cheat Mode) Option 1 -- Restricted mantle while shouldering rules: * "pm_mantle_maxShoulderingObstacleHeight" sets max height; default 41. * obstacle height is based on the obstacle relative to the player rather than the obstacle relative to the ground. * no pull or hang allowed. * must not be falling fast. r10261-low-mantle-check-while-shouldering-v5.diff (6,596 bytes)
diff --git game/Player.cpp game/Player.cpp index c6f71dd..240ad06 100644 --- game/Player.cpp +++ game/Player.cpp @@ -4514,7 +4514,7 @@ void idPlayer::OnStartShoulderingBody(idEntity* body) // TODO: Also make sure you can't grab anything else (hands are full) // requires a new EIM flag? SetImmobilization( "ShoulderedBody", - cv_pm_mantle_while_shouldering.GetBool() ? + cv_pm_mantle_while_shouldering.GetInteger() > 0 ? // #5892: Mantle while carring a body (SHOULDER_IMMOBILIZATIONS & ~EIM_MANTLE) : SHOULDER_IMMOBILIZATIONS diff --git game/Player.h game/Player.h index a51a589..b4f2fd5 100644 --- game/Player.h +++ game/Player.h @@ -825,6 +825,8 @@ public: void UpdateSkinSetup( bool restart ); + bool IsShoulderingBody( void ) { return m_bShoulderingBody; }; + bool OnLadder( void ) const; // Virtal override of idActor::OnElevator() virtual CMultiStateMover* OnElevator(bool mustBeMoving) const; diff --git game/gamesys/SysCvar.cpp game/gamesys/SysCvar.cpp index 0bc7994..7aec3d4 100644 --- game/gamesys/SysCvar.cpp +++ game/gamesys/SysCvar.cpp @@ -208,9 +208,6 @@ idCVar cv_pm_softhinderance_run( "pm_softhinderance_run", "1.0", CVAR_GAME | CVA idCVar cv_pm_weightmod( "pm_weightmod", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "Gets multiplied to the force applied to objects below the player model. Defaults to 1." ); -// #5892: Mantle while carring a body -idCVar cv_pm_mantle_while_shouldering( "pm_mantle_while_shouldering", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "If set to 1, allow mantling while shouldering a body." ); - idCVar cv_pm_mantle_reach( "pm_mantle_reach", "0.5", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "Horizontal reach of mantle ability, as fraction of player height. Default is 0.5" ); idCVar cv_pm_mantle_height( "pm_mantle_height", "0.2", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "Vertical reach of mantle ability, as fraction of player height. Default is 0.2" ); idCVar cv_pm_mantle_minflatness( "pm_mantle_minflatness", "0.707", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT, "Cannot mantle on top of surfaces whose angle's cosine is smaller than this value. e.g. >1.0 means nothing can be mantled; 1.0 means only perfectly flat floors (0 degrees) can be mantled on top of; ~0.707 means no surfaces steeper than 45 degrees can be mantled on top of; 0.5 means no surfaces steeper than 60 degrees can be mantled on top of; a large negative value (like -10) means all surfaces can be mantled regardless of steepness. Default is 0.707." ); @@ -226,6 +223,17 @@ idCVar cv_pm_mantle_pushNonCrouched_msecs("pm_mantle_pushNonCrouched_msecs","550 idCVar cv_pm_mantle_pushNonCrouched_playgrunt_speedthreshold("pm_mantle_pushNonCrouched_playgrunt_speedthreshold", "120.0", CVAR_GAME | CVAR_FLOAT, "If the player speed exceeds this threshold, a grund sound is played when performing the mantle.", 0.0f, 100000.0f); idCVar cv_pm_mantle_fastLowObstaces("pm_mantle_fastLowObstacles", "1", CVAR_GAME | CVAR_BOOL, "If true, a faster mantle will be performed for low obstacles.", 0, 1); idCVar cv_pm_mantle_maxLowObstacleHeight("pm_mantle_maxLowObstacleHeight", "36.0", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE, "The maximum height of obstacles over which a fast mantle can be performed", 0.0f, 60.0f); + +// Daft Mugi #5892: Mantle while carring a body +idCVar cv_pm_mantle_maxShoulderingObstacleHeight("pm_mantle_maxShoulderingObstacleHeight", "41", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE, "The maximum height of obstacles allowed for a shouldering body mantle", 0.0f, 100.0f); +idCVar cv_pm_mantle_while_shouldering( + "pm_mantle_while_shouldering", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_INTEGER, + "Which restriction for mantle while shouldering?\n" + " 0 --- no mantling while shouldering a body (TDM original)\n" + " 1 --- restricted mantling while shouldering a body\n" + " 2 --- unrestricted mantling while shouldering a body (Cheat Mode)" +); + idCVar cv_pm_mantle_fastMediumObstaclesCrouched("pm_mantle_fastMediumObstaclesCrouched", "1", CVAR_GAME | CVAR_BOOL, "If true, a faster mantle will be performed for medium-high obstacles in crouched state", 0, 1); idCVar cv_pm_mantle_pullFast_msecs("pm_mantle_pullFast_msecs", "450.0", CVAR_GAME | CVAR_INTEGER |CVAR_ARCHIVE, "The duration it takes for a fast pull.", 0, 10000); idCVar cv_pm_mantle_fallingFast_speedthreshold("pm_mantle_fallingFast_speedthreshold", "360.0", CVAR_GAME | CVAR_FLOAT, "If falling faster than this threshold, no fast mantles will be performed.", 0.0f, 100000.0f); diff --git game/gamesys/SysCvar.h game/gamesys/SysCvar.h index 0d558ff..74b9b6c 100644 --- game/gamesys/SysCvar.h +++ game/gamesys/SysCvar.h @@ -181,6 +181,7 @@ extern idCVar cv_pm_mantle_push_msecs; extern idCVar cv_pm_mantle_pushNonCrouched_msecs; extern idCVar cv_pm_mantle_fastLowObstaces; extern idCVar cv_pm_mantle_maxLowObstacleHeight; +extern idCVar cv_pm_mantle_maxShoulderingObstacleHeight; extern idCVar cv_pm_mantle_fastMediumObstaclesCrouched; extern idCVar cv_pm_mantle_pullFast_msecs; extern idCVar cv_pm_mantle_pushNonCrouched_playgrunt_speedthreshold; diff --git game/physics/Physics_Player.cpp game/physics/Physics_Player.cpp index e610f28..a0abf21 100644 --- game/physics/Physics_Player.cpp +++ game/physics/Physics_Player.cpp @@ -5105,15 +5105,26 @@ void idPhysics_Player::PerformMantle() if (self->GetFloorPos(pm_normalviewheight.GetFloat(), floorPos)) floorHeight = -floorPos * gravityNormal; } + const float feetHeight = -(GetOrigin() * gravityNormal); const float eyeHeight = -eyePos * gravityNormal; + const float obstacleHeight = mantleEndHeight - feetHeight; const bool bFallingFast = (current.velocity * gravityNormal) > cv_pm_mantle_fallingFast_speedthreshold.GetFloat(); + // Daft Mugi #5892: While shouldering a body, allow mantling at roughly waist height. + if (cv_pm_mantle_while_shouldering.GetInteger() == 1 + && p_player->IsShoulderingBody() + && (eyeHeight < mantleEndHeight // no pull or hang allowed + || obstacleHeight > cv_pm_mantle_maxShoulderingObstacleHeight.GetFloat() // restrict max height + || bFallingFast)) // must not be falling fast + { + return; + } + if (cv_pm_mantle_fastLowObstaces.GetBool()) // STiFU #4930 { - const float feetHeight = -(GetOrigin() * gravityNormal); if ( IsMantleable == EMantleable_YesUpstraight // Upstraight mantle possible && !bFallingFast && (mantleEndHeight < floorHeight + cv_pm_mantle_maxLowObstacleHeight.GetFloat() // Only allow the full obstacle height when near the floor |
|
I've been releasing updates sooner than I probably should in case there's more code feedback. Sometimes I notice a typo in the comments, make an improvement, or change something based on the public discussion. So, instead of posting changes a lot here, I'll post patch updates as a GitHub Gist. Future patch updates: https://gist.github.com/daftmugi/8febb3fce1dc0c123210db70ee34b323 |
|
I applied the latest version in svn rev 10267. (I only added a line to cvar description) Thanks, Daft Mugi! |
|
Adding that extra line "Note that mantling above eye level is disabled regardless of this value" to the cvar description is a great clarification! Thank you! |
|
Previous commits added support for mantling while shouldering a body. Added support for mantling while carrying an object as code rev 10454. |
|
Date Modified | Username | Field | Change |
---|---|---|---|
26.01.2022 10:16 | Bikerdude | New Issue | |
06.08.2022 10:20 | Bikerdude | Product Version | TDM 2.09 => TDM 2.10 |
06.08.2022 10:21 | Bikerdude | Note Added: 0015129 | |
07.08.2022 04:35 | Daft Mugi | Note Added: 0015141 | |
07.08.2022 04:35 | Daft Mugi | File Added: mantle-carry-body-v1-r10063.diff | |
08.08.2022 00:55 | nbohr1more | Note Added: 0015148 | |
08.08.2022 00:56 | nbohr1more | Assigned To | => nbohr1more |
08.08.2022 00:56 | nbohr1more | Status | new => assigned |
08.08.2022 07:54 | Bikerdude | Note Added: 0015151 | |
08.08.2022 12:33 | nbohr1more | Relationship added | child of 0005453 |
08.08.2022 12:36 | nbohr1more | Note Added: 0015154 | |
08.08.2022 22:36 | Daft Mugi | Note Added: 0015156 | |
09.08.2022 02:43 | nbohr1more | Note Added: 0015157 | |
09.08.2022 02:43 | nbohr1more | Note Edited: 0015157 | |
09.08.2022 02:44 | nbohr1more | Note Edited: 0015157 | |
09.08.2022 03:18 | Daft Mugi | Note Added: 0015158 | |
09.08.2022 06:21 | Bikerdude | Note Added: 0015159 | |
21.01.2023 19:13 | Daft Mugi | Note Added: 0015840 | |
21.01.2023 22:01 | nbohr1more | Note Added: 0015841 | |
21.01.2023 23:47 | Daft Mugi | Note Added: 0015842 | |
21.01.2023 23:47 | Daft Mugi | File Added: r10256-pm_mantle_while_shouldering.diff | |
22.01.2023 00:05 | Daft Mugi | Note Added: 0015843 | |
22.01.2023 00:05 | Daft Mugi | File Added: r10256-pm_mantle_while_shouldering-v2.diff | |
22.01.2023 03:19 | nbohr1more | Severity | normal => feature |
22.01.2023 03:19 | nbohr1more | Status | assigned => feedback |
22.01.2023 03:19 | nbohr1more | Fixed in Version | => TDM 2.11 |
22.01.2023 03:19 | nbohr1more | Target Version | => TDM 2.11 |
22.01.2023 03:20 | nbohr1more | Note Added: 0015844 | |
22.01.2023 09:30 | Bikerdude | Note Added: 0015845 | |
22.01.2023 09:30 | Bikerdude | Status | feedback => assigned |
22.01.2023 16:19 | nbohr1more | Status | assigned => feedback |
22.01.2023 17:53 | stgatilov | Note Added: 0015847 | |
22.01.2023 18:09 | nbohr1more | Additional Information Updated | |
22.01.2023 18:09 | nbohr1more | Note Added: 0015848 | |
25.01.2023 19:14 | Daft Mugi | Note Added: 0015885 | |
25.01.2023 19:14 | Daft Mugi | File Added: r10262-low-mantle-check-while-shouldering.diff | |
25.01.2023 19:14 | Daft Mugi | File Added: table-height.jpg | |
25.01.2023 21:26 | stgatilov | Note Added: 0015888 | |
26.01.2023 06:10 | Daft Mugi | Note Added: 0015890 | |
26.01.2023 06:10 | Daft Mugi | Note Added: 0015891 | |
26.01.2023 17:36 | Daft Mugi | Note Added: 0015892 | |
26.01.2023 20:17 | stgatilov | Status | feedback => suspended |
26.01.2023 20:17 | stgatilov | Note Added: 0015895 | |
26.01.2023 20:17 | stgatilov | Fixed in Version | TDM 2.11 => |
26.01.2023 20:17 | stgatilov | Target Version | TDM 2.11 => TDM 2.12 |
26.01.2023 21:16 | STiFU | Note Added: 0015903 | |
28.01.2023 18:16 | Daft Mugi | Note Added: 0015918 | |
28.01.2023 18:16 | Daft Mugi | File Added: r10261-low-mantle-check-while-shouldering-v2.diff | |
28.01.2023 19:31 | Daft Mugi | Note Added: 0015919 | |
28.01.2023 19:31 | Daft Mugi | File Added: r10261-low-mantle-check-while-shouldering-v3.diff | |
30.01.2023 17:38 | Daft Mugi | Note Added: 0015921 | |
30.01.2023 17:38 | Daft Mugi | File Added: r10261-low-mantle-check-while-shouldering-v4.diff | |
31.01.2023 20:37 | Daft Mugi | Note Added: 0015922 | |
31.01.2023 20:37 | Daft Mugi | File Added: r10261-low-mantle-check-while-shouldering-v5.diff | |
31.01.2023 20:39 | Daft Mugi | Additional Information Updated | |
01.02.2023 06:09 | Daft Mugi | Note Added: 0015923 | |
05.02.2023 17:47 | stgatilov | Note Added: 0015927 | |
05.02.2023 17:47 | stgatilov | Status | suspended => feedback |
05.02.2023 18:15 | Daft Mugi | Note Added: 0015928 | |
16.06.2023 13:36 | stgatilov | Status | feedback => resolved |
16.06.2023 13:36 | stgatilov | Resolution | open => fixed |
16.06.2023 13:36 | stgatilov | Fixed in Version | => TDM 2.12 |
28.09.2023 15:50 | Daft Mugi | Note Added: 0016084 |