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

Bot questing fixes #416

Closed
wants to merge 0 commits into from
Closed

Bot questing fixes #416

wants to merge 0 commits into from

Conversation

atidot3
Copy link
Contributor

@atidot3 atidot3 commented Jul 30, 2024

Bot should be way more consistent and accurate at doing quests.
Add missing implementation of update kill / update loot on quests.
Add "debug quest" strategy to allow debugging.

image
image
image
image

Known issue:
Gameobject quest arent functionnal yet
Quest item use on NPC doesnt seem to be implemented

@noisiver
Copy link
Collaborator

noisiver commented Jul 30, 2024

This is great. Good job!

I haven't tested it yet because I'm working on all the compiler warnings but just that you got so many of them to accept the quest is fantastic.

@atidot3
Copy link
Contributor Author

atidot3 commented Jul 30, 2024

There's still so much to do with quests its insane :')

@Dreathean
Copy link
Collaborator

Awesome stuff! Thank you for your contribution!

@noisiver
Copy link
Collaborator

noisiver commented Jul 30, 2024

I'm testing it now, will merge your recent commit and reset the bots. They're not talking at all though, not sure why. Anyway, how would you currently enable them to /say what they're doing with quests?

Edit: I see, I have to add +debug quest to the playerbots config?

@atidot3
Copy link
Contributor Author

atidot3 commented Jul 30, 2024

you need to add them "debug quest" strategy in the cfg yes

@noisiver
Copy link
Collaborator

I'm running it now. I also applied my changes to stop them from ever teleporting so I can observe their progress through the levels.

@atidot3
Copy link
Contributor Author

atidot3 commented Jul 30, 2024

i've been trying to force them to ONLY do quests but tbh i've no idea itf its even possible

@noisiver
Copy link
Collaborator

It has to be. It would be a nice feature to have, although it shouldn't be enabled by default if so because it limits them in other ways. All their actions are pre-determined so telling them to only do quests has to be possible, somehow.

@atidot3
Copy link
Contributor Author

atidot3 commented Jul 30, 2024

no not all the time, but for testing so they only make quests

@noisiver
Copy link
Collaborator

noisiver commented Jul 30, 2024

After letting the server run for a while, this happens. Now the server crashes as soon as the bots log in.

I have AiPlayerbot.RandomBotGroupNearby enabled. I use this on all my realms but never had crashes before.

gdb.txt

I'm currently compiling using the same source to gather a list of the warnings, but as soon as it's done I'll compile it again with your changes so I can get a proper crash log. Well, it's still the same source, just cmake arguments were changed so I don't know what it's talking about in that log.

@atidot3
Copy link
Contributor Author

atidot3 commented Jul 30, 2024

i havent test bot in groupe and quest sharing
Randombots will group with nearby bots to do shared quests
AiPlayerbot.RandomBotGroupNearby = 0

This is my settings.

I belive the issue is here:
if (AI_VALUE2(bool, "group or", "should sell,can sell,following party,near leader") ||
AI_VALUE2(bool, "group or", "should repair,can repair,following party,near leader") ||
(AI_VALUE2(bool, "group or", "should sell,can ah sell,following party,near leader") && bot->GetLevel() > 5))

        one of the define must not exist

@noisiver
Copy link
Collaborator

Yes but if it's crashing because of it being enabled, as a result of this PR, you have to fix it before it's merged though.

@atidot3
Copy link
Contributor Author

atidot3 commented Jul 31, 2024

New commit require core changes to be able to compile
liyunfan1223/azerothcore-wotlk#18

@zhangbo8418
Copy link

Can the default conversation language of the robot be controlled through the configuration file?

@atidot3
Copy link
Contributor Author

atidot3 commented Aug 1, 2024

Bot default conversation is using the config DBC locale.
There is some hardcoded english chat line but most of it is using mysql entry that contains translation so you should be fine

@atidot3
Copy link
Contributor Author

atidot3 commented Aug 1, 2024

This last commit should be working now without any more crashes.

@liyunfan1223
Copy link
Owner

Thank you @atidot3. Could you check the warning here liyunfan1223/azerothcore-wotlk#18 (comment)

@liyunfan1223
Copy link
Owner

I appreciate your effort, but I have to say that these changes involve so much that I can't start a code review. Aside from extensive testing, I can't guarantee they won't break existing functionality.

@atidot3
Copy link
Contributor Author

atidot3 commented Aug 2, 2024

No probs, allowing bot to handle quests was indeed going to change alot of thing as the mod/core was missing some implementation and i had to rework some feature as bot questing in group was making few crashes.

My dedicated is running this PR for while now and i havent seen ( so far ) any changes in functionnality, been doing BGs and Dungeon / Raid, bot still uses their items move to location randomly kill enemy for grinding etc.

The only issue so far i have made is now all bots have full quest log im trying to make a patch to allow them to drop quests that they dont have any interest in anymore

