Repository navigation
(feat) WSG Tactics - #2893
Draft
Jellypowered wants to merge 2 commits into
Draft
(feat) WSG Tactics#2893Jellypowered wants to merge 2 commits into
Jellypowered wants to merge 2 commits into
Conversation
Contributor
Author
|
With the latest commit 6965e49, |
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.
Pull Request Description
WSG bots had a habit of wandering around while a flag needed returning, leaving our carrier without help, or chasing the wrong target. Both flags out could turn into a long standoff with bots sitting in midfield.
This adds an opt-in WSG tactics mode, including WSG through the Random BG queue. Bots use the actual flag state to decide who should return, escort, defend, or push. They protect a friendly carrier, pursue the enemy carrier using the position shown on the BG map, and only attack that carrier when they can actually detect them. When both flags are held, available non-carrier, non-escort bots help return ours instead of waiting around.
The team presets use bot-only assignments:
Strength is ranked by level, then average equipped item level, with GUIDs breaking ties. Defense slots are filled first, capped by the number of eligible living, non-carrier bots; attack slots use the remaining bots. Real players do not fill or reduce bot quotas. A human carrying the flag still gets bot support. Escorts use flexible bots first, then attackers, without taking defender slots. Defenders stay near the home flag unless responding to its loss, and other eligible bots push for the enemy flag when it is available.
Movement now chooses the best eligible corridor deterministically and retains it while movement is waiting. Completing a corridor is handled separately from a stall so bots can move on without repeatedly switching or backtracking. Bots spread across the starting positions before the gates open. Graveyard cliff checks prevent joining upper routes from below, while the explicit jump-down handling remains responsible for those descents.
There are also WSG-specific improvements to healing teammates and rejecting dead or ghost targets. Ordinary enemy-player targeting is limited by the core's configured
MonsterSight; actual flag carriers are exempt from that distance cap (because flag carriers are visible on the map), but still require normal detection and valid combat targeting.The option is
AiPlayerbot.WsgTactics.Enabled = 0by default. Other battlegrounds and feature-off behavior keep their existing tactics.Feature Evaluation
The mode reads WSG flag state and assigns jobs from the current bot roster. Assignments and strength rankings are cached for two seconds. Flag and support checks use cached values where appropriate; route selection is bounded by the existing waypoint pool and happens when a route is needed, not at every waypoint. The extra work only runs with the option enabled in WSG.
The profiler comparison is mixed: average full tick went from 32.68 ms to 35.53 ms (+2.85 ms), while AI time per full tick went from 5.71 ms to 5.25 ms (-0.465 ms) and instrumented work per tick went from 3.63 ms to 3.05 ms (-0.576 ms). I've seen several runs with a similar pattern. I would call the measured AI impact minimal, but I don't want to present the overall tick increase as an improvement. More testing is welcome.
How to Test the Changes
(NOTE: most will be noticable by observing map/battlefield with eyes)
AiPlayerbot.WsgTactics.Enabled = 1and restart the worldserver. Run WSG with bots on both teams, preferably with a human on one team. Repeat through the Random BG queue when it selects WSG.(1318.79, 1533.00, 315.43). Check for repeated stopping, route switching or backtracking. At the Horde graveyard lower approach near(1045.86, 1356.21, 327.57), bots should not try to climb the cliff. Check both graveyards, normal tunnel/ramp access and valid jump-down movement.MonsterSightand confirm bots stop targeting them. Flag carriers retain their existing detection rules rather than this ordinary-player distance cap. Kill and release an enemy player during a fight and check that bots drop dead or ghost targets. Check that healers help injured BG teammates outside their party.0and confirm WSG uses the previous behavior. Check another battleground for regressions. Compare profiler runs under similar server load if possible.I've built and tested this on
test-staging. After addressing route switching and defender coverage, the latest live results are much better than playing with tactics disabled. I'd like more feedback, especially on both-faction routes and role coverage, but it's ready for outside eyes.Impact Assessment
Only enabled WSG bots run the extra logic. The team scan is cached and limited to the BG roster, and the profiler runs so far show minimal AI cost. The full-tick result in the attached comparison was higher, so I would still like to keep an eye on it during testing.
Yes and no? The new WSG tactics are disabled by default. Enabling them changes WSG behavior, including WSG reached through Random BG.
It adds WSG-specific roles, flag checks, support targeting, and route handling. That is more code to maintain, but it stays behind the config option rather than replacing the tactics for everyone.
AI Assistance
Was AI assistance used while working on this change?
I used AI to assist with investigating the existing code, implementation, and static checks. I've built and tested the changes on my server, against the most current test-staging, and i'm ready for it to be picked apart!
Code Provenance / Attribution
Was any code in this PR copied or adapted from a sister / upstream project (e.g. CMaNGOS playerbots,
MaNGOS, another module)?
No code was copied from another project. This works within the module's existing battleground code.
Final Checklist
Notes for Reviewers
I looked at the other open BG PRs, especially #2857 and #2855. #2857 fixes bugs in the old WSG objective path. This PR takes a separate path when the option is on, so I think both are worth keeping: #2857 helps default WSG, and this changes opt-in WSG. #2855 fixes enemy-player attacker and PvP checks shared across battlegrounds. It should help combat here too, but it edits some of the same target-selection code. When they come together, please keep both its BG fixes and this PR's opt-in WSG checks for dead and ghost targets, ordinary-player
MonsterSightlimits, and flag-carrier exceptions.If other PR's get merged in first, I will gladly push changes that address merge conflicts/integrate functionality.
The final note: This will produce varied wins/losses. It's meant to increase difficulty, improve cohesion, make it less like a free for all, and give you a sense of challenge. It's a BIG DANG PR. Lots of files touched, headers included so it's gonna take a bit to compile. I hope you all enjoy! I'm submitting this as a draft, so we can get some real feedback/reviews before officially making it a proper PR.