Adjust Newbie aim spring to reduce snap headshots
Some checks are pending
build / bot-build (apple-x86) (push) Waiting to run
build / bot-build (linux-amd64) (push) Waiting to run
build / bot-build (linux-arm64) (push) Waiting to run
build / bot-build (linux-riscv64) (push) Waiting to run
build / bot-build (linux-x86) (push) Waiting to run
build / bot-build (linux-x86-gcc) (push) Waiting to run
build / bot-build (linux-x86-nosimd) (push) Waiting to run
build / bot-build (windows-amd64) (push) Waiting to run
build / bot-build (windows-x86-clang) (push) Waiting to run
build / bot-build (windows-x86-gcc) (push) Waiting to run
build / bot-msvc (windows-x86) (push) Waiting to run
build / bot-msvc (windows-x86-msvc-xp) (push) Waiting to run
build / bot-apple (apple-arm64) (push) Waiting to run
build / bot-continuous-release (push) Blocked by required conditions
build / bot-release (push) Blocked by required conditions

This commit is contained in:
markmental 2025-12-27 18:25:40 -05:00
commit 95f1261dda

View file

@ -278,8 +278,8 @@ void Bot::updateLookAngles () {
} }
void Bot::updateLookAnglesNewbie (const Vector &direction, float delta) { void Bot::updateLookAnglesNewbie (const Vector &direction, float delta) {
Vector spring { 13.0f, 13.0f, 0.0f }; Vector spring { 13.0f, 9.0f, 0.0f };
Vector damperCoefficient { 0.22f, 0.22f, 0.0f }; Vector damperCoefficient { 0.28f, 0.26f, 0.0f };
const float offset = cr::clamp (static_cast <float> (m_difficulty), 1.0f, 4.0f) * 25.0f; const float offset = cr::clamp (static_cast <float> (m_difficulty), 1.0f, 4.0f) * 25.0f;
@ -296,10 +296,14 @@ void Bot::updateLookAnglesNewbie (const Vector &direction, float delta) {
if (m_aimFlags & (AimFlags::Enemy | AimFlags::Entity)) { if (m_aimFlags & (AimFlags::Enemy | AimFlags::Entity)) {
m_playerTargetTime = game.time (); m_playerTargetTime = game.time ();
m_randomizedIdealAngles = m_idealAngles;
stiffness = spring * (0.2f + offset / 125.0f); // bias aim slightly below exact target (chest > head)
m_randomizedIdealAngles = m_idealAngles;
m_randomizedIdealAngles.x += rg(2.0f, 6.0f); // pitch down
stiffness = spring * (0.18f + offset / 140.0f);
} }
else { else {
// is it time for bot to randomize the aim direction again (more often where moving) ? // is it time for bot to randomize the aim direction again (more often where moving) ?
if (m_randomizeAnglesTime < game.time () if (m_randomizeAnglesTime < game.time ()
@ -670,3 +674,4 @@ void Bot::setAimDirection () {
m_lookAt = m_destOrigin; m_lookAt = m_destOrigin;
} }
} }