J.A.C.K.

J.A.C.K.

Not enough ratings
Bot Routing with Quake 3
By Clavius
This guide will help you patch in the missing bot routing entities as well as add in a step on the compile process to produce the necessary AAS (bot route) file.
   
Award
Favorite
Favorited
Unfavorite
Introduction
In this tutorial you’ll learn how to setup J.A.C.K. to export a map that is compatible with bots. You’ll also learn the basics of setting up proper bot routing.
F.A.Q.
Why isn’t J.A.C.K. setup for bot routing by default?
There's no actual reason given, but I have a feeling there might be a legal matter since they sell this level editor on Steam, but BSPC is a separate third party tool made by someone else for free. So including BSPC would mean they're technically profiting off someone else's work, so explains the omission. But in any case, hey, at least it gave me an excuse to make this guide.
Why would I want to enable bot routing?
For a variety of reasons, mainly these two:
  1. You’re not gonna be able to easily play your map with several people every time you want to test it or just play it for fun.
  2. By having bots, you’ll be able to test balance. Is the BFG10k too easy to get? Is this map too small for more than 4 players? You’ll never know unless you put bots on the map.
Could you go more into depth about bot routing setup?
I intend to make an effective part two of this guide which will highlight some additional bot routing techniques.
Part of this guide needs some clarification
Please specify the issue in the comments, I want to improve this guide where it might be weak. Help me help you.
Compiling with the method you suggested didn't produce a level
I realized that I accidentally omitted some crucial pieces in the level compile process. Gimme a bit to resolve this. For now, you can just run a regular compile, then run a bot route compile in the meantime.
Can you setup my botroams for me?
No
Necessary files and directories
Files
Quake 3 additional definitions:
http://likoclave.com/files/quake3addons.fgd

BSPC (tool):
http://likoclave.com/files/bspc.zip

Definitions Installation
1. For the definition file, you could effectively put it anywhere, but for convenience sake, put it in your J.A.C.K. directory in Steam (if installed on C:\ it would be C:\program files\Steam\steamapps\common\JACK\quake3).
2. Open J.A.C.K., Tools > Options > Game Profiles.
3. Click add then navigate to where you put the FGD file and select it.
4. Apply and click OK. info_camp and item_botroam should now appear under your entities menu.

BSPC Installation
Open the zip and drag the exe inside of the maps folder inside of baseq3 (If you have the steam version of Quake 3 on your C:\ drive, it will be C:\Program Files\Steam\steamapps\common\Quake 3 Arena\baseq3\maps). Do not run BSPC.exe on its own, it is a command line application that must be ran through either command line or a batch file. How it works is that it extracts 3D volume data, omits all entities, textures, etc. (except for those relevant to bot navigation) and turns it into a bot navigation file. Or in the case of this tutorial, through J.A.C.K. itself.

BSPC Integration

Now we need to integrate BSPC as part of the compilation process. This will put it at the end of the compiling order once the map itself is done being compiled. The bot navigation file is a seperate file ending with the .aas extension.

Traditionally BSPC is ran through command prompt. This process does get monotonous when you're making minor adjustments to bot routing and have to constantly recompile the map then run BSPC. By integrating it into "Run Map" you don't even have to think about it too much; just run it, then wait for Quake 3 to launch. Just remember to only compile for bots once it's ready for bots. Using the dialog for reference, follow these steps for setup:
  1. Open the Run map dialog
  2. Change to Expert Mode
  3. Select "Edit" from the Game configuration dropdown
  4. Select "Default"
  5. Copy that configuration and rename it to something so it's obvious what it is (such as "Default + bots") it's the same thing but now with bot routing
  6. Create a new step on the end with "$bspdir/bspc.exe" as the command, "-bsp2aas "$bspdir/$file.bsp"" for the parameters, check off both "Wait for termination" and "Use Process Window"
  7. Bump this step up above "Change Directory" (this new step should be the third to last step now; after doing this it should autosave so you can use this configuration here on out.)
  8. Clicking OK will now run the process.
