ZhengPeiRu21 / mod-playerbots

AzerothCore Playerbots Module
MIT License
194 stars 93 forks source link

Random bots don't leave starting areas #124

Closed drozco closed 11 months ago

drozco commented 1 year ago

Regardless of enabling random levels for random bots, they never seem to leave the starting areas. They painfully grind up to about level 10 and then (I presume) they can't level any further and just stay in that newbie zone. If you teleport them out, they will run or teleport back to that area. If you allow random levels, then you have up to level 80s in the starting areas just milling around doing nothing. I've wiped the bot characters several times now and can't find a solution that will allow them to grind in a level-appropriate zone. Does anyone have this working?

virgo77 commented 1 year ago

I can see the same, on some zones. For example: Druids on Teldrassil. Lots of them are following the creatures, but never attack them. So, it's for 24h now that they still are level 1 ^^ The DKs too. Still 55, and for all of them (about 10 bots) But some others are questing and leveling. And are outside the start area. So I decided to not touch any of the "others". Maybe they will "learn" how to quest and fight! :D

Lastly, I was just for 2 minutes near one bot, and he started to spam all the emotes he could find, like '... tells you to attack something', or '... orders you to open fire.' etc. But we were not in party and I was not doing something with him. Very strange ^^

htc16 commented 1 year ago

The same thing is happening to me too, I'm trying to see if it's something in the settings or even see how to improve the RPG in the bots RPG table.

drozco commented 1 year ago

For the DK's I have no idea how they expect to leave the DK starting area. Unlikely they will figure out how to complete the quest line. At least a lot of them have made it to level 56, probably just killing things. I have one bot out of almost 300 that's made it to level 12. Gonna have to go spy on him to see what he's doing. The rest are all level 10 and below. I should say that I increased their XP to 4x to help them out a bit, so maybe that's why they are higher level.

There's a lot of code commented out where the quest table is supposed to be loaded in TravelMgr::LoadQuestTravelTable(). I suspect there should be data in there on how to complete quests and for traveling to the next area.

ManGuyNY commented 1 year ago

Made a fresh compile last night. Bots are all still in the starting zone even after leaving the server on overnight.

The random levels setting doesn't seem to change anything. Leaving it at the default (bots start at lvl 5) still has them all start at level 1 and be stuck in starter zone purgatory. Trying to enable random levels and setting the range high also does nothing for me.

As for DKs, I am curious if the "Skip DK starting zone" module would be compatible with the bots. Assuming I can get them to leave the starter area anyway.

drozco commented 1 year ago

Using the DK starter area skip sounds like an interesting idea. The DK skip code requires the event OnFirstLogin to fire for the skip to trigger, but I'm not sure if the bots do that.

Yeah the randomize level setting works on my end, but the bots about half end up naked, although some of them are fully kitted out with epic gear, so not sure what's going on with that, either. However it seems they start life as a level 1 bot, then at some random point in time later, they are leveled up. The RandombotStartingLevel setting is ignored. They all start at level 1.

I've seen a few bots not wander out of the starting areas now, but not many, and most of them have stopped doing anything. Settings changed: AiPlayerbot.RandomBotRpgChance = 0.80 AiPlayerbot.RpgDistance = 4000

virgo77 commented 1 year ago

So, you mean that if we change these 2 values and restart the server, it will be a little better for them? Only DKs or others too?

drozco commented 1 year ago

It's inconclusive. I let it run 400 bots overnight after a wipe and a few have made it out of the starting areas like in the Barrens but most are still hanging out in noob areas. I turned on random levels just to see what would happen. They seem to be queueing for battlegrounds but not for LFG. When they go in the BG they just stand there. Opposite faction will attack you but they don't leave their base. Needs more testing.

htc16 commented 1 year ago
  • AiPlayerbot.RandomBotRpgChance = 0,80
  • AiPlayerbot.RpgDistance = 4000

try to put it like this AiPlayerbot.RandomBotRpgChance = 100.0

drozco commented 1 year ago

Ill try that. I had assumed that 0.20 meant 20% but it's actually looking at 0.0-100.0 random value. Thanks!

htc16 commented 1 year ago

Ill try that. I had assumed that 0.20 meant 20% but it's actually looking at 0.0-100.0 random value. Thanks!

Did you make any progress?

drozco commented 1 year ago

