Skip to content

Comments

Make bots affected by chaingun jitter#3057

Merged
slipher merged 4 commits intoUnvanquished:masterfrom
slipher:botangles
Nov 1, 2024
Merged

Make bots affected by chaingun jitter#3057
slipher merged 4 commits intoUnvanquished:masterfrom
slipher:botangles

Conversation

@slipher
Copy link
Contributor

@slipher slipher commented Jul 2, 2024

When bots are aiming at enemies, don't erase the view angle perturbations enforced through delta_angles. This makes bots affected by chaingun shake. This also affects bots in trappers, but it's harder to characterize the difference there.

Since low-skill bots were then too bad at aiming with chaingun due to the upward drift while firing, I made bots take into account the determinic upward part of the view angle deflection.

Still draft because I need to fix some vertical navcon-related code that sets an absolute value for the pitch angle. The Obey usercmd_t protocol to set bot view angles commit needs to be updated to fix that part.

Don't 'cheat' by modifying player state directly.

There is no functional difference here in how the bots behave. Just an
architectural fix.
When aiming at an enemy, bots will now be affected by view direction
disturbances added via delta_angles. Chaingun jitter, trappers, and
wallwalk use this.
@slipher slipher marked this pull request as ready for review October 23, 2024 12:39
@slipher
Copy link
Contributor Author

slipher commented Oct 23, 2024

It's now ready. I accounted for the 3 places that set the bot's pitch angle directly and tested them.

@DolceTriade
Copy link
Member

I'll cherrypick on my server for testing and report back.

Copy link
Member

@illwieckz illwieckz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@illwieckz
Copy link
Member

I followed bots equiped with chaingun attacking buildables (so, a non-moving target), and indeed they're affected by the jitter.

@slipher slipher merged commit ef34054 into Unvanquished:master Nov 1, 2024
@slipher slipher deleted the botangles branch November 1, 2024 01:13
@sweet235
Copy link
Contributor

I'll cherrypick on my server for testing and report back.

What is your conclusion?

slipher added a commit to slipher/Unvanquished that referenced this pull request Jan 15, 2025
Fixes Unvanquished#3273, a regression in 1530111.

Before PR Unvanquished#3057 pounce and barb aim also didn't correct for delta
angles, but that flaw was masked by the movement code frequently setting
the delta angles.
@slipher slipher mentioned this pull request Jan 16, 2025
slipher added a commit that referenced this pull request Mar 15, 2025
Fixes #3273, a regression in 1530111.

Before PR #3057 pounce and barb aim also didn't correct for delta
angles, but that flaw was masked by the movement code frequently setting
the delta angles.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants