Refactor bot improvements under bot_enhanced#92
Merged
Conversation
When tracking target with humanized aim, would consistently lag behind the target. This meant hitscan weapons rarely connected, as shots were always just a little too late. This fix adds: - A live updating aim target during combat, replacing the more static earlier version - Angular feed-forward in the harness plus some catch-up impetus, pushing the aim towards the target Fix intermittent firing bug when bots were using continuous-fire weapons
…. Improve weapon selection Up close aiming = jerkier, more overshoot, larger movements Distance aiming = smoother, less overshoot, smaller movements Improved roaming weapon selection for bots when not in a fight Roaming bots should now pick a better weapon to hold when roaming: - Not always the machinegun - Generally not loud weapons
Bot behavior with the new aim harness was behaving differently on dedicated, unexpectedly. Turns out, listen server follows a slightly different path with bots that gives them some data feeds at client framerate (i.e. 125hz). So on dedicated, this broke aiming with the new code. Have fixed up the code so it behaves acceptably at 20hz. Also introduced scaffolding for bot aim debugging. Not fully working yet.
With new aiming logic the bot has a desired aiming position and an actual aiming position, separately. This debug route (bot_debugAim <0|1> and on the client-side cg_debugBotAim <0-7> (Bitmask: 1 = draw for followed bot. 2 = draw for all bots. 4 = draw second (yellow) ray for bot's actual crosshair direction Fix bot debug path for new joining bots If bots joined while cg_debugBotAim was set, their debug traces weren't being sent. Only existing bots. Now corrected. Fix debug routine Debug aim traces for new bot aiming was only displaying when bot was in combat. When roaming, the trace remained locked to the last fight location. Now fixed - When roaming, shows desired aim correctly.
Fixed a regression. Bots should now be much more trigger happy.
Refactor bot enhancements - Step 2 (and windows build script) Refactor bot enhancement - Step 3 No intended gameplay change. Changes: Add bot_combat_intent_t combat to bot_state_t. BotCombat_Reset / BotCombat_UpdateIntent (defaults only). BotCombat_OnWeaponCommitted stub. BotEnhanced_OnThinkStart: BotEvents_Drain (phase 4), BotCombat_UpdateIntent. Call BotEnhanced_OnThinkStart from BotDeathmatchAI immediately after BotUpdateInventory (before roam/tactics ordering: inventory → enhanced start → tactics). Touch: ai_main.h, ai_dmq3.c, ai_weapon_select.c (NotifyWeaponCommitted → stub). Refactor bot enhancement - Step 4 No gameplay changes. Code changes: Define BOT_EVT_HURT_BY_OTHER (same bit as BOT_TACT_EVT_HURT_BY_OTHER or alias). BotEvents_Drain forwards to tactics scan/process when tactics active. Deprecate direct BotTactics_OnThink from ai_dmq3.c; only BotEnhanced_OnThinkStart calls drain. Document queue contract: producers push, drain once per think, bounded fields (no malloc). Exit: Third-party hurt reaction unchanged when bot_enhanced_tactics 1; tactics file still owns logic. Refactor bot enhancement - Step 6 (Docs) Just documentation stuff. Signoff Small workplan for bot enhancement (WIP)
Added a basic build script for windows when using MINGW64. This lets agents easily invoke the build without user intervention. Quiet build & fixed bot_challenge override Added a -quiet path for the build_windows.ps1 script. This minimizes console output during builds to just warnings and errors. This is handy because it makes the build a tiny bit faster (no console spam) but mainly because it significantly reduces token consumption when you have a cloud AI running a build on your behalf. Also fixed a mistake in the bot refactor work - bot_challenge 1 was overriding the new bot_enhanced_aim code paths. It doesn't do that any more.
Implement so: - Bots close to an opponent may choose to switch to gauntlet - If they do, they will aggressively charge the opponent and attempt to pummel - If it doesn't work within a couple of seconds, they'll break off. Also if a bot is forced to use gauntlet because it has no ammo, it'll make a choice to attack as above, or flee.
High-value items (MH, RA, YA, Quad, Flag) are prioritized as a goal if a bot sees one available for collection. Has some checks to make sure unattainable items (e.g. MH on DM17) are not pursued Bots also prioritize picking up weapons they don't yet have.
New bot routines were messing with the old rocketjump process. Now fixed, and bots should angle their jumps a bit better so they move towards their target more directly.
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.
Refactored the recent bot enhancements under a single banner bot_enhanced. All gated by bot_enhanced <1|0>. Downstream cvars are:
Implemented a PowerShell build script with -Quiet and -Deploy. Mainly to allow my LLM agent to perform builds itself without spunking tokens on useless console output information.
Implemented bots seeking out important items when they see them. MH, RA, YA, Quad, Flag, and any weapons they don't current have. Bots will beeline for the item (routine via the usual AAS bot wayfinding methods, including rockets jumps etc if suitable).
Implemented high-skilled bots swapping to gauntlet when close to enemy, and aggressively pursuing them with it for a little while.
Fixed broken rocket jumps whenbot_enhanced is enabled, and slightly improved it by having bots use the initial rocket blast to send themselves towards the target (default behavior is straight up then air-walk towards target).