Skip to content

Basic Usage Guide

thebigsleepjoe edited this page Feb 11, 2024 · 2 revisions

The Basics

Creating a P2P server

At the Garry's Mod main menu:

  1. Go to Start New Game
  2. Select TTT/2

image

  1. Pick any of the following options, depending on how many players you want to have

image

  1. Click Start Game

Adding Bots to the Server

There are a few ways to accomplish this:

  1. Use the console command, ttt_bot_add X, where X is the number of bots.
  2. Use the chat command, !botadd X, where X is the number of bots.
  3. Set a quota with the console command, ttt_bot_quota X, where X is the number of bots to have in the game.**
  4. Set a quota with the chat command, !botquota X, same as above.**

** Note: The quota behavior changes if the convar ttt_bot_quota_mode is set to exact or fill. If set to exact, then there will always be X bots in the game; if set to fill, the mod will add/remove bots as players leave/join respectively, until X slots are filled.

Helpful Commands

Chat commands always start with !bot, while console commands will always start with ttt_bot_

  • !botkickall - Kicks all bots from the game instantly and sets the quota to 0. Useful for if you have a friend complaining about the bots.
  • !botadd X - Does what you think it does. Adds X bots to the game instantly.
  • !botdescribe X - Prints out a list of bot X's traits. This can be helpful if you think one of them is acting weird or if you are curious as to one of their traits.
  • !botdifficulty X - If given a number 1-5, will set the difficulty, with 1 being easiest and 5 being hardest. If a quota is set, then bots will be kicked out (if they are dead or there isn't a round active) to bring in harder ones. You can skip including X and just do !botdifficulty to get the current difficulty.
  • !botquota X - Sets the quota of bots to have in the game to X. If 0, then the game will stop managing bots automatically.
  • !bothelp - Displays a comprehensive list of chat commands

Basic Configuration

This mod prides itself on being highly configurable and having many things the user can tweak. Among the many options, here are some that you may find particularly useful. Note that if it starts with "ttt_bot_", it's a console variable.

  • ttt_bot_difficulty X - The difficulty of the mod, as an integer, from 1-5. Note that setting the difficulty outside this range will cause errors.
  • ttt_bot_quota X - The target number of bots in the game. If set to 0, no bots will be added or removed.
  • ttt_bot_allow_leaving 0/1 - Whether or not a bot will stay in the game when it gets too bored or angry. A bot will rejoin after some seconds delay. It is only recommended to disable this if you don't want any bot downtime, but you also don't want to enable quota (quota removes the rejoin delay)
  • ttt_bot_rdm 0/1 - Whether or not bots will RDM. A bot will only RDM if it has an applicable trait or if it is bored/angry. They will prefer to target whoever killed them last round and will typically be satisfied after their first RDM.
  • ttt_bot_language X - A shortened language, such as "en" or "es", that the addon will use in text form (chat, notices, etc.). Please note that only English (en) is supported as of writing, but other language packs may come along from other people.
  • ttt_bot_name_prefixes 0/1*** - Whether or not bots will have their names prefixed with [BOT]. 1 = on, 0 = off.
  • ttt_bot_pfps_humanlike 0/1*** - Whether or not bots will be assigned humanlike (ai-generated) avatars or just use a generic bot picture.
  • ttt_bot_emulate_ping 0/1*** - Whether or not bots will simulate ping on the scoreboard.
  • ttt_bot_cheat_know_shooter 0/1 - Whether or not bots know who started a gunfight when they are witnessing one; greater suspicion is given to the one who started it.
  • ttt_bot_cheat_redhanded_time X - The time, in seconds, that bots will know a person killed someone else just by looking at them. This cheat feature exists to prevent stupid situations from happening where it'd be obvious to a human who killed who.
  • ttt_bot_cheat_traitor_reactionspd 0/1 - If enabled, traitor bots will face no delay to killing their targets, which gives them a competitive advantage.
  • ttt_bot_reaction_speed X - The minimum number of seconds, internally scaled by difficulty, it takes for a bot to start shooting someone who pissed them off. At difficulty 3 ("normal"), X is the exact delay the mod uses.
  • ttt_bot_chatter_lvl - An integer from 0-3. 0 = NO text chat, 1 = Critical only (e.g., KOS), 2 = Callouts only (KOS, gunshots, etc), 3 = everything.
  • ttt_bot_attack_delay X - The time, in seconds, a traitor must wait before randomly starting to shoot someone. Note that this does not affect traitor plans. (see advanced configuration for an explanation of that)
  • ttt_bot_names_allowcommunity 0/1 - Useful to disable if you want to show this mod to your grandma. Community names may be inappropriate or offensive.

***: If these three settings are configured to make bots blend in, a mandatory notice will be printed in chat every round, notifying the humans on the server that there are bots in the match. Trying to circumvent this feature may subject you to Garry's Mod TOS. These features exist for fun and to be used responsibly in a private server ONLY.

Navmesh Creation/Design

Navmeshes are an important component of the addon, but they can also be tedious to set up. Once a good navmesh is established on a map, you likely won't have to worry about it again. However, some maps are FAR more difficult than others. I recommend avoiding Minecraft-style maps, as the navmesh doesn't work well with the blocky, knee-high-slope-style terrain.

Common issues with bots:

  • Going up poorly placed ladders - Some maps have ladders that go all the way to the ceiling. I tried to prevent this from causing issues, but honestly, the bots will sometimes freak out when they come across this.
  • Going down ladders - to be fair, most humans also struggle with this in Source games.
  • Tight spaces - Especially with several bots, this is typically a no-go.
  • Jumping over gaps - This feature doesn't exist in this mod, because I honestly couldn't figure it out without creating too much lag. Maybe in the future.
  • Moving parts - Bots cannot stand on moving objects, like boats or helicopters.
  • Traitor rooms - Bots love to generate paths into traitor rooms, regardless of if they're traitors or not, so it's best to REMOVE ANY NAV AREAS IN THERE.
  • Stupidly large/complex maps - Tends to bring the A* pathfinding to a crawl. I've optimized it as much as I can, but your mileage may vary based on the power of your machine.

Starting from Nothing

I HIGHLY recommend viewing this guide so that you are familiar with the concepts discussed below.

  1. The best way to start is to start no clipping, turn on sv_cheats 1, then nav_edit 1.
  2. It can be highly beneficial to get into the habit of placing walkable seeds, although it is not always necessary. You can do this by typing nav_mark_walkable into the console while looking at a place where players usually walk. This action plants a wireframe purple pyramid on the ground where you were looking. You should place these "seeds" at the top/bottom of ladders, in any blocked-off rooms, and some vents. Over time, you will learn where to put these seeds. You do not need to put them everywhere, but it cannot harm to place them in strategic locations.

image

Note: you might be able to get away with just placing the one as seen in the top image, but I prefer the route of "better safe than sorry."

  1. IMPORTANT: enter nav_generate_fencetops 0 into the console. Fencetops tend to confuse the bots more so than they help.
  2. Run nav_generate and prepare to wait a while depending on a) your hardware, and b) the map size. Small-to-medium maps of low-to-moderate complexity are best for bots.
  3. I highly recommend running ttt_bot_nav_cullconnections. This will automatically prune any 2-way connections that try to make a bot jump up an unreasonably tall threshold. Below is a quick reference for what the connection lines mean. Cyan is 2-way, while navy blue is 1-way. For more info, see this Valve guide.