*Sidenote: I don't know why but appending the BSPC step to any of the Quake III configurations didn't work, but appending it to the Default one does. It's dumb, but it works, so it's not dumb.
Entities Added
The new FSD file you downloaded is a file that I authored, based off of entities from the original GTK Radiant definitions file that were missing from J.A.C.K.’s definitions file. Two of these (info_camp and item_botroam) are tantamount for setting up your bot pathing file (AAS).
Info_camp
This tells the bot that this is a good place to stand in place and shoot at players, without them, bots will continually run around the map until they encounter someone. It effectively tells them to stop for a moment and look for a target and shoot from that spot. You can designate a weight; the higher the number, the more likely they’ll gravitate towards it. As well as range; which designates a set radius of in-game units that would qualify as the camping area.
Item_botroam
This acts like an invisible item or cookie (hence being given an item_ designation) for bots to “collect.” This should connect between key items (such as weapons and armor) to tell bots where they should go. You can designate weight which will be factored in when a bot is trying to figure out which path to follow. Allegedly you can make a map without botroams and bots will just bounce between items, but in all cases, I’ve just seen bots stand around if I don’t use botroams.
Func_timer
This was omitted for an unknown reason. So I readded it to the definitions file. This could potentially be used for a number of events that could add dynamicism to a map.
The Basics: Building a map for bots
Awesome, now that you have everything installed and setup, you're ready to build your map for bots.

item_botroam
As previously mentioned, botroams will tell bots where to go. They will show up as 16x16x16 orange nodes. Their weight will range between 0 and 400. The definitions file has them defaulted to 200 as I figure that would be a good middle ground. Set the number lower (to say 100) if you're going to pack them tighter. Raise the number if a bot is not cooperating and not going to an area where you want them to go. Generally when you place botroams, you'll want to continually recompile your map and rebuild the AAS file (anytime you make changes to the botroams), spectate a bot as they navigate your map to debug. You'll likely need to adjust weights and distances of your botroams. I can't say there's really a good rule of thumb regarding placement of botroams since it really varies map by map.

info_camp
This entity is a 16x16x16 dark green node. You'll want to place these in locations where a player would likely stop and snipe other players, typically an overlook or ambush location. Changing the weight will greatly influence the bot's choice to camp; the higher the number, the more likely they'll camp. Also make sure to adjust the range to be about the size of the area the camp is in. So in the example shown, the ledge is just under 500 units wide, so I set the range/radius of the info_camp to 256. Again, you'll want to experiment with these numbers until you get a satisfactory result.

bot clip
Bot clip is a very specific use texture. It's completely invisible and is used to cover up elaborate geometry to allow BSPC to skip over it. Also use it in areas where bots get stuck, or travel in such ways that aren't satisfactory. The most frequent usecase for it I've found is for areas that are out of reach that realistically a player could want to get to, but a bot won't go to (for example rocket jumping to a higher wall).
Common Issues and how to fix them
This section is reserved for anything that is brought up in the comments.
Final Notes
If you correctly implement these entities and compile your AAS file, you'll have a bot ready map. Since this is my first guide, feel free to hit up the comments section with questions or errors you ran into and I'll try to address them in the FAQ or any future revisions.
5 Comments
Clavius  [author] 9 Mar, 2022 @ 9:57pm 
Cool, good to know. I'll look into that. I need to reinstall JACK at some point anyway and tweak the command line to account for that.
Shonathan Wick 9 Mar, 2022 @ 8:55pm 
Hey again!
Btw this method does work for Return To Castle Wolfenstein. Although a different version is required. It can be grabbed from GTKradiant's SVN. I think there is also a Quake 3 one there as well.

Still trying to automate the BSPC process though. so far I've got a batch doing the work atm. :steamthumbsup:
Clavius  [author] 9 Mar, 2022 @ 11:28am 
It looks like the link to the BSPC download is 404'd. Considering it was a Creative Commons licensed tool, I will be placing it onto another webspace. Sit tight.
Clavius  [author] 11 Feb, 2021 @ 7:52am 
Sorry for the late reply. I'm not entirely sure. I'd expect Return to Castle Wolfenstein to use a different pathfinding method being a singleplayer game with matinees and triggers compared to a multiplayer game where the goal in AI pathfinding is to circulate around the arena looking for targets.

But, I figure it's worth trying to find out.
Shonathan Wick 16 Jan, 2021 @ 10:47pm 
Hey! Would this work with Return To Castle Wolfenstein?
I'm thinking of putting an .FGD together for it and maybe on for Soldier Of Fortune.