Combat: tame aimbot bots, fix gun viewmodels (show + orientation) - #37
Merged
Conversation
Bots played like aimbots — perfect tracking + pixel-perfect shots. Guns 2/3 barely rendered: the Deagle faced backward and neither gun really showed, just arms. Bots: - Add human aim inaccuracy: the bot now aims at a point that drifts around the true target (smoothed random walk whose amplitude grows with distance), so it over/under-shoots and misses instead of laser-beaming. Also slower turn (3.2->2.4 rad/s), longer reaction (0.75->0.9s) and tighter fire tolerance. Verified: 100 HP after standing still 13s vs the old ~1-2s instakill. The pure decideBotInput stays deterministic (wander lives in the stateful tick), so the unit tests are untouched. Gun viewmodels: - Fix the real bug behind 'guns don't show': the fit computed bone centres in WORLD space while the placement pos is CAMERA-local. It happened to work at the world origin but in-game the camera sits at z=16, so the gun was placed ~16 units behind the view. Now the fit works in the mount's (camera-local) space. - Fix the animation blend bug: draw/fire/idle all played at full weight at once and the mixer averaged them into a broken pose that threw the gun off-screen. Replace with a clean crossfade state machine (one active action; one-shots ease back to idle via the mixer 'finished' event). - Derive gun orientation from the model's own reference nodes so the barrel points forward (-Z) instead of hand-guessing Euler angles. - The AWP (clean arms+gun rig) now renders correctly as a real textured sniper held in two hands. - The Deagle Sketchfab model is a broken export — its gun and hand meshes are at incompatible 1:8000 scales in one skeleton, so no uniform transform can render both (only the hand showed). Replace it with a clean procedural Desert Eagle that renders reliably, and drop the 8 MB unused GLB + its credit. AWP credit (Addison Ye) stays.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses the playtest feedback: bots felt like aimbots, and weapon slots 2/3 barely rendered (Deagle faced backward, neither gun really showed — just arms).
🤖 Bots — no more aimbot
They had perfect tracking + pixel-perfect shots. Now:
decideBotInputstays deterministic (the wander lives in the statefultick), so the unit tests are untouched.🔫 Gun viewmodels — actually show now
posis camera-local. It worked at the world origin but in-game the camera sits at z=16, so the gun was placed ~16 units behind the view. Now the fit is done in camera-local space.finishedevent).🪫 Deagle model was a broken export
The Sketchfab Deagle's gun and hand meshes are at incompatible 1:8000 scales in one skeleton — no uniform transform can render both (only the hand showed; verified with two independent re-compressions). Replaced it with a clean procedural Desert Eagle that renders reliably, and dropped the 8 MB unused GLB + its credit. The AWP credit (Addison Ye) stays.
Verification
npm run ci: tsc clean, 132/132 tests pass, build clean.The procedural Deagle is a stopgap — if you grab a clean arms+gun Deagle rig (like the AWP, not a full-character rig), I can swap it straight in.