Skip to content

Entity: AreaVolume

NoneGiven edited this page Jul 11, 2022 · 20 revisions

An area volume is an invisible entity which sends messages when other entities enter or exit its associated collision volume. Area volumes are similar to triggers, with the main differences being that area volumes always use a collision volume rather than having different means of triggering, and that the entry message is sent repeatedly while an entity is inside it, rather than only on the first frame it enters. The exit message is sent once on the frame an entity leaves the volume.

Because of these characteristics, area volumes are usually used for persistent areas of effect, such as part of a room that damages the player, a low-gravity zone, or an area where the player can't switch forms. They are less often used to trigger room events in single-player mode. Another unique feature of area volumes is the priority and overlap system, which is used in Head Shot to create a volume of normal gravity inside the structure, encompassed in a larger volume of low gravity which only takes effect if the player is not also inside the inner volume.

The trigger flags field determines what can trigger this entity; in practice, area volumes are never set to be triggered by beams. Normally, the entry message is sent to the parent entity, and the exit message is set the child entity. However, the following message types are always sent instead to the player who triggered the volume (or player who owns the beam which did so): damage, death, gravity, prevent form switch, and Drip Moat platform lock.

Entity type: 8

See also: Visualization Guide (Part 1, Part 2)

File struct

  • Size: 0x94 (148)
Offset Size Type Name Description
0x00 40 EntityDataHeader Header
0x28 64 CollisionVolume Volume Effective area
0x68 2 --- Unused68
0x6A 1 byte Active Boolean
0x6B 1 byte AlwaysActive Boolean
0x6C 1 byte AllowOverlap Boolean; whether to trigger if player is in more than one
0x6D 1 byte MessageDelay Number of frames to queue outgoing message (0 or 1)
0x6E 2 --- Unused6E Boolean?
0x70 4 uint EntryMessageType Message type ID to send when player is inside
0x74 4 uint EntryMessageParam1 Message-specific data
0x78 4 uint EntryMessageParam2 Message-specific data
0x7C 2 short ParentId Entity ID or -1
0x7E 2 --- --- Padding
0x80 4 uint ExitMessageType Message type ID to send when player is outside
0x84 4 uint ExitMessageParam1 Message-specific data
0x88 4 uint ExitMessageParam2 Message-specific data
0x8C 2 short ChildId Entity ID or -1
0x8E 2 ushort Cooldown
0x90 4 byte Priority Boolean
0x94 4 uint Flags

Runtime class

  • Size: 0xBC (188)
Offset Size Type Name Description
0x00 24 CEntity Entity Runtime entity base class
0x18 12 vec3 Position
0x24 12 vec3 Facing Unit facing avector
0x30 12 vec3 Up Unit up vector
0x3C 1 byte Active Boolean
0x3D 1 byte AllowOverlap Boolean; whether to trigger if player is in more than one
0x3E 1 byte MessageDelay Number of frames to queue outgoing message (0 or 1)
0x3F 4 byte[4] TriggeredSlots Which players have triggered this, indexed by player slot
0x43 4 byte[4] PrioritySlots Indexed by player slot
0x47 1 --- --- Padding
0x48 4 uint EntryMessageType Message type ID to send when player is inside
0x4C 4 uint EntryMessageParam1 Message-specific data
0x50 4 uint EntryMessageParam2 Message-specific data
0x54 4 uint ExitMessageType Message type ID to send when player is outside
0x58 4 uint ExitMessageParam1 Message-specific data
0x5C 4 uint ExitMessageParam2 Message-specific data
0x60 4 uint Flags Same as file struct
0x64 2 ushort Priority
0x66 2 ushort Cooldown
0x68 8 ushort[4] CooldownSlots Indexed by player slot
0x70 4 uint Parent Pointer to parent entity (Initially set to ParentId)
0x74 4 uint Child Pointer to child entity (Initially set to ChildId)
0x78 4 uint NodeRef Pointer to node ref
0x7C 64 Collision volume Volume Effective area

Flags

Bit Mask Flag Description
0-7 Beams Triggered by the corresponding beam if 1 << beam_id is set
8 0x100 Charged If set, beams only trigger if charged
9 0x200 Biped Triggered by player in biped form
10 0x400 Alt Triggered by player in alt form
12 0x1000 Bots If cleared, players only trigger if not bots

Only players and player beams are checked for collision with the volume. Weavel's Halfturret does not count as a player.

Note: The Omega Cannon (beam ID 8) will trigger volumes with the Charged flag set, platform beams (beam ID 9) will trigger volumes with the Biped flag set, and enemy beams (beam ID 10) will trigger volumes with the Alt flag set (subject also to the Charged flag). These behaviors are not observable in practice with either area volumes or triggers.

Examples

Entry Type 0 - None

Orange is used here to distinguish the volume. MphRead displays these volumes in black.

00-01 00-02

Entry Type 5 - SetActive

5-01

Entry Type 7 - Damage

7-01 7-02 7-03

Entry Type 15 - Gravity

15-01 15-02

Entry Type 18 - Activate

18-01 18-02 18-03

Entry Type 21 - Death

21-01 21-02 21-03

Entry Type 23 - Ship Hatch

23-01

Entry Type 25 - Unknown/Unused

25-01

Entry Type 35 - Prevent Form Switch

35-01 35-02 35-03

Entry Type 44 - Platform Wakeup

44-01 44-02

Entry Type 46 - Drip Moat Platform Lock

46-01

Entry Type 56 - Unlock Oubliette

56-01

Entry Type 57 - Checkpoint

57-01 57-02 57-03

Entry Type 58 - Update Escape Sequence

58-01

Clone this wiki locally