-
Notifications
You must be signed in to change notification settings - Fork 327
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
You can run at full speed while crouched #2670
Comments
PlayerMotor.UpdateSpeed() calls PlayerSpeedChanger.GetBaseSpeed(), then PlayerSpeedChanger.ApplyInputSpeedAdjustment(). The latter totally overrides GetBaseSpeed() computations in the case you're running (l.120):
P.S.: I just noticed that PlayerSpeedChanger.baseSpeed works as a covert channel between GetBaseSpeed() and GetRunSpeed(), but is only when you're riding, so my analysis still holds when you're crouching? That code is so convoluted... |
A simple but cowardly fix would be to consider that when you're crouching you can't be running. Not great, does not match classic, but less surprising than what we have now. index 0ea93e535..8e7bc9a38 100644
--- a/Assets/Scripts/Game/Player/PlayerSpeedChanger.cs
+++ b/Assets/Scripts/Game/Player/PlayerSpeedChanger.cs
@@ -107,7 +107,7 @@ namespace DaggerfallWorkshop.Game
{
if (playerMotor.IsGrounded)
{
- isRunning = CanRun() && runningMode;
+ isRunning = CanRun() && runningMode && !playerMotor.IsCrouching;
isSneaking = !isRunning && sneakingMode;
}
else |
I'm thinking we might just be able to apply the crouch speed to the run function. public float GetRunSpeed()
{
Entity.PlayerEntity player = GameManager.Instance.PlayerEntity;
- float baseRunSpeed = playerMotor.IsRiding ? baseSpeed : (player.Stats.LiveSpeed + dfWalkBase) / classicToUnitySpeedUnitRatio;
+ float baseRunSpeed;
+ if (playerMotor.IsRiding)
+ baseRunSpeed = baseSpeed;
+ else if (playerMotor.IsCrouching && !levitateMotor.IsSwimming)
+ baseRunSpeed = (player.Stats.LiveSpeed + dfCrouchBase) / classicToUnitySpeedUnitRatio;
+ else
+ baseRunSpeed = (player.Stats.LiveSpeed + dfWalkBase) / classicToUnitySpeedUnitRatio;
return baseRunSpeed * (1.35f + (player.Skills.GetLiveSkillValue(DFCareer.Skills.Running) / 200f));
} |
Fix by KABoissonneault: Interkarma#2670 (comment)
Describe the issue
If you press the run key while crouched, you'll move at full running speed, same as if you were standing.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
In classic, crouching + running seems faster than crouching alone, but much slower than running alone.
I suspect running applies the same speed multiplier whether you're standing or crouched, but I haven't measured to be sure.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: