Bots: install the default settings file into worldserver.conf.d if it is missing (#77)

* Bots: install the default settings file (world bots, auction house bot, logging) into worldserver.conf.d if missing

* Bots: default world-bot settings match the test server (roster 3000, 220 awake, 160 per player)

* Bots: default settings use the neutral auction buyer only and timestamps in Playerbot.log
This commit is contained in:
Karrz1
2026-10-20 09:06:05 +08:00
committed by GitHub
parent 2f563a1872
commit 21558cccda
4 changed files with 148 additions and 7 deletions
+8 -7
View File
@@ -43,14 +43,15 @@ with a builder script that is not part of this branch. Without them the bots and
Your database user needs rights on the new `playerbot` database
(`GRANT ALL ON playerbot.* TO '<your db user>'@'%';`). The server reads and writes it with the
same login as your other databases. The files do not drop anything.
4. **Settings.** In `worldserver.conf.d`, rename `playerbot.conf.dist` to `playerbot.conf`, and copy
`examples\zz-forever-bots.conf` into the same folder. That file is optional and turns on
extras that are **not** Blizzlike: solo raid entry and saving on entry (`Instance.IgnoreRaid`, `Instance.BindOnEntry`), killed raid trash staying dead (`Instance.PersistRaidTrash`),
no Molten Core runes, no attunements, open Ahn'Qiraj gates (see `doc/OptionalServerOptions.md`), the
auction house bot, faster raid casting, and world bots (stage A, 300 bots, `Playerbot.World.*`).
4. **Settings.** The build puts `zz-forever-bots.conf` into `worldserver.conf.d` (an existing copy is never overwritten).
It turns on the world bots (up to 220 awake, about 160 around each player, from a roster of 3000), the auction house bot, bot raid tactics and bot logging, so they work
without further setup. The raid and instance shortcuts that are not Blizzlike (solo raid entry, no attunements, no Molten Core runes,
open Ahn'Qiraj gates; see `doc/OptionalServerOptions.md`) are in that file but commented out; remove the `#` to use them.
Optionally rename `playerbot.conf.dist` to `playerbot.conf` to change other bot settings (every key is documented there).
`examples\zz-forever-bots.conf` is the older optional version (shortcuts switched on, faster raid casting, 300 bots); copy it over to use that.
Change a value and restart to tune; set `Playerbot.World.Enable = 0` for no roaming bots,
`AuctionHouseBot.Seller.Enabled = 0` for no auction bot. Weak PC: set `Playerbot.World.MaxBots = 100`
and `Playerbot.World.GlobalFill = 0`. Expect 4-6 GB of extra RAM at 300 bots.
`AuctionHouseBot.Seller.Enabled = 0` for no auction bot. Weak PC: set `Playerbot.World.MaxBots = 100`,
`BotsPerPlayer = 40`, `CityBots = 40` and `ZoneBots = 20`. Expect about 2.9 GB of RAM for the server plus about 4 MB per awake bot (about 3.8 GB at 220 bots).
5. **Start the server** (bnetserver, then worldserver). The first start takes longer while the bot
tables are created. Bot log lines go to `Playerbot.log` in your logs folder.
6. **Install the addon.** Copy the folder `src\modules\PlayerbotV2\Addon\ForeverBots` into
+20
View File
@@ -233,4 +233,24 @@ trinity_add_module(playerbot-v2 AddSC_playerbot_v2
CONFIGS
${CMAKE_CURRENT_SOURCE_DIR}/conf/playerbot.conf.dist)
# Default settings (world bots, auction house bot, bot logging) as an active file in worldserver.conf.d, so the bots work
# out of the box. An existing copy is never overwritten.
set(PLAYERBOT_V2_DEFAULT_CONF ${CMAKE_CURRENT_SOURCE_DIR}/conf/zz-forever-bots.conf)
set(PLAYERBOT_V2_COPY_IF_MISSING ${CMAKE_CURRENT_SOURCE_DIR}/conf/CopyIfMissing.cmake)
if(COPY_CONF)
if(UNIX)
set(_pbv2_build_conf_dir ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/../etc/worldserver.conf.d)
set(_pbv2_install_conf_dir ${CONF_DIR}/worldserver.conf.d)
elseif(WIN32)
set(_pbv2_build_conf_dir ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/worldserver.conf.d)
set(_pbv2_install_conf_dir ${CMAKE_INSTALL_PREFIX}/worldserver.conf.d)
endif()
if(_pbv2_build_conf_dir)
add_custom_target(playerbot-v2-default-conf ALL
COMMAND ${CMAKE_COMMAND} -DSRC=${PLAYERBOT_V2_DEFAULT_CONF} -DDST_DIR=${_pbv2_build_conf_dir}
-P ${PLAYERBOT_V2_COPY_IF_MISSING})
install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" \"-DSRC=${PLAYERBOT_V2_DEFAULT_CONF}\" \"-DDST_DIR=\$ENV{DESTDIR}${_pbv2_install_conf_dir}\" -P \"${PLAYERBOT_V2_COPY_IF_MISSING}\")")
endif()
endif()
message(STATUS "Playerbot V2 module enabled (multi-library: 13 sub-libs)")
@@ -0,0 +1,8 @@
# Usage: cmake -DSRC=<file> -DDST_DIR=<dir> -P CopyIfMissing.cmake
# Copies SRC into DST_DIR unless a file of that name is already there, so a user's edited copy is never overwritten.
get_filename_component(_name "${SRC}" NAME)
if(NOT EXISTS "${DST_DIR}/${_name}")
file(MAKE_DIRECTORY "${DST_DIR}")
file(READ "${SRC}" _content)
file(WRITE "${DST_DIR}/${_name}" "${_content}")
endif()
@@ -0,0 +1,112 @@
[worldserver]
###################################################################################################
# WoW Forever Bots - DEFAULT SETTINGS
# The bots build puts this file into worldserver.conf.d\ if it is not there yet (an existing copy is never overwritten).
# It is read after playerbot.conf, so it wins. Edit the values and restart; delete the file to go back to the stock defaults
# (then no world bots and no auction house bot run). The raid and instance shortcuts below are commented out because they
# change core gameplay; remove the leading # to use them.
###################################################################################################
# Raids and instances (core keys, all off: not Blizzlike)
###################################################################################################
# Not Blizzlike: a solo player may enter a raid (no 40-player raid group needed), so you can walk in and call bots inside.
# Instance.IgnoreRaid = 1
# Vanilla lockout rule: you are saved to the raid on entry.
# Instance.BindOnEntry = 1
# Killed raid trash stays dead after you leave and come back (it does not respawn until the weekly reset).
# Instance.PersistRaidTrash = 1
# Molten Core: Majordomo and Ragnaros are up without dousing the runes.
# Instance.MoltenCoreSkipRunes = 1
# No attunement item or quest is needed to enter a raid.
# Instance.IgnoreAttunement = 1
# The Gates of Ahn'Qiraj start open.
# Instance.AhnQirajGatesOpen = 1
# Stock value (0), listed so you can see it: Molten Core core hound packs are unlinked by default, so they die one by one. See doc/OptionalServerOptions.md.
# Instance.MoltenCoreHoundsLinked = 0
###################################################################################################
# Auction house bot (core keys): fills all three houses with level 1-60 vanilla items, buys listings
###################################################################################################
AuctionHouseBot.Seller.Enabled = 1
# One shared (neutral) auction house: the neutral buyer buys what you list; the faction buyers are off.
AuctionHouseBot.Buyer.Alliance.Enabled = 0
AuctionHouseBot.Buyer.Horde.Enabled = 0
AuctionHouseBot.Buyer.Neutral.Enabled = 1
# Reserved account id for the seller characters (no real account; keep it below 2147483647).
AuctionHouseBot.Account = 2000000001
AuctionHouseBot.Sellers.Count = 12
AuctionHouseBot.Vanilla.Only = 1
AuctionHouseBot.Vanilla.MaxReqLevel = 60
AuctionHouseBot.Vanilla.MaxItemLevel = 100
AuctionHouseBot.Items.Amount.White = 3500
AuctionHouseBot.Items.Amount.Green = 3500
AuctionHouseBot.Items.Amount.Blue = 1200
AuctionHouseBot.Items.Amount.Purple = 250
AuctionHouseBot.Items.Vendor = 1
AuctionHouseBot.Class.TradeGood = 10
AuctionHouseBot.Class.Consumable = 8
AuctionHouseBot.Class.Recipe = 6
AuctionHouseBot.Class.Container = 5
AuctionHouseBot.Class.Weapon = 4
AuctionHouseBot.Class.Armor = 4
AuctionHouseBot.Class.Reagent = 2
AuctionHouseBot.Class.Projectile = 3
AuctionHouseBot.Class.Misc = 2
AuctionHouseBot.Class.Quest = 0
AuctionHouseBot.Class.Key = 0
AuctionHouseBot.Class.Gem = 0
AuctionHouseBot.Class.Glyph = 0
AuctionHouseBot.Update.Interval = 10
AuctionHouseBot.ItemsPerCycle.Normal = 100
###################################################################################################
# Logging: bot module lines go to Playerbot.log (rewritten at each start), not the console
###################################################################################################
Appender.Playerbot = 2,3,1,Playerbot.log,w
Logger.playerbot.v2 = 3,Playerbot
Logger.playerbot.api = 3,Playerbot
Logger.ahbot = 3,Console Server
###################################################################################################
# Bots (module keys; every key is documented in playerbot.conf.dist)
###################################################################################################
Playerbot.SharedDatabase = "playerbot"
Playerbot.Raid.Enable = 1
# Off: vanilla cast speed. Set Playerbot.Cast.Enable = 1 to use the percentages below (percent of normal cast time and GCD, GCD never under 750 ms).
Playerbot.Cast.Enable = 0
Playerbot.Cast.RaidSpeedPct = 75
Playerbot.Cast.DungeonSpeedPct = 90
Playerbot.Cast.WorldSpeedPct = 100
Playerbot.Cast.BgSpeedPct = 115
Playerbot.Cast.WorldPvpSpeedPct = 115
# Battlegrounds: bots join only when a real player queues.
Playerbot.Bg.AutoSeed.Matches = 0
Playerbot.Bg.AutoJoin = 0
# World bots, set up like the live test server: a roster of sleeping residents (PoolMax) that wake near real players, so the
# world feels populated. Up to MaxBots are awake at once; each player gets about BotsPerPlayer around them (CityBots in a
# capital or town, ZoneBots in a leveling zone), and residents within WakeRadius yards of a player wake up.
# Weak machine? RAM is about 2.9 GB for the server plus about 4 MB per awake bot. For 8 GB use MaxBots 60, for 16 GB MaxBots 100
# with BotsPerPlayer 40, CityBots 40 and ZoneBots 20; the roster itself (PoolMax) costs database rows, not memory.
# To switch the world bots off: Enable = 0.
Playerbot.Population.TotalTarget = 0
Playerbot.World.Enable = 1
Playerbot.World.FriendlyPct = 100
Playerbot.World.GlobalFill = 0
Playerbot.World.MaxBots = 220
Playerbot.World.BotsPerPlayer = 160
Playerbot.World.CityBots = 160
Playerbot.World.ZoneBots = 60
Playerbot.World.ActivityRadius = 600
Playerbot.World.WakeRadius = 450
# Roster of sleeping residents, built up to PoolMax in the background (SeedRoster = 1).
Playerbot.World.PoolMax = 3000
Playerbot.World.SeedRoster = 1
# Part of the roster that is kept as a temporary pool, balanced by faction and level. Only read by builds that have the
# temporary pool; this build ignores it.
Playerbot.World.VariableMax = 2000
Playerbot.World.FillerHubOnly = 1
# The spawner stops adding bots when the worldserver process passes this many MB (0 = no limit).
Playerbot.World.RssBudgetMb = 9000