Physics

Contents

Overview - Details general physics information.

Player Physics - Details variables and files regarding player physics.

Platform Physics - Details variables and files regarding platform physics.

Remarks - General and misc. information.

Overview

The various physics files define a variety of variables/values that can be redefined to control the physics of the game. Note that this effects the game on a global scale and cannot be defined to only impact specific areas. Modifying the different physics files can lead to some drastic changes to gameplay and can even create entirely new methods of play, making it an extremely powerful modding tool.

The physics files are split into two main categories: player physics, which defines variables directly relating to the control and feel of the player; and platform physics, which defines variables controlling how the various tag movement tiles move tiles/entities.

Player Physics

Location in the unpacked data: data\playerphysics.txt
Location in the unpacked data: data\playerphysics_lowgrav.txt
Location in the unpacked data: data\playerphysics_water.txt

The player physics files define a variety of different variables relating specifically to how the player moves throughout the game world. The values will control, movement speed, jump height, long-jump speed, and much more. Player physics is split into three different files, all containing the same variables: the first, playerphysics.txt, is the standard physics for the player when moving around levels, on ground and in air; the second, playerphysics_lowgrav.txt, is the physics used when the player is within a gravitational-pull beam; and the third, playerphysics_water.txt, is the physics applied when the player is currently in a liquid (water, or toxic water). The variables contained within these three files are as follows:

gravity - The gravity applied to the player normally.
leniency - The amount of time a player can fall through the air and still jump.
max_fallspeed - The maximum speed the player can reach whilst fall.
maxspeed - ???
runspeed - The maximum movement speed of the player.
ground_friction - The friction applied to turning whilst on the ground.
stop_friction - How quickly the player stops moving after releasing a move key.
air_friction - The friction applied to turning whilst in the air.
fastfall_gravity - The gravity applied to the player whilst fast-falling.
fastfall_jerkdown - Inital jerkdown force applied to the player when fast-fall is initiated.
fastfall_maxspeed - The maximum speed the player can reach whilst fast-falling.
float_time - ???
jumpheight - The max height of the player’s jump.
release_jumpheight - The height of the player’s short hop (tapping the jump button).
longjump_slidethreshold - ???
longjump_speed - The speed at which the player moves during a long jump.
longjump_height - The height gained when performing a long jump from a ledge.
longjump_airfriction - The friction applied to turning during a long jump.
ledgejump_height - The height gained from a normal ledge jump (not a long jump).
enemy_bounceheight_nojump - The height gained by the player when bouncing off an enemy.
enemy_bounceheight_jump - The height gained by the player when bouncing off an enemy with a jump.
mush_bounceheight_nojump - The height gained by the player when bouncing off a spring.
mush_bounceheight_jump - The height gained by the player when bouncing off a spring with a jump.
enemy_prebounce_time - ???
enemy_postbounce_time - How long the "no jump" bounce force is applied for? (Impacts no jump bounce height.)
swimspeed - The speed the player moves horizontally in the water.
water_exitheight - The height gained when jumping out of the water.

Platform Physics

Location in the unpacked data: data\platformphysics.txt

The platform physics file defines a variety of different variables relating specifically to how the various movement tag tiles will move tiles aroud levels. The speeds for each tile type can be set from within this file, which contains the following variables:

MovingPlatformSpeedLow - The speed at which tags F8-G1 move tiles.
MovingPlatformSpeedMed - The speed at which tags G2-G5 move tiles.
MovingPlatformSpeedHigh - The speed at which tags G6-G9 move tiles.
SmoothMovingPlatformSpeedXSlow - The speed at which tags N2-N5 move tiles.
SmoothMovingPlatformSpeedLow - The speed at which tags ID-I5 move tiles.
SmoothMovingPlatformSpeedMed - The speed at which tags I6-I9 move tiles.
SmoothMovingPlatformSpeedHigh - The speed at which tags J0-J3 move tiles.
FallingPlatformGravityLow - The speed at which tag F2 makes tiles fall.
FallingPlatformGravityMed - The speed at which tag F3 makes tiles fall.
FallingPlatformGravityHigh - The speed at which tag F4 makes tiles fall.
WeightedPlatformSpeedSlow - The speed at which tag L7 makes tiles move.
WeightedPlatformSpeedMed - The speed at which tag L8 makes tiles move.
WeightedPlatformSpeedHigh - The speed at which tag L9 makes tiles move.
SmasherSpeedLow - No effect.
SmasherSpeedMed - No effect.
SmasherSpeedHigh - No effect.
SmasherDelayLow - No effect.
SmasherDelayMed - No effect.
SmasherDelayHigh - No effect.

Remarks

The physics variables are handled globally and, currently, cannot be modified to only be applied in certain areas of the game. This limits some potential uses that physics modifications could potentially have.

Removing a variable from any of the physics files will lead to it being assigned a default value, most likely 0. However, leaving a variable without a value in the file will result in undefined and obscure behaviour from the game and is not recommended at all.