80 Commits

Author SHA1 Message Date
bash
6b6f61a89d fix(Core/Travel): Restructure GetFullPath to mirror reference: drop probe short-circuit, add per-candidate validation + bad-node tracking + transport early-return + hearthstone fallback 2026-06-05 09:56:46 +02:00
bash
b0324cd343 fix(Core/Travel): Map-wide node scan in GetFullPath candidate pick (was zone-restricted) 2026-06-05 09:56:46 +02:00
bash
b371eff871 fix(Core/Travel): Tighten GetFullPath probe gate so graph routing wins when probe misses 2026-06-05 09:56:46 +02:00
bash
ccfcb1dfb0 fix(Core/Travel): Hoist AiObjectContext* context in GetNodeRoute so PortalNode injection blocks see it 2026-06-05 09:56:46 +02:00
bash
43186dac42 fix(Core/Travel): Declare AiObjectContext* context in ClipPath for AI_VALUE macro 2026-06-05 09:56:46 +02:00
bash
b446c5c3ac fix(Core/Travel): Re-add PathNodeType::NODE_TELEPORT now that BuildPath emits + handler consumes 2026-06-05 09:56:46 +02:00
bash
c2df89f923 fix(Core/Travel): Re-add TravelNodePathType::teleportSpell now that PortalNode emits it 2026-06-05 09:56:46 +02:00
bash
33aa553b71 feat(Core/Travel): Inject hearthstone + mage teleport spells into A* via PortalNode 2026-06-05 09:56:46 +02:00
bash
5fcba45e80 feat(Core/Travel): Emit NODE_TELEPORT for teleport-spell edges; add HandleSpecialMovement consumer 2026-06-05 09:56:46 +02:00
bash
f32ebb8f6b feat(Core/Travel): Port TravelPath::ClipPath; call from MoveFarTo, drop inline clip 2026-06-05 09:56:46 +02:00
bash
f7df64e4c2 refactor(Core/Travel): Drop TravelPlan struct; GetFullPath returns TravelPath 2026-06-05 09:56:46 +02:00
bash
dcecb6844f feat(Core/Travel): Port UpcommingSpecialMovement + getNextPoint helpers 2026-06-05 09:56:45 +02:00
bash
78ae50d3ba feat(Core/Travel): Add WorldPosition::projectOnSegment for path-progress checks 2026-06-05 09:56:45 +02:00
bash
052b8de95c feat(Core/Travel): Port TravelPath::cutTo for upcoming special-movement handling 2026-06-05 09:56:45 +02:00
bash
d85d0aabbc fix(Core/Movement): Bypass stale lastMove gate when bot stopped + loosen probe short-circuit 2026-06-05 09:56:45 +02:00
bash
e57dcf50c5 refactor(Core/Travel): Remove dead spline-progress tracking and unused NODE_TELEPORT path 2026-06-05 09:56:45 +02:00
bash
f328f455ca feat(Core/Travel): Re-enable area-trigger, static-portal, and teleport-spell nodes 2026-06-05 09:56:45 +02:00
bash
e7870afbd9 feat(Core/Travel): K-nearest node search, cropPathTo reuse, cross-map pathToEnd 2026-06-05 09:56:45 +02:00
bash
f85e6568d0 fix(Core/Travel): mmap-path startPath and endPath in GetFullPath 2026-06-05 09:56:45 +02:00
bash
c0e41e6ce1 feat(Core/Travel): Exclude area-trigger, static-portal, teleport-spell path types from PR 2026-06-05 09:56:45 +02:00
bash
7ac501adb0 feat(Core/Travel): Handle NODE_TELEPORT (hearthstone) and NODE_AREA_TRIGGER 2026-06-05 09:56:45 +02:00
bash
65bf6a0dff fix(Core/Travel): Soft-bias STEEP at regen PathGenerator sites 2026-06-05 09:56:44 +02:00
bash
f5cd75e336 refactor(Core/Movement): Drop redundant bot filter setters at PathGenerator sites 2026-06-05 09:56:44 +02:00
bash
a6d691e6a7 refactor(Core/Movement): Rename SetAreaCost calls to SetNavTerrainCost 2026-06-05 09:56:44 +02:00
bash
2a8bd23272 fix(Core/Movement): Apply bot filter setters at all PathGenerator construction sites 2026-06-05 09:56:44 +02:00
bash
9d3ecbab88 fix(Core/Travel): Apply NAV_WATER cost bias on regen PathGenerator 2026-06-05 09:56:44 +02:00
bash
326f962bd7 fix(Core/Travel): Exclude NAV_GROUND_STEEP on regen PathGenerator 2026-06-05 09:56:44 +02:00
bash
6d6ad2412d fix(Core/Travel): Hoist portal/transport cheat above 2-point reject 2026-06-05 09:56:44 +02:00
bash
3d7e43c1a2 fix(Core/Travel): Match cmangos buildPath stitching, drop 75y guard 2026-06-05 09:56:44 +02:00
bash
e3b24aadd9 fix(Core/Travel): Preserve walk paths from taxi-path overwrite 2026-06-05 09:56:44 +02:00
bash
7bbcc62797 chore(Core/Travel): Warn admins to shutdown after generatenode 2026-06-05 09:56:44 +02:00
bash
39927925e4 fix(Core/Travel): Skip 5y dedup when loading nodes from DB 2026-06-05 09:56:44 +02:00
bash
9bd76103f2 fix(Core/Travel): Drop 2-point check, keep last-segment teleport guard 2026-06-05 09:56:44 +02:00
bash
7a9d5cd73d fix(Core/Travel): Reject paths with >75y final-segment teleport jumps 2026-06-05 09:56:44 +02:00
bash
2d83396c59 fix(Core/Travel): Reject 2-point BuildShortcut paths between non-adjacent nodes 2026-06-05 09:56:44 +02:00
bash
537d7b0284 chore(Core/Travel): Bump 2-point shortcut threshold to 75y 2026-06-05 09:56:44 +02:00
bash
8a5b6d455c fix(Core/Travel): Reject 2-point BuildShortcut teleports in chained probe 2026-06-05 09:56:44 +02:00
bash
b1dde93827 Revert non-progress chained-probe detection (broke valid paths) 2026-06-05 09:56:44 +02:00
bash
5cf7a2e0db fix(Core/Travel): Loosen chained-probe non-progress threshold 2026-06-05 09:56:44 +02:00
bash
cb2fae7628 fix(Core/Travel): Bail chained probe on non-progress oscillation 2026-06-05 09:56:44 +02:00
bash
0d7b7bb1da fix(Core/Travel): Chunk all saveNodeStore phases (deletes, nodes, links) 2026-06-05 09:56:44 +02:00
bash
5b39d1552c fix(Core/Travel): Chunk saveNodeStore path inserts to avoid mega-tx 2026-06-05 09:56:44 +02:00
bash
a81c7a2761 chore: Tighten comments in travel and movement code 2026-06-05 09:56:43 +02:00
bash
70efd4f1b9 refactor(Core/Travel): Drop redundant NAV_GROUND_STEEP excludes (core handles via IsBot) 2026-06-05 09:56:43 +02:00
bash
523624c611 fix(Core/Travel): Exclude NAV_GROUND_STEEP at all bot PathGenerator sites 2026-06-05 09:56:43 +02:00
bash
86f0be5b08 feat(Core/Travel): Align MoveFarTo and probe pipeline with cmangos 2026-06-05 09:56:43 +02:00
bash
724b15e39f feat(Core/Travel): Cap bots at 50° via NAV_GROUND_STEEP exclude 2026-06-05 09:56:43 +02:00
bash
c7fa1fcc4f feat(Core/Travel): Travel-node graph routing for long-distance pathing 2026-06-05 09:56:42 +02:00
bash
8c110ba515 feat(Core/Loot): Quest GO loot, bag-make-room, item-pursuit 2026-06-05 09:56:42 +02:00
Mat
240bb2dfca
Autogear suffixes (#2415)
<!--
Thank you for contributing to mod-playerbots, please make sure that
you...
1. Submit your PR to the test-staging branch, not master.
2. Read the guidelines below before submitting.
3. Don't delete parts of this template.

DESIGN PHILOSOPHY: We prioritize STABILITY, PERFORMANCE, AND
PREDICTABILITY over behavioral realism.

Every action and decision executes PER BOT AND PER TRIGGER. Small
increases in logic complexity scale
poorly across thousands of bots and negatively affect all. We prioritize
a stable system over a smarter
one. Bots don't need to behave perfectly; believable behavior is the
goal, not human simulation.
Default behavior must be cheap in processing; expensive behavior must be
opt-in.

Before submitting, make sure your changes aligns with these principles.
-->

## Pull Request Description
Suffix scoring was already wired up in playerbots, bots could evaluate
suffix items they owned, but factory init scored candidates with
randomPropertyId = 0 and equipped via EquipNewItem which doesn't roll
suffixes, so suffix items always looked like junk and never got picked.

Added a cached item_enchantment_template pool in RandomItemMgr, a
PickBestRandomPropertyId helper that picks the best suffix per bot
class/spec, and added it on the equipped item via
SetItemRandomProperties.

Tested levels 20-80, suffixes match spec. Closes #2370.



## Feature Evaluation
<!--
If your PR is very minimal (comment typo, wrong ID reference, etc), and
it is very obvious it will not have
any impact on performance, you may skip these question. If necessary, a
maintainer may ask you for them later.
-->

<!-- Please answer the following: -->
- Describe the **minimum logic** required to achieve the intended
behavior.

For items with RandomProperty != 0 or RandomSuffix != 0, run the
item_enchantment_template pool once, score each candidate suffix against
the bot's existing class/spec stat weights, keep the highest, and stamp
that id on the item right after EquipNewItem. Items without a suffix
pool skip the helper entirely. Without this, every suffix template
scores as base stats only (often near zero) and never gets picked during
factory init.

- Describe the **processing cost** when this logic executes across many
bots.

Startup: one SELECT entry, ench FROM item_enchantment_template (few
hundred rows), parsed into an unordered_map<uint32, vector<uint32>>
once. No SQL afterwards.
Per bot during init: PickBestRandomPropertyId only runs on candidates
that actually have a suffix pool. Each call is a hash lookup plus a loop
over 5-15 enchantment ids, each doing DBC lookups already used by the
scoring code. Cost is mostly by the existing CalculateRandomProperty
work, not new logic.
Scales linearly with bot count, same as the rest of factory init. No new
per-tick work.


## How to Test the Changes

1. Generate a fresh random bot at level 20-79 and use autogear (cloth,
leather, mail, plate, lots of suffix gear at that range).
2. Inspect the bot's gear. Items with names like "of the Eagle", "of the
Monkey", "of Healing", etc... should be equipped, with the suffix stats
visible on the tooltip.
3. Generate a level 80 bot at high gear-score limit. Confirm it still
equips raid epics normally (epics have no suffix pool, so this path is
untouched).



## Impact Assessment
<!-- As a generic test, before and after measure of pmon (playerbot pmon
tick) can help you here. -->
- Does this change increase per-bot/per-tick processing or risk scaling
poorly with thousands of bots?
    - - [x] No, not at all
    - - [ ] Minimal impact (**explain below**)
    - - [ ] Moderate impact (**explain below**)



- Does this change modify default bot behavior?
    - - [ ] No
    - - [x] Yes (**explain why**)
Bots now consider random-suffix items during factory init and equip them
with the best suffix for their class/spec. Before, suffix items were
effectively invisible to init autogear because they scored as base stats
only. This is the intended fix for #2370.


- Does this change add new decision branches or increase maintenance
complexity?
    - - [ ] No
    - - [x] Yes (**explain below**)
Added one new public method on StatsWeightCalculator
(PickBestRandomPropertyId) and one new cache in RandomItemMgr
(LoadEnchantmentPool + GetEnchantmentPool). The candidate list in
InitEquipment changed from vector<uint32> to vector<pair<uint32, int32>>
to carry the chosen suffix id alongside the item id. Logic mirrors
existing patterns in the same files (DBC lookups, SQL-backed caches,
signed randomPropertyId encoding), no new abstractions, no new wrappers.


## AI Assistance
<!--
AI assistance is allowed, but all submitted code must be fully
understood, reviewed, and owned by the contributor.
We expect contributors to be honest about what they do and do not
understand.
-->
Was AI assistance used while working on this change?
- - [ ] No
- - [x] Yes (**explain below**)
Used AI to help me find the bug. It mapped the existing scoring pipeline
and pointed out that PlayerbotFactory::InitEquipment was scoring
candidates with randomPropertyId = 0 and equipping via EquipNewItem
(which doesn't roll suffixes), so the scoring side was already built,
just never fed real suffix ids during init. I reviewed and tested all
the code in-game across levels 20-80 and multiple classes/specs.




<!--
TRANSLATIONS:
Anything new that the bots say in chat must be in a translatable format.
This is done using GetBotTextOrDefault,
which you can search for in the codebase to find examples. Your code
needs to have English as the default fallback,
while the full translations need to be in an SQL update file. The
languages in the file are the nine language
options supported by AzerothCore: English, Korean, French, German,
Chinese, Taiwanese, Spanish, Spanish Mexico, and
Russian. See
data/sql/playerbots/updates/2025_12_27_ai_playerbot_fishing_text.sql as
an example of a translation SQL
update, whose content are called within the codebase at
src/strategy/actions/FishingAction.cpp
-->

## Final Checklist

- - [x] Stability is not compromised.
- - [x] Performance impact is understood, tested, and acceptable.
- - [x] Added logic complexity is justified and explained.
- - [x] Any new bot dialogue lines are translated.
- - [x] Documentation updated if needed (Conf comments, WiKi commands).

## Notes for Reviewers
<!-- Anything else that's helpful to review or test your pull request.
-->

---------

Co-authored-by: Keleborn <22352763+Celandriel@users.noreply.github.com>
Co-authored-by: bash <hermensb@gmail.com>
Co-authored-by: Revision <tkn963@gmail.com>
Co-authored-by: kadeshar <kadeshar@gmail.com>
2026-05-30 06:48:07 -07:00