1 / 32

CSE4MOD Bot Navigation and Karma

CSE4MOD Bot Navigation and Karma. Paul Taylor 2009. Unreal 4. For the Next, Next Generation Consoles Due around 2012 http://arstechnica.com/gaming/news/2008/07/epic-games-unreal-engine-4-ready-in-2012.ars. Karma. Karma was the Physics Engine in Unreal.

zelig
Download Presentation

CSE4MOD Bot Navigation and Karma

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSE4MODBot Navigation and Karma Paul Taylor 2009

  2. Unreal 4 • For the Next, Next Generation Consoles • Due around 2012 http://arstechnica.com/gaming/news/2008/07/epic-games-unreal-engine-4-ready-in-2012.ars

  3. Karma • Karma was the Physics Engine in Unreal. • Used from UT2003 & Unreal Championship • Until UT2K4 • Basically used on all versions of the Unreal 2.x Engine • As of Unreal3 Karma has been dropped in favour of Ageia’sPhysX • Now owned and hardware supported by Nvidia!

  4. Access to Karma • To use Karma you need to have a special actor • KActor • This class + children can react dynamically with the environment • In the movement category the Physics property is set to PHYS_Karma. • How objects react is stored in the KParams property (in the Karma category)

  5. Surfaces That Interact • All surfaces in the Unreal Level have a variable bBlockKarma

  6. Multiplayer = Failure • Karma does not replicate. • The Physics that reacts to your explosions etc, will not replicate as Karma is local only ?? One of the reasons Karma was dropped ??

  7. Static Mesh Performance • UseSimpleKaramaCollisions • This is the complicated way to use Karma • You need to have a Collision model for your mesh • Otherwise you set it to false, and Karma will use every Polygon in your static mesh • = Slow!!! • If you set it to true without a Collision Mesh

  8. Enabling Karma • Karma doesn’t get enabled till enough force is applied to an Actor. • This is not a bug, it’s an optimisation feature. • In Kparams you can alter KStartEnabled

  9. Karma Parameters • bDestroyOnWorldPenetrate • bDoSafeTime • Extra safe checks on world penetration • bHighDetailOnly • Removes actions for lower machines • bKAllowRotate • Allows z-axis rotation • Only affects actors with KStayUpright set

  10. bKDoubleTickRate • Increases the speed + Accuracy of physics calculations but should be set Uniform to any objects which MAY collide • bKNonSphericalInertia • Calculate Inertia NOT based on a sphere • bKStayUpright • Duh! = zAxis

  11. KActorGravScale • Gravity Multiplier per-actor • KAngularDamping • Rotational Drag • Kboyancy • 0 = ignored • 1 = float mid water • >1 = float to surface

  12. KLinearDamping • Translational Drag • Kmass • Relative to the volume of the Karma Primitives • KMaxAngularSpeed • Max speed of actor rotating • KMaxSpeed • Plain old speed

  13. KStartAngVel (XYZ) • KStartEnabled • KStartLinVel • KVelDropBelowThreshold • Causes an Event • StayUprightStiffness • Springiness to stay upright • StayUprightDamping

  14. Kfriction • 1=Full friction • 0 = no friction • KImpactThreshold • Calls an event • Krestitution • Bouncyness • 0 = None • 1 = perfect energy retention

  15. bKDoConvulsions • Allows RagDolls to convulse! At interval: • KConvulseSpacing • bRubbery • Makes Ragdolls bend and flex dramatically • Kskeleton • This sets the ragdoll skeleton to be used.

  16. KCOMOffset • Centre of mass offset (XYZ) • KInertiaTensor • 6 variables, 0 3 and 5 are important • 0 = ease of roll, changes with Kmass and Drawscale • 3 = ease of pitch • 5 = ease of yaw

  17. Collision Primitives • MCDBX • MCDSP • MCDCY • MCDCX

  18. Collision Primitive Prefixes • MCDBX - Box • MCDSP - Sphere • MCDCY - Cylinder • MCDCX – Convex Mesh • These will allow a static mesh to be imported with the collision already set

  19. Viewing Collisions In UnrealEd

  20. Constraints • So far we have covered free objects • Constraints will let us tie objects together • The Three Constraint actors • KBSJoint • Ball-Socket Joint • KConeLimit • This applies to existing joints and seves to limit rotation • KHinge

  21. KHinge • HT_Normal • HT_Springy • HT_Motor • HT_Controlled • Motor + Specified Destination Angle Hinges are Triggerable

  22. Ragdolls and Complex Physics KAT The Karma Authoring Tool Karma Workspaces And Karma Assets

  23. Maya -> KAT -> Unreal • Objects are created in Maya with Joints • Exported with axTools to the Unreal PSK format • KAT opens the .PSX and can then be used to create the .KA file. • You must copy the .AK into the KarmaData folder of UT. • Then set the KSkeleton variable of your object

  24. Bot Navigation and AI basics Bots navigate primarily through the Navigation Path network The engine uses the A* path-finding algorithm to navigate from X to Y

  25. Storing Paths LevelInfo class contains var const NavigationPointNavigationPointList; The Bot Brains come from Bot.uc in the UnrealGame Package. Yes the original Unreal Package (UT). ~c1994 TeamAI again from UnrealGame

  26. Bot.uc 260 Functions 24 events derives a lot of code from Controller.uc

  27. Path Colours • White – Very Wide • Green – Large NPCs • Blue – Cramped decreased game flow • Purple – Lift, Teleporters and Jump Pads • Light Purple – Ladder • Yellow – Forced Paths • Red – Proscribed Paths (Inverse of Forced)

  28. Order of preference • Bots will usually take White, then Green, then blue, but the true answer is hidden in the navigation code • Bots navigate by attaching a cost to every action. • This allows you to entice them into blue paths with goodies.

  29. Remember your console! • Navigation Debuging: ShowDebug Viewclass <> ReviewJumpSpots <optional limit> - Spawns a bot and forces it to attempt various jump types on every jump spot in your level. Limits: • Transloc • Combo • Jump • LowGrav

  30. ShowAI – AI debugging ViewBot – cycles bots ViewFlag – CTF Debugging SoakBots – When errors happen bots will pause the game Rememberspot Used by showdebug to show a white line directly, and if possible green lines following the navigation points

  31. Jump Pads and Teleporters • JumpSpot points act as a Jump Destination, bots will jump TO this point, not from it! • JumpSpot Properties • bForceDoubleJump • bDodgeUp • bForceDoubleJumping – no check on success of a jump • bNeverImpactJump – disables shield jumping • bNoLowGrav – not used in low G • bOnlyTranslocator • TranslocTargetTag – set a target for using the TransLocator • TranslocZoffset – Adjusts bot aiming up / down (z)

  32. Doorways • The Door actor acts as a navigation point. • If you have a simple actor as your door, you just need to set bPathColliding to false.

More Related