Structsยง
- Airship
Route ๐Context - The context data for the pilot_airship action.
- Distance
Trend ๐Tracker - Tracks airship distance trend from a fixed position. Used for airship traffic control. The parameter C is the threshold for determining if the trend is stable (i.e., not increasing or decreasing too much).
- Moving
Average ๐ - A moving average of at least N values and at most S values.
- Rate
Tracker ๐ - Tracks previous position and time to get a rough estimate of an NPCโs velocity.
- Stuck
Airship ๐Tracker - Tracks the airship position history. Used for determining if an airship is stuck.
Enumsยง
- Airship
Avoidance ๐Mode - Airships can slow down or hold position to avoid collisions with other airships. Stuck mode means the airship was stuck in one position and is not backing out and climbing to clear the obstacle.
- Airship
Flight Phase - The flight phases of an airship.
- Distance
Trend ๐ - The trend of the distance changes. The distance measured could be between a fixed position and an NPC or between two NPCs.
Constantsยง
- CLOSE_
AIRSHIP_ ๐SPEED_ FACTOR - CLOSE_
TO_ ๐DOCKING_ SITE_ DISTANCE_ SQR - CRUISE_
CHECKPOINT_ ๐DISTANCE - MOVING_
AVERAGE_ ๐SCALE_ FACTOR - NEXT_
PILOT_ ๐CRUISE_ SPEED_ TOLERANCE - NEXT_
PILOT_ ๐MOVING_ DIST_ AVERAGE_ CAPACITY - NEXT_
PILOT_ ๐MOVING_ DIST_ AVERAGE_ MIN_ SIZE - NEXT_
PILOT_ ๐MOVING_ DIST_ TRACKER_ THRESHOLD - NEXT_
PILOT_ ๐MOVING_ VELOCITY_ AVERAGE_ CAPACITY - NEXT_
PILOT_ ๐MOVING_ VELOCITY_ AVERAGE_ MIN_ SIZE - NEXT_
PILOT_ ๐SPACING_ THRESHOLD_ SQR - NEXT_
PILOT_ ๐VELOCITY_ RATIO_ MIN - VERY_
CLOSE_ ๐AIRSHIP_ DISTANCE_ SQR
Functionsยง
- approach_
target_ ๐pos - Get the target position for airship movement given the target position, the default height above terrain, and the height above terrain for the airship route cruise phase. This samples terrain points aound the target pos to get the maximum terrain altitude in a 200 block radius of the target position (only checking 4 cardinal directions). and returns the input approach_pos with z equal to the maximum terrain alt + height or the default_alt whichever is greater.
- fly_
airship ๐ - Wrapper for the fly_airship action, so the route context fields can be reset.
- fly_
airship_ ๐inner - The action that moves the airship.
- fly_
inner_ ๐default_ goto - The normal controller movement action of the airship. Called from fly_airship_inner() for cases that do not mean the airship is avoiding the airship ahead of it on the route.
- log_
airship_ ๐position - When the logging feature is not enabled, this should become a no-op.
- pilot_
airship - The NPC is the airship captain. This action defines the flight loop for the airship. The captain NPC is autonomous and will fly the airship along the assigned route. The routes are established and assigned to the captain NPCs when the world is generated.
- should_
hold ๐ - My airship should hold position if the next pilot is moving towards my docking target and is close to my docking target and my pilot is close to the next pilot.
- should_
slow_ ๐down - My pilot should slow down if the pilot ahead is moving towards my target docking position and the ratio of next pilot velocity over my velocity is less than a threshold (i.e. the next pilot is moving slower than my pilot), and the distance between the next pilot and my pilot is less than some fraction of the standard airship spacing, and the distance between my pilot and my docking target position is greater than the distance between the next pilot and my docking target position (i.e. the next pilot is inside my radius from my target docking position).