Jump to content

Jedi Academy turned 20 this year! We celebrated in a ton of different ways: mod contest, server event, podcast, etc. Thank you to all who have been a part of this game for the last two decades. Check out the anniversary content!

Read more

Welcome to JKHub

This community is dedicated to the games Star Wars: Jedi Outcast (2002) and Jedi Academy (2003). We host over 3,000 mods created by passionate fans around the world, and thousands of threads of people showcasing their works in progress and asking for assistance. From mods to art to troubleshooting help, we probably have it. If we don't, request or contribute!

Get started

This game turned 20 years old this year, and it is still one of the greatest Star Wars games of all time. If you're new or returning from a long hiatus, here are the basics of getting started with Star Wars Jedi Knight Jedi Academy in 2023.

Read more

Multiplayer Bot Routing


Kessno

Tutorial originally created by Wedge on Map-Review and posted on 08-15-2003.

Bot routing in Jedi Outcast is fairly easy, once you get the basic idea, and it is necessary to include in MP levels when you want to distribute them. This tutorial will provide an overview of basic bot routing, what it is, and how to go about doing it. More specific information can be found in the Word document \GameData\Tools\Bot waypoint tutorial.doc that came with the JKII tool kit. My tutorial contains less raw information, but I tried to make it easy to understand. (This tutorial assumes Windows XP in a few places.)

Okay, here we go--

What is a bot route?

A multiplayer bot route is the set of instructions that tells bots (computer AI players) where they should move within a map. bot routes are specific to certain maps--the route for ctf_nstreets will be much different from the route for ffa_yavin. A bot route file consists of a list of connected waypoints and their coordinates in the map. Bots will travel from one waypoint to the next in numerical order (or reverse numerical order if the bot reaches the end). Also, bots will branch from a waypoint to another, nearby waypoint (not in order) if there is something they want near the second waypoint. In other words, if a bot is at waypoint 6 and it sees another bot at nearby waypoint 74, then the bot will skip waypoints 7 through 73 and go directly towards waypoint 74. Waypoints can be given flags that specify certain characteristics of that waypoint, for example, that the bot will have to crouch or jump to get to that waypoint, or that one waypoint is a good place to camp. When you finish making the bot route, it will be written to a bot route, or .wnt, file. This is the actual set of instructions that bots follow.

How do I set the program up for making a bot route?

