Skip to content

Gates: the Nebákov, Semín and lower Trosky gates are Gates - #344

Closed
Kharote wants to merge 11 commits into
mainfrom
feat/brush-gates
Closed

Kharote wants to merge 11 commits into
mainfrom
feat/brush-gates

Conversation

@Kharote

@Kharote Kharote commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

What this changes

Some gates are drawn as part of the map (level brushes), not as objects or layer series of their own, so Gate did not list them and nothing could open them: Nebákov's gate (gate_nebakov.cgf), the lower gate of Trosky (gate_blocks_b_door.cgf), and Semín's two gates (gate_b_doors_wing_left/right, barn_door_a_left/right). Hiding them with LevelEdit left their collision, which is a separate collider of the level standing beside the model.

  • Dev/tools/gates/build_catalog.py adds hand-chosen brush gates (BRUSH_GATES) with the states closed and open: brush/nebakov_gate, brush/trosky_lower_gate, brush/semine_gate, brush/semine_barn_gate. GateSeries gets the brush leaves (mesh, open mesh), a swing angle and whether the map shows the gate open.
  • Client (gates/series): a brush gate's leaves are the shown brushes of those meshes nearest its centre, looked for until the player comes near. The variants of a leaf in its place on hidden layers (barricaded, broken) are taken out with it. Each player's game stands its own copies, like the other series.
    • A gate drawn as one model of both leaves fades into the game's own opened model (gate_nebakov_opened, gate_blocks_b_door_open).
    • Other leaves turn on their hinge, the leaf's origin, all to the same side. Semín's leaves stand ajar in the map, so that pose is their open state and they swing shut.
    • The gate's walls: the level's upright colliders standing in its leaves (level::upright_colliders, at least half the leaf's height, so a gateway's floor is never taken) stand while the gate is in the map's state and are held out in the other (level::hold_colliders), from the moment a move begins.
  • The server's Gate lists them from catalog.json with no other change: setState, open, close, toggle, late joiners.

Docs: KCD-Synced/KCDS-DOCS#98.

How it was tested

  • gates.test.cjs: new test, the four brush gates are found on trosecko with closed/open, and opening one sends the gate state; 10 pass.
  • Kit (one game on trosecko, Gate.setState from a kit command, rays across each gate):
    • Nebákov: closed, the ray stops at the gate (6.19 m); open, it passes through to the roof behind (7.82 m); closed again, blocked.
    • Lower Trosky gate: closed, the ray hits the closed copy; open, the open model (3.77 m); closed again.
    • Semín: all leaves and their hidden variants taken over (4 brushes each). Both stand open as the map has them; closed, the wing gate's leaves shut the arch and stop the ray (3.98 m), the barn doors shut flush (pictures). The barn door model has no collision of its own and the map stands no wall beside it (its doors are open), so shut barn doors do not stop people.

Checklist

  • I read CONTRIBUTING.md and agree that my contribution is licensed as it says.
  • The change is my own work: no code, assets or dumps that are not mine or that come from the game.
  • python Dev/tools/format_source.py --check passes.
  • Tests cover the change, and the checks of this pull request pass.
  • Public behaviour that changed is documented (KCD-Synced/KCDS-DOCS) or needs no docs.

@Kharote Kharote mentioned this pull request Nov 24, 2026
5 tasks done
@Kharote

Kharote commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

Shipped in 1.2.1 (#349, release v1.2.1).

@Kharote Kharote closed this Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant