Bot Path Noding 201

By: Adam ‘Muad'dib’ Stiles

http://www.planetunreal.com/muad

muad@planetunreal.com

> PRE-REQUISITES:
> Understanding of basic path-noding. Check my bot-noding tutorials.
> The typical UnrealEd (1 or 2) knowledge.
> Ok by now you should at least have a solid understanding of UnrealEd so I'm going to assume that you know how to edit the properties of actors and brushes and such :)
> Capture the Flag bot noding is a little bit different than typical deathmatch bot noding, but is rooted in the same principles. You want a nice network of nodes for the bots to follow, but don't want the network excessive. You want the bots to behave well.
> This works great for regular deathmatch, but capture the flag has a few extras you need to pay attention to: you typically want bots to use different routes to the flags, you want bots to be able to defend the base, and of course you want bots to be able to capture the darned flag!
> A list of pathing related actors a CTF level NEEDS to have:

> - PlayerStart

> - PathNode

> - FlagBase

> A list of pathing related actors a CTF level SHOULD have:

> - PlayerStart

> - PathNode

> - FlagBase

> - DefensePoint

> - AlternatePath

> All of these items, by the way, can be found in UnrealEd within the Actor browser under "NavigationPoint". Let's go over what each one does and what properties we need to look at:

> 1. PlayerStart:
>    If you dunno what this is then you really shouldn't be reading this :) This is a spawn point for a player.
>    Properties:

>    - PlayerStart->TeamNumber : used to set which team color will be able to spawn here. 0 is red, 1 is blue.

> 2. PathNode:
>    This is the typical building block of a path system. If you've done deathmatch pathing before you'll know how to use these, if not then check my other pathing tutorials.

> 3. FlagBase:
>    This is the actual flag. You'll notice that if you place one of these down it plops down with only one flag color visible. Not to worry.
>    Properties:

>    - FlagBase -> Team : Set this to the number of the team you want this flag to belong to. 0 is red, 1 is blue. This changes the color of the flag IN GAME, but NOT in the editor - just make sure the team number is set correctly ;)

> 4. DefensePoint:
>    Located under NavigationPoint->AmbushPoint->DefensePoint. If you tell your teammates to "defend the base" in a CTF game, the bots will go to these points to defend.
>    Properties:

>    - AmbushPoint->bSniping : Set this to true if you wish the bot to use sniping skills at this defense point.

>    - DefensePoint->Team : the team to which this defense point belongs. 0 is red, 1 is blue.

>    - DefensePoint->Priority : used to set the likelihood that a bot will pick this defense point to defend from.

> 5. AlternatePath:
>    A tricky one this is. This is used to give the bots a way of recognizing an alternate path to the flag.
>    Properties:

>    - AlternatePath->Team : this tells the bots which teams flag this is an alternate path to. ie if red bots are supposed to use this AlternatePath to get to the blue flag you'd set the team to be blue. 0 is red, 1 is blue.

>    - AlternatePath->SelectionWeight : used to set the likelihood that a bot will use this path to get to the enemy flag. Very useful if you have several paths to get to the enemy flag (which you should).

> Ok so now we know what they are and we know what they can do, but how do we effectively use them? Here's the method I typically use for completely path noding a CTF level. This is NOT the only way to do it, but I find it an effective way of going about it.

> 1. Place player starts:
>    I know this one really should go without saying, but you really need to do this first. Particularly with CTF maps as you need to pay attention to the Team property and make sure the numbers are set correctly. You don't want red team members spawning in front of (or inside of for that matter) the blue base :)

> 2. Place weapons and items:
>    This should probably come next as it's an extremely important part of either deathmatch or CTF pathing. Weapon and item placement can make or break a level. You will typically want to put weapons and maybe weak armor in the vicinity of a spawn point. Nothing worse than spawning and getting blitzed because you didn't have a decent weapon to fight with.
>    You'll probably want to put strong armors and items (like the shield belt, UDamage and Redeemer) farther away to make players work for them.
>    This part is also tweakable later, but you should start thinking about good item and weapon placement at this stage.

> 3. Flagbase and defensepoints:
>    Odds are you knew where you wanted the flags to go when you started building the map. Go ahead and put them down if you haven't done so already. Also start finding good spots to defend the base from, put down some DefensePoints and make sure you have the Team attributes set correctly!
>    The defense points should probably be placed at some choke points of the map and/or near the flag itself. Also remember that you can set DefensePoints to be sniping points so keep that in mind when putting them in your map.

> 4. Pathnodes:
>    Now you ought to start putting down your network of pathnodes just as you would in a deathmatch map. Placement of the items in sections 1, 2, and 3 above will help to guide you in your generic pathnode placement.
>    Always keep in mind, though, that you're pathing for TWO teams here. There should be decent pathing for both teams and make sure that there are solid paths between the flags!!

> 5. AlternatePaths:
>    These things are tricky at best. Here's the way I handle them tho. Typical CTF levels are somewhat symmetrical in nature (ie there's a definite "halfway" point between the flags). You'll want to put an AlternatePath, for the blue team for example, on the half of the map that the blue team resides on and it needs to be part of the path that the bot should take. ie if you have a road that leads to the blue base, put the AlternatePath on the road, on the half of the map that the blue team resides.
>    You can use MULTIPLE AlternatePaths and you're encouraged to do so. In my map "CityOfSynn" you can open it up in UnrealEd and see where I placed AlternatePaths. I put them at obvious "starting" points of a possible path to the flag on the side of the map that the base the path was to resided on. Yes these things can be tricky to get the hang of so if it doesn't work the first time through - don't feel bad :)
>    If a bot doesn't seem to be using an AlternatePath and you're just *sure* you have it in a correct physical location, don't forget that you can fiddle with the SelectionWeight property to adjust how much a bot "likes" this AlternatePath.

> That pretty much covers the basics for a CTF level. I've included here some answers to FAQ's typically posed by people building a CTF level and having troubles with it.
> Q: My bots won't capture the damned flag no matter what I do!
> A: ALWAYS make sure that the FlagBase has it's pole SUNK into the floor. Ie, it shouldn't be "hovering" above the ground, but should be firmly planted in it. Whether this is a bug kind of thing in the AI, I dunno, but I've seen this problem in action before and it does help in some cases.
> Q: Ok I planted the flag. The bots still aren't going for it.
> A: Make sure the path to the flag isn't very obstructed. Remember, bots dislike roaming through tight places (like small doorways/hallways) and hate lava/slime/damage areas. Also remember that a bot chooses the *shortest* route to a flag it can find. And please please please for the love of God ALWAYS do a "Paths Define" before saving your map! :)
> Q: I've got people of team blue spawning in the red players spawn points.
> A: Double check the Team attribute of the PlayerStarts. After that, do a "Paths Define" to rebuild the pathing.
> Q: I've got really weird stuff going on with my map. Where can I get more help?
> A: Goto http://unreal.gamedesign.net/ - you'll have to sign up for an account (absolutely free and no nagging email spam either) to be able to post there, but the people are friendly and knowledgable on Unreal editing. I keep spouting this URL all over my pages - believe me it's an *invaluable* resource. Go there and ask questions - someone is very very likely to answer. (to my recollection, I've not seen a message get posted there yet that someone hasn't at least posted a reply to)