Bot routing is done manually from the Q3 Arena console ( [~] key, or [shift] + [`] ). First, you must open your map up in bot routing mode. This is easiest done by making a batch file, which you will only have to make once. Do the following:

  • Open Notepad
  • Type jk2mp +set bot_wp_edit 1 +devmap mapname where "mapname" is the name of your map, for example, ffa_SpaceStation
  • Save the file as Jedi Outcast/GameData/jk2mp_botroute.bat (BE SURE THIS IS A .BAT FILE, NOT A .TXT FILE!) Whenever you want to bot-route a map, right-click this file, select Edit, and change "mapname" to whatever map you want to bot-route.
  • Now, double-click on the .bat file! Jedi outcast should now launch and start up your map automatically.
  • As soon as the game starts, make sure there is no time limit, or that there is a long one. Some bot routes take a long time.
  • Open the console. Type set bot_wp_edit 1

How do I make a bot route?

Okay, so now you have JKII set up in bot waypoint editing mode. Now, we have to set up the commands we want to use. The most relevant bot-routing commands are these:

  • bot_wp_add: Add a new waypoint.
  • bot_wp_rem: Remove a waypoint.
  • bot_wp_addflagged: Add a waypoint with specific flag instructions for the bot.
  • bot_wp_switchflags: Change the flags on a waypoint.

Next up, the most useful waypoint flags, for use on the bot_wp_addflagged and bot_wp_switchflags commands (there are more, these are just the "most useful"):

  • j : Bots will jump on their way TO this waypoint.
  • d : Bots will crouch on their way TO this waypoint.
  • c : Bots that camp will use this waypoint as a camping/sniping spot.
  • x : Bots that camp will use this as a camping spot and crouch in the camping spot.
  • f : Bots will wait for a func_ brush to be under this waypoint before they move onto it (i.e., an elevator or train).

So, this seems like it's going to involve a lot of typing. To save time, I like to set hotkeys for the commands I think I'm going to use most often. For example, a common setup for me is to type this in the console:

  • bind 1 bot_wp_add : Add new waypoint
  • bind 2 bot_wp_addflagged j Add new jumping waypoint
  • bind 3 bot_wp_addflagged d Add new crouching waypoint
  • bind 4 bot_wp_addflagged c : Add new camping spot

Now when I press the 1, 2, 3, and 4 keys, those actions will be performed. you may substitute whatever keys you want there, I just use the numbers because I can remember them more easily. On maps with lots of elevators, add the "f" flag to the hotkeys, and on complicated maps, adding "bot_wp_rem" won't hurt. Just be sure to set your keys back to normal after you finish, or you'll end up doing something like trying to pull out a disruptor and getting the computer screaming about commands bot_wp_addflagged not being allowed on the server. 🙂

Now you are ready to make the actual bot route! The idea is quite simple: You have the normal JKII controls available, plus these waypoint-adding controls, and you move about the level putting in waypoints. You have to move everywhere you want bots to move, adding waypoints as you go. Find a good corner of your map to start in, and press whatever key you have bound to bot_wp_add. You will see a group of little floating number "0"s appear at your location, along with some information in the upper left of your screen: The waypoint number, the flags this waypoint has, and its coordinates. Now, move a little bit, and press the bot_wp_add key again. You should see some floating "1"s this time (this is the waypoint number). Move through the entire map, placing waypoints as you go. A couple things to keep in mind:

  • Bots will follow the bot route in sequential numerical order.
  • When bots get to the end of the route (the last waypoint), they will turn around and follow the route backwards.
  • Be sure to place waypoints near powerups and info_player_ entities (spawn points).
  • It is a good idea to place your last waypoint near the first one, so the bots can branch from last to first and make a circuit.
  • Around corners, doors, and other tricky places, be sure to place more waypoints than usual so the bot can easily get around obstacles.
  • When you have a long corridor, don't just place one waypoint at the beginning and one at the end: sprinkle some in between, too. Bots are easily confused.

What do I do if I make a mistake?

If you ever make a mistake placing a waypoint, then you can use the bot_wp_rem command. This command will remove the last waypoint you placed, or can remove a specific waypoint by number, i.e., bot_wp_rem 43. If you want to put another waypoint in between two existing ones, type bot_wp_add 32, if you want the new waypoint to go between 32 and 33. If you accidentally place a waypoint that has the wrong flags, you can use the command bot_wp_switchflags. This command works just like the addflags command, you specify the number of the waypoint, and then whatever flags you want it to have: bot_wp_switchflags 60 j, for instance, will make waypoint 60 a jumping waypoint, regardless of what it was before. If you don't include a number, this command will switch the flags of the last waypoint you placed. You can also include multiple flags on the addflagged and switchflags commands, for example, bot_wp_addflagged j f will add a point that the bot will jump to get to, but only move to if there is a func_brush underneath it.

Bot routes vary depending on the map, and on the complicatedness of a map. My Mars map, for instance, has about 150 waypoints (If I remember correctly), City of the Ancients has about 700. The more waypoints you have, the better your bots will be able to navigate complicated or large areas, but if you have too many, the bots may try to branch to too many waypoints or get stuck moving back-and-forth between two close-together points.

What do I do with the bot route?

When you have put waypoints in every part of the level that you want bots to go in (you can leave complicated parts out--the bots just won't go there) and gone back to the place where you put the first waypoint, type bot_wp_save. This will save the bot route .wnt file, which will appear in the GameData/base/botroutes/ directory. If you want to edit this bot route later, run the same batch file you ran in the beginning, and your map will appear, with all the waypoints visible. When you put your level into a .pk3 file, you must put the yourmap.wnt file in the .pk3, under base/botroutes/ for the map to be properly bot-supported.

Now, try it out. There are a couple things I would do: First, play the map with two players, a human and a bot, and join the spectators. Click the left mouse button to set your view to follow the bot. The bot will trace out the route, from start to finish, letting you know of any problem spots. If there are any hang-ups, they may only be minor ones, so try spectating the map with more bots: 6, 8, or 10, even. With more bots present, each bot will branch to different waypoints, and will have to react to attacking bots, so hangups may be less noticeable (the bot will come under attack eventually, and will either run away, counterattack, or be killed, all of which will force it to change its movement pattern). Lastly, play a game with the bots! See if they put up a good fight.

Bot-routing is the last step before releasing a level for distribution. Make sure it works, make sure the bots fight well, and have fun!


User Feedback

Recommended Comments

There are no comments to display.



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...