From fc09212d43d37595a5896b824aa90716104b9315 Mon Sep 17 00:00:00 2001 From: VoxelDoesCode Date: Sat, 8 Oct 2022 16:07:15 -0400 Subject: [PATCH] Tweak the running visuals --- datasrc/content.py | 54 +++++++++++++------------- src/game/client/components/players.cpp | 2 +- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/datasrc/content.py b/datasrc/content.py index fbf8dc284..1c5ec50b1 100644 --- a/datasrc/content.py +++ b/datasrc/content.py @@ -501,50 +501,52 @@ anim.front_foot.frames.Add(AnimKeyframe(0.8, 8, 0, 0)) anim.front_foot.frames.Add(AnimKeyframe(1.0,-10,-4, 0.2)) container.animations.Add(anim) +# the run_left animation is taken directly from run_right, only the x and rotate values are flipped, +# and each string is run backwards, to account for how it's played in game. anim = Animation("run_left") -anim.body.frames.Add(AnimKeyframe(0.0, 0, -2, 0)) +anim.body.frames.Add(AnimKeyframe(0.0, 0, -1, 0)) anim.body.frames.Add(AnimKeyframe(0.2, 0, 0, 0)) -anim.body.frames.Add(AnimKeyframe(0.4, 0, 0, 0)) -anim.body.frames.Add(AnimKeyframe(0.6, 0, -2, 0)) +anim.body.frames.Add(AnimKeyframe(0.4, 0, -1, 0)) +anim.body.frames.Add(AnimKeyframe(0.6, 0, 0, 0)) anim.body.frames.Add(AnimKeyframe(0.8, 0, 0, 0)) -anim.body.frames.Add(AnimKeyframe(1.0, 0, -2, 0)) +anim.body.frames.Add(AnimKeyframe(1.0, 0, -1, 0)) -anim.back_foot.frames.Add(AnimKeyframe(0.0, 18, -11, -0.27)) +anim.back_foot.frames.Add(AnimKeyframe(0.0, 18, -8, -0.27)) anim.back_foot.frames.Add(AnimKeyframe(0.2, 6, 0, 0)) anim.back_foot.frames.Add(AnimKeyframe(0.4, -7, 0, 0)) anim.back_foot.frames.Add(AnimKeyframe(0.6, -13, -4.5, 0.05)) -anim.back_foot.frames.Add(AnimKeyframe(0.8, 0, -11, -0.2)) -anim.back_foot.frames.Add(AnimKeyframe(1.0, 18, -11, -0.27)) +anim.back_foot.frames.Add(AnimKeyframe(0.8, 0, -8, -0.2)) +anim.back_foot.frames.Add(AnimKeyframe(1.0, 18, -8, -0.27)) -anim.front_foot.frames.Add(AnimKeyframe(0.0, -13, -4.5, 0.05)) -anim.front_foot.frames.Add(AnimKeyframe(0.2, -14, -7, 0.1)) -anim.front_foot.frames.Add(AnimKeyframe(0.4, 11, -13, -0.3)) -anim.front_foot.frames.Add(AnimKeyframe(0.6, 18, -11, -0.27)) -anim.front_foot.frames.Add(AnimKeyframe(0.8, 3, 0, -0.02)) -anim.front_foot.frames.Add(AnimKeyframe(1.0, -13, -4.5, 0.05)) +anim.front_foot.frames.Add(AnimKeyframe(0.0, -11, -2.5, 0.05)) +anim.front_foot.frames.Add(AnimKeyframe(0.2, -14, -5, 0.1)) +anim.front_foot.frames.Add(AnimKeyframe(0.4, 11, -8, -0.3)) +anim.front_foot.frames.Add(AnimKeyframe(0.6, 18, -8, -0.27)) +anim.front_foot.frames.Add(AnimKeyframe(0.8, 3, 0, 0)) +anim.front_foot.frames.Add(AnimKeyframe(1.0, -11, -2.5, 0.05)) container.animations.Add(anim) anim = Animation("run_right") -anim.body.frames.Add(AnimKeyframe(0.0, 0, -2, 0)) +anim.body.frames.Add(AnimKeyframe(0.0, 0, -1, 0)) anim.body.frames.Add(AnimKeyframe(0.2, 0, 0, 0)) -anim.body.frames.Add(AnimKeyframe(0.4, 0, -2, 0)) -anim.body.frames.Add(AnimKeyframe(0.6, 0, 0, 0)) +anim.body.frames.Add(AnimKeyframe(0.4, 0, 0, 0)) +anim.body.frames.Add(AnimKeyframe(0.6, 0, -1, 0)) anim.body.frames.Add(AnimKeyframe(0.8, 0, 0, 0)) -anim.body.frames.Add(AnimKeyframe(1.0, 0, -2, 0)) +anim.body.frames.Add(AnimKeyframe(1.0, 0, -1, 0)) -anim.back_foot.frames.Add(AnimKeyframe(0.0, -18, -11, 0.27)) -anim.back_foot.frames.Add(AnimKeyframe(0.2, 0, -11, 0.2)) +anim.back_foot.frames.Add(AnimKeyframe(0.0, -18, -8, 0.27)) +anim.back_foot.frames.Add(AnimKeyframe(0.2, 0, -8, 0.2)) anim.back_foot.frames.Add(AnimKeyframe(0.4, 13, -4.5, -0.05)) anim.back_foot.frames.Add(AnimKeyframe(0.6, 7, 0, 0)) anim.back_foot.frames.Add(AnimKeyframe(0.8, -6, 0, 0)) -anim.back_foot.frames.Add(AnimKeyframe(1.0, -18, -11, 0.27)) +anim.back_foot.frames.Add(AnimKeyframe(1.0, -18, -8, 0.27)) -anim.front_foot.frames.Add(AnimKeyframe(0.0, 13, -4.5, -0.05)) -anim.front_foot.frames.Add(AnimKeyframe(0.2, -3, 0, 0.02)) -anim.front_foot.frames.Add(AnimKeyframe(0.4, -18, -11, 0.27)) -anim.front_foot.frames.Add(AnimKeyframe(0.6, -11, -13, 0.3)) -anim.front_foot.frames.Add(AnimKeyframe(0.8, 14, -7, -0.1)) -anim.front_foot.frames.Add(AnimKeyframe(1.0, 13, -4.5, -0.05)) +anim.front_foot.frames.Add(AnimKeyframe(0.0, 11, -2.5, -0.05)) +anim.front_foot.frames.Add(AnimKeyframe(0.2, -3, 0, 0)) +anim.front_foot.frames.Add(AnimKeyframe(0.4, -18, -8, 0.27)) +anim.front_foot.frames.Add(AnimKeyframe(0.6, -11, -8, 0.3)) +anim.front_foot.frames.Add(AnimKeyframe(0.8, 14, -5, -0.1)) +anim.front_foot.frames.Add(AnimKeyframe(1.0, 11, -2.5, -0.05)) container.animations.Add(anim) anim = Animation("hammer_swing") diff --git a/src/game/client/components/players.cpp b/src/game/client/components/players.cpp index 1ca644798..5c7664695 100644 --- a/src/game/client/components/players.cpp +++ b/src/game/client/components/players.cpp @@ -420,7 +420,7 @@ void CPlayers::RenderPlayer( // evaluate animation float WalkTime = fmod(Position.x, 100.0f) / 100.0f; - float RunTime = fmod(Position.x, 250.0f) / 250.0f; + float RunTime = fmod(Position.x, 200.0f) / 200.0f; // Don't do a moon walk outside the left border if(WalkTime < 0)