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

The initial bot login process can be slow, tedious and buggy #902

Open
nl-saw opened this issue Jan 24, 2025 · 6 comments
Open

The initial bot login process can be slow, tedious and buggy #902

nl-saw opened this issue Jan 24, 2025 · 6 comments

Comments

@nl-saw
Copy link
Collaborator

nl-saw commented Jan 24, 2025

Bug Description
When starting the server for the very first time, the initial bot login process can be slow, tedious and buggy, whereas a rnd bot init command is extremely fast in comparison.

Seems something chokes, during this, player login is also hard to achieve (long hang on Connected + long time before you enter the world after character selection).

There are also repeated errors that there are no captains available.

Desired behavior
The initial bot login process right after having them created to be quick and bug free.

How to replicate?
Ensure you have >1 map and sql threads:

Worldserver.conf:
LoginDatabase.WorkerThreads = 4
WorldDatabase.WorkerThreads = 2
CharacterDatabase.WorkerThreads = 4
ThreadPool = 4
MapUpdate.Threads = 8

Playerbots.conf:
PlayerbotsDatabase.WorkerThreads = 2
PlayerbotsDatabase.SynchThreads = 2

@nl-saw
Copy link
Collaborator Author

nl-saw commented Jan 24, 2025

Solved the slow login with the oversight in pb config which should be instead:

Playerbots.conf:
PlayerbotsDatabase.WorkerThreads = 4
PlayerbotsDatabase.SynchThreads = 1

so that resolves that part, yet the server still needs a reboot when starting with 3k bots from the get-go, and if there are no accounts present at all at first run it required 2 reboots.

@hermensbas
Copy link
Collaborator

hermensbas commented Jan 25, 2025

Basically its eating resources during the init process, the init ingame skips certain events. The amount of bots per batch being logged in biggest factor causing the you as player to have connection issues in relation to the amount of bots and so on (e.g. AI iterations). Basically eating all resources nonstop, there should be delay prolly between the batches, or partially mitigated by using more threads. The freezing of bots during init partially mitigates that as well, but has been alterted when the freezing is applied and its kinda not a real solution but it helps in general when booting a server.

https://github.com/liyunfan1223/mod-playerbots/blob/master/conf/playerbots.conf.dist#L870C1-L870C34

Or change the logon mechanism entirely, since after the bot is logged on it starts initializing gear and teleporting right away, that whole process is parallel and continues doing while meanwhile adding more and more bots. There a few mitigation mechanism's be adding delays and whatnot, but that simply does not work when having a large some of bots.

What basically happens now (which means faster hardware can work against you due faster and overlapping init bot phase)

  1. Logon
  2. SetLevel
  3. init gear
  4. first teleport for level

The last 3 are the main problem because the delay between batches isnt enough nor configurable atm for those inits. So we either try solve the thread priotity issue, not sure we can. Or we seperate the init process of logon and init steps. Or more delay between batches, or both :)

@nl-saw
Copy link
Collaborator Author

nl-saw commented Jan 26, 2025

Thanks for your insights @hermensbas, there sure are a lot of factors indeed. Raised this so we can start tackling the culprits over time and make it a better (1st time) experience. Another thing I forgot to mention is that after everyone has logged in for the first time they are all clogged together until you issue a playerb rnd init to force them being scattered across the map.

@hermensbas
Copy link
Collaborator

hermensbas commented Jan 26, 2025

Hmmz i dont see that clogged behaviour, thats strange. The teleportForLevel shouldnt effected by when the init happens. Thats interesting

@nl-saw
Copy link
Collaborator Author

nl-saw commented Jan 26, 2025

I think it has to do with some server restarts before one gets to 4k, without it completely choking (in my case) and not able to login (which I had a look at and it seems ok-ish with AiPlayerbot.RandomBotsPerInterval = 8-10, tops). Then also 50% of the bots are level 1 in the end :D. So in essence if the server gets restarted during initial create/init a bot for the first time, there are some quirks. I have to do a playerbot rnd init to restore that afterwards, else they stay level 1 until they grind their way op.

Level ones

Image

After rnd init

Image

I'll try and create a bit better organized list of issues soon, so all is a bit more clear. Certain config settings lead to different behavior on some of these aspects.

@nl-saw
Copy link
Collaborator Author

nl-saw commented Jan 26, 2025

Found out that PreQuestst enabled is the biggest culprit. Disabling that makes it magnitudes better.
Edit: Together with AiPlayerbot.RandomBotsPerInterval = 20 instead of 60

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

No branches or pull requests

2 participants