Commit Graph
26 Commits
Author SHA1 Message Date
Zapgun 1f86c6ef66 PlayerbotV2: race/sex RPG first names + reusable surnames for bot chars
BotNamePool gains three first-name tiers: curated per-race/sex names from
the new playerbots_race_names table (consumed on spawn, released on bot
delete, orphans reclaimed by ReconcileOnBoot), then the generic
playerbots_names pool, then the existing syllable fallback. CharacterCache
collision checks self-heal taken rows.

BotComposition Pick carries a surname; name hints with a space split into
first name + surname (a hinted surname is never re-rolled).
BotCharacterFactory writes characters.surname in the same transaction as
the INSERT and mirrors it into the character cache, capped at 48 UTF-8
chars like the player path.

Surnames come from playerbots_surnames (whole names) or
playerbots_surname_parts (prefix/suffix compounds that reject degenerate
pairs), chosen by Playerbot.Names.SurnameCompoundChance; whole vs compound
is gated by Playerbot.Names.Surnames.

SQL: 9001 creates the three tables on the shared db (plain `race` column
so Skyborne ids 95/96 fit); 9002 seeds 995 first names, 404 surnames and
551 parts for all races incl. Skyborne. The 9000-series keeps the
community migrations clear of upstream numbering.

Also adds ".playerbot selftest botnames <race> <sex> [n]" to sample the
pool without spawning, and guards "selftest namegen" with IsValidRace /
IsValidGender before calling GetNameGenEntry (sex 3 crashed the client).
2026-11-23 22:13:07 +00:00
Karrz1 b441bf74e0 0.1.39: bots and core since 0.1.38 (Naxxramas fights, hunter companions get their pet, dungeon runs, bug fixes) 2026-11-21 17:45:23 +00:00
Karrz1 8e679df0e1 0.1.38: bots and core since 0.1.37.6 (Naxxramas: Patchwerk, Grobbulus, Gothik, Maexxna, Sapphiron; raid healers and tanks; bug fixes) 2026-11-18 21:11:41 +00:00
Karrz1 d70d3ee5b6 PlayerbotV2: bot pickup groups break up again
Two world bots that grouped on their own (idle:invite_nearby_player) stayed
grouped until the next restart: grouped bots counted as tied up, outside
the world cap, the spawner never logged them out and the runtime group
hygiene left every pure-bot group alone, so the grouped count only grew
(GitHub #345).

A group a bot's own invite made is now noted as a pickup group
(Fleet/PickupGroups.h). Its bots count toward Playerbot.World.MaxBots, the
spawner breaks it up once none of its bots is near a player (they are then
logged out like any far world bot), and the group hygiene breaks it up at
the end of its 10 to 20 minute life. Never while a member fights, is being
teleported or is in an instance, and a group a player joined is his.
The [world] line counts pickup_groups and how many were broken up.
2026-11-16 09:57:46 +00:00
Karrz1 13e2f64829 Bots: rule path probes use their own query and never load a grid
The idle rules run on the worker pool while the map threads update the
world, and several of them check paths and nav points on the bot's live map
(stand points, dungeon steps, regroup and rejoin steps, water exits). Those
searches used the one Detour query each map instance shares with the map's
own creature pathing, which is not thread-safe, and NearestNavPoint called
Map::LoadGrid from the worker.

Each worker thread now:
- searches with its own navmesh queries (MMAP::ScopedThreadNavMeshQuery), and
  SehSafeCalculatePath, SehSafeCalculatePathFrom and SehSafeNearestPolyProbe
  hold the navmesh read lock for the search, so no tile changes under it;
- never touches the grids (BotMovement::ScopedBotLogicThread): a nav-point
  probe hands its grid to the world thread, which loads it at the start of
  the next snapshot phase, and searches the tiles loaded now.

World and map thread searches are unchanged. Deferred grid requests are
kept by map id and instance id and looked up again before loading, so a
request never outlives its map. TickPerf logs bot_logic_grid_loads when
there were any.
2026-11-15 17:29:16 +00:00
Karrz1 38c976d6b4 Bots: split the snapshot build of one busy map over the build pool
The parallel snapshot build gave each map one thread. With nearly all bots on
one continent (the busy-world soak: ~300 bots on Eastern Kingdoms) the whole
build ran on the world thread, about as much world-thread time as all the map
updates together.

PlayerbotV2.SnapshotBuildSplitMap = 1 (default 0, read every tick) also splits
an open-world map with 16 or more due bots into parts, at most one per build
thread (8 bots per part at least). A bot's part comes from its group (or the
bot alone when ungrouped), so a group always builds on one thread. Dungeons,
raids, battlegrounds and arenas are never split.

Building a snapshot is not read-only, so a split part changes two things:
- every navmesh query on the thread uses the thread's own query
  (MMAP::ScopedThreadNavMeshQuery), never the shared per-instance one;
