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 names random collision 🤔 #5

Open
artkirienko opened this issue May 14, 2020 · 2 comments
Open

Bot names random collision 🤔 #5

artkirienko opened this issue May 14, 2020 · 2 comments

Comments

@artkirienko
Copy link
Contributor

Hi @jkivilin @Bots-United! Thanks for your great work! 🎉

I have a HLDS HLDM server set up for 8 bots. Sometimes two bots get the same random name.

Example

example

There are plenty of names

$ cat jk_botti_names.txt | wc -l
32

How I suppose it should work

I guess you just call something like BOT_NAMES.random() on every bot creation event, where BOT_NAMES represent all the bot names from jk_botti_names.txt as an array. If it's true, you could fix it by adding some singleton state, like BOT_NAMES_CURRENTLY_IN_USE, so you could pick a random name from (BOT_NAMES - BOT_NAMES_CURRENTLY_IN_USE).random().

Also, you need to take into account the size of jk_botti_names.txt and the number of bots requested: jk_botti_names.txt could have 2 names only, and the config could request 8 bots to be created when bot names should collide instead of creating just 2 bots.

These are my thoughts and ideas on this problem, I didn't read the source code.

Versions and configs

jk_botti version 1.43

  • HLDS Build 7882.

    Protocol version 47/48
    Exe version 1.1.2.2/Stdio (valve)
    Exe build: 17:23:32 May 24 2018 (7882)
    
  • Metamod-p version 1.21p38

  • AMX Mod X version 1.8.2

Available as a Docker Image here: https://github.com/artkirienko/hlds-docker-dproto

@artkirienko
Copy link
Contributor Author

https://github.com/Bots-United/jk_botti/blob/master/bot.cpp#L326

🤔 💭 Uniqueness check is implemented already. There is a bug there probably.

@josemam
Copy link
Contributor

josemam commented May 20, 2020

I never found out this until actually testing for #6, so this is certainly caused by #6. In particular, this is probably common among HPB-bot-based bots, and fixing #6 should fix this as 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

No branches or pull requests

2 participants