Couple things I've found and testing, but so far I'm letting the server run to see what happens with this batch of bots.

  1. Method RandomTeleportForRpg references vector rpgLocsCache but that's never populated so the teleport does nothing. I temporarily changed the code to call RandomTeleportForLevel instead.
  2. The giant SQL query in PrepareTeleportCache only generates entries in playerbots_tele_cache from map 0, instead of 0, 1, 530, 571 like it should. If I change the config RandomBotMaps to "530,1,0,571" it works correctly. But I think this is a moot point since that table doesn't seem to be used by anything. It's used by the RandomTeleportForLevel function.
  3. In PlayerbotAIConfig.cpp around line 314 the check for autoDoQuests seems backward. It's loading the data for quests etc if the value is set to 0? I would think it should be loading quest data if the bots were set to do quests.
  4. I made a lua script that can 'skip' the DK starting area so at least I can have the DKs leave that zone and do something else.
  5. The playerbots log doesn't seem to work unless the Appender at least is added to the worldserver.conf file. The way it is by default, it doesn't create the playerbots.log file at all.

Some other weird stuff is happening now. I followed a level 7 bot that was teleporting in 40 or 50 yard steps all the way from Valley of Trials, across Durotar, all the way to the zeppelin, then teleported to Undercity Zeppelin tower and then died somehow. Maybe falling off the tower? Then they appeared at a graveyard in Alterac mountains and getting killed over and over. There were about 7-8 bots in the graveyard. Not sure why they are respawning there but it is close to the zeppelin.

Also, the bots just sometimes stop. I have a feeling they can see my hidden GM character and if I'm in the area they get confused or something and stop what they were doing. I can tell they were busy since there's sometimes a trail of bodies around.

ManGuyNY commented 1 year ago

Would you mind sharing that DK skip script? I can confirm the module version does not seem work on the bots 😅.

On my end, I did get the random levels working. I set the range to 70-80, and they all just stand around in starter zones at those levels. Most were naked. I haven't tried your config changes yet.

The bots queued up for Warsong Gulch all on their own. I teleported over, and all of the bots were naked and stuck at the beginning. The doors were visually open, and the time was ticking down, but there were invisible walls in place where the gates were.

drozco commented 1 year ago

Sure let me see if I can post it somewhere. I have a theory about them being naked. Last night I wiped the playerbots database and it re-generated all the cache tables inside. The playerbots_equip_cache table has about 6.7 million records and took about an hour to populate. It only had about 1 million records previously. I think the server was crashing before and the table wasn't re-generated. Check if you have about 6.7 mil records in there and if not, wipe the table and have it re-generate.

drozco commented 1 year ago

This is the eluna script to skip DK areas: https://gist.github.com/drozco/562f2f6f5e806f71ef03c9f274ffecb7

ManGuyNY commented 1 year ago

Sure let me see if I can post it somewhere. I have a theory about them being naked. Last night I wiped the playerbots database and it re-generated all the cache tables inside. The playerbots_equip_cache table has about 6.7 million records and took about an hour to populate. It only had about 1 million records previously. I think the server was crashing before and the table wasn't re-generated. Check if you have about 6.7 mil records in there and if not, wipe the table and have it re-generate.

Thanks for the script! I'm gonna have to try letting it regenerate that database when I get a chance. I was having several crashing issues when I first set the server up, so it is definitely possible it did not fully generate that table.

I've been religiously checking this repository for any updates 😅. I wish I had the coding knowledge to help out more.

EDIT: My playerbots_equip_cache table only had ~800k rows. Regenerating it now.

drozco commented 1 year ago

The bots queued up for Warsong Gulch all on their own. I teleported over, and all of the bots were naked and stuck at the beginning. The doors were visually open, and the time was ticking down, but there were invisible walls in place where the gates were.

The invisible walls are there if you're on a GM character. You have to go .gm off and then you can run through them.

ManGuyNY commented 1 year ago

Ah, ok. That makes sense. At 1.3 million rows now btw. I'll just leave the server on and login later to look for nudist bots.

Any more progress on your end?

EDIT: No more nudist bots! They are still chilling in the starter zone.

virgo77 commented 1 year ago

Wow Oo, too much lines in this table? I just took a look on mine and it's around 183803 rows. No changes. Stable.

Dreathean commented 11 months ago

@drozco I think the primary issue on here has been resolved if you can please close this out.