210 likes | 421 Views
Unreal Bot Navigation. CIS 488/588 Bruce R. Maxim UM-Dearborn. Basics. Must be done in Unreal Tournament 2004 not the runtime version In general paths are built among PathNodes PlayerStarts, pickups, and actors that let bots deal with obsticles (jump points, doors, lifts)
E N D
Unreal Bot Navigation CIS 488/588 Bruce R. Maxim UM-Dearborn
Basics • Must be done in Unreal Tournament 2004 not the runtime version • In general paths are built among PathNodes PlayerStarts, pickups, and actors that let bots deal with obsticles (jump points, doors, lifts) • You need rebuild AI paths using the button on the top tool bar • You can toggle viewing of AI paths using the RMB on one of the viewport title bars and choosing View>ShowPaths
Path Nodes - 1Tutorial 12.1 • Open the map in Tutorial12_01_Start.ut2 • If you add any bots added to this level they will do nothing • You can use the RMB to open the context menu and add Path Nodes any where in the level • You want to add enough Path Nodes so that every navigation point is reachable in the map
Path Nodes - 2Tutorial 12.1 • Rebuild the AI paths using the top menu button and use RMB to check path layout • Adjust the position of any node needed to make most of the path Green • Rebuild the level and test it • Open the console in Unreal by typing ~ • Type ghost and the type addbots 1 • Move outside the map and observe the bot’s movements
Path Color Codes • White wide path (big NPC’s or vehicles) • Green relatively wide (big NPC’s) • Blue narrow (small NPC’s) • Purple lift, teleporter, jump pad • Liliac ladder • Yellow forced path (create additional link) • Red proscribed path (break node link)
Jumping Onto Ledge - 1Tutorial 12.2 • Use Tutorial12_02_Start.ut2 • Open Actor class browser, expand NavigationPoint>JumpDest and select JumpSpot • Use RMB to place the JumpSpot near the middle edge of the upper level • You need to force a path from the nearest PathNode to the JumpSpot
Jumping Onto Ledge – 2Tutorial 12.2 • In the PathNode Properties window, expand the NavigationPoint category and enter JumpSpot1 and the value of ForcedPath[0] • It’s also a good idea to open the Properties window for the JumpSpot actor, expand the JumpSpot category, and set the value of bForceAllowDoubleJumping to True • Rebuild paths, save, and test (using ghost and addbots)
Translocating Through HoleTutorial 12.3 • I have not gotten this example to work yet
Simple Door - No Door ActorTutorial 12.4 • Use Tutorial12_04_Start.ut2 • Open the Properties window for the BlastDoor • Expand the Collision category and set bPathColliding to False • Rebuild the paths and now you see a path passing through the door (the bots will too) • Save and test the map
Simple Door With Door ActorTutorial 12.5 • Use Tutorial12_05_Start.ut2 • Open the Actor class browser, expand NavigationPoint, and select Door • Use RMB to add Door in center Door Mover • Open the Properties window for the Door, expand the Door category, set the DoorTag property to BlastDoor, and the DoorTrigger property to BlastDoorTrigger • Rebuild the path, save, and test
Complex Bot-Door Interaction - 1Tutorial 12.6 • Use Tutorial12_06_Start.ut2 • We want to set up a bot trigger away from from the door and wait for door to open before entering it • Open the Actor class browser, expand NavigationPoint, and select Door • Use RMB to add a Door in center of the Door Mover
Complex Bot-Door Interaction - 2Tutorial 12.6 • Open the Properties window for the Door, expand the Door category, set the DoorTag property to BlastDoor, and the DoorTrigger property to BlastDoorTrigger • Rebuild the path, save, and test (note that the bots go to the Trigger to open the BlastDoor and not directly to the BlastDoor)
Bot-Navigable Lift - 1Tutorial 12.7 • Use Tutorial12_07_Start.ut2 • Open the Actor class browser, expand NavigationPoint, and select LiftExit • Use RMB to add a LiftExit in front of the LiftMover and one at the top of the platform • Open the Properties window for the LiftExit in front of the LiftMover, expand the LiftExit category, set LiftTag to LiftMover, and SuggestedKeyFrame to 0
Bot-Navigable Lift – 2Tutorial 12.7 • Open the Actor class browser, expand NavigationPoint, and select LiftCenter • Use RMB to add the LiftCenter near the lift and move it to the center of the LiftMover • Open the Properties menu for the LiftCenter, expand the LiftCenter categtory, change the LiftTag property to LiftMover (the Tag property of the LiftMover)
Bot-Navigable Lift - 3Tutorial 12.7 • Open the Properties window for the LiftExit on top of the platform, expand the LiftExit category, set LiftTag to LiftMover, and SuggestedKeyFrame to 1 • Rebuild the paths, save, and test (use ghost mode and addbots)
Assault Paths • In Capture the Flag or Bombing Run you may wish to have the bots choose paths to objectives more carefully • You can assign priorities to multiple assault paths or designate one path for the attack routes and one for the return route
Using Assault Paths - 1Tutorial 12.8 • Start with the map file Tutorial12_08_Start.ut2 • Open the Actor class browser, expand NavigationPoint, and select AssaultPath • Place one AssaultPath in the upper hallway near the Shield Charger • Use the RMB to open the AssaultPath properties window, open the AssaultPath category, set PathTag[0] to AttackPath, set the ObjectiveTag to xBlueFlagBase, and set bNoReturn to True
Using Assault Paths - 2Tutorial 12.8 • Place the second AssaultPath along the lower walkway • In the properties window for this AssaultPath, open the AssaultPath category, set PathTag[0] to AttackPath, set ObjectiveTag to xBlueFlagbase, and bReturnOnly to True • Rebuild the paths, save and test the map (using Ghost mode will make it easier to observe the action)
Creating Defense Points - 1Tutorial 12.9 • Start with map file Tutorial12_09_Start.ut2 • Select UnrealScriptedSequence in the Actor class browser • Add the UnrealScriptedSequence actor in front of the blue team’s Sniper Rifle weapons base • Rotate actor to face flag (the area being defended)
Creating Defense Points - 2Tutorial 12.9 • Use RMB to open the properties window, open the Events category set and set Tag property to DefendBlueFlag • Expand UnrealScriptedSequence category and set • bSniping property to True • WeaponPreference to SniperRifle • Save and run the map
Vehicle Navigation • RoadPathNodes • Placed like PathNodes, make sure paths are white • You should adjust the value of MaxRoadDist to remove connections between parallel roads • HoverPathNodes • Use instead of RoadPathNodes to allow traversal of unusual terrain elements • FlyingPathNodes • Defined by CollisionHeight and CollsionRadius properties