[Combat] Stop the hazard flip re-choosing a strafe side every frame

Open
#754 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
22/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
c

Research direction

The bug sits in the combat hazard block of src/argus.qc around line 6791, where battle item, cover retreat, approach, high ground and dodge each rewrite ar_moveyaw every frame and ar_strafedir flips between sides. Start by reading the hazard check and the strafe-side selection, then reproduce with tools/verify_motion.py on dm4 and count wish changes over 100 degrees in consecutive ARGMOT rows. Done means a refused non-strafe heading keeps one chosen side for its flip, with no runs of three or more per-frame flips on dm4 and dm2, and control maps at parity.

Written by the indexing model from the issue text.

Description

bug combat physics

Problem

The combat hazard block re-chooses a strafe side every frame when the heading it refuses is not the strafe heading. Battle item, cover retreat, approach, high ground and dodge all write ar_moveyaw again each frame, before the check at src/argus.qc:6791. If that heading stays refused, ar_strafedir flips on every frame and the wish alternates between two sides.

This is separate from the strafe bounce recorded on #697. That one flips about every 0.1 to 0.2 s and is counted as reversals. This one flips every frame, the bot barely gets up to speed, and the reversal measure does not see it because of its 120 u/s floor.

Evidence

Three 40 s dm4 tapes on main 8922727, skill 2, played rate, scratch1 697. Across about 370 bot-seconds there are about 60 runs of three or more consecutive frames where the wish changes by over 100 degrees, for about 9 s in total. The longest:

Tape Bot t Flips Seconds Moved Wish
motion697_dm4_b Romero 21.53 45 0.65 14.9u 87, 245, 87, 245
motion697_dm4_c Carmack 29.10 34 0.49 18.9u 141, -23, 142, -22
motion697_ctl_dm4_h Joe Rogan 32.42 32 0.46 14.9u 69, 222, 67, 221

One dm2 tape has one such run, four flips long. The tapes are machine-local under backups/motion697_*.

Reproduce

python tools/verify_motion.py --output backups/<new-directory> --prefix <new_prefix> --map dm4 --seconds 40

Read consecutive ARGMOT rows for one bot and count wish changes over 100 degrees between adjacent frames.

Acceptance

  • A frozen main control reproduces the runs at the played rate, using a scan that is kept with the fix.
  • A refused non-strafe heading picks a side once and keeps it for that flip's commitment, unless that side is refused too.
  • Runs of three or more per-frame flips fall to zero on dm4 and dm2 at played and 100 ms cadence.
  • Stalls, lava, freezes, under-fire freezes and engagements stay at parity against matched controls, three tapes a side on dm4 and five on dm2.

Read the two refused strafe responses on #697 first. Backing off moved the bounce to the range band, and holding ground failed the dm4 stall gate. Neither touched this path.

Dominant language
Rust
Stars
4
Forks
0
Avg merge
30m
Merged PRs (30d)
130

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from saworbit/argus

All issues in saworbit/argus

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.