Introduction

The alien moves through the ceiling. It climbs up into a vent, travels unseen, and drops out of another vent somewhere else - to hunt, to escape when it is flamed, to leave when the script sends it away. In your own level it can only do that through vents: the game's vent composites, placed under ceilings, and the backstage navmesh a Save and Build bakes from them.

A level with an alien and no vents crashes the game the first time the alien retreats - when it is flamed, sent away by the script, or after an ambush - because it asks for the nearest vent and there is none. Level Check and Save and Build say so.

File → Alien Vents... finds spots for vents, places the game's own vent composites there, and checks that the alien will be able to use them.

How the Alien Uses Vents

A vent is a composite holding a PathfindingAlienBackstageNode: the point on the floor where the alien stands to climb in (and lands when it drops out), the clips it plays going up and coming down, and the vent's kill trap. The composite's origin is the vent itself, in the ceiling; the node stands the vent's height below it, on the floor.

While the alien is in the vents it is "backstage": hidden, moving over a sheet of navmesh that Save and Build makes 6 m above the vents' floor points, joined to the floor by a link up into each vent. That sheet and those links are what let it travel from one vent to another.

The Vent Composites

The game's levels use three, and the helper picks between them by the height of the ceiling over each spot:

  • 4.25 m - Archetypes\Jobs\VentTraversalMarker, the most common (corridors, low rooms). For ceilings 3.2 to 5.1 m up.
  • 6 m - Archetypes\Jobs\VentTraversalMarker6M. For ceilings 5.1 to 7.6 m up.
  • 9 m - Archetypes\Jobs\VentTraversalMarker9m, for tall halls. For ceilings 7.6 to 12 m up.

A vent doesn't need its ceiling at exactly its height: once the alien is in the ceiling it is hidden, so the game's own levels mix them freely. The composites are the game's own, so they aren't shipped with OpenCAGE: when your level doesn't have one yet it is brought in from a level of your game install that has it (PRODUCTION/TECH_HUB has all three), the way Import Composites From Level does - with its effects and sounds. Like any import that can't be undone; the vents you place can.

Networks and the Backstage

Each vent has a Network_ID (0 unless you change it). The backstage sheet is made for each network on its own, over that network's vents - so the alien only travels between vents of one network. A network needs:

  • 3 or more vents, not in a line. With fewer, no sheet can be made: the alien climbs into a vent and has nowhere to go.
  • Vents more than 10 m apart. When the alien breaks out it goes to a vent more than 10 m from where it went in.
  • Each vent's floor point on the navmesh the alien walks, or the link up into it joins nothing.

Spread the vents over the area the alien hunts: it uses them to close in on the player, too.

Adding Vents

Save and Build your level once first (the helper looks for spots on its navmesh), then open File → Alien Vents... - or, if Level Check says "The alien has no vents to retreat into", press its Add vents... button.

The Alien Vents window: what the level has (its vents per network, the backstage sheet, the saved navmesh), the options, the spots found with their ceiling height, vent kind and facing, and the buttons Find Spots, Check Vents, Place Ticked Vents and Save and Build.

  1. The top of the window says what the level has: whether the alien can spawn without vents, its vents and networks, and what the saved navmesh has baked.
  2. Press Find Spots. The spots appear in the list, each with its ceiling height and the vent that fits it, and the line below says how many were wanted and why the others were turned down.
  3. Untick any you don't want, then press Place Ticked Vents. They are placed in the composite shown under Put them in (the root, or the one on display), named AlienVent_1, AlienVent_2 and so on, on a flowgraph page called AlienVents. It's one step on the undo history.
  4. Press Save & Build - it is the editor's own Save and Build - to bake the backstage.

Placed vents are ordinary entities: move one with the Viewport gizmo or its position (the vent itself; its floor point is the vent's height below), delete one, or set its pins in the inspector.

How Spots Are Chosen

The helper samples the navmesh the alien walks on (big areas only - not the tops of crates) and keeps a spot when:

  • there is a ceiling over it, facing down, 3.2 to 12 m up, that one of the three vents fits;
  • the column up to it is clear - the same ceiling 0.7 m round, not its edge, no beam, pipe or stairs in the way;
  • the floor round it is flat (no drop or step within 1 m) and there is no wall or prop within 1 m.

From those it picks the spots farthest apart: first the one farthest from the middle, then each time the one farthest from every vent so far - your level's own vents included - until it has enough, or no spot is Spacing metres from every vent. Each vent faces the most open way, toward the middle of the area. It reads your level's collision as it is now (unsaved edits included) and the navmesh as the last Save and Build made it.

Options

  • Vents to add - 0 adds as many as the floor area calls for (about one per 250 m², 3 to 12, counting the network's own).
  • Spacing - the least distance between two vents (8 m).
  • Kind - by the ceiling over each spot, or one of the three for every vent.
  • Network ID - the network the new vents join.
  • Kill traps on - the game's own vents can pull a player standing under one up into it, when the alien is in it. Off by default (the vents' DisableKilltrapOnReset is set), since your ceiling has no vent model for it to come out of.
  • Put them in - the root, or the composite on display (placed once).

Save and Build

Vents only work through the navmesh: Save and Build with the navmesh baker on makes the backstage sheet over each network and the link up into each vent. Vents add no models, so they don't need the lighting baked again (Options → Save/Build → Don't Rebuild Radiosity keeps a big level's build quick). A plain Save doesn't bake them.

Level Check

Every Save and Build, and Level Check at any time, checks the alien and its vents:

  • The alien has no vents to retreat into (crash) - its Add vents... fix opens the Alien Vents window.
  • The alien vents make no backstage - a network with fewer than 3 vents. Add vents... adds the ones missing.
  • Alien vents stand in a line - the backstage is a narrow strip along the line, not a sheet over the area.
  • Alien vents are all within 10 m of each other - the alien has nowhere to break out to.
  • Alien vents are not in the navmesh yet - Save and Build with the navmesh baker.
  • Alien vents stand off the navmesh - the alien can't walk to them: move them so their floor point is on walkable floor.

The Level Check window with the finding 'The alien has no vents to retreat into' selected and its Add vents... button.

These only look at vents you placed or changed: the game's own levels keep the vents they ship with.

Testing in Game

A test room made with Create Level: the alien leaping up into a 6 m vent placed by Alien Vents in the corner of the room.

A test room made with Create Level, its vents placed by Alien Vents: the alien hunting the player climbs into the nearest vent, crosses the room unseen in the ceiling, and drops out of another vent near where it heard the player.

With the Debug Menu on, the alien's state says when it is in the vents (ai.flags: backstage, and in_backstage_transition while it climbs in or drops out), and Alien → backstage target draws where it is heading. A vent's reached_top and reached_bottom pins fire when the alien has climbed into it and dropped out of it: link them to a DebugText to see which vents it uses.

To send the alien into the vents from your script, as the game's own missions do: a TriggerBindCharacter whose characters links to the alien's npc_reference, its bound_trigger to an NPC_WithdrawAlien's trigger (time_to_force 0 sends it at once, permanent off lets it come back; its cancel brings it back).

For AI Assistants

An AI assistant connected to OpenCAGE adds vents with add_alien_vents (the spots found, or spots it gives; count, spacing, kind, network_id, killtraps, region; dry_run lists the spots and what would be brought in) and checks them with check_alien_vents (every vent, each network's sheet, what the navmesh has baked, the problems). check_level and fix_level_check report and fix the Level Check findings above.