image

  1. Make sure you've found some keys to nav_delete, nav_mark, nav_connect, nav_begin_area, and nav_end_area bound to keys. You can do this with bind <key> "command", e.g. bind ; "nav_delete". It will save you an incredible amount of time if you do this.
  2. Find any obvious areas that shouldn't exist, such as ones in precarious positions or within a static (non-physics) prop. Then delete it. Also, delete areas separated from the map that can never (or will likely never) be accessed. This can save a lot of processing power spent trying to navigate an area that can't be reached.

Before:

image

After:

image

  1. Start marking ladders! Look at a ladder so that the cursor turns green and then type nav_build_ladder. For further help, see this section of the Valve guide.

Before:

image

After:

image

  1. Make sure that every area has a navmesh inside it. Some rooms will not get navmeshes, and when that happens, you must either run nav_generate_incremental (generates a small area without restarting the level) or paint it by hand with the suite of commands I mentioned earlier.
  2. Run ttt_bot_nav_markdangerousnavs so that the script will automatically designate any area within a deadly zone (like within lava on Minecraft maps) as an AVOID area. This can prevent bots from just running headfirst into lava or instakill water.
  3. Using nav_mark_attribute CROUCH on any areas where the bots need to crouch is not something to overlook. The bots highly depend on this CNavArea attribute to determine when to crouch.
  4. Run nav_save (to be safe), nav_analyze to update vis/spots/etc, then nav_save to save again. Test out some bots and try to understand how the map plays. If there are any troublesome areas, use nav_mark and then nav_disconnect to remove any troublesome connections. Always remember to nav_save!!!!!

Being capable of editing the navmesh can be the difference between a terrible experience and an engaging one. The earlier linked Valve guide should be of use to you.