AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Automatic Bot Names (https://forums.alliedmods.net/showthread.php?t=115486)

agrif 01-13-2010 17:06

Automatic Bot Names
 
3 Attachment(s)
This is a simple plugin to give names to bots when they are created. I wrote it and tested it under TF2, but it should work fine with other games.

(edit: this mod definitely doesn't work on Left 4 Dead (2) servers, for reasons that I have not yet discovered. Apparently, it also crashes INS servers, but I'm currently looking in to that.)

I wrote this plugin because the names for the new bots for TF2 KOTH are hardcoded into the game, and I don't think that's very cool. This plugin reads bot names from a file, and gives every new bot an appropriate name.

Update (version 1.1):
If you're having issues with the auto-fill bots recently added to TF2 not getting names, see this post for the (not anymore) latest version.


Update (version 1.2):
I just added support for loading bot names from a database table rather than from a text file. If that's your thing, see this post for the (not anymore) latest version.


Update (version 1.2.1):
This small change to version 1.2 adds a few bug fixes, and more advanced options for database name loading. See this post for the (not anymore) latest version.


(!!!) Update (version 1.3.0):
This update incorporates a 3 patches from contributors and consolidates them into one place. See this post for the latest version.

Most Recent Documentation
and most recent releases

Updating this post for each new version has become a hassle, so I'll just say that the most recent documentation and stable source can always be found here. I'll probably still announce new releases here, though.

About botnames.txt

botnames.txt should be at {sourcemod}/configs/botnames.txt (so, for me, it's in valve/orangebox/tf/addons/sourcemod/configs/botnames.txt). It's a simple text file, with one name per line, and some basic comments. Anything on a line after a '#' or '//' is ignored, and blank lines are also ignored. Excessive whitespace is also trimmed off the ends.

I've included a generic botnames.txt here, with names of Physicists, and an extra one with character names from science fiction novels, for a quick start and as examples. For best results, though, write your own! It's fun and easy!

botnames CVars

Here's a list of the relevant cvars, their defaults, and what they do:
  • sm_botnames_version : always set to the current version
  • sm_botnames_enabled (default 1) : set to 0 to disable everything
  • sm_botnames_prefix (default "") : set this to add something before each bot name. Remember to add a space at the end if you want a space between your prefix and the name! Requires reload.
  • sm_botnames_random (default 1) : when set to 1, randomly give out names. When 0, the names are given out in the same order as in the file. Requires reload.
  • sm_botnames_announce (default 1) : print a message to general chat (and the server) whenever a bot is added, when this is 1
  • sm_botnames_suppress (default 1) : when set to 1, suppress connect/team change/name change messages for bots. This reduces visual spam, and is best replaced by sm_botnames_announce = 1
Reloading of the file, and setting new values of sm_botnames_prefix and sm_botnames_random is done on map load. To do this manually, use the command sm_botnames_reload.

Other Notes

If anyone ends up using this plugin, I would love to see your bot name file. This could be fun!

Also, I'd like to know if this works fine with other games. I'll work to fix anything that comes up.

I would also like to thank contributors to this thread for their tutoring in the arcane art of blocking name change notifications.

shustas 01-14-2010 05:06

Re: Automatic Bot Names
 
Well done son. I always thought there is a game txt file with all the bot names in game dir...

Keksmampfer 01-14-2010 08:38

Re: Automatic Bot Names
 
i think it is the botprofile.db in the mod directory

exvel 01-14-2010 10:13

Re: Automatic Bot Names
 
Quote:

Originally Posted by shustas (Post 1054547)
Well done son. I always thought there is a game txt file with all the bot names in game dir...

But it can be rewritten after server update. :)

psychonic 01-14-2010 11:10

Re: Automatic Bot Names
 
Quote:

Originally Posted by exvel (Post 1054682)
But it can be rewritten after server update. :)

So can many other files, like mapcycle.txt. Any files that would get overwritten that you want to keep should be marked read-only or backed up before an update.

agrif 01-14-2010 13:50

Re: Automatic Bot Names
 
Quote:

Originally Posted by exvel
i think it is the botprofile.db in the mod directory

I couldn't find such a file in my server install, just now. I'm also sure that my server is up to date. Maybe TF2 doesn't do this?

Besides, the TF2 smartbots seem to ignore the normal bot commands for the most part, including bot_randomnames, so I doubt even if this file existed it would do what I want.

I ran a fulltext search on all the files in my server directory for the bot names, and only the server shared libraries came up. I suppose with some hackery you could change them there, in the binary, but you'd be limited by number to about the same number of names as is already there. My plugin is less hackish and easier to do.

Also, the bot_randomnames setting seems to be truly random. That is, it can assign the same name to two concurrent bots, which is not desirable. In contrast, my plugin isn't truly random. Instead, it shuffles the name order every map load, when it reloads the names. This way, as long as you have more names in the file than bots in the server, no two bots will have the same name.

(You can, in extreme cases, still get one name on two bots. For example, if you keep adding and removing bots, you'll eventually get back to the first bot name. This is not a normal use case though.)

I looked for ages to find such a list of bot names that I could change. You'd expect there to be one. But I don't think there is one for TF2.

triggerman 01-14-2010 16:59

Re: Automatic Bot Names
 
im going to assume that this wont rename bots in l4d.

agrif 01-14-2010 17:20

Re: Automatic Bot Names
 
Quote:

Originally Posted by triggerman (Post 1055074)
im going to assume that this wont rename bots in l4d.

That depends. It automatically renames all fake clients. TF2 bots fit this description. Now, the new TF2 bots are based on infected AI, so... it should work. I'm sort of concerned about some cosmetics, such as blocking the name change spam, but it should assign names, and will probably do everything else fine too.

Unfortunately, I can only personally test for TF2, but I encourage testing with other games! I'd love to hear the results.

triggerman 01-14-2010 19:35

Re: Automatic Bot Names
 
tried. it crashes

agrif 01-14-2010 19:45

Re: Automatic Bot Names
 
Quote:

Originally Posted by triggerman (Post 1055196)
tried. it crashes

oh wow, that was not at all what I was expecting...

I'll get a l4d server running here sometime soon, and I'll figure out what's causing the crashes.


All times are GMT -4. The time now is 14:35.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.