@liyunfan1223
Copy link
Owner

I'm happy to see new features being added, but as a maintainer it's more important that I make sure existing features don't break or cause additional crashes before I introduce new features. Testing is certainly one method, but testing is not comprehensive, because different people run the server in different ways, and one person's testing cannot cover all situations.

We need to "prove" together that it will not introduce new issues. If the scope of the modified code is small and the function is clear, it will be easier to implement, but vice versa is very difficult.

@atidot3
Copy link
Contributor Author

atidot3 commented Aug 2, 2024

Yea yea ofc sorry i didnt meant to say like i tested it its working pardon my english !

@noisiver
Copy link
Collaborator

noisiver commented Aug 2, 2024

Changes not related to quests should've been their own PR. This is why you don't commit to and PR from the master branch. Separate branches for these changes would've been easier.

@atidot3
Copy link
Contributor Author

atidot3 commented Aug 2, 2024

image
image
image

Bot will always try to keep a certain amount of quests in their log grey / green / red but if they have more than 15 quests they will start to cleanup quests based on priority.

This action will not be performed automatically if the bot has a master.

This should conclude this PR with lots of crash related to group and chatting with bots performing quests action in party.

@zhangbo8418
Copy link

image image image

Bot will always try to keep a certain amount of quests in their log grey / green / red but if they have more than 15 quests they will start to cleanup quests based on priority.

This action will not be performed automatically if the bot has a master.

This should conclude this PR with lots of crash related to group and chatting with bots performing quests action in party.

A bunch of warnings

