Raised This Month: $12 Target: $400
 3% 

Automatic Bot Names


Post New Thread Reply   
 
Thread Tools Display Modes
Author
agrif
Junior Member
Join Date: Jan 2010
Plugin ID:
1400
Plugin Version:
1.0
Plugin Category:
Fun Stuff
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    226 
    Plugin Description:
    Gives automatic names to bots on creation.
    Old 01-13-2010 , 17:06   Automatic Bot Names
    Reply With Quote #1

    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.
    Attached Files
    File Type: sp Get Plugin or Get Source (botnames.sp - 15510 views - 7.7 KB)
    File Type: txt botnames.txt (613 Bytes, 11689 views)
    File Type: txt botnames.scifi.txt (1.7 KB, 7304 views)

    Last edited by agrif; 01-24-2014 at 11:19. Reason: added link to version 1.2.1
    agrif is offline
    shustas
    SourceMod Donor
    Join Date: May 2007
    Location: London
    Old 01-14-2010 , 05:06   Re: Automatic Bot Names
    Reply With Quote #2

    Well done son. I always thought there is a game txt file with all the bot names in game dir...
    __________________
    shustas is offline
    Keksmampfer
    Junior Member
    Join Date: Apr 2009
    Old 01-14-2010 , 08:38   Re: Automatic Bot Names
    Reply With Quote #3

    i think it is the botprofile.db in the mod directory
    __________________
    My Plugins: Death Sound
    Keksmampfer is offline
    exvel
    SourceMod Donor
    Join Date: Jun 2006
    Location: Russia
    Old 01-14-2010 , 10:13   Re: Automatic Bot Names
    Reply With Quote #4

    Quote:
    Originally Posted by shustas View Post
    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.
    __________________
    For admins: My plugins

    For developers: Colors library
    exvel is offline
    Send a message via ICQ to exvel
    psychonic

    BAFFLED
    Join Date: May 2008
    Old 01-14-2010 , 11:10   Re: Automatic Bot Names
    Reply With Quote #5

    Quote:
    Originally Posted by exvel View Post
    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.
    psychonic is offline
    agrif
    Junior Member
    Join Date: Jan 2010
    Old 01-14-2010 , 13:50   Re: Automatic Bot Names
    Reply With Quote #6

    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.
    agrif is offline
    triggerman
    Senior Member
    Join Date: Jun 2009
    Old 01-14-2010 , 16:59   Re: Automatic Bot Names
    Reply With Quote #7

    im going to assume that this wont rename bots in l4d.
    __________________
    triggerman is offline
    agrif
    Junior Member
    Join Date: Jan 2010
    Old 01-14-2010 , 17:20   Re: Automatic Bot Names
    Reply With Quote #8

    Quote:
    Originally Posted by triggerman View Post
    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.
    agrif is offline
    triggerman
    Senior Member
    Join Date: Jun 2009
    Old 01-14-2010 , 19:35   Re: Automatic Bot Names
    Reply With Quote #9

    tried. it crashes
    __________________
    triggerman is offline
    agrif
    Junior Member
    Join Date: Jan 2010
    Old 01-14-2010 , 19:45   Re: Automatic Bot Names
    Reply With Quote #10

    Quote:
    Originally Posted by triggerman View Post
    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.
    agrif is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 07:34.


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