Log inGet started
World

Sengoku Trance

Branchmain
Branchesmain
Commitdc4575bacb

README.md

venue

The place SENGOKU TRANCE happens in. This module owns the great torii, the raised stage and its decks, the backdrop, the crowd, the speaker stacks, the overhead truss and its moving heads, the lasers, the haze, the lanterns, the banners, and the beat-reactive light rig that drives all of it. Everything it builds is parented under the Venue scene anchor.

It is also the slice responsible for not drowning the note highway. See "The corridor" below — that is the load-bearing part of this module, not a footnote.

Exports

  • M.mount() — build the venue and its rig. Called once by the scene.
  • M.tick(dt, songTime) — drive the light show. Called once a frame.
  • M.unmount() — tear down the emitters and drop the bus subscriptions.
  • M.setStage(stageId) — put the venue into one of the three rooms ("okehazama" / "nagashino" / "honnoji") without waiting for a duel. Useful for staging shots and for looking at the thing.
  • M.setPhase(kind) — set the rig's temperament to a section of the track ("intro" / "groove" / "build" / "drop" / "outro"). Also moves the bloom, within a cap.
  • M.report() — what the rig is right now: stage, weather, phase, and the count of beams, crowd banks, wash lights, lanterns and emitters.
  • M.corridorReport() — how many laser samples and how many pieces of geometry are currently inside the note highway's protected volume. The requirement is zero, and this is the number that says so.

Usage

local ST = require("game.core")
local V = ST.need("game.venue")
if V then
    V.setStage("honnoji")
    V.setPhase("drop")
    print(V.corridorReport().inside)      --> 0
end

What drives it

The rig reads ST.clock.beat() and derives the beat phase itself, so it needs no conductor to be alive. When the clock is not bound to a deck — the title screen, a staged beat, an agent looking at the scene in the editor — the room keeps dancing at the current stage's own BPM rather than freezing; a venue that only moves during a duel is a venue almost nobody sees move.

It also listens on four bus topics, all optional:

topicwhat it does
duel.beginswaps the room to that duel's look and weather
phase.changesets the rig's level and the bloom
note.hitkicks the wash and widens the beams, harder for a KIWAMI
note.missa brief stumble in the rig

The corridor

The note highway owns a volume and a screen region, and nothing this module draws may enter either:

  • World box — x ±2.9 m, y −1.2 … 5.5 m, z −4 … 16.1 m (the receptor line up to 62% of the way along the highway).
  • Screen rectangle — the central 47% of the frame's width, from the bottom edge up to just above the middle. The world box alone is not enough: a beam thirty metres behind the highway still projects straight down the middle of a 3:4 frame and lands on the lanes as far as the player's eye is concerned. That was found by capture, not by reasoning.

Every laser is sampled along its length each time it is aimed. A sweep that would put any sample in either region is refused, and the head holds its last safe heading. M.corridorReport() runs the same test over the whole rig and answers with counts.

Strobes are the moving heads' own lenses and the stage wash lights — small, local, and capped. Nothing here writes exposure, clear colour, or a full-screen flash, so a strobe cannot black out an incoming note. The haze, the rain, the gunsmoke and the embers are all additive: they can wash a note but they cannot hide one.

The three rooms

stageweatherbeamsair
OKEHAZAMArain, in curtains either side and behind the stagecyan / white / violetcold blue
NAGASHINOgunsmoke walls, a stockade of stakes, muzzle flashes on the beatacid / gold / whiteochre
HONNŌ-JIthe temple roof burning behind the torii, embers, a smoke columnmagenta / ember / goldember red

Notes

  • Art lives in /source/art/venue/ — the venue_glow shader behind every beam, the venue_air depth-haze post-process, and the vn_* materials.
  • The module registers two post-process effects (bloom, vignette) if the chain does not already carry them, and one of its own (venue_air). It never removes an effect it did not add.
  • Particle emitters spawn their own render entity outside the anchor tree; M.unmount() destroys every one it created.