How to Host a Bot


  • Moderators Admin

    Anyone that can host a room in the lobby is able to host a bot. If we had more hosts that donated a few bots to triplea the overhead of triplea would be decreased greatly. (Less servers would be needed)

    This is an example of a bot script which can be edited using notepad but needs to be saved as a .bat file in your triplea installation directory in windows.
    You can name the .bat file what you wish and the bot number needs to be something other than the current triplea bot numbers. Slap me if any need some help. Or Slap @RoiEX Hopefully we will get some bot host volunteers 🙂

    The download link for the headless bot script is here which must be installed in your current triplea stable dl folder since it is no longer included in the dl. https://github.com/triplea-game/triplea/releases/download/1.9.0.0.13066/triplea-game-headless-1.9.0.0.13066.zip

    @ECHO OFF
    REM
    REM This is a sample batch file for running a TripleA bot on a Windows system.
    REM
    REM THIS SCRIPT MAY NOT RUN CORRECTLY UNLESS YOU CUSTOMIZE SOME OF THE
    REM VARIABLES BELOW!  Please read each variable description carefully and
    REM modify them, if appropriate.
    REM
    REM To run this script, change to the directory in which you unpacked the
    REM headless game server archive, and type "run_bot.bat".
    REM
    
    REM ###########################################################################
    REM VARIABLES THAT YOU MAY CUSTOMIZE BEGIN HERE
    REM ###########################################################################
    
    REM
    REM The folder from which the bot will load game maps.
    REM
    REM The default value is the folder in which the TripleA game client stores
    REM maps that it downloads.  Under normal circumstances, you will not have to
    REM change this variable.  However, if you customized the settings in your
    REM TripleA client to use a different maps folder, you should change this
    REM variable to refer to the same location.
    REM
    SET MAPS_FOLDER=%USERPROFILE%\triplea\downloadedMaps
    
    REM
    REM The port on which the bot will listen for connections.  This port must be
    REM reachable from the Internet, so you may have to configure your firewall
    REM appropriately.
    REM
    REM Under normal circumstances, you will not have to change this variable.
    REM However, if you choose to run multiple bots on your system, you need to
    REM select a different available port for each bot.
    REM
    SET BOT_PORT=3300
    
    REM
    REM The name of the bot as displayed in the lobby.  Each bot must have a unique
    REM name.
    REM
    REM The default value uses a combination of your username and the local port
    REM you selected above on which the bot will run.  Under normal circumstances,
    REM you will not have to change this variable.
    REM
    SET BOT_NAME=Bot_%USERNAME%_%BOT_PORT%
    
    REM
    REM The password used to secure access to games running on your bot.  Users
    REM attempting to start a new game or connect to an existing game on your bot
    REM will be prompted for this password.  If the password is an empty string,
    REM the user will not be prompted, and any lobby user will be able to use your
    REM bot.
    REM
    REM The default value is an empty password. You should change this to a
    REM non-empty string if you do not want arbitrary users to use your bot.  For
    REM example, you may wish to run a private game for you and some friends.  In
    REM that case, set the password to a non-empty string and communicate it to
    REM your friends in some manner (e.g. via email).
    REM
    SET BOT_PASSWORD=
    
    REM
    REM The hostname of the lobby to which the bot will connect.
    REM
    REM The default value is the hostname for the TripleA community's public lobby.
    REM Under normal circumstances, you will not have to change this variable.
    REM
    SET LOBBY_HOST=lobby.triplea-game.org
    
    REM
    REM The port on which the lobby to which the bot will connect listens for
    REM connections.
    REM
    REM The default value is the port for the TripleA community's public lobby.
    REM Under normal circumstances, you will not have to change this variable.
    REM
    SET LOBBY_PORT=3304
    
    REM
    REM The email address at which you can be contacted.  Lobby moderators will
    REM communicate with you using this email address if they notice problems with
    REM your bot, or if they need to perform remote maintenance on your bot (e.g.
    REM to shut down your bot).
    REM
    REM The default value is meaningless.  IT IS STRONGLY RECOMMENDED THAT YOU
    REM CHANGE THIS VARIABLE TO A VALID EMAIL ADDRESS THAT YOU CONTROL.
    REM
    SET LOBBY_SUPPORT_EMAIL=%USERNAME%@localhost.localdomain
    
    REM
    REM The password used to secure remote maintenance of your bot.  A lobby
    REM moderator who wishes to perform remote maintenance on your bot will be
    REM required to enter this password in order to complete any maintenance
    REM action.  If the password is an empty string, a lobby moderator will be able
    REM to perform remote maintenance on your bot without your permission.
    REM
    REM The default value is an empty password. You should change this to a
    REM non-empty string if you do not want lobby moderators to interfere with the
    REM operation of your bot.  Note that a lobby moderator that cannot perform
    REM remote maintenance of your bot may choose to boot your bot from the lobby.
    REM
    SET LOBBY_SUPPORT_PASSWORD=
    
    REM ###########################################################################
    REM VARIABLES THAT YOU MAY CUSTOMIZE END HERE
    REM
    REM DO NOT MODIFY ANYTHING BELOW THIS LINE!
    REM ###########################################################################
    
    java^
     -server^
     -Xmx256M^
     -Djava.awt.headless=true^
     -jar bin\triplea-game-headless-1.9.0.0.13066-all.jar^
     -Ptriplea.game=^
     -Ptriplea.lobby.game.comments=automated_host^
     -Ptriplea.lobby.game.hostedBy=%BOT_NAME%^
     -Ptriplea.lobby.game.supportEmail=%LOBBY_SUPPORT_EMAIL%^
     -Ptriplea.lobby.game.supportPassword=%LOBBY_SUPPORT_PASSWORD%^
     -Ptriplea.lobby.host=%LOBBY_HOST%^
     -Ptriplea.lobby.port=%LOBBY_PORT%^
     -Ptriplea.map.folder="%MAPS_FOLDER%"^
     -Ptriplea.name=%BOT_NAME%^
     -Ptriplea.port=%BOT_PORT%^
     -Ptriplea.server=true^
     -Ptriplea.server.password=%BOT_PASSWORD%
    

  • Moderators Admin

    Also the set port number is the port you have opened should be noted.



  • Still confused as to exactly how this works. So do I need to set this up just to have an AI at all in my game????


  • Moderators Admin

    @storm-gav No. If you can host you can use the AI live in the lobby. Otherwise you can use the AI offline vs yourself or others using PBEM. This is only if you wish to host a bot in lobby for others to use. Example (the lobby bots that triplea hosts for everyone).



  • @prastle I'm curious about this thread. I have posted on another thread that I can host a game on the lobby. Therefore if I can host, am I able to host a bot, and if so, does that mean I need to have my PC on all the time to host? I'm rather unfamilair with this concept.


  • Moderators Admin

    @scousemart Yes if you wanted to host a bot or bots pc would have to stay on.


  • Moderators Admin

    @scousemart Well done! Hopefully more in the lobby will learn to host bots and we can close a server or two. Great job!



  • Hosting bots is not as difficult as it sounds. If I can do it, then I’m sure most people here can too. If you can Host a game on the Lobby, then you are almost there. Just needs a few tweaks to your router, a .bat file, a bit of patience and possible some help from a friendly Mod!
    First you need to update your router settings and open more ports. You should already have port 3300 open. I opened 6 in all, 3300 to 3305 (one for your own Hosting and 5 for the Bots). There is a freeware program you can use: Simple Port Forwarding (see here http://www.simpleportforwarding.com/download ), which can help with the task. Follow the program instructions and open the required ports.
    Once you’ve opened the ports, you need to download the latest Beta(Pre-Release) version of TripleA. This is located here https://github.com/triplea-game/triplea/releases/ . This can be installed in a different folder from your stable TripleA. It's is recommended that you keep the stable version for testing purposes between the two versions of TripleA. I used the 1.9.0.0.10245 version. It is in this new folder that the .bat files must be inserted.
    Next is to create a .bat file. Using the attached .txt file as an example, edit the following asterisked sections:

    SET PORT= **** (the number of the port)
    SET BOT_NUMBER= *** (the number to identify the bot on the lobby, your choice)
    .name=Bot%BOT_NUMBER%_ ***** (letters and/or numbers to identify the bot on the lobby, your choice. Mine is DKMart1)
    .hostedBy= Bot%BOT_NUMBER%_***** (letters and/or numbers to identify the bot on the lobby, your choice. Mine is DKMart1)
    .supportEmail=************** (your email so Mods know where to find you… )

    Once you’ve finished editing, save the file with the .bat extension. You can call the file anything you wish (in my case DKMart1_bot_1.bat).

    Repeat for the number of bots you wish to create.

    Remember, SET PORT= must be different for each .bat file and correspond to the ports you have opened on your router!
    Place the .bat files in the 1.9.0.0.10245 TripleA folder. If all goes to plan, when you click on the .bat file a command prompt window will open and attempt to load the bot to the server lobby. Open TripleA as usual (not the 1.9.0.0.10245 version), go to the lobby and marvel at the wonder of your work.
    Any problems contact a Mod (@prastle). He’ll sort you out! LOL

    0_1526910156861_DKMart_bot_1a.txt


Log in to reply