Jump to content

Paths

From HEModdingWiki
Revision as of 15:27, 6 January 2025 by Angryzor (talk | contribs) (Created page with "Paths are common to all versions of the Hedgehog Engine, and play an important role in many of its features. In essence, paths are 3D splines or curves, which the engine uses for many things, e.g.: * Player automation (like autorun volumes and grinding). * Camera movement (for cameras like the Rail family of cameras). * Confinement of the player to a 2D side view. * Movement of ballistic projectiles. * Calculation of the player's movement when using gimmicks like spring...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Paths are common to all versions of the Hedgehog Engine, and play an important role in many of its features. In essence, paths are 3D splines or curves, which the engine uses for many things, e.g.:

  • Player automation (like autorun volumes and grinding).
  • Camera movement (for cameras like the Rail family of cameras).
  • Confinement of the player to a 2D side view.
  • Movement of ballistic projectiles.
  • Calculation of the player's movement when using gimmicks like springs.
  • Placement of replicated game objects on a curve.
  • Automatic generation of grind rails.

Paths can be contained in either path resources, generated at runtime when objects need them (e.g. for springs or ballistic projectiles), or they can be generated by special set objects in the "Set Path" family.

Structure of a path

Paths in HE are defined as a series of "path segments" connecting "path nodes". Each of these path nodes is composed of 5 components:

  • The position vector, which defines where the path node is located.
  • The forward vector, which defines the tangent to the path at the location of the node.
  • The up vector, which defines which direction is "up" in the game world, similar to the up vector used to calculate a view matrix.
  • The distance along the path where the node is located.
  • A boolean flag that decides whether the segment it starts is a straight segment or an SNS (Smooth Nonuniform Spline) segment.

Resource-defined also define a length. Resource-defined paths may additionally describe 2 additional side paths. These can be used to generate triple rails (someone please confirm if this is correct).

Segment types

Straight

Straight path segments are very straightforward: they are straight.

Smooth Nonuniform Spline

Smooth Nonuniform Splines are a type of nonuniform spline. While it is difficult to find clear information about this type of spline, the nomenclature seems to originate from the 4th volume of Game Programming Gems. The book describes the following distinctive properties of these types of splines: