celguar / mangosbot-bots

Bot AI Core from ike3 for cmangos/mangos classic/tbc/wotlk
https://github.com/cmangos/playerbots
86 stars 41 forks source link

Beta: Party members not rolling #183

Closed poogie closed 1 year ago

poogie commented 1 year ago

Since roll implementation, bots don't roll anymore. I have to type "/p roll auto" every time an item is being rolled I've been trying loot strategies and roll help, but they only roll on demand. Do I need to set up anything else? Running TBC 12/14/22 build Calling @mostlikely4r for help

mostlikely4r commented 1 year ago

Randbots should now have the 'roll' strategy in co and nc. Alts should have 'delayed roll' strategy in nc (unless you have different strategies in your config) Both should make bots roll on items very often and after you roll respectively.

Can you check if you have any of those strategies enabled and if not try again with them enabled?

poogie commented 1 year ago

Nailed it! I added roll strategies ( nc +roll / co +roll ) to alts and usual "friends" Now they show "roll" in their strategies when asked. The rest of Randombots seem to be ok. (they have roll strategy.) I guess alts and/or customized bots lack the roll strategy after updating. You only need to set up them. I also added "maintenance" to them Thank you very much!!

celguar commented 1 year ago

Hello, is it solved?

poogie commented 1 year ago

Yes. Everything is fine now. Adding the strategies via commands (co +roll nc+roll nc +maintenance) solved the problem.

This is what I Found: It looks like customized bot strategies are read from ai_playerbot_db_store table. So if you customize behavior for an alt or party member, the data is stored there. After updating, the system reads the table and bots use the stored settings. It only happens with bots in "ai_playerbot_db_store" , those that you customized, ie your alts or favorite bots. The solution is simple: Adding the strategies or resetting them in-game, stores the new strategies into the sql database.

I hope it helps

poogie commented 1 year ago

This is a general workaround solution via sql

The query simply deletes all ai_playerbot_db_store data keeping the table.

CREATE DATABASE IF NOT EXISTS `tbcplayerbots` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `tbcplayerbots`;
DELETE FROM `ai_playerbot_db_store`

The sql file is attached. I'm not a coder, so I'm sure you can improve this in some way.

You should take this into account if you want to avoid this issue with players who update their working servers from previous builds, where the new strategies were not defined and users customized them.

I suggest including the sql in the update launcher.

Clean_playerbot_strategies.zip

mostlikely4r commented 1 year ago

Hey poogie,

With that script. What strategies do bots have after running (rndbots/alt bots)?

poogie commented 1 year ago

They are different for alts/rndbots:

Alts show a simplified set (which includes delayed roll) example: +bmana,+buff,+chat,+cure,+default,+delayed roll,+dps assist,+duel,+emote,+follow,+food,+gather,+loot,+mount,+nc,+quest,+racials,+return

this is copy/pasted straight from the ai_playerbot_db_store after cleaning the table and summon the bot in game

Rndbots show a more wide set of strategies: example with already customized bot before cleaning table : +chat,+collision,+custom::say,+default,+dps assist,+emote,+follow,+food,+gather,+grind,+group,+guild,+loot,+mount,+nc,+quest,+racials,+roll,+rpg,+rpg bg,+rpg explore,+rpg guild,+rpg maintenance,+rpg player,+rpg quest,+rpg vendor,+travel (I removed nc -duel for the test and followed same procedure)

Example with a pure random bot: +buff,+chat,+collision,+cure,+custom::say,+default,+dps assist,+emote,+follow,+food,+gather,+grind,+group,+guild,+loot,+mount,+nc,+quest,+racials,+roll,+rpg,+rpg bg,+rpg explore,+rpg guild,+rpg maintenance,+rpg player,+rpg quest,+rpg vendor,+travel

Brief: As you see, the alts lack the rpg stuff ( I think is intended), but "delayed roll" was added successfully by default. The previously customized bot (not alt) added "roll" The pure random bot is untouched by the script, so it shows all defaults.

mostlikely4r commented 1 year ago

Aye so all returns to default. Which is a good situation.

I think it's better not to include this in the repack though as it does remove any player defined strategies as you said.

Rndbots are less of a concern as they are reset/deleted/created freely and will get the new roll strategy eventually.

For alt-bots we don't want to reset all strategies since these are purposely given to the bots by a player. One could argue they could be given 'roll delayed' in an update script but I'd rather players wonder why it's missing and see the two new options (and pick one or none accordingly).

But for those who just want to bulk apply it and don't care about saved strats your method is good to have around.

poogie commented 1 year ago

I agree A simple warning about adding a roll strategy after updating should be enough. You can still keep this fix for people who just want to reset a wide number of customized bots or seriously struggled with rolling. It should work as a "reset all bot strategies" fix also