- a build never loads a grid (water-escape footing and elevator ledges used to
  call Map::LoadGrid). The grid goes to a list and the world thread loads it
  right after the build barrier; that build has no answer and the next one
  gets it. An elevator ledge is no longer stored as "none" when its grid was
  not loaded yet.

TickPerf gains a "same_map_split" line (parts per tick, bots per part, grids
handed to the world thread). With the switch off nothing changes.
2026-11-15 17:29:16 +00:00
Karrz1 5cd819c0b0 Scenario: boss pulls log each raider's damage and healing by spell
A combat log parse shows where a player's damage came from: the share of
each spell, its hits, and for a healer the overheal of each heal. The
[pull_stats] line had only totals and the last rule that fired each second,
so a warlock with 34 of 90 s casting could not be told apart from one that
cast the wrong spells.

- [pull_spells] lines after each [pull_stats] line: damage by spell (melee
  as "melee", the pet's spells as "pet <spell>"), top ten, with the share
  of the total and the hits; healing by spell with heals and overheal.
- [pull_stats] adds a mana user's average and lowest mana and its seconds
  under 20%.
2026-11-15 14:21:46 +00:00
Karrz1 14c4d76338 Bots: raid healers count the damage a patient takes while a heal casts
The heals-in-flight check only knew the melee swings of the mob whose
victim the patient is. Patchwerk's Hateful Strike, breaths and volleys
never show there. On Patchwerk the off tank at 63% had one Greater Heal
on the way (4058, 2.4 s to land) for 3980 missing; eight healers left
him to it and he kept dropping while it cast.

Each grouped player inside an instance now has a measured damage taken
per second (decayed over about 3 s, from the hits that land). The
deficit a heal in flight has to cover is the missing health plus the
damage until the first heal lands: half the swings or the measured
rate times the time to land, whichever is more. The projected health
uses the same. The [raid_heal] "leaves ... to heals in flight" line
shows missing, swings and the damage until it lands.
2026-11-15 11:38:23 +00:00
Karrz1 64bffc62af Bots: "raid reset" brings the bots out and gives a fresh raid
Typed in party or raid chat (or sent by the panel) by a player outside: his
bots inside a raid instance come out to him, each emptied instance is
closed (the reset a raid with a boss down allows; the map unloads and stops
holding the locks), then his and his bots' locks on that raid are cleared
and the group forgets the old instance. Answered once, and again when it is
done or when someone is still inside.
2026-11-14 15:36:07 +00:00
Karrz1 236158fad9 PlayerbotV2: Stay / Follow pause the tank lead, "go" goes on
chris: Stay and Follow should pause the lead, not end it, and "go" picks
it up again.

- stay, hold, follow and come (typed, whispered or the panel buttons and
  keys) pause a running lead once for the group and tell the owner to say
  go; the order itself works as before
- "go" alone (also the Russian "вперед" / "го") resumes a paused lead;
  it is the lead's word only while the lead is on or paused, otherwise it
  stays chat
- the Lead button turns blue when Follow, Stay or Come is pressed
- Russian text, docs and tests
2026-11-14 08:49:57 +00:00
Karrz1 1c64802e46 PlayerbotV2: tank leads the dungeon (lead mode for 5-man runs with a human)
The bot tank walks the route, pulls pack by pack, waits for mana and for
the player, and goes boss to boss while the player follows. Turned on by
the Tank leads button in /fb or .bot lead on|pause|off.

- lifts the human-lead hold, auto/defensive passivity and the missing
  mana gate while the lead is on
- holds the advance while the player is dead, away (>60 y) or off map
- tank callouts: waiting for mana / waiting for you
- lead ends 10 s after the party leaves the dungeon
- Russian text for all new lines
2026-11-14 08:49:57 +00:00
Karrz1 5efb85406b Bots: what a raid hears from its bots goes to raid chat
A bot answered a player's /raid line in party chat, and a bot's own
line written by the bot bridge program was always sent to party chat.
In a raid party chat reaches only the bot's own sub-group, so the
player often never saw the answer. An answer to a raid line now goes
to raid chat, and in a raid of more than 15 the program's lines do
too. A party line in a raid is answered only by the bots of the
speaker's sub-group, the ones who heard it.
2026-11-14 08:11:11 +00:00
Karrz1 953e578044 Bots: the [cast_state] log budget is 6,000 lines per 5 minutes, not 1,500 a run
The 1,500 lines for the whole server run were spent 145 s into the first fight
of a raid sweep (bwl_nefarian 0136-r9: all of them in run 1, none in runs 2
and 3), so the end of a long fight never showed what the bots cast. A 40-man
raid in a fight logs about 600 lines a minute; the budget now refills every
5 minutes.
2026-11-12 20:56:51 +00:00
Karrz1 96b3f5d7b7 Bots: one boss-kill moment that knows 5-man bosses
This core never sets the dungeon boss flag (the template load strips it
and nothing sets it later), so a 5-man boss never counted as a boss:
no "gg", bow or cheer from the companions, no boss_kill moment for the
AI bots program, no [boss_kill] line for the fight report. Only world
boss ranked raid bosses had them.

Bot/BossCheck.h decides it once: a scripted boss (its AI is a BossAI),
the world boss flag, or the vanilla boss rank. The moment now comes from
the unit death hook, so the player with the credit is also found when a
pet, totem or charmed unit landed the last hit (the old listener only saw
kills by the player's own hand). The raid layer uses the same check.
2026-11-12 09:21:30 +00:00
Karrz1 a7feec8180 Raid: the player's boss tactics in plain words, kept per boss
"tactics Lucifron: adds first, no aoe, no fear, tank here" in party, raid,
a whisper or a ';' line. The plan is kept for that boss (per account, across
restarts) and the bots follow it every time the boss is in the fight:

- adds first: the damage dealers leave the boss to the tanks while one of his
  adds is up; boss first: they stay on him and the tanks keep the adds.
- no aoe: no spell that hits more than one enemy in that fight.
- no fear / no sheep / no banish ...: that crowd control is not elected and not
  cast in that fight, on top of the owner's standing orders.
- tank here: the tank holding the boss drags him to where the player stood,
  never into a hazard and not where the raid rules already place the tank.

"tactics: boss first" uses the targeted boss, "tactics Lucifron" shows his plan,
"tactics" lists all, "clear" drops one. Names can be short ("geddon") and a plan
can be set from outside the raid. No model is needed; with the bot bridge on, a
free sentence becomes the same order ("tactics ..." is one of its safe orders).
Plain party chat that only starts with the word stays chatter. Russian clients
get the answers in Russian.

New table playerbot_v2_owner_tactics (migration 0039).

(cherry picked from commit 99f77b0b0e04ec83c2b0da6f13c5f274523c7245)
2026-11-11 23:44:07 +00:00
Karrz1 8d26e53319 Bots: "sell junk" sells everything a vendor takes, and sells on arrival
Gun's bags were full and "sell grey" only looked at grey items ("nothing grey to
sell"), only found vendors within 60 yards, and asked to be told again on arrival.

- sell grey / sell junk / sell your junk counts what a vendor visit really sells
  (CountBagRot: greys, trade goods for no profession of the bot's, gear it can't use,
  outgrown greens when the bags are tight), and says so when there is nothing.
- No vendor selected or in the bot's 60 yard scan: the nearest friendly vendor within
  200 yards.
- Farther than 5 yards: the bot walks there and sells once it arrives
  (TickVendorRuns, once a second), or says after a minute that it could not get there.
- "sell junk" is one of the program's safe orders, and the full-bags rule in its prompt
  uses it.

(cherry picked from commit 15e2eb0cc58096621ac68b9374a7edf1f36fb542)
2026-11-11 23:37:46 +00:00
Karrz1 0d49e4e094 Bots: a party order the bot commands don't know goes to the whole group
"all go to the bank and wait" in party went through the bot command parser, which
doesn't know it, and nothing happened (Gun, 2026-11-09).

- An addressed party or raid line ("all ...", "everyone ...", "<bot name> ...", or the
  ";" form) that the parser does not know goes to the bridge's program when it answers
  chat with actions on: as a group order for all the sender's bots in the group, or as
  an order to the one bot named. A role prefix ("tank: ...") stays the parser's.
- The program picks one action and one short line for the group; one bot answers, and
  every other bot runs the same action 300 ms apart, each with its own checks. A ref
  from the answering bot's NEAR list is given to each bot for the same thing.
- Group actions: moving, stopping, fighting, emotes, orders, steps and signing a
  charter; a trade, a spell or a quest stays one bot's.

(cherry picked from commit 54a0d1fd491944957c3227b934473260fbb00052)
2026-11-11 23:37:46 +00:00
Karrz1 15f7d8303e Bots brought to their player stay there instead of walking back and warping again
(cherry picked from commit 71907d0399d3ceafbf17564da62567d77ee66542)
2026-11-11 23:37:41 +00:00
Karrz1 312fdf59e4 PlayerbotV2: no hired bots and no bot arenas
The hired bots (hire brokers, Playerbot.Hire.*, .bot hire, the add-on's hire panel) and the bot arena play
(.bot arena, arena bot teams, the add-on's arena buttons and the Ring of Law arena script) are taken out.
Neither is Blizzard content. The stock TrinityCore arena code and the bot module's arena tactics stay.
2026-11-09 17:35:58 +00:00
Karrz1 b5f1d43560 Merge forever (sync with WoW Forever 0.1.34) into forever-bots
forever-bots is forever plus the optional player bots module (src/modules/PlayerbotV2), now at our 0.1.34 bot code:
dungeon and raid tactics (BWL Nefarian, Zul'Gurub), pull back, ships and zeppelins, gear trading, orders in party chat,
autosave every 15 minutes, the ForeverBots add-on 0.6.20 and the Playerbot.Enable master switch.
World PvP bots and the optional bot chat program are in the module but off by default.
2026-11-09 17:27:57 +00:00
Karrz1 9df935eed5 PlayerbotV2: bot module update
conf/zz-forever-bots.conf ships the WoW Forever repack settings: world bots on with the
16-29 GB crowd preset (RssBudgetMb 6000), start zone caps, spawn pacing, and the auction
house bot listing every quality on the neutral house with a fair-price buyer. A
playerbot.conf next to worldserver.conf is read too; one in worldserver.conf.d is not
loaded twice.
2026-10-27 23:06:42 +00:00
Karrz1 f8067cf820 Bots: no riding and no mounts below level 40 (#98)
Reason: bots made by earlier builds, or taught by a retail trainer pass, could hold riding skill and mounts below level 40, and riding 150 at levels 40 to 59.

Why: vanilla gives riding at level 40 (75, the normal mount) and at 60 (150, the swift mount); the rule was spread over the setup code and the login correction.

Fix: Bot/World/RidingTier.h is the one rule (none below 40, 75 from 40, 150 from 60). Setup uses it, and the login correction removes the riding skill and every mount spell from a bot under level 40 (vanilla realm only). Unit test in tests/game/ClassicRidingTier.cpp.
2026-10-23 18:55:25 +08:00
Karrz1 911c523267 Bots: a companion its owner removes from the group is let go like a dismissal (#97)
Reason: after its owner used Uninvite on a companion bot, the bot kept following the owner for as long as the owner binding stood.

Why: nothing reacted to the group removal; only .bot dismiss released a companion.

Fix: a group hook releases an owned companion that the owner kicks or that leaves the group: it says goodbye and logs out, and the owner and saved mark stay, so .bot call brings it back. Battleground groups, a bot that is logging out, internal removals and kicks by anyone but the owner do nothing.
2026-10-23 18:55:16 +08:00
Karrz1 956aff2834 Bots: module update (raid tactics, group control, world-bot pool, riding, starter gear, combat fixes) (#71)
* Bots: module update (raid tactics, instance entry, world-bot and combat fixes)

* Bots: module update from the current build (follow-the-owner on drops, group-human instance entry, raid-ready and population fixes)

* Bots: group control, pool balance at every level, starter outfit for low world bots, riding tiers and mount fallback

* World bots: no quest hub for a bot that can take no quest there (#87)

* World bots: no quest hub for a bot that can take none there (ring spot instead); move_abandon logs why the bot did not move

* Starter outfit: wait while the bot casts or fights, and leave quivers and ammo out of the pieces that must be worn

* Bots: seven small cleanups of the bot rules (#88)

* Bots: one OwnerOrders struct holds the owner's orders (command, follow, stance, windows) and the cross-thread fields are now locked

* Bots: one pet attack order per combat tick; drop the warlock and hunter duplicates, new victim ordered at once and the same one every 3 s

* Raids: one script_names_target() test for the boss script's kill target, used by the raid dispatch and both generic pickers

* Bots: idle:rest sits a solo bot under 50% health that has nothing to eat

* Bots: remove the retail rotations of the nine vanilla classes (every spec is already overridden by the Classic rotation)

* Group: one movement_owned_elsewhere test for the follow, slot move and recall gates

* Bots: the threat drop spells and the 60/80 percent triggers live next to the other threat limits in ThreatLimits.h

* Trade: reagents of a recipe the bot knows, from the owner or a group mate, are a gift; trade line in the command guide (#89)
2026-10-20 09:05:38 +08:00
Karrz1 d01d392103 Bots: module update (raid, dungeon, battleground and world-bot fixes) (#61)
Module-only update of src/modules/PlayerbotV2. Nothing outside the module directory changes.
2026-10-18 09:20:47 +08:00
Karrz1 d13cdf728d Add WoW Forever Bots by Karrz (optional, -DBUILD_PLAYERBOT_V2=1, default off)
Imported from Karrz's karrz-bots branch (12a3d94547) on top of forever: the
PlayerbotV2 module, the ForeverBots add-on (/fb), the bot SQL, the core hooks
and API it needs, and the Classic battleground, raid, auction house and road
navigation changes it was tested with.

Left out of this import: the world editor, tests, protocol research and data
generator tools, dev setup scripts, the realm example config, the design notes,
the older PlayerbotControl add-on, and changes to sql/create, the Boost
minimum, and the build revision files. These stay in Karrz's own repository.
2026-10-13 09:21:34 +08:00