Jump to content

Home

bots...


Nanaki

Recommended Posts

The JK2 ones work the same as JA but I'll provide you with a tut from Map-Center that was made for JA MP:

 

 

"Raven"[/b]]Jedi Knight2 Bot Routes

 

Before you can use any waypoint-related bot commands you will need to enter into bot waypoint edit mode. To do this you'll need to set bot_wp_edit to 1 and restart the map. The bot_wp_edit cvar is cheat protected however, so you'll likely want to add something like this to your command line when starting the game:

 

+devmap mymapname +set bot_wp_edit 1

 

That should take you into edit mode. Once in edit mode a number of bot waypoint management commands and cvars are available. The first two cvars to note are bot_wp_distconnect and bot_wp_visconnect. If distconnect is non-0 (and it is by default), when a route file is saved there will be an automatic check for how close waypoints are to one another. If a waypoint is more than 400 ingame units from the last or next, a node branching system will be used to connect it (inserting points in between as necessary). The visconnect option works in a similar way, except it checks for visibility rather than distance. Both of these options are very convenient if a level is rather simple and allow you to route a level with very little work. However, if a level is more complex and involves numerous lifts and tricky waypoints placement, it's best to disable them because they may fail where unexpected. If either method fails to branch to a waypoint, it will set that waypoint as being a "one way point" (I'll explain what these are later in more detail), which means that the bot will reverse on the trail when it reaches that point and not go forward on it.

 

When routing a level, you essentially want to just make sure there are waypoints (whether placed manually or by the automated connection routines) everywhere you want bots to go. It's also best to make sure there's always a waypoint close to each spawn point, so a bot has a place to resume the trail on when it respawns. The bots aren't perfect, so if you have an area that's very complex and hard to get through, you may wish to have bots avoid it (unless you don't mind them failing at it now and then). If a bot does manage to get stuck on its trail, it will time out after 2 seconds of no visibility to the next trail point. If it somehow can see the point and cannot get to it, the timeout process will take longer, but will still happen eventually.

 

As far as how the bots actually follow the points you place, they will follow them in numerical order back and forth by default. When the route file is saved, all nearby points and linked to one another as well. So if, for example, waypoint 5 is close to waypoint 98 and the bot wants to get a powerup which is near waypoint 105, he will branch from waypoint 5 to waypoint 98 in order to get to his destination quicker.

 

With that in mind, here are the main commands used for waypoint placement:

 

bot_wp_add - Adds a waypoint at your current ingame location. By default it will add a waypoint after the last in numerical order. However, if you specify an argument with the command it will add the waypoint after a specified waypoint number. So, if you use "bot_wp_add 3", it will insert a waypoint between waypoint 3 and waypoint 4 as waypoint 4 (waypoint 4 will then be bumped up to waypoint 5 an so on).

 

bot_wp_rem - Removes a waypoint. By default this will remove the last waypoint place. If you specify an argument you can remove a specific waypoint by number. So bot_wp_rem 5 would remove waypoint number 5. (and if there is a waypoint number 6, it then becomes number 5, and so on)

 

bot_wp_addflagged - Similar to bot_wp_add, but this requires an argument for the special type of waypoint. Valid arguments are:

 

j - The bot will jump while trying to get to this waypoint.

 

d - The bot will crouch while trying to get to this waypoint.

 

c - A camping/sniping point, the bot will often stand here if it has camping properties.

 

f - Wait for a func brush underneath this point before moving onto it. This is useful for elevators, moving platforms, and other such items so that the bot will wait until the object is under the point before advancing.

 

x - This creates a one-way forward point. The bot will travel past this point, but when reversing on the trail, once he reaches it he will turn back and go forward again. This is a good last resort if you want the bot to jump off a tall ledge he can't get back up. However, use these points sparingly, as they make the bot much less efficient in getting places.

 

y- This creates a one-way backward point. Same principle as the above, except the bot will only pass this point when following a trail in reverse order (5, 4, 3, etc).

 

n - The bot will not perform visibility checks when moving to this point. Should also be used sparingly, as the bot can easily get stuck when moving to these if something prevents it from getting there.

 

m - Sort of reversed from 'f'. The bot will only move here if there is NOT a func brush underneath this point.

 

You can combine these flags however you wish. So if you wanted to add a point that the bot will jump to and only move to when a func brush is under it, you would use "bot_wp_addflagged jf" as the command. This parameter also accepts an additional argument for inserting within trails like bot_wp_add, so if you wanted to insert said point after point 5 in your existing trail, you would use "bot_wp_addflagged jf 5".

 

bot_wp_switchflags - Switches the flags of an existing waypoint. Uses same flags as bot_wp_addflagged. So if you wanted to turn point 5 into a jump point but let it keep all its other existing properties, you would use "bot_wp_switchflags j 5".

 

bot_wp_killoneways - This will remove all one-way (x and y) flags from all waypoints on the level. Can be handy sometimes when the distconnect and visconnect cvars flag waypoints as being one-way automatically.

 

bot_wp_tele - Teleport to a specific waypoint by index. By default it will teleport to the last placed waypoint, but an additional argument will allow you to specify any number (so use "bot_wp_tele 5" to teleport to waypoint number 5, for example).

 

bot_wp_save - Once you are done placing waypoints, this will write the route file out and do all the calculations necessary at save-time.

 

bot_wp_distconnect 0 - This can be used before you use the save command so the engine will not create its own connections or mess up your connections. Only used when trying to fix problems with the engine creating unwanted flags, such as X and Y, somewhere along the chain when the botroute is saved. Replace the 0 with a 1 if you want to set it back to the default connection system.

 

Those are all the commands you should need. If you want to edit an existing route file, just load the level up in waypoint edit mode (as described above) and all the waypoint data will be visible and modifiable.

 

You probably won't end up needing to use many commands other than bot_wp_add, bot_wp_rem, and bot_wp_save. I suggest binding keys to bot_wp_add and bot_wp_rem in order to save time. So then, good luck.

 

 

Original: http://www.map-center.com/modules.php?name=Forums&file=viewtopic&t=1521

Link to comment
Share on other sites

Three flags were left out of that tutorial, possibly for good reasons, dunno. I don't know if they work or not as I just stumbled into them looking at the source code for mp I downloaded from LF, but here are the missing three flags:

 

"n" go here for a bit even with no visibility(sounds kind of scary actually, seems bots might get stuck easily trying to go through walls to a WP flagged with this)

 

"s" a good position to snipe or camp - crouch (appears to be the same as the documented "c" flag but bot is supposed to crouch while camping)

 

"g" make it a goal to get here.. goal points will be decided by setting "weight" values (I never did find exactly where this flag type gets "weighted" as the comments in the code said, but the way the code reads it does pick this up and should write to the botroute file, sounds like maybe this would be usefull for CTF and/or Siege maps)

 

Reading the code that parses the flags when "/bot_wp_addflagged" is used without a flag (the console command without arguemnts vs "bot_wp_addflagged" without the "/" to get valid usage) it should show them as valid options on the console error message that will be displayed. They are in the printf command for the error handling and in the case statement for parsing out "bot_wp_addflagged" but they're not listed in any documents or BBS posts that I have been able to find.

 

As I said, I haven't had a chance to experiment with these yet, so I can't say what behavior you'll get from your bots with them. But they are in there even though they aren't documented.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...