Pathnoding Unreal Levels for the Unreal Bots

by: Randar
mimpchnk@uswest.net

In a very real sense, the Unreal Bots are ONLY as good as the levels designed for them. In other words, for the Bots to play at their optimal best, the Unreal levels must be carefully created for them. While there are many good deathmatch levels out there for human play, there are unfortunately too few that are great for Bot play. (I have seen some levels that can NOT be adequately pathed for the Bots!) This tutorial will attempt to help the level designers design levels that will make the Unreal Bots and the Bot loving community happy.

WHERE DO YOU BEGIN?

First, design a level with the Bots in mind. This means that you must know the limitations of the Unreal Bots. (Yes, they DO have their limitations!) The Bots do NOT like levels with too much water, lava, slime, or acid in them. Even with good pathing, they either will avoid these areas altogether, or you will always find them jumping in and choking it down. Another little problem with the Bots is they apparently cannot use all of the items (i.e., jump boots, force field, etc.) that the human players might find in their inventory.
All in all, the best levels for the Bots are those that are designed with an elegant simplicity. If a level is too complicated or has a lot of tricks and traps, it will probably present problems for the Bots. Now, while it is tempting to design a killer level with all kinds of bells and whistles, the best levels for deathmatch (whether for humans or for Bots) are those levels that tend to be the simplest in design. Save all of the unique and unusual effects for the single player levels. For the deathmatch levels, the best ones are those that are fast and efficient—given to the one and only goal of "kill or be killed." Of course this does not mean that a good deathmatch level must be boring. Use textures that work well together and support the theme of your creation. But keep the "eye candy" to a minimum. Levels that contain a lot of special effects (i.e., lighting, fog, etc.) will really slow down when a Bot or two are added to them.

THEN WHAT?

After a level has been completely designed, pathnode the level for the Unreal Bots. In the "Browse" Menu at the right hand side of the Unreal Editor choose "Classes." Under Actor Classes choose "NavigationPoint." Under NavigationPoint you will be using "PathNode" to path the level for the Bots. And, so the Bots can use the elevators, you will also be using "LiftExit" and "LiftCenter." In one of the Map View screens (Mode—Textures; View—Show Moving Brushes; Actors—Full Actor View) choose the view that allows you the first person perspective so that you can move through the level.

THE PATHNODES

