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-10] respawn configured bots / part 2 #426

Open
wants to merge 11 commits into
base: bot10
Choose a base branch
from

Conversation

d47081
Copy link

@d47081 d47081 commented Jan 14, 2024

Update for PR #422

Removes bot state reset on bot thinking, also the kicked state was changed from BOT_IDLE to BOT_NEED_TO_RESPAWN

I think this model more useful in bot container and looks not conflicting with it logic.
That allows to respawn configured bots only (from queue not from default BOT_IDLE slots registry)

Solution looks stable, but please let me test it for few days before merge.

@d47081
Copy link
Author

d47081 commented Jan 14, 2024

Well, in last commit have fixed players online counter and make code optimizations:

  1. fixed online counter as bots generated in wrong quantity after player disconnect / map rotation events
  2. removed duplicated construction with BotCreate - as calling twice
  3. renamed count variable to online as more clear, defined it also on init with integer data type
  4. fixed bot_check_time as found the loop never stops - it reduces the CPU load

After this commit I need additional time for tests, it looks better just doubts that everything stable.

@d47081
Copy link
Author

d47081 commented Jan 15, 2024

Last 2 commits includes:

  • bots quantity fix on map change (before it was more than configured in max_bots, this bug was depended of real players quantity in previous session)
  • added respawn event on map rotate (forgot to add in previous commits)
  • initial CBot::Spawn state now BOT_IS_RESPAWNING instead of BOT_IDLE / is_used is TRUE

testing..

@d47081
Copy link
Author

d47081 commented Jan 16, 2024

Everything works, but I found bots and players sometimes freeze / stuck - maybe after disconnection.
It happened on high online and/or session is closer to map rotate.

I think this problem related with slot.state changes, it's not frames or CPU issue as debug of timing works well.

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.

1 participant