Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bots] Bot Overhaul #4580

Open
wants to merge 278 commits into
base: master
Choose a base branch
from
Open

[Bots] Bot Overhaul #4580

wants to merge 278 commits into from

Conversation

nytmyr
Copy link
Contributor

@nytmyr nytmyr commented Dec 30, 2024

Description

Spells:

  • Complete bot AI spell rewrite. Bots are much smarter with how they pick and choose when/how to cast.
  • Bots will respect spell settings of any bot or player. Every setting is a per bot basis so any bot can be customized how you like.
  • All spells bots use (including commands) are now pulled from spell lists, no more hardcoding spells. These are all provided in the update.
  • Bots run through a series of checks before attempting to cast anything to limit casts and CPU cycles that won't work or land.
  • Bard bots will re-sing their songs when they are on their last tick instead of waiting till they've faded to begin singing it again.
  • Rule ShowResistMessagesToOwner will display bot resist messages to their owner. Default True.
  • Rule BotsUseLiveBlockedMessage similar to clients.
  • Rule BotBuffLevelRestrictions added to split Client vs Bot restrictions. Default True.
  • Rule CanCastPetOnlyOnOthersPets to control whether bots can cast their pet spells on other's pets or not. Default False.
  • Rule RaidBuffing similar to GroupBuffing but will buff the entire raid.
  • Rule CrossRaidBuffingAndHealing - Whether or not bots can heal/buff across the entire raid instead of their own raid group.
  • Rule CanCastIllusionsOnPets - Whether or not pets can receive illusions.
  • Rule RequirePetAffinity - If Pet Affinity AA is required for bots to receive group spells on their pets.
  • Rule SpellResistLimit - Default resist limit for bots to not attempt a spell (150 default). If a target has > 150 MR and the spell is Magic based, it will not attempt to cast due to resists (resist check factors in debuffs and spell adjustments).
  • Rule HasOrMayGetAggroThreshold - Controls the % of hate where a bot thinks they'll get aggro or not. Affects spell casting and sitting.
  • Rule EnableBotTGB to allow bots to TGB like players.
  • Many rules to control cast chances for different types, delay between AI checks for casts or movements (performance based), combat distance, taunting movement logic.
  • Rules to control whether charmed pets can be buffed, healed, cured.
  • Can control how and if pets are buff on a per bot basis.

Spell lists:

  • No more bitmasking of spell types for bots.
  • Fear spells are automatically moved to their own spell type.
  • Corrects a bunch of entries on stock PEQ that were incorrect. If you're not using stock PEQ spell levels and such, be weary. May need to cross check your backup.
  • If enabled, RunSpellTypeChecksOnSpawn will run a check on all bot spells when a bot is spawned to suggest changes to be made to spell entries. Use only one bot to spawn this, it'll get spammy. Check your logs for info. Not 100% accurate.

