Movedefs.lua: Difference between revisions

From Spring
Jump to navigationJump to search
Jk (talk | contribs)
Slogic (talk | contribs)
Line 25: Line 25:
=== tank&kbot only tags ===
=== tank&kbot only tags ===
*DepthMod
*DepthMod
** How much to slow down amphibian speed when they're underwater


=== ship only tags ===
=== ship only tags ===

Revision as of 21:00, 31 January 2010

What is a movetype?

Spring uses base movetypes to determine pathing for units.

What classes of movetypes do exist?

  • Bot
  • Tank
  • Ship
  • Hover

Known Tags

  • Name
  • FootprintX
    • (FootprintZ gets totally ignored!!!)
  • CrushStrength
    • power of unit to crush features
  • SlopeMod
    • how much a slope will slow a unit, 0 means no slowdown
  • MaxSlope

Heat tags(used in unit avoidance)

  • HeatMapping
  • HeatMod
  • HeatProduced

tank&kbot only tags

  • DepthMod
    • How much to slow down amphibian speed when they're underwater

ship only tags

  • MinWaterDepth
  • MaxWaterDepth
  • SubMarine

Special notes

  • Hover movetypes require "HOVER" in the name to work
  • Ship movetypes require "SHIP" or "BOAT" in the name to work
  • Tank movetypes require "TANK" in the name to work
  • KBot movetype is default
  • depth is measured in elmos
  • Slope is not measured in degrees.
  • CrushStrength uses mass to determine if a feature cam be crushed by a unit.
    • default feature: mass = metal * 0.4 + maxHealth * 0.1
    • default unit: mass = metalCost

How slope is determined.

Spring doesn't represent terrain slopes in degrees, internally it uses (1.0 - the terrain normal's y-component) so the slope of vertical faces is 1 and that of horizontal ones 0. A unit's maxSlope value (which is in degrees in its movedef) is converted so that the "can we go here?" (ie "maxSlope > terrainSlope?") comparisons are meaningful, the formula is 1.0 - cos(DEG2RAD(maxSlope * 1.5)). If you want to know the terrain angle in degrees, compute RAD2DEG(arccos(1.0 - terrainSlope)). For a kbot with a maxSlope of 36 degrees (~0.41221 in "Spring format"), the maximum tolerable terrain angle is approximately

RAD2DEG(arccos(1.0 - 0.41221))

or 54 degrees. If maxSlope was 30, the MTTA would be 45, and if it was 60 (the highest sensible value due to that 1.5 scalar and the absence of overhanging cliffs) the kbot could mount any terrain. In other words you do not need the long mathematical derivation, just remember that maxTerrainAngle = maxSlope * 1.5 -kloot, Thu Jul 31, 2008