Log inGet started
World

First Light: Lavic Odyssey

Branchmain
Branchesmain
Commit1698ee71e5

README.md

game.rules.Rules

The round of FIRST LIGHT: LAVIC ODYSSEY. One component, mounted by the scene entrypoint on mount_rules, owning what state the game is in and when that changes. Everything else reads it through game.lavic — L.state for what is true now, L.bus for the moment it became true.

The phases

title ──requestStart / Continue──▶ opening ──openingDone / Continue──▶ play
                                                                        │
                             requestPause / Pause ◀────────────────────┤
                                        │                               │
                                     paused ──requestResume / Continue──┘
                                        │
play ── rim reached ──▶ (rimReached, the finale's chance) ──finaleDone──▶ won
play ── lava over the head, or heat at 100 ─────────────────────────────▶ lost
won / lost ──requestRestart / Again / Continue──▶ play   (a fresh round, no opening)

requestStart / requestRestart / requestResume / requestPause come from the screens slice's cards; openingDone / finaleDone from the staging slice's moments; the same transitions are reachable from this slice's own hold map, so a round is playable with neither of them mounted.

A staged moment gets first refusal on the opening and on the end. While the staging slice is on its mount the round waits for it to say the moment is done, capped at stagingCap seconds and skippable with Continue at any point. With nothing mounted there the round continues by itself after stagingGrace.

What it emits

phase · helm · heat · canto · freeHeld · rimReached · skipCutscene · won · lost · restart · lava (only while no lava slice is writing it).

What it reads

requestStart requestRestart requestResume requestPause openingDone finaleDone cutscene emberHit lava localPlayerReady bodyReady.

The controls

Two maps, and the second is what makes the first honest.

  • game.input.lavic (group climb) is the climb: Move, Look, Jump, Scramble, Helm, Free, Pause. This component points the humanoid's CharacterController and the follow camera's third_person_follow at it, on the prototype so a joining player arrives with it, and on the live body once it appears — both of those read inputMap once, when they come up, so the live pair are taken off and put back with the field already set rather than having the field written underneath them.
  • game.rules.hold (group hold) stands climb and player down whenever the round is not in the player's hands, and carries Continue and Again.

climb suppressing player is what keeps the engine's own default map off the screen: the player prototype's controller and camera rig hold it live whether or not anything reads it, so without that line a phone shows this game's four buttons beside a built-in Crouch, Interact, Zoom and Pointer Lock.

The camera

game.rules.framing solves the follow rig from ui.screenSize() — the vertical field of view backwards from a target horizontal one, the distance from the aspect, and the aim point raised by a share of the visible height so the pilgrim sits 40% up the frame on any screen. The component installs it on the local player's camera and re-solves it whenever the screen changes shape.

Fields

FieldMeaning
walkSpeedThe pilgrim's ground speed, m/s.
jumpForceTake-off speed, m/s, for the jump the ledges are spaced against.
scrambleMultiplierSpeed multiplier while Scramble is held.
stagingGraceSeconds the round waits before continuing when no staging slice is mounted.
stagingCapLongest a staged moment may hold the round.