Commands:

  • Redid some commands to have a better help layout. Will probably redo remaining in the future.
  • Added correct actionables to ^timer help, ^suspend help, ^release help.
  • Most all commands support a "current" option to see their current setting.
  • ^spelltypeids and ^spelltypenames will list different spelltypes available.
  • ^enforcespellsettings had the alias ^enforce added.
  • ^botsettings/^bs/^settings - Lists all commands that can customize a bot.
  • ^illusionblock (^ib) /#illusionblock - Bots/Clients can enable/disable to prevent the illusion portion of bot buffs from landing on them.
  • ^inventorygive/remove/list/window/ have had shorthands added (^ig/^ir/^il/^iw).
  • ^inventorygive now allows you to specify a valid slot ID.
  • ^itemuse had the shorthand ^iu added.
  • ^pickpocket had the shorthand ^pp added.
  • ^behindmob/^bh - Bots with this enabled will stay behind their target.
  • ^spelldelays/ - Controls the rate at which bots will cast or receive spells of particular types. Can be used for clients to control how bots affect them with #spelldelays.
  • ^spellholds/ - Used to control whether or not bots will cast particular types.
  • ^spellminthresholds - % of health when a bot will stop casting or receiving particular spell types. Can be used for clients to control how bots affect them with #spellminthresholds.
  • ^spellmaxthresholds - % of health when a bot will start casting or receiving particular spell types. Can be used for clients to control how bots affect them with #spellmaxthresholds.
  • ^spelltargetcount - Number of targets required for specific spell types to attempt to cast a group or AE of said type.
  • ^spellidlepriority/^spellpursuepriority/^spellengagedpriority - Allows players to reorder the cast sequence of spell types for each scenario.
  • ^spellminmanapct/^spellmaxmanapct - % mana when a bot will stop/start casting given spell types.
  • ^spellhpmanapct/^spellhpmanapct - % HP when a bot will stop/start casting given spell types.
  • ^spellaggrochecks - Toggle whether or not specific spell types will check if you bot will gain aggro or not before casting.
  • All the above ^spell commands can be shorthanded by removing "spell" IE ^spelldelays = ^delays.
  • ^sitmanapercent/^sithppercent (^sitmana/^sithp) - % of hp/mana when a bot will sit in combat if they don't believe they'll get aggro by sitting.
  • ^sitincombat/^sitcombat - Whether or not bots will sit in combat to med/heal.
  • ^spellinfo will now show the correct info for the spells in the pop-up.
  • ^petsettype/^pst - Now has an option for Epic pets, controlled by various rules - AllowMagicianEpicPet (allowed or not), Bots,AllowMagicianEpicPetLevel (level when allowed if required), RuleI(RequiredMagicianEpicPetItemID (item required to cast an epic pet if required) - EpicPetSpellName will be the pet that is considered epic.
  • ^maxmeleerange/^mmr - Chosen bots will stay at max melee range (avoid things like short AEs or Wild/AE Rampage). If the rule DisableSpecialAbilitiesAtMaxMelee is enabled, special abilities and taunt will be disabled when at MMR.
  • ^follow has been rewritten to allow following of others in raids.
  • ^botfollowdistance/^followdistance/^followd has been rewritten to allow actionables for different bot settings, chain, etc.
  • ^report now supports actionables.
  • ^stance supports actionables now. Stances have been implemented to allow quick changing of bots to control all sorts of different settings like delays, holds, min/max thresholds, etc. All customizations save to each stance type.
  • ^stopmeleelevel/^sml - Supports actionables and proper resets.
  • ^defaultsettings/^default - Restored a bot to their default settings - Many options to control what is restored or all.
  • ^copysettings/^copy - Copy settings from one bot to another, many options including all to be copied. Rules - CopySettingsOwnBotsOnly (if disabled will allow copying of other's bots settings), AllowCopySettingsAnon (if disabled, anonymous players cannot be copied from).
  • ^classracelist - Shows a list of classes and races with their IDs, similar to ^create help.
  • ^distanceranged/^distranged/^dr (formerly ^casterrange) - Range at which bots will attempt to stay for casting or ranged throwing/archery.
  • ^cast - Force bots to cast a specific spell type or can supply a spell ID if AllowForcedCastsBySpellID is enabled. Supports AAs if AllowCastAAs is enabled. Can supply any AA ID the bot has or "harmtouch"/"layonhands" to cast those specifically. Multiple rules to control whether or not things like res, mez, charm, etc are allowed.
  • ^bottoggleranged/^btr/^toggleranged (renamed from ^bottogglearcher now that throwing is allowed).
  • ^pull has been rewritten. Bots will properly return to their location unless told to attack during a pull, can use different rules to control whether bots can cast, archery, throw or rule-based spell pull.
  • ^camp will now tell you how many bots were camped.
  • ^depart has been rewritten and ^circle/^teleport have been removed.
  • ^itemuse/^iu - added a haste option, allows combining of certain options to further narrow.
  • ^delete now requires a confirm option (^delete confirm) to prevent accidental deletes.
  • ^blockedbuffs/^blockedpetbuffs - Allows you to specify buffs that will be blocked on a bot or their pet by spellID.
  • ^taunt now has an option to toggle pet taunting.
  • ^discipline/^disc - Can use any disc a bot has in their spell list by supplying the spell ID or using aggressive/defensive (^aggressive/^defensive have been removed, use ^disc defensive/^disc aggressive).
  • ^setassistee - Set your bots to assist a group or raid member as well as yourself.
  • Any commanded spell like ^mez, ^rez,, ^movementspeed, etc. now fall under the ^cast command.

Movement:

  • Bot movement has been rewritten to be smarter.
  • Bots that are currently taunting will remain in front of the bot. Taunting bots will stick together by default or follow whoever has aggro. Adjustable by rules.

Combat:

  • Major combat rewrite to make bots much better and smarter in combat.
  • Bot combat is now in line with clients as far as skills go, double, triple, extra attacks, etc. factoring in AA and spell bonuses.
  • Rules BotArcheryConsumesAmmo/BotThrowingConsumesAmmo to allow unlimited ammo or not.
  • Bots will no longer spam you if they don't have a weapon to backstab. They will only announce once per engagement.
  • Rogue and Monk bots will attempt to FD/Evade on aggro if ^spellholds escapes is not enabled.
  • Bots will assist group/raid main assists. If you don't want them to do this when grouped or in a raid, just set yourself as the assistee.
  • Bots will only use special abilities they are trained in (kick, bash, etc).

General:

  • Major performance improvements done for bots.
  • You will now properly get exp in raids with bots.
  • Bots will check LoS for all spells and commands, you cannot tell bots to attack or command them to do something if you don't currently have line of sight on them.
  • Cannot tell bots to attack near locked doors that are currently closed to prevent door pulling.
  • Moved all bot settings to bot_settings table. Most all settings will save instead of temporary. Exceptions are ^taunt and ^mmr (bots will automatically taunt if set to an aggressive stance).
  • The rule MinStatusToBypassCreateLimit will control at what status players can create beyond the standard limit. Limited by StatusCreateLimit.
  • Lore conflicts for bots will now display the proper message.
  • Rule AllowBotEquipAnyClassGear will allow bots to equip any classes gear.
  • Rule StackSizeMin to control the quantity required to give a bot ammo.
  • Rules PreventBotCampOnFD/PreventBotSpawnOnFD/PreventBotSpawnOnEngaged/PreventBotCampOnEngaged
  • Rule BotSoftDeletes.
  • Bots need to be in your group or raid to be able to do most anything, including commands.
  • Bots will follow their owner by default always unless told otherwise.
  • Bots can now be feared, stunned, knocked back, gravity effect, viral, etc.
  • Bots will now properly show their ranged weapons if set to ranged attack on spawn.
  • Rule Bots, CampTimer can be set to control when bots are camped when a player /camps.
  • Made most errors for commands/bots display yellow rather than white.
  • Bot names will now follow same rules as players.
  • Bots will no longer auto HT/LoH. This is done manually by ^cast now.
  • Added BotGroupSay method.
  • Add check to allow SpawnLimit to be set to 0 for rules and strictly control bot spawn limits by buckets (bot_spawn_limit).
  • Rules to control spawn limits per zone and/or force a spawn limit per zone.

Misc:

  • CheckLosCheat in source can be expanded as needed to allow special areas to bypass LoS restrictions. Example provided in source.

Probably missed quite a few changes and there is a LOT more detail that has been done here but if bots were previously version 1.0, consider these version 10.0

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Testing

Thorough testing done during rewrite. Inevitable with something this big that SOMETHING will pop up and will be addressed as discovered.

Clients tested:
RoF2

Checklist

  • I have tested my changes
  • I have performed a self-review of my code. Ensuring variables, functions and methods are named in a human-readable way, comments are added only where naming of variables, functions and methods can't give enough context.
  • I have made corresponding changes to the documentation (if applicable, if not delete this line)
  • I own the changes of my code and take responsibility for the potential issues that occur
  • If my changes make database schema changes, I have tested the changes on a local database (attach image). Updated version.h CURRENT_BINARY_DATABASE_VERSION to the new version. (Delete this if not applicable)

…eline type...

Add incapacitated checks to casting logic and checks.
Add candocombat zone check, summon other's corpse for bot, in/out combat spell checks, mute checks, level restriction
zone/mob.cpp Outdated Show resolved Hide resolved
zone/mob.cpp Outdated Show resolved Hide resolved
zone/mob.cpp Outdated Show resolved Hide resolved
zone/mob.cpp Outdated Show resolved Hide resolved
zone/mob.cpp Outdated Show resolved Hide resolved
zone/mob.cpp Outdated Show resolved Hide resolved
zone/mob.cpp Outdated Show resolved Hide resolved
zone/mob.cpp Outdated Show resolved Hide resolved
zone/mob.cpp Outdated Show resolved Hide resolved
zone/mob.cpp Outdated Show resolved Hide resolved
zone/mob.cpp Outdated Show resolved Hide resolved
zone/spells.cpp Outdated Show resolved Hide resolved
zone/spells.cpp Outdated Show resolved Hide resolved
zone/spells.cpp Outdated Show resolved Hide resolved
@Kinglykrab
Copy link
Contributor

Left quite a few comments, could have done more but figured it was unnecessary.

Code looks great, everything seems to work well.

Just a matter of formatting and use of snake_case in places where we're adding code or changing pre-existing code.

Don't see any glaring issues and nothing has poked its head out in testing.

Branch will need to be rebased due to recent merges.

@nytmyr
Copy link
Contributor Author

nytmyr commented Jan 11, 2025

Went through and cleaned up as many camelCase as possible.

In line with master now to prevent merge conflicts.

Removed all the bcspells hardcodes as they're not used any more

Fixed helper to show the lowest level required to use a commanded spell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants