Browse Source

Merge pull request #256 from aws-lumberyard-dev/SprintCamTweaks

Sprint cam tweaks
Karl Berg 2 năm trước cách đây
mục cha
commit
a565516cc6

+ 2 - 3
Gem/Code/Source/Components/NetworkPlayerMovementComponent.cpp

@@ -164,8 +164,7 @@ namespace MultiplayerSample
             playerInput->m_forwardAxis = StickAxis(m_forwardWeight - m_backwardWeight);
             playerInput->m_strafeAxis = StickAxis(m_leftWeight - m_rightWeight);
 
-            // Strafe input
-            playerInput->m_sprint = m_sprinting;
+            playerInput->m_sprint = m_sprinting && (playerInput->m_forwardAxis > 0.0f); // Only sprint if we're moving forward
             playerInput->m_jump = m_jumping;
             playerInput->m_crouch = m_crouching;
         }
@@ -206,7 +205,7 @@ namespace MultiplayerSample
             // the other players moving around, still receive damage notifications,e tc.
             // This logging will get removed after the root cause has been found and resolved.
             AZLOG_INFO("netEntityId=%u: Different reset count, discarding player input. Input / local reset=%u / %u, clientInputId=%u, hostFrame=%u",
-                GetNetEntityId(), playerInput->m_resetCount, GetNetworkTransformComponentController()->GetResetCount(), 
+                GetNetEntityId(), playerInput->m_resetCount, GetNetworkTransformComponentController()->GetResetCount(),
                 input.GetClientInputId(), input.GetHostFrameId()
             );
             return;

+ 3 - 3
Gem/Code/Source/Components/NetworkSimplePlayerCameraComponent.cpp

@@ -24,9 +24,9 @@ namespace MultiplayerSample
     AZ_CVAR(AZ::Vector3, cl_cameraColliderSize, AZ::Vector3(0.5f, 0.1f, 0.3f), nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "Temporary collider size for player camera");
     AZ_CVAR(bool, cl_drawCameraCollider, false, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "Draw the camera collider");
     AZ_CVAR(bool, cl_cameraBlendingEnabled, false, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "When active, blends the camera aim angles.");
-    AZ_CVAR(float, cl_cameraFovSprintModifier, 15.0f, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "Controls how much to adjust camera FOV when sprinting");
-    AZ_CVAR(float, cl_cameraZoomSprintModifier, -0.5f, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "Controls how much to adjust camera zoom when sprinting");
-    AZ_CVAR(float, cl_cameraSprintBlendRate, 0.125f, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "The rate at which to blend into sprint camera");
+    AZ_CVAR(float, cl_cameraFovSprintModifier, 10.0f, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "Controls how much to adjust camera FOV when sprinting");
+    AZ_CVAR(float, cl_cameraZoomSprintModifier, -0.3f, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "Controls how much to adjust camera zoom when sprinting");
+    AZ_CVAR(float, cl_cameraSprintBlendRate, 0.25f, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "The rate at which to blend into sprint camera");
 
     NetworkSimplePlayerCameraComponentController::NetworkSimplePlayerCameraComponentController(NetworkSimplePlayerCameraComponent& parent)
         : NetworkSimplePlayerCameraComponentControllerBase(parent)

+ 2 - 2
Gem/Code/Source/Weapons/BaseWeapon.cpp

@@ -125,7 +125,7 @@ namespace MultiplayerSample
         const bool result = MultiplayerSample::GatherEntities(m_weaponParams.m_gatherParams, eventData, m_gatheredNetEntityIds, outResults);
         if (gp_PauseOnWeaponGather && (outResults.size() > 0))
         {
-            AZ::Interface<AZ::IConsole>::Get()->PerformCommand("t_scale 0");
+            AZ::Interface<AZ::IConsole>::Get()->PerformCommand("t_simulationTickScale 0");
         }
         return result;
     }
@@ -135,7 +135,7 @@ namespace MultiplayerSample
         ShotResult result = MultiplayerSample::GatherEntitiesMultisegment(m_weaponParams.m_gatherParams, m_gatheredNetEntityIds, deltaTime, inOutActiveShot, outResults);
         if (gp_PauseOnWeaponGather && (outResults.size() > 0))
         {
-            AZ::Interface<AZ::IConsole>::Get()->PerformCommand("t_scale 0");
+            AZ::Interface<AZ::IConsole>::Get()->PerformCommand("t_simulationTickScale 0");
         }
         return result;
     }