Open artkirienko opened 4 years ago
https://github.com/Bots-United/jk_botti/blob/master/bot.cpp#L326
🤔 💠Uniqueness check is implemented already. There is a bug there probably.
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.
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
There are plenty of names
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 fromjk_botti_names.txt
as an array. If it's true, you could fix it by adding some singleton state, likeBOT_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
.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