Madwand

Avanced AI 2.8 documentation

Aug 15th, 2015
2,118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.08 KB | None | 0 0
  1. -- BASIC OPTIONS
  2. -- When the vehicle is within "AngleBeforeRoll" degrees of its target, it will try to yaw towards
  3. -- (or away!) from its target such that its nose is pointed "AngleBeforeTurn" degrees away from it.
  4. AngleBeforeTurn = 10
  5. -- If the vehicle is at greater than this angle from it's target, it will try to roll towards it.
  6. -- (and stop rolling when AngleBeforeTurn is reached).
  7. -- Set this to 180 to NEVER use roll.
  8. AngleBeforeRoll = 50
  9. -- Outside of this distance, the vehicle will try to close on it's target.
  10. AttackRunDistance = 600
  11. -- Within this distance, the vehicle will just try to go straight until AttackRunDistance is triggered.
  12. AbortRunDistance = 300
  13. -- Ouside of this distance, the AI will try to close directly with the target, temporarily
  14. -- using AngleBeforeTurn = 0 to do so.
  15. ClosingDistance = 1000
  16. -- If AttackRunDistance hasn't been triggered within this time, force an attack run.
  17. ForceAttackTime = 15
  18. -- Altitude we will try to cruise at by default.
  19. CruiseAltitude = 200
  20. -- Maximum elevation angle, positive or negative, AI will attempt to use while climbing or descending.
  21. -- Usually refers to pitch, but AI will also try to yaw to this angle when rolled on it's side.
  22. MaxElevationAngle = 30
  23. -- Speed we'll cruise at when no enemies are present. Should be in the range of 0 to 5.
  24. CruiseSpeed = 5
  25. -- Throttle (drive) setting to use when engaged with enemies. Should be in the range of 0 to 5.
  26. AttackRunSpeed = 5 -- when on an attack run (angle to target is less than "AngleBeforeRoll") inside of ClosingDistance
  27. EscapeSpeed = 5    -- triggered after coming within "AbortRunDistance" until "AttackRunDistance" is reached
  28. RollingSpeed = 5   -- when rolling aircraft to face enemy (angle to target is greater than "AngleBeforeRoll")
  29. ClosingSpeed = 5   -- when on attack run outside of ClosingDistance AND not using RollingSpeed
  30. -- Whether to orbit the spawn point when there are no enemies, or just fly off in a straight line
  31. OrbitSpawn = true
  32.  
  33. -- AIRSHIP/HELICOPTER OPTIONS
  34. -- Use jets pointing up or down to assist in controlling altitude.
  35. UseAltitudeJets = false
  36. -- Use spinners (hopefully with helicopter blades) to try to control altitude.
  37. UseSpinners = false
  38. -- The helicopter blade speed to use when lowering altitude. Ranges between -30 to 30.
  39. MinHelicopterBladeSpeed = 20
  40. -- The helicopter blade speed to use when gaining altitude. Ranges between -30 to 30.
  41. MaxHelicopterBladeSpeed = 30
  42.  
  43. -- TERRAIN AVOIDANCE OPTIONS
  44. -- 0: Ignore terrain. Only recommended for spacecraft.
  45. -- 1: As normal aerial AI, just add CruiseAltitude to terrain when terrain is above sea level.
  46. --    This will respect "MinAltitude" and "MaxAltitude" constraints when possible.
  47. -- 2: Adjust altitude by minimum necessary to respect "MinAltitude" constraint.
  48. TerrainAvoidanceStrategy = 1
  49. -- The minimum relative altitude a vehicle will maintain above terrain. Higher priority than MaxAltitude.
  50. MinAltitude = 50
  51. -- The maximum sea-level altitude the vehicle will attempt when avoiding terrain.
  52. MaxAltitude = 400
  53. -- A set of multipliers on current velocity; how far we look ahead to avoid terrain.
  54. -- We'll look ahead at each of these points to see if terrain is in the way.
  55. TerrainLookahead = {2,4,6}
  56. -- Cap vehicle speed at this value when a possible collision is sensed.
  57. MaxTerrainSpeed = 5
  58. `
  59. -- WATER START OPTIONS
  60. -- Water start will deploy balloons when the center of mass is lower than this.
  61. -- If your vehicle has no water start balloons, set this to some large negative value.
  62. DeployAlt = 5
  63. -- Water start will release balloons when the center of mass is higher than this.
  64. ReleaseAlt = 15
  65. -- After water start has been triggered, will disable movement until this altitude has been reached.
  66. EnableEnginesAlt = 10
  67.  
  68. -- COLLISION AVOIDANCE OPTIONS
  69. -- Collision detection and avoidance tries to detect and avoid possible collisions
  70. -- with the target (only!). The "Range" parameter is how far away it will check. The "Height"
  71. -- parameter is how far above and below the vehicles current altitude it will check.
  72. -- The "Angle" parameter describes a cone within this area that is checked. If at any
  73. -- time the target is within this area, the AI will temporarily use CollisionAngle instead
  74. -- of AngleBeforeTurn and thus attempt to yaw to avoid the collision.
  75. CollisionDetectionRange = 300
  76. CollisionDetectionHeight = 20
  77. -- This does nothing if it's less than "AngleBeforeTurn"
  78. CollisionAngle = 20
  79.  
  80. -- "DOGFIGHTING" OPTIONS (changing behavior based on information about the target)
  81. -- Whether or not to try to match our altitude to the target.
  82. -- If set to "false", will use CruiseAltitude during combat.
  83. MatchTargetAltitude = false
  84. -- Range within which to attempt altitude matching. Beyond this range, uses CruiseAltitude.
  85. MatchAltitudeRange = 300
  86. -- Altitude above (or below, if negative) the target the vehicle will attempt to attain.
  87. -- Altitude will still be constrained by "MinAltitude" and "MaxAltitude" terrain avoidance constraints
  88. MatchAltitudeOffset = 50
  89.  
  90. -- ADVANCED OPTIONS (You shouldn't need to mess with these most of the time.)
  91. -- 0 for water mode, 1 for land mode, 2 for air mode. You can try it for non-aircraft, but YMMV.
  92. MODE = 2
  93. -- This AI automatically clamps "MaxElevationAngle" according to how near the aircraft is to it's target
  94. -- altitude to prevent overshooting (i.e. going into space) when changing altitude. Higher values of
  95. -- "AltitudeClamp" decrease this effect, allowing steeper climbs. Lower values help prevent overshooting.
  96. AltitudeClamp = .2
  97. -- Damping parameters to mitigate wobbling in high-performance vehicles. Higher values can help
  98. -- control wobbling, lower values allow faster turns but may overshoot and cause wobble more often.
  99. PitchDamping = 90
  100. YawDamping = 90
  101. RollDamping = 70
  102. -- The default roll angle to maintain. Set it to 90 to have the vehicle usually on it's side.
  103. -- You may want to set "AngleBeforeTurn" to 0 if you do this, so you never yaw.
  104. DefaultRollAngle = 0
  105. -- Use forward (only) propulsion balancing. This helps to compensate for damage to thrusters,
  106. -- or unbalanced thruster placement compared to the center of mass.
  107. UsePropulsionBalancing = true
Advertisement
Add Comment
Please, Sign In to add comment