Under Classes, NavigationPoint, choose and highlight "PathNode." Place the pathnodes in the level by pointing to the location on the floor where you want the node to go, then right click the mouse and choose "Add PathNode Here." The pathnode will appear. (It is a Golden Apple.) Continue pathing the level choosing the best possible route for the Bots. All pathnodes should be placed at key points—next to weapons or items. Each pathnode should be visible to the next pathnode which is in sight of the next node, and so on. (In other words, do not separate the nodes by too great a distance. But, don"t place them too close together either.) On stairs, place one pathnode on the floor at the middle of the base of the stairs, and place the next node on the floor at the middle of the top of the stairs. (In other words, you should only have two nodes per flight of stairs: one at the top, and one at the bottom. Try not to put any nodes in the middle of the flight of stairs.) The two nodes should be visible to each other. If there is a landing (that changes the direction of the stairs) place a node on that landing, and, of course, another at the top of the stairs. (Do NOT place a node on every step! Of course spiral staircases present a unique pathing challenge—just do the best you can, with as few pathnodes as possible.) Continue to path the level until you have left a trail of "golden apples" throughout the entire level.

PATHING TIP: Some areas are very difficult to path because they are too small for the Actor. (You will get a message saying: "Actor does not fit here.") Difficult areas would include ledges that are too narrow, rooms or halls that are too small, etc. One work-around is to place items in these areas, if you know that the player actually can go there. Then place a pathnode as close to this trouble spot as possible. The pathnodes will usually link to the items in and through the problem area when you do a "Path Define." But, the best work-around is this: You can MOVE any pathnode or item to exactly where you want it (moving it in any direction; left, right, front, back, up or down) by selecting it, after you have placed it, and using a combination of the CTRL key and the left or right or left-right mouse buttons, for precise placement. (You can also DUPLICATE an existing pathnode by right-clicking on it and choosing "Duplicate.") This means that you can move a pathnode into an area that gives you an "Actor does not fit here" message. So, you can put pathnodes on narrow ledges, in difficult areas, spiral staircases, etc. You can do the same thing for the elevator nodes as well. One more thing. If you use any portals or teleports in the level, make sure that you place a pathnode just outside the portal, and put a pathnode inside the portal chamber as well. You may have to move the pathnode (as described above) to place it in the best center position.
PATHING TIP: Every once in a while, you will come across a specific area that almost defies pathing. What do you do? Well, here is a little trick that really works: use the "LiftExit" and "LiftCenter" nodes! (Just be sure and give both of their LiftTags the same name.) You read that correctly. You can use the elevator nodes to get the Bots to jump or drop to difficult areas that may not easily link when you do a "Path Define." You can even use the elevator nodes to help the Bots get into and out of water more easily. Another interesting use of the liftnodes is in a low gravity room. You can actually get the Bots to jump UP to higher areas to retrieve items. (In normal gravity, they would only jump to the same level or drop down to the next lift node. But, jumping in low gravity gets the Bots to jump higher than they even "expected.") Be creative and find other ways to use these special nodes to move the Bots into and out of unusual areas! One other thing that you can try is to increase the "desirability" of any item that the Bots can get and use. Every item has a "Properties Sheet." In it you will find the "maxdesirability" field. Tweak this number, and the Bots may show a greater interest in the area that is giving you problems.
PATHING TIP: Then there is the dreaded "camping" problem that sometimes happens even when a level seems to be pathed correctly. I have found that the only thing that usually works is to (sometimes drastically) change the weapons and items placement, not just the pathnode placement. Even then, be aware that the problem may not entirely go away. A different kind of problem is seen when dealing with an area that the Bots just won"t frequent. (This often happens with "dead-end" rooms and areas. Remember it is best to design your levels where there are NO "dead-end" areas. Make sure that every area has an entrance and an exit for better game flow and for better routing. If you simply must have a "dead-end" area, make sure that you have something really significant in that room that will give the Bots a reason for going there.) If you follow the Bot around in Spectator Mode, you will realize that in almost any level the Bots tend to follow a predictable path. This path may leave certain areas out of the Bots territory. This problem too, demands a sometimes radical solution—change the weapons and items placement. This is a frustrating solution to an aggravating problem, but it usually does work. Don"t give up! Keep at it until the level flows smoothly and works well in Bot play. If one pathing or weapons and items placement does not work, try another.
PATHING TIP: To get the Bots to "use" a button or switch, you must place a Trigger in front of the button. The Trigger must be set so that it will "push" the button AND also activate the object you want the button to open. This is rather complicated, so for purposes of illustration, let"s assume you want a button or switch to open a door. FIRST, put a Trigger in front of the button and open its Properties Sheet. Under Events, you see a field for Event and Tag. In the Event field put "Door" and in the Tag field put "DoorTrigger." Under Object of the Properties Sheet for the button the Initial State should be "NormalTrigger." Under Trigger of the Same Properties Sheet, put "True" for InitiallyActive and "False for TriggeronlyOnce. For TriggerType put "TT_PlayerProximity." SECOND, go to the Properties Sheet for the button or switch (the button or switch is actually a "Mover") and under Events, in the field for Event put "None" and in the field for Tag put "Door." Under the Properties Sheet, Mover, for the BumpType put "BT_PlayerBump." And Under the Properties Sheet, Object, for the InitialState put "TriggerOpenTimed." THIRD, go to the Properties Sheet for the door (this is also a "Mover") and go to Events. Under Event put None and under Tag put "Door." Under the Properties Sheet, Mover, for the BumpType put "BT_PlayerBump." And Under the Properties Sheet, Object, for the InitialState put "TriggerOpenTimed." (NOTE: There are quite a few other fields that you can choose to effect various aspects of the button and the door, but the above fields in the Properties Sheet tie the trigger in with both the button and the door. What you have basically done is make the trigger activate the "Door"—the name of the Events Tag for BOTH the button mover and the door mover. By the way, you should realize that you must set the time delay for the door so that it will stay open long enough for the Bots to actually go through that door. What is more, there must be something behind that door that is worth getting—like a SuperHealth or a weapons cache. Then that door must stay open long enough for them to get out of that room.)
PATHING TIP: One of the hardest things for the Bots to do is navigate through water. (Perhaps the best advice is this: Do NOT put any pathnodes in the water unless you have to!) If you must have them "take the plunge" make sure that there is a very good reason for them to get all wet. Some good reasons would include items and weapons in the water (If you place items in the water, you should raise them off the ground about a foot or so. Otherwise, the Bots will get hung up trying to get the item while in swimming mode.), or the need to move into another area of the level. Do NOT make the Bots wander through underwater labyrinths just for "fun." (The Bots have a nasty habit of drowning, especially in deep water. In fact, it looks like the Bot"s AI does not always tell them to go UP for air! Another little problem the Bots appear to have is that sometimes they stop swimming and go into a walking or running mode underwater. This almost always means a sure death, unless their swimming AI kicks back in.) Place the pathnodes in the water like you do on land. However, if the water is deep, you may have to move the pathnodes (up or down) into the most efficient path possible. (Sometimes, for some unexplained reason, the pathnodes under water do not always connect properly, especially if the water is deep. Make sure that you go back into the water after a Path Define to check that all the water nodes are linked properly.) Always put pathnodes at the water"s edge, and put several of them at various points along the water"s edge so the Bots can easily jump out of the water. One or two more things, do NOT place any pathnodes above the water. And, remember, you can use the liftexit and liftcenter nodes in and around water. But, use them only to get the Bots in and out of water areas. Do NOT use these lift nodes to try and get the Bots to move through vast underwater areas. These elevator nodes will cause the Bots to pause at the various points (or sometimes change direction) and then all they will do is choke it all down. (And, don"t even think about trying to path the Bots through acid, slime or lava.)

THE ELEVATORS

Do NOT use "PathNodes" (Golden Apples) for the Elevators—they do not work! Instead use the "LiftExit" and "LiftCenter" nodes. (These nodes look like a Griffin"s head.) Place the LiftExit node where you want the Bot to WAIT for (or get off) the elevator. But, do NOT place the LiftExit too close to the actual elevator brush itself. If you do, and the Bots get too close to the elevator, they will active the lift too soon. (Use the same procedure as you would a regular pathnode. Point at a spot on the floor just outside the elevator platform brush and right click to place the LiftExit.) You must have at least TWO LiftExit nodes. One for the bottom of the elevator and one for the top. (You can have more than one entry or exit nodes, but it is best to only have one for each floor.) Place the LiftCenter node in the center of the elevator area, on the floor where the elevator brush is. This is where the Bot will stand and wait until the elevator reaches the top—if you do everything else correctly. (NOTE: Do not place any nodes, of any kind, in "mid-air"—floating far above the ground. They must be placed at approximately "waist-high" level above the ground.)
This next step is CRITICAL to getting the Bots to use the elevators properly. (In other words, to keep them from jumping off the elevator too early, or to keep them from standing under the elevator, etc. EACH ELEVATOR MUST BE GIVEN A UNIQUE NAME, AND EVERY "TAG" ("LIFTTAG") MUST BE SET ACCORDINGLY, AND THE ELEVATOR"S MOVER PROPERTIES MUST ALSO BE SET PROPERLY! Each elevator node (LiftExit and LiftCenter) has its own properties sheet. Right click on them and you will find their properties. When you are in the LiftExit Properties choose "LiftExit" and then "LiftTag"—Give a name to that tag that will be used for that elevator and all its tags. (Each elevator MUST have a different name.) Do the same with the LiftCenter LiftTag—give it the same name that you gave to the LiftExit for that elevator. NOW, and this is absolutely essential if the Bots are to behave themselves on the elevator, you MUST select the elevator brush, then right click that highlighted (pink) brush and choose "Mover Properties." This will give you the Properties Sheet for the selected elevator. On this Properties Sheet choose "Event" and then "Tag." Give the elevator the same name as its LiftExits and LiftCenters. This will "link" the elevator with the LiftExits and the LiftCenter nodes.
Bot Trivia: Did you know that the Bots can "call" elevators, but you can"t? It looks like the Unreal Bots know how to "push all of the elevator"s buttons" to use the elevators to their own advantage. If the Bot is at the top of an elevator shaft and the elevator is on the ground level, the Bot can actually summon the elevator. Hey, we can"t do that!

THE PATH DEFINE

If you have completely pathed the level and properly pathed the elevators as well, the next step is to go to "Options" and choose "Rebuild." Under Rebuild, choose the "Lighting" tab and then you will find the "Paths Define" button. Press this and the level will be processed and pathed. (This can take several minutes!) After the level is pathed, choose "Close." Then go to "File" and SAVE THE LEVEL. (Of course, you should be saving the level all along at various stages of development.)

AUTO BOT TIP

You can make your level automatically add Bots by going to Options, Level Properties, Level Info, and under Default Game Type put: Class"Unreall.DeathMatchGame" (The way you place this in the field is to, under Browse Classes, choose: Actor, Info, Game Info, Unreal Game Info, and then highlight "DeathMatchGame." Then in the Level Properties field for "Default Game Type"—which probably says "None"—click on the field and then select "Use." Because you have highlighted "DeathMatchGame," this will be placed in that field. Be sure and save the level now.) This will automatically bring Bots into the game when you start the level. So, you can just double click on the name of the level in Windows Explorer to fire up a game (and then close Explorer when the Unreal Log starts) and you don"t even have to fool with the BotMatch Menu! (This option reads your Bot Configuration file in the unreal.ini, so make sure that you have at least one Bot selected for BotMatch.) If you want to bring in other Bots, just go to the console and type in: addbots x (where "x" is the number of Bots you want).

THE FINAL STEPS

Unfortunately your mission to create a killer Bot level is not done. There are a few more steps that you really must take, if you want your level to be a top Bot level. First, go back into UnrealEd and load the map. Go through the level in the 3D view and look at ALL the pathnodes. Are the pathnodes and their links neat or sloppy? (It does usually make a difference! Remember, you are actually laying out the exact route that the Bots will take through the level.) Especially pay attention to trouble areas—like stairs or areas around lava or portals! Look for any pathnodes that are too far off the ground. Also, while in UnrealEd look at each elevator and their special pathnodes (LiftExit and LiftCenter) to see if they are placed and linked properly. And, if you are really brave, turn the "View Paths" option on and follow the pathnodes, looking for any broken (i.e., unconnected) links. All of the paths will appear as blue and red lines that connect all of the nodes and items. Fix any problems and then do another "Path Define" and save the level.
Secondly, whether the level was tweaked or not, go into Botmatch with ONE Bot and use "Spectator Mode" to follow the Bot through the level. Look for problems: areas where the Bot gets stuck and run in place; areas where the Bot does not go; excessive camping; etc. Then add one more Bot and watch them interact for a while. Next add several more Bots into the level and go spend time in each room/area looking for any problems. This second step will catch things you can"t see in UnrealEd. If Bots don"t move through a level, even if the pathnodes are great, you may have to change weapons/items placement. Sometimes Bots will just get stuck on several items if they are placed all in a row. To fix this, you have to break up the items placement—avoid straight line series placement of ammo and health. Sometimes you just have to delete and then re-place the item that gives the Bot a problem. You should realize that some Bot problems will be solved by just having another entity (Bot or human) to interact with, but observing a single Bot in the level while you are in Spectator Mode is very revealing. Watching the Bots, you really begin to notice all kinds of things that will teach you the ways of the Bots.

For a variation of the "Spectator Mode" you can also go to the console while the Bots are in play and type in "viewclass femaleonebot" (or femaletwobot, maleonebot, maletwobot, malethreebot, etc. depending on which Bot you have in the game).

Finally, go into Botmatch and go one-on-one against the Bot on your level. Then bring in a few more Bots for a good old fashioned free-for-all. The better you have pathed and optimized the level for the Bots, the better they will play . . . and the more you will die!
Yes, this is a lot of trouble! But it is an essential part of quality level design. Remember, our ultimate goal is not to just build a good level for human deathmatch play, but also to build a better level for the Bots.

CLOSING HINT

If you run across a level that someone else made and the Bots don"t play it well, you can always fire up UnrealEd and follow all the steps in this tutorial to make your own Bot improvements. (But, if you want to re-release the Bot improved level, please be sure and get the permission of the level designer first.)