In file included from /azerothcore/modules/mod-playerbots/src/PlayerbotAI.h:8,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/WarriorTriggers.h:9,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/TankWarriorStrategy.h:9,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/WarriorAiObjectContext.cpp:9:
/azerothcore/src/server/game/Chat/Chat.h:66:88: warning: argument 1 null where non-null expected [-Wnonnull]
66 | ObjectGuid const& senderGuid = ObjectGuid(), std::string_view senderName = nullptr,
| ^~~~~~~
In file included from /usr/include/c++/11/bits/basic_string.h:48,
from /usr/include/c++/11/string:55,
from /azerothcore/src/common/Common.h:22,
from /azerothcore/modules/mod-playerbots/src/strategy/AiObjectContext.h:8,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/WarriorAiObjectContext.h:8,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/WarriorAiObjectContext.cpp:5:
/usr/include/c++/11/string_view:131:7: note: in a call to function ‘constexpr std::basic_string_view<_CharT, _Traits>::basic_string_view(const _CharT*) [with _CharT = char; _Traits = std::char_traits]’ declared ‘nonnull’
131 | basic_string_view(const _CharT* __str) noexcept
| ^~~~~~~~~~~~~~~~~
In file included from /azerothcore/modules/mod-playerbots/src/PlayerbotAI.h:8,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/WarriorTriggers.h:9,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/TankWarriorStrategy.h:9,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/WarriorAiObjectContext.cpp:9:
/azerothcore/src/server/game/Chat/Chat.h:67:88: warning: argument 1 null where non-null expected [-Wnonnull]
67 | ObjectGuid const& targetGuid = ObjectGuid(), std::string_view targetName = nullptr,
| ^~~~~~~
In file included from /usr/include/c++/11/bits/basic_string.h:48,
from /usr/include/c++/11/string:55,
from /azerothcore/src/common/Common.h:22,
from /azerothcore/modules/mod-playerbots/src/strategy/AiObjectContext.h:8,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/WarriorAiObjectContext.h:8,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/WarriorAiObjectContext.cpp:5:
/usr/include/c++/11/string_view:131:7: note: in a call to function ‘constexpr std::basic_string_view<_CharT, _Traits>::basic_string_view(const _CharT*) [with _CharT = char; _Traits = std::char_traits]’ declared ‘nonnull’
131 | basic_string_view(const _CharT* __str) noexcept
| ^~~~~~~~~~~~~~~~~
In file included from /azerothcore/modules/mod-playerbots/src/PlayerbotAI.h:8,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/WarriorTriggers.h:9,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/TankWarriorStrategy.h:9,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/WarriorAiObjectContext.cpp:9:
/azerothcore/src/server/game/Chat/Chat.h:68:44: warning: argument 1 null where non-null expected [-Wnonnull]
68 | std::string_view channelName = nullptr, uint32 achievementId = 0);
| ^~~~~~~
In file included from /usr/include/c++/11/bits/basic_string.h:48,
from /usr/include/c++/11/string:55,
from /azerothcore/src/common/Common.h:22,
from /azerothcore/modules/mod-playerbots/src/strategy/AiObjectContext.h:8,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/WarriorAiObjectContext.h:8,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/WarriorAiObjectContext.cpp:5:
/usr/include/c++/11/string_view:131:7: note: in a call to function ‘constexpr std::basic_string_view<_CharT, _Traits>::basic_string_view(const _CharT*) [with _CharT = char; _Traits = std::char_traits]’ declared ‘nonnull’
131 | basic_string_view(const _CharT* __str) noexcept
| ^~~~~~~~~~~~~~~~~
In file included from /azerothcore/modules/mod-playerbots/src/PlayerbotAI.h:8,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/WarriorTriggers.h:9,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/WarriorTriggers.cpp:5:
/azerothcore/src/server/game/Chat/Chat.h:66:88: warning: argument 1 null where non-null expected [-Wnonnull]
66 | ObjectGuid const& senderGuid = ObjectGuid(), std::string_view senderName = nullptr,
| ^~~~~~~
In file included from /usr/include/c++/11/bits/basic_string.h:48,
from /usr/include/c++/11/string:55,
from /azerothcore/src/common/Common.h:22,
from /azerothcore/modules/mod-playerbots/src/PlayerbotAIConfig.h:8,
from /azerothcore/modules/mod-playerbots/src/strategy/triggers/RangeTriggers.h:8,
from /azerothcore/modules/mod-playerbots/src/strategy/triggers/GenericTriggers.h:10,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/WarriorTriggers.h:8,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/WarriorTriggers.cpp:5:
/usr/include/c++/11/string_view:131:7: note: in a call to function ‘constexpr std::basic_string_view<_CharT, _Traits>::basic_string_view(const _CharT*) [with _CharT = char; _Traits = std::char_traits]’ declared ‘nonnull’
131 | basic_string_view(const _CharT* __str) noexcept
| ^~~~~~~~~~~~~~~~~
In file included from /azerothcore/modules/mod-playerbots/src/PlayerbotAI.h:8,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/WarriorTriggers.h:9,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/WarriorTriggers.cpp:5:
/azerothcore/src/server/game/Chat/Chat.h:67:88: warning: argument 1 null where non-null expected [-Wnonnull]
67 | ObjectGuid const& targetGuid = ObjectGuid(), std::string_view targetName = nullptr,
| ^~~~~~~
In file included from /usr/include/c++/11/bits/basic_string.h:48,
from /usr/include/c++/11/string:55,
from /azerothcore/src/common/Common.h:22,
from /azerothcore/modules/mod-playerbots/src/PlayerbotAIConfig.h:8,
from /azerothcore/modules/mod-playerbots/src/strategy/triggers/RangeTriggers.h:8,
from /azerothcore/modules/mod-playerbots/src/strategy/triggers/GenericTriggers.h:10,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/WarriorTriggers.h:8,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/WarriorTriggers.cpp:5:
/usr/include/c++/11/string_view:131:7: note: in a call to function ‘constexpr std::basic_string_view<_CharT, _Traits>::basic_string_view(const _CharT*) [with _CharT = char; _Traits = std::char_traits]’ declared ‘nonnull’
131 | basic_string_view(const _CharT* __str) noexcept
| ^~~~~~~~~~~~~~~~~
In file included from /azerothcore/modules/mod-playerbots/src/PlayerbotAI.h:8,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/WarriorTriggers.h:9,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/WarriorTriggers.cpp:5:
/azerothcore/src/server/game/Chat/Chat.h:68:44: warning: argument 1 null where non-null expected [-Wnonnull]
68 | std::string_view channelName = nullptr, uint32 achievementId = 0);
| ^~~~~~~
In file included from /usr/include/c++/11/bits/basic_string.h:48,
from /usr/include/c++/11/string:55,
from /azerothcore/src/common/Common.h:22,
from /azerothcore/modules/mod-playerbots/src/PlayerbotAIConfig.h:8,
from /azerothcore/modules/mod-playerbots/src/strategy/triggers/RangeTriggers.h:8,
from /azerothcore/modules/mod-playerbots/src/strategy/triggers/GenericTriggers.h:10,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/WarriorTriggers.h:8,
from /azerothcore/modules/mod-playerbots/src/strategy/warrior/WarriorTriggers.cpp:5:
/usr/include/c++/11/string_view:131:7: note: in a call to function ‘constexpr std::basic_string_view<_CharT, _Traits>::basic_string_view(const _CharT*) [with _CharT = char; _Traits = std::char_traits]’ declared ‘nonnull’
131 | basic_string_view(const _CharT* __str) noexcept
| ^~~~~~~~~~~~~~~~~
In file included from /azerothcore/modules/mod-pvpscript/src/PvPScript.cpp:10:
/azerothcore/src/server/game/Chat/Chat.h:66:88: warning: argument 1 null where non-null expected [-Wnonnull]
66 | ObjectGuid const& senderGuid = ObjectGuid(), std::string_view senderName = nullptr,
| ^~~~~~~

@atidot3
Copy link
Contributor Author

atidot3 commented Aug 3, 2024

Edit: chat.h is in core sources i need to update it yes

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

Successfully merging this pull request may close these issues.

5 participants