Skip to content
mrchengPublic

Latest commit

 

History

129 Commits

Folders and files

Repository files navigation

Left Right

Play in your browser: https://mrcheng.github.io/leftright/ - choose Create Online Drill and share the code, or Join Online Drill. Keyboard: A/D to move and S to jump.

Unity 6.6 project (6000.6.9f1) containing the playable prototype and a separate starting point for its rebuild.

Prototype snapshot

The annotated Git tag prototype-v1 preserves the full working project before cleanup, including scripts, assets, package versions, settings, and smoke checks. A scene copy alone would still share those dependencies.

For an independent reference checkout, run git worktree add --detach ../leftright-prototype prototype-v1 and open that directory as a separate Unity project. That snapshot uses the original scene path, Assets/Scenes/Scene1.unity. Keep the tag unchanged. The tag and snapshot commit are also available on origin.

The prototype remains playable at Assets/Prototype/Scenes/Prototype.unity. Use LeftRight > Open prototype reference, then Play. Its assets and runtime code live under Assets/Prototype; treat them as reference material. Git preserves the exact original even if these working files change later.

Rebuild

Open Assets/Rebuild/Scenes/Main.unity, or use LeftRight > Open rebuild. It contains a low-poly military outpost: four raised walkways, a command post, barracks, tents, sandbags, wire, watchtowers, and forest scenery. Put new scripts in Assets/Rebuild/Scripts, using the LeftRight.Rebuild namespace. Its assembly has no dependency on the prototype assembly. Main now has four controlled recruits and a beat-driven spike course, including elimination, game over and restart.

RecruitController owns input and movement, RecruitMarch owns the character animation, and SpikeCourse owns penalties and round results. The new course replaces platform shrinking with closing spike pillars. Player-count selection, menus and additional pickup types remain future work; the first health-crate powerup is connected.

Avoid editing prototype assets to serve the new game. Copy a needed visual asset into the rebuild through Unity so it gets its own GUID. Keep render pipeline settings shared until the rebuild needs different rendering. Audio is intentionally shared: Assets/Rebuild/Settings/PrototypeAudio.asset references the exact original title/round music, direction calls, footsteps, landing, and health-pickup clips. Play Mode waits three seconds, then starts the original title music on its opening beat; OutpostAudio exposes the other cues for the future game flow.

The prototype remains the enabled build scene. Main is listed but disabled; switch the build entry point when the rebuild is ready to ship. LeftRight > Build prototype for Windows always builds only the prototype.

Environment assets

The starter models are from Kenney Survival Kit 2.0, released under CC0. This is a general survival/camp kit, dressed here as a fictional WWII-inspired outpost. The selected FBX files, palette texture, original license, and provenance live in Assets/Rebuild/Art/KenneySurvivalKit. The full original download is retained outside Unity imports in SourceArt/Environment/KenneySurvivalKit.

Additional military props were made in Blender: SourceArt/Environment/OutpostProps.blend is the editable prop library, and build_outpost_props.py regenerates its FBX exports. Run blender --background --python SourceArt/Environment/build_outpost_props.py, let Unity finish importing, then use LeftRight > Rebuild > Build outpost environment to regenerate the arrangement. This replaces the generated Outpost Environment hierarchy; keep manual scene additions outside it. Material tweaks belong in the builder/palette if they need to survive regeneration. The saved prefab is Assets/Rebuild/Prefabs/OutpostEnvironment.prefab.

See the environment preview. The original prototype scene and art have not been changed for this environment work.

With Main open in Play Mode, run unity command script eval --file Tools/Rebuild/VerifyOutpost.cs --timeout 60 for the environment and audio checks. All 52 checks passed after setup, including model scale, walkway colliders, materials, camera/listener counts, and the original audio palette/playback. These checks exercise the audio outputs, so expect music and short sound cues.

RebuildRoundStart owns startup: three seconds of silence with the officer still and both tower floodlights off, then music, marching, a randomly selected first left/right cue, and its matching floodlight start together. Music is scheduled on the DSP clock from the measured opening beat, skipping the short pre-beat pickup. Subsequent direction cues alternate right/left with a fresh random 2–5 second wait, matching the prototype's ongoing pattern. The active arm swings out over 0.25 seconds and holds exactly horizontally while the other arm lowers. The original German voice call plays when each direction changes. Future start-screen logic can call BeginRound/CancelStart and switch off RebuildRoundStart.playOnStart. OfficerDirections also exposes ActivateDirections, StopDirections, DirectionRight, IsIdling, and DirectionChanged for the round rules. LeftRight > Rebuild > Update round start timing installs the startup coordination without rebuilding the environment. Tools/Rebuild/VerifyRoundStart.cs passed 17 checks, including silence during the lead-in, first-beat alignment, cancellation, and restart; VerifyOfficerDirections.cs checks ongoing cues and floodlights independently.

The instructor now uses an adapted Quaternius soldier matching the recruits' low-poly style, at 1.25 times their standard scale. He wears a black tunic, trousers, boots and peaked cap, with light collar tabs, buttons and a belt buckle; the lectern remains removed. The editable model is SourceArt/Characters/RecruitInstructor.blend; regenerate only him with blender --background --python SourceArt/Characters/build_recruits.py -- Instructor, then run Update marching officer. VerifyInstructor.cs passed 10 model, scale, uniform, pointing and marching checks. OfficerMarch alternates high knees in place, bends the knees to keep the boots level, and swings the free arm while preserving the pointing arm. Footfalls follow the shared MasterBeat clock, with quiet original boot sounds. Title/round beat estimates (115/137 BPM with separate onset offsets) live in PrototypeAudio.asset; the analysis is recorded in SourceArt/Audio/PrototypeMusicBeats.json. Pause, seeking, track changes, and game time scale follow the audio rather than a separate animation timer. LeftRight > Rebuild > Update marching officer updates the rig without rebuilding the environment. Tools/Rebuild/VerifyOfficerMarch.cs passed 15 focused checks. To repeat the onset analysis using Blender's bundled NumPy and the installed FFmpeg, run blender --background --python Tools/Audio/AnalyzeMusicBeats.py.

MasterBeat is the course's shared musical clock, installed by Update round start timing and the scene builder. Other components should reference it instead of calculating their own BPM timers: use BeatPosition for continuous animation, BeatIndex for the current step, BeatPhase (0–1) for progress within a beat, and BeatsPerMinute/SecondsPerBeat for tempo. Check IsPlaying before animating. Subscribe to Beat(long beatIndex) for a pulse or connect an Inspector action to onBeat. Beat zero is the measured opening downbeat; notifications arrive on the first rendered frame observing each beat. Countdown and paused music emit no events; seeking, looping, or a dropped frame emit only the observed beat, without replaying missed events. Restarting resets to beat zero, while track changes select that track's timing. Direction changes retain their existing random intervals. Tools/Rebuild/VerifyMasterBeat.cs checks shared phase, beat events, countdown, pause/resume, game time scale, pitch, seeking, track switching, and restart.

The left flag carries a black L, and the right a black R. The glyphs are textures printed on the cloth, so they deform with it. LeftRight > Rebuild > Update flag letters regenerates them and their separate materials without altering the shared red prop material. Both flags use flexible fabric meshes with their pole edges pinned. WindFlag adds gentle sag, traveling ripples, and wind gusts. Both flags match the right flag's direction and phase, so the fabric extends leftward and ripples together. The fabric is visible from both sides, and each flag animates its own mesh without modifying the shared source asset. This is lightweight procedural wind deformation, without a cloth-physics package. Tools/Rebuild/VerifyWindFlags.cs checks motion, shared wind direction, pinned edges, rigid poles, mesh ownership, and re-enabling.

The rebuild uses a procedural stormy evening sky, with drifting cloud banks, a faint warm horizon, cooler ambient light, and damp distance haze. It adds no external texture pack or weather package. Adjust Assets/Rebuild/Settings/StormEveningSky.mat for cloud cover, drift, colors, and sky brightness. LeftRight > Rebuild > Apply stormy evening applies the matching camp lighting without changing camera framing, and the scene builder uses the same settings. Tools/Rebuild/VerifyStormSky.cs passed 11 checks, including shader compilation, visible cloud variation, evening brightness, and retained framing.

Each watchtower has one roof-mounted floodlight, with an emissive gridded lamp housing and a warm-white spotlight aimed across the lanes and command post. DirectionFloodlights follows the officer: a left cue turns on only the left tower's beam and glowing panel; a right cue turns on only the right. Both are off during the initial neutral wait and when the sequence stops or resets. The lights aim toward their corresponding halves of the stage. LeftRight > Rebuild > Install tower floodlights updates the fixtures without rebuilding the scene, and the environment builder includes them automatically. The mounting and housing models are in the editable Blender prop library. The spots use the existing URP pipeline's lighting capabilities; additional-light shadows are disabled in that shared pipeline.

The four streetlamps remain on independently of the direction cues. Their point lights sit just below the actual lamp heads, with warm pools reaching the ground and nearby structures. LeftRight > Rebuild > Update streetlamp lighting refreshes their brightness, range, bulb emission, and attachment to the fixtures. The update tools rebind imported materials by source name, including the floodlight lens slots, to repair material assignments after FBX re-exports.

Recruits

Main has four recruits plus the officer. The recruits use adapted male/female soldiers from Quaternius Ultimate Animated Character Pack, released under CC0. The green female rifle recruit carries a wooden-stock rifle and ammunition pouches; the blue male sniper has a scoped rifle and camouflage roll; the ochre male mortar carrier has a tube, base plate and support legs; the muted-red female medic has marked medical bags. Skin tones, hair, headgear and equipment distinguish the characters.

Each recruit starts at its lane's center and stands still during the silent lead-in unless the player moves. Once music starts, standing still uses the high-knee march in place. Moving switches smoothly to a straighter-legged military march. RecruitMarch reads MasterBeat; RecruitController moves and turns the recruit according to player input, including during the silent lead-in. MasterBeat.AnimationBeatPosition counts negative beats toward the scheduled opening downbeat for player-controlled walking during the lead-in, then follows the audible music's sample clock. Releasing movement before the music returns the recruit to attention; idle marching never uses the silent count-in. Gameplay beat events still begin with the music. Pausing audible music holds both animation and movement. Restart restores all recruits to center. The animation also supports presentation without a player controller, following the officer automatically in that mode.

Original CC0 Blender files and source hashes live in SourceArt/Characters/Quaternius; adapted editable models live in SourceArt/Characters/Recruit*.blend. Regenerate their FBX models with blender --background --python SourceArt/Characters/build_recruits.py, then use LeftRight > Rebuild > Update four recruits to refresh the scene without changing camera framing or the environment. The full scene builder also installs the recruits. Imported models, materials, license and provenance live in Assets/Rebuild/Art/Recruits. Tools/Rebuild/VerifyRecruits.cs passed 27 Play Mode checks covering count, roles, rigs, materials, grounded support, shared beat, both directions, pause and reset.

Spike pillars

Each walkway has five slim pillars directly on its five yellow end markers, at both ends: eight banks and forty pillars total. All pillars are fully raised from the start, including during the three-second silent lead-in and after restarting; there is no rise animation. The actual spike tips face inward. The platforms keep their full size.

On each master beat, standing still or moving opposite the officer advances both banks on that recruit's lane by 0.45 metres each. Correct movement leaves them still. The opening beat is free, and new cues give half a beat to react. The first spike contact pins that recruit upright: the tips penetrate the torso, movement and marching stop, and the recruit travels with that bank. The pinned lane keeps closing on missed beats. Contact from the opposite set completes elimination; the sets then finish closing until one walkway plank (0.25 metres) remains between their inner faces. The trapped recruit stays sideways and its model compresses along the closing direction to fit the gap. At full closure, a randomized low-poly blood burst splatters onto the walkway and spreads into a puddle. The flattened body releases into physics and falls onto the walkway; after a short hold, both spike banks slide back to the original lane ends. This sequence continues after game over; restart clears the liquid and restores the original proportions. Other lanes continue independently. When all four recruits are eliminated, music/cues stop and Enter restarts the course. Music pause also pauses recruit movement, penalties and pillar motion.

Only the local green recruit in the front lane reads this client's controls: A/D, or the current gamepad's left stick/D-pad. The other recruits ignore local hardware. RecruitController.isLocallyControlled separates input ownership from playerIndex (lane assignment); character selection/network identity should later map the local character into the front presentation slot. Networking and character selection are not implemented yet. InputOverride remains a separate simulation input path. Tools/Rebuild/VerifyLocalControls.cs passed 8 checks using a synthetic keyboard, covering A/D movement, front-lane placement, other-player isolation, removed legacy keys and restart. LaneSpikeTrap exposes inward travel per miss, slide speed and final gap for tuning. LeftRight > Rebuild > Update spike pillars installs the traps and controls without changing framing. The full builder and recruit updater also install them. Editable art is SourceArt/Environment/SpikePillar.blend; regenerate it with blender --background --python SourceArt/Environment/build_spike_pillar.py. Tools/Rebuild/VerifySpikeCourse.cs passed 19 checks covering mesh orientation, full-height startup, penalties, correct/incorrect movement, pause, elimination, game over and restart. VerifySpikePinning.cs adds 18 checks for the final one-plank gap, mesh compression/restoration, both attachment sides, visible penetration depth, disabled input, carried travel, pause, second-set elimination, game over and reset. The 27 recruit rig checks still pass with controlled movement isolated. VerifyRecruitGaits.cs adds 13 checks for centered spawns, immediate pre-music control, high-knee idle, moving gait, grounded support, beat synchronization, release, pause and restart.

Cleanup

Archive retains 23 assets not referenced by the prototype or rendering settings: migration candidates, an old import package, unused animation clips, materials, images, and audio. Their original metadata is retained. Archive/asset-moves.json maps the old paths to their archive paths. The completed project-upgrade script is archived too, so it cannot rewrite the rebuilt project.

All prototype runtime scripts remain necessary. Perlin and LocalPlayerInput are called from code even though they have no scene component references. URP, Input System, uGUI, and Unity Pipeline remain in use; the latter supports editor automation. Redundant direct declarations for UI, IMGUI, and JSON serialization modules were removed; their owning packages still bring them in as dependencies.

Library, Temp, Logs, UserSettings, and builds are generated and ignored. SourceArt and Misc remain source/reference material outside Unity imports.

Checks

Use LeftRight > Validate scenes to check both scenes for missing scripts. Prototype checks live in Tools/Prototype and run through the installed Unity Pipeline CLI, with the prototype open in Play Mode:

unity command script eval --file Tools/Prototype/PlayerCountSmokeTest.cs --timeout 60
unity command script eval --file Tools/Prototype/DirectionPlatformSmokeTest.cs --timeout 60
unity command script eval --file Tools/Prototype/FallDeathSmokeTest.cs --timeout 60

These scripts reload scenes and simulate gameplay; run them in a disposable Play session. SmokeTest.cs also retains broader legacy input, animation, and pickup checks. It previously stopped at a Player 3 body-material identity check, so it is not a fully passing baseline.

After cleanup, all 99 focused checks passed (43 player-count/UI checks, 33 direction/platform checks, and 23 fall/death checks). All 135 original asset GUIDs were retained, and the moved asset contents match the snapshot.

Recruit hit audio

Each recruit has a distinct scream, played once on the first spike hit alongside a short wet splash. The opposite-set hit plays a separate crunch/splatter squeeze effect. RecruitAudio uses an independent source per recruit so simultaneous hits can overlap; restart stops and rearms the effects. Volume follows the existing AudioLevel preference. SpikeCourseSetup assigns the clips when installing the course or rebuilding recruits.

The six derived WAVs and source records are in Assets/Rebuild/Audio/Recruits; original recordings and archives are in SourceArt/Audio/Recruits. Female voices come from wuxiascrub and AuraVoice/NocturnalVanguard; the two male recordings are JohnsonBrandEditing samples extracted by congusbongus; the splash and squeeze are Independent.nu Ljudbank recordings hosted by qubodup. All selected recordings are CC0. The original mixed-license male archive also contains unused CC-BY recordings; only its explicitly CC0 aargh3 and aargh5 are used. See source.json and aargh.txt for exact sources and license mapping. Tools/Rebuild/VerifyRecruitAudio.cs passed 18 playback, identity, overlap and restart checks.

The source soldier feet were root-level IK controls. The procedural rig now parents each Foot.L/R to its corresponding lower leg while preserving its rest pose, so the combat boots lift with the animated legs. Tools/Rebuild/VerifyBootAttachment.cs checks all four foot hierarchies, both boot lifts, skinned geometry attachment and the supporting foot; the instructor uses the same corrected hierarchy.

Walking now uses opposing forward/back leg swings instead of leaving the supporting leg vertical. RecruitMarch adds a subtle beat-driven torso bob, levels the boots and adjusts only the visual model height to keep the support foot planted. walkingBodyBob and inPlaceBodyBob tune the weight shift; gameplay position remains unchanged. Tools/Rebuild/VerifyWalkingWeight.cs checks visible torso motion, backward support-leg motion, ground contact, pause and reset.

Health crate powerup

A small wooden medical crate with red crosses on pale panels restores room on the collecting recruit's lane. Collecting queues three outward recovery steps (1.35 metres per bank total at current tuning) and plays the prototype health-pickup sound. On each of the next three master beats, both banks step back one increment and hold there until the next beat. A recovery beat takes priority over an inward penalty; recovery clamps at the original lane width. Pinned/eliminated recruits cannot collect it.

HealthCrateSpawner lives under Powerups, separate from spike/obstacle logic. Each lane has independent, guaranteed spawn opportunities at beat 8 and every 16 beats thereafter. At least two missed beats of current lost space are required; full-width, pinned and eliminated lanes skip the opportunity. An existing crate also consumes/skips the slot. Collecting or expiring never resets the lane cooldown, and a seek does not replay missed slots. There is at most one crate per lane. Only placement is random: 1.5?2 metres to either side of the recruit, inside a margin of 0.8 metres from the spike tips. If neither side has enough safe space, that opportunity is skipped instead of clamping a crate underfoot. Crates bob gently on the master beat and expire after 12 beats or when advancing spikes reach them. Pausing music freezes its motion and lifetime; restart and game over clear all crates. Spawning uses its own random source so it does not change instructor cue timing. Spawn intervals, eligibility threshold, placement ranges, lifetime and restored beats have commented Inspector settings. The comments in HealthCrateSpawner explain the fairness, fixed schedule and safe-range decisions; pickup and trap comments explain one-shot collection, musical expiry and clamped recovery.

Use LeftRight > Rebuild > Update health crate powerup to install it independently; rebuilding the course/recruits also preserves it. The prefab is Assets/Rebuild/Prefabs/HealthCrate.prefab; editable art is SourceArt/Environment/HealthCrate.blend, regenerated with blender --background --python SourceArt/Environment/build_health_crate.py. Tools/Rebuild/VerifyHealthCrate.cs passed 17 checks for spawning, collection, recovery limits, lane ownership, sound, pause, expiry, pinned-player exclusion and reset.

Tools/Rebuild/VerifyHealthSpawnRules.cs passed 12 additional checks covering the saved per-lane rules, guaranteed opportunities, damage eligibility, safe placement, fixed cooldown, three-beat recovery, one-crate cap, unsafe-space skips and schedule reset.

BloodSplash uses low-poly droplets with gravity and swept collisions against scene colliders, a small energy-losing recoil, impact splats and a spreading irregular puddle. Droplets stretch with speed; off-edge droplets fall away. This is particle-based liquid presentation, not a full fluid solver. Each effect uses its own random seed without consuming gameplay randomness. LaneSpikeTrap triggers it only when the one-plank crush is complete, starts retracting immediately after the completed crush and returns in 1.2 seconds. The crushed recruit begins tipping slowly at the same time, randomly choosing left or right independently of which bank first hit it, and bends down as it falls. Its compressed proportions stay independent of the withdrawing banks. VerifyBloodAndReturn.cs passed 14 checks for full closure, droplets, platform impacts, pooling, variation, body release, bank return, game-over completion and restart cleanup.

First spike contact emits a smaller blood burst and puddle; full closure emits the larger squeeze splash. Both are owned by the lane and cleaned on reset. RecruitRagdoll snapshots the crushed skin and equipment once at release into a six-centimetre-thick flexible sheet. A small position-based cloth solver connects five strips with length and bending constraints; gravity, initial momentum and ground friction let the torso, head and legs flop with a two-second slow tip followed by a sharply accelerating drop. Once the upper body passes balance, the head and torso whip down in roughly 0.1 seconds; small solver substeps preserve the sheet and ground contact during this fast finish while preserving the silhouette. The same meshes deform continuously from release through landing, with no delayed flattening, separate head correction or mesh swap. The trap supplies the actual walkway height at release, avoiding false floor hits on spikes. The feet remain anchored to the walkway throughout the fall; the other cloth points bend around that fixed base, preventing constraint corrections from lifting the recruit into the air. Each section gets one small impact-driven rebound, capped at a nominal 5.5 cm ballistic rise, while the feet stay pinned. This is a lightweight cloth-like fall rather than Unity Cloth or a full soft-body collision solver. Restart destroys the temporary meshes and restores the original renderers and marching. VerifyRagdollRelease.cs passed 36 checks across all four recruits in two casualty batches, preserving the new rule that one final contender must win, including immediate release during retraction, an upright start, grounded feet throughout the fall, no upward launch, two-second slow tipping, a final 0.06–0.12-second head collapse, acceleration, impact rebound, visible flex, stable strip lengths, landings matching the randomly chosen direction, thin ground contact, bank return and restart cleanup.

Puddles now spread over seven seconds after the first drops land. The main pool is clipped to the walkway's half-width so it does not float over the trench. Once it reaches a ledge, randomized low-poly drips fall from the wet portion of that edge under gravity for twelve seconds. Each effect reuses a fixed pool of 24 runoff droplets; the final puddle remains until restart. Small first-hit pools do not drip unless they actually reach an edge. spreadSeconds, laneHalfWidth and runoffSeconds are exposed on BloodSplash. VerifyPuddleRunoff.cs passed 10 checks for gradual growth, edge detection, clipping, bounded droplet pooling, falling runoff and restart cleanup.

Collecting a health crate now plays a 1.1-second HealthCrateBurst reward animation. The lid pops off, the four walls fold 90 degrees outward around fixed bottom hinges, and a red-filled low-poly syringe rises slightly toward the camera and fades away. The three-beat recovery is queued and the pickup sound plays immediately; collection is claimed before the cosmetic effect is spawned, so debris cannot heal twice. All debris and the syringe fade and self-destruct, and round reset clears any burst still in progress. The closed crate hides the syringe. The articulated source parts and syringe live in HealthCrate.blend; HealthPowerupSetup generates both HealthCrate.prefab and HealthCrateBurst.prefab with separate transparent effect materials. VerifyHealthCrateBurst.cs passed 13 checks for hinged wall motion, lid release, syringe rise/visibility/fade, immediate healing and cleanup; the 17 health pickup checks still pass.

Camera lens splatter

Each recruit's first spike hit adds a smaller, lighter lens splat (55% size and 65% relative opacity); elimination adds a separate larger splat. Repeated contact while pinned cannot duplicate the initial hit. The procedural LensSplatter.shader draws translucent, defocused wet droplets and soft downward-running trails, fades them after eleven seconds, and keeps the central view mostly clear. Centered deaths can splash either side. The eight-entry buffer bounds rendering work; no active splats disables the overlay draw. LensSplatter owns its material instance, listens to recruit elimination events, uses cosmetic randomness and clears on round reset. The effect continues draining after game over. lifetimeSeconds and splatSize are tunable.

Research compared Unity's URP Full Screen Pass with a screen-space Canvas. This implementation uses one transparent full-screen RawImage and a custom shader: it needs no scene-color/depth copy, downloaded textures or renderer changes. The runtime overlay Canvas is a root object and never intercepts input. This is surface blood tint/highlights, without scene refraction. It adds the existing uGUI assembly reference to the rebuild; no package installation is needed. The prototype's shared renderer remains untouched.

LeftRight > Rebuild > Update lens splatter installs it independently; the course builder also wires it. VerifyLensSplatter.cs checks death triggers, deduplication, four-player accumulation, bounded state, local material ownership, RNG isolation, expiry, disable/re-enable and restart. VerifyLensRendering.cs renders actual pixels to verify shader compilation, visible limited coverage, downward movement and complete fade. These passed 21 checks combined, including first-hit splats and the translucent/defocused material settings.

The revised VerifyRecruitGaits.cs passed 15 checks, including stillness before music, immediate walking animation during the lead-in, release back to attention, and high-knee idle only after the opening beat.

Local and Online camera modes

Both local and online matches follow the locally controlled recruit with smooth inertia. Menus and round results use the saved full-course framing; victory sequences retain their own camera control. Session mode chooses ownership and networking, rather than whether following is enabled. The opening camera fits a 26-unit camp width to the current aspect ratio; following frames a 22-unit width at the recruit with a 9-unit minimum distance and 60-degree field of view. The 20-unit front lane nearly fills the landscape view; instructor visibility can pull the camera back as the recruit moves. Online Match supports Relay join codes and public waiting-room discovery. The in-game gear opens the normal settings menu, which contains volume controls and no camera-mode selector. Victory sequences may still use their own temporary cinematic camera before returning to the full-course view.

Health recovery uses LaneSpikeTrap.PendingRecoverySteps instead of a multi-step sliding target. ProcessRecoveryBeat consumes at most one reserved step per musical beat; SpikeCourse gives that outward step priority over damage on the same beat. Recovery never begins on the pickup frame, pauses with the musical clock, and resets with the round. Eligibility uses the space remaining after reserved recovery so extra health cannot stack beyond the original lane width. VerifyHealthBeatRecovery.cs passed 14 actual-clock checks for three discrete steps, holds between them, penalty priority, pause and reset.

Victory sequences

SpikeCourse ends a multiplayer round when exactly one recruit survives, checks the full contact batch before applying fatal hits and reserves one random winner if all final contenders would die together, and publishes Completed(winner). Single-recruit test rounds continue normally. Gameplay input, penalties and officer cues stop at round end. Every dead lane finishes its crush and retracts; the winner's lane retracts too. Enter restarts as before.

VictoryDirector is separate from damage, movement and beat logic. Its Inspector field victoryDelaySeconds defaults to 1 second after the last opponent is eliminated. A pending victory is cancelled by restart. The sequences array is an equal-chance pool of distinct, available VictorySequence assets: one gets 100%, two get 50% each, N get 1/N. Null entries, duplicates and assets marked unavailable are excluded. Selection happens immediately when the winner is decided, using independent cosmetic randomness with repeats allowed; only playback waits for the delay. An empty pool skips the celebration safely. Simultaneous final deaths use the same normal winner celebration.

The first asset is Assets/Rebuild/Victories/TurnAndRaiseArms.asset. It turns the survivor toward the camera, raises both arms into a victory V and smoothly moves/zooms the camera toward them over four seconds. Turn speed, arm timing/angle, zoom duration, distance and FOV are editable on the asset. Camera ownership passes temporarily from GameViewSettings to the sequence in both view modes and returns on cancellation/restart.

To add the next 20–30 celebrations, derive a new ScriptableObject from VictorySequence, implement CreatePlayback(winner, camera) and keep mutable per-run state in the returned VictoryPlayback. Tick(elapsedSeconds) drives the pose/camera and Stop() releases/restores any resources owned by that playback. Create an asset and add it to VictoryDirector.sequences; round logic and selection need no changes. Shared assets are configuration only, so separate runs never reuse animation state. LeftRight > Rebuild > Update victory system installs the director and first asset without rebuilding the scene; the course builder includes it too.

VerifyVictory.cs passed 23 checks for the survivor, delay, pose, zoom, spike return, pool filtering/random selection, empty pool, tied final deaths and reset/cancellation. VerifyVictoryCharacters.cs passed 16 checks covering all four winner rigs and camera framing. Victory playback is capped by VictoryDirector.victoryDurationSeconds (default 5 seconds), followed by a smooth 1.5-second return to the saved full-course camera (zoomOutSeconds). The selected sequence holds its final pose during the pullback, then releases its resources. Online follow stays suspended in the round summary so it cannot zoom back in behind the Start again prompt. The button calls StartAgain(); Enter still restarts. Restart/cancellation clears the prompt, camera ownership and cheer in every phase.

A dedicated non-looping 2D AudioSource plays Audio/Victory/Cheers.ogg exactly when celebration playback starts, respecting the existing AudioLevel preference. It is separate from gameplay audio, so ending the round does not silence it. The recording is Cheers by AuraVoice / Nocturnal_Vanguard, CC0; provenance is recorded beside the clip. cheerClip, cheerVolume, duration and pullback timing are editable on the director.

The 16 checks in VerifyVictoryFinish.cs cover cheer data and playback, the five-second limit, smooth pullback, stable wide framing, prompt timing and restarting during celebration. The existing 23 victory checks also pass.

Winner protection is immediate: the course predicts fatal contacts across every lane before applying them. If only one safe recruit remains, that recruit is reserved; if all remaining contenders would die in that frame, one is chosen uniformly at random. Earlier casualties never enter this draw. The winner is detached from spikes and their trap cancels any pending squeeze and starts retracting during the victory delay. Already-applied external death batches use only the latest simultaneous casualties as fallback contenders. Gameplay randomness and lane order do not control the tie draw. VerifyWinnerResolution.cs passed 72 checks, including repeated native four-way ties, a final two-way tie, external batches, a nearly squeezed winner, immediate sequence selection and reset.

Instructor pistol-shot victory

The second sequence is a separate asset in the victory pool. InstructorPistolShot.asset uses its own InstructorShotVictory playback, leaving ArmsRaisedVictory unchanged. It zooms to the instructor, draws a low-poly pistol from his belt into his right hand, aims at the winning recruit's head, then fires one visible bullet with a muzzle flash, recoil and gunshot. The camera moves to the winner before impact; the bullet continues beyond the head, triggering the existing lens splatter and a directed head-height blood spray over a spreading floor puddle.

ExecutionAftermath handles a separate full-proportion side collapse, keeping the visible mesh above its lane rather than using spike-crush flattening. This is post-match presentation: the recorded winner and tie logic stay unchanged. The corpse and blood remain through the replay prompt, while the pistol, projectile and instructor pose control are released after the five-second sequence and camera pullback. Restart cancels all phases, removes aftermath immediately and lets the normal round reset restore the recruit rig. No delayed callbacks can shoot into the next round.

Draw/aim/fire timing, bullet travel, instructor zoom, pistol prefab, effects materials and sound are editable on the second asset. VictorySetup creates the second asset and pistol prefab, then appends the asset once to the existing pool without replacing other entries. The gunshot is a trimmed CZ-52 recording by Vincent Sevedge from Gunshot Sounds, credited under the archive's CC BY 3.0 license in Audio/Victory/PistolShot-License.txt.

VerifyInstructorShotVictory.cs passed 57 checks across all four recruits, covering hand attachment, aim, sound, visible projectile, impact effects, retained winner state, full-proportion grounded collapse, persistent aftermath and cleanup/cancellation. The original celebration checks explicitly select its asset so they remain deterministic with multiple sequences in the pool.

Instructor self-shot victory

The default pool now contains three distinct assets, each with a 1/3 chance. InstructorSelfShot.asset owns an independent InstructorSelfShotVictory playback: zoom to the instructor, play the generated "Fuck this!" voice line, draw the pistol, bend the arm to bring it to his head, then fire and collapse on the command platform. The recruit remains the recorded winner and is never damaged by this sequence.

The voice is synthetic prototype dialogue made locally with Microsoft David Desktop, with compression and loudness processing; provenance is in Audio/Victory/InstructorFuckThis-source.txt. PlayOpeningCheer is a per-sequence virtual option, defaulting to true for existing assets. This dialogue-led sequence overrides it to false so the shout is clear; the other two keep their opening cheer. Shout, draw and fire timing and audio clips are editable on the new asset.

InstructorDeathAftermath owns the corpse, directed head spray, growing blood puddle and a temporary invisible liquid-collision surface on the command platform. It persists through the replay prompt and restores the instructor's standing transform, arm/head bones and normal animation ownership on round reset. Cancelling before the shot restores the pose immediately; cancelling during the fall also removes the body effects. The existing five-second celebration, camera pullback and restart prompt remain shared.

VerifyInstructorSelfShotVictory.cs passed 28 checks for the three-entry pool, speech timing and audibility, camera, hand/muzzle placement, shot, grounded collapse, blood pooling, unchanged winner, persistent corpse, and cancellation before speech, before the shot and during the fall.

Start menu and computer opponents

Main now opens at the start menu instead of automatically playing music. The fullscreen menu uses hard-edged buttons from Kenney Pixel UI Pack, CC0, and Press Start 2P, SIL OFL 1.1. Kenney also created the Survival Kit environment. Used pixel assets, original licenses and provenance are under Assets/Rebuild/UI/Pixel. Text uses raster rendering and UI textures use point filtering without mipmaps. Olive/cream tinting matches the camp.

Portrait screens use a dedicated 480x860 menu layout with larger buttons; landscape retains the existing 1280x720 layout. Native mobile room entry/copy controls follow the same reference rectangles. Fullscreen does not force landscape orientation. The main screen has Start Local Game, Online Match for join-code internet games, and Settings. Local setup offers 2, 3 or 4 total recruits, then Start Game. Settings provides a stepped master volume control. The camera follows the human recruit in both local and online play. The front green recruit is the human player (A/D or the existing gamepad controls); the remaining slots are computer opponents. Changing the count hides the unused recruits, their walkways and spike banks and replaces the actual SpikeCourse roster. Hidden players cannot receive pickups, advance traps or prevent victory. Reopening the menu cancels the current round and cleans effects before roster changes. Escape opens the menu during gameplay and goes Back inside the menu; Enter opens local setup from the title screen and starts from local setup. Main menu is also available after a completed match. Start again preserves the current roster and computer settings.

RecruitComputer reads only the public instructor direction. Each cue gets a random reaction delay (0.18–0.65 seconds by default) and a 22% chance of moving incorrectly for 2–4 beats. Bots use the same walking, pinning, damage and health-crate rules as the human, and stop during countdown, music pause, menu or game over. They do not consume the local keyboard, override simulation inputs, teleport, heal themselves or predict cues. Their independent random source does not change instructor timing. Reaction ranges and mistake chance are editable on each bot component.

StartMenuSetup installs the menu and bot components without rebuilding the environment, and course generation includes it. SpikeCourse.SetRoster rebinds elimination subscriptions; lens splatter observes all recruit objects so changing the active roster cannot lose death effects. VerifyStartMenu.cs passed 59 checks covering repeated 2/3/4 roster changes, visible lanes and spike banks, music startup, actual bot movement, correct and mistaken reactions, override priority, pause, two-player victory and replay/reset.

Online: Relay host/client play

Online Match uses Netcode for GameObjects 2.14.0, Unity Transport and Multiplayer Services 2.5.0. Anonymous Unity Authentication and Relay provide internet connections without port forwarding. The project is linked to the LeftRight Unity Cloud project; no account registration UI is needed for players. Start Local Game and online rounds both enable the close follow camera.

To try it:

  1. Share the entire Builds/OnlineTest folder with your friend (zip the folder, not only the executable). Both players launch LeftRight.exe and choose Online Match.
  2. The host selects 2?4 total slots and presses Host Online, then shares the displayed join code. The friend enters that code and presses Join. The host must keep the game running; codes expire when that session ends. This works across different networks.
  3. Once at least two humans have connected, the host presses Start Match. Remaining slots use host-side AI. Every client controls only its assigned recruit with A/D/gamepad and sees that recruit on the front lane. Color/identity is preserved when the presentation order changes.
  4. The host controls rematches. Losing the host, or losing a peer during a round, ends this first-version session and returns everyone to the menu. An online client cannot start a rematch independently. Volume settings can be opened during an online round without pausing or disconnecting the session.

LeftRight > Rebuild > Build online test player creates the standalone executable using Main explicitly, without changing the frozen prototype or its scene. Update start menu and computer players also installs the OnlineMatch and optional test-driver components. Build output, logs and report files are ignored by Git.

OnlineMatch hosts the rules in one process. Clients send only sequenced, clamped horizontal inputs; sender-to-slot assignment is checked on the host, non-finite or stale inputs are rejected, and input falls back to zero after half a second without a fresh packet. The host alone evaluates spike damage, health collection/recovery, final ties and victory selection. Client movement and obstacle logic are replicas, never independent second authorities. Positions, spike state, pending health recovery, pickup visuals, cue IDs, winner and selected victory asset are sent in versioned named messages at 20 Hz. Client health models cannot collect locally. Repeated recovery versions trigger the existing pickup presentation once per pickup.

The host schedules each round three seconds ahead on the network timeline. Each process schedules its own music against that timestamp; MasterBeat uses shared elapsed network time during the session and audio sample time offline. The client clock uses NGO's estimated current server time rather than its deliberately delayed interpolation time. Direction cues originate on the host. Victory playback uses the same host-selected asset and scheduled start on every client. Blood droplet randomness and corpse presentation remain cosmetic and local.

StartMenu.ArrangeOnlineFront changes only local lane/recruit presentation Z positions. Stable roster indices still identify players, damage, pickups and results. Leaving restores the original lane order and local green input ownership. New joins are rejected once the round is underway; there is no host migration or mid-round reconnect in this milestone.

Relay allocation and authentication are isolated in UnityRelayConnection; allocation keys stay in memory and only the friend-facing code is displayed. Cancel invalidates pending requests so a late response cannot open a hidden session. The main menu initializes cloud discovery; local rounds remain usable when discovery is unavailable. Direct transport remains available to automated tests. Automatic matchmaking, latency compensation/input prediction and simulated bad-connection testing remain next steps. The initial JSON snapshots favor inspectability over bandwidth optimization.

Public waiting rooms use PublicDrillLobby and UnityPublicDrillDirectory from the existing Multiplayer Services package. The first screen lists Drills soon about to take place with player counts and Join buttons. Hosting defaults to public; uncheck Public room to use private code invitations. The list refreshes every eight seconds and shows the authoritative NGO human count, including people who joined by code. Lobby contains only the host, so its membership count is deliberately not used for occupancy. Joining rechecks the room before connecting through Relay.

Private, full, started and closed rooms stop advertising. A freed slot can advertise again before the round starts. Heartbeats run every 15 seconds; abandoned listings expire under Unity Lobby inactivity rules. Async creation that finishes after cancellation is deleted, and discovery failures leave code-based games usable. The start screen initializes cloud discovery, while local play remains usable without it. No allocation keys or authentication credentials are included in room metadata.

VerifyPublicDrills.cs covers 23 lifecycle, privacy, stale-response and failure checks. VerifyPublicDrillsCloud.cs exercises real Lobby creation/query/count updates, visibility and removal. node Tools/Web/VerifyPublicBrowser.cjs uses three independent browsers to check a landscape phone visitor joining from the first screen, a second visitor seeing the actual 2/4 human count, privacy toggling and match start. Set PRIVATE_HOST=1 MOBILE_PEER=1 MOBILE_PORTRAIT=1 when running VerifyBrowser.cjs to check the rotate prompt before private code invitations on a landscape phone. The Editor uses WSS when WebGL is the active build target; native standalone builds retain DTLS.

OnlineTestDriver is dormant unless -lr-test is supplied. For repeatable standalone tests it accepts -lr-host 2 or -lr-join 127.0.0.1, -lr-relay-host 2 or -lr-relay-join CODE, -lr-port, -lr-autostart, -lr-report <path> and -lr-input-file <path>. It writes only game-state diagnostics. VerifyOnlinePeer.cs launches a real standalone client against the editor host and checks shared start/beat, ownership, front-lane presentation, host AI slots, remote movement, two health recoveries, winner/sequence parity, rematch and disconnect cleanup. VerifyOnlineClient.cs exercises the reverse role against a standalone host, including host loss and a return to offline play. VerifyStartMenu.cs checks the existing local menu and AI behavior.

Validation for this milestone: 24 host/standalone-peer checks, 12 reverse-role client checks and 59 local menu/AI checks (95 total). The standalone Development build succeeds. Two standalone processes were also connected directly for an initial smoke test. Relay validation is recorded below; adverse network conditions remain untested.

Relay checks: VerifyRelayMenu.cs covers malformed/expired codes, code normalization, correct guest capacity, duplicate requests, cancellation/late responses, retry and friendly errors. VerifyRelayPeer.cs uses a real cloud allocation and a standalone peer to check join-code connectivity, lobby, shared round timestamp/beat, assigned front lane, AI slots, remote input and disconnect cleanup. These tests use the public Relay service from two processes on this PC; they do not simulate two separate household networks or poor connections.

Verified Relay build: 13 service/menu boundary checks, 15 live DTLS Relay checks with editor host and standalone client, and 59 local menu/AI regression checks passed. Builds/LeftRight-Online-Windows.zip is the shareable Windows package; extract it before launching. The host menu shows connection progress and times out stalled allocation requests after 30 seconds.

Survival scoring: SurvivalScore starts at the scheduled first music beat, freezes each recruit's time on elimination and freezes the entire result at round completion, before victory playback. Online snapshots carry host-recorded survival times. Local and Online matches retain their winner sequences and roster results, without loading or submitting the Survival leaderboard.

Survival is the third menu mode: one human recruit, one walkway and one pair of spike sets. It continues until that recruit dies, then opens results after VictoryDirector.soloResultsDelaySeconds (default 1.5 seconds), without selecting or playing a winner sequence. Replay preserves Survival; Main Menu restores the multiplayer roster and lane positions. Solo and multiplayer personal bests have separate PlayerPrefs keys.

SurvivalResults owns completed-run presentation and named score submission; SurvivalResultsPanel renders the Editor/native UI, while the WebGL template uses Tools/Web/results.js and results.css for a scrollable, mobile-sized panel and native keyboard name entry. Only qualifying Survival runs offer name entry. UnitySurvivalLeaderboard uses Unity Leaderboards survival_all_time, descending hundredths with keep-best updates and name/run metadata. Its configuration is versioned in Assets/Rebuild/Leaderboards/survival_all_time.lb and deployed to the linked project's production environment through the Unity Editor deployment workflow. Times freeze before death presentation; repeated taps cannot submit twice, and late responses cannot overwrite a new run's results. Loading errors leave retry, replay and menu available. Names are limited to 14 letters, digits, spaces, hyphens or underscores. The current anonymous authentication is unchanged; there is no cross-device account login or server-side score validation yet.

VerifySurvivalMode.cs checks the single-lane lifecycle, no winner playback, score isolation, qualification and asynchronous submission guards. VerifySurvivalBrowser.cjs exercises actual deaths, mobile name entry, replay and shared scores across isolated browsers. CleanSurvivalQa.cs removes only the exact recorded test player/run pairs after validating their live metadata; it never resets the leaderboard. Existing score and local-menu checks remain in VerifySurvivalScore.cs and VerifyStartMenu.cs.

Jumping: Space (or gamepad south button) requests one jump per press. RecruitController owns the configurable height/duration and grounded landing; A/D movement continues in the air. RecruitMarch overrides the drill with a two-knee tuck, raised arms and landing crouch. Spike contact, death, victory and reset clear airborne state. Jumps currently do not bypass spike contacts or direction penalties. Online input repeats a jump-press counter to survive lost input packets; the host validates it and sends jump phase in snapshots. Online protocol versions require matching builds (currently version 4 with longer jumps). VerifyRecruitJump.cs passed 15 checks; VerifyRelayPeer.cs also tests a remote jump through the host and back to the client. The optional test driver accepts -lr-jump-file <path> containing an increasing integer press counter.

Mine obstacles: Obstacles/ObstacleSpawner is installed on the environment prefab and uses the same LaneSpawnPlacement helper as health crates, with its own beat schedule and RNG. Defaults: first opportunity beat 12, every 16 beats, two-beat arming warning, twelve-beat lifetime, one mine per active lane, 1.5?2 metre placement and 0.8 metre spike clearance. Health and mines avoid each other by 0.9 metres. Skipped/expired opportunities never produce catch-up spawns. Music pause freezes arming and expiry; round reset clears hazards and effects. Hidden/dead/pinned lanes receive no new mines. Timing and distance fields are editable on the prefab's ObstacleSpawner.

LaneMine sweeps foot movement across the pressure plate; jumps need 0.24 metres of clearance while overlapping its 0.32 metre trigger radius. Ground contact eliminates once, retracts that lane's spikes, fragments the actual recruit mesh, and plays an original synthesized explosion with a short flash, tiny shrinking sparks, blood sprays, spreading puddles and the existing lens splatter. Mesh fragments are cosmetic and use swept collisions. Reset restores the intact model. Bots attempt visible mines using ordinary jumps and their existing mistake probability. Host snapshots contain mine IDs/timing and blast death state; clients display hazards and effects without applying independent damage. Protocol 4 requires both players to use the new build.

Mine validation: 32 obstacle checks (spawn cadence, safe placement, warning, full jump crossing, detonation, fragments/audio/blood, swept contact, replica protection, expiry/pause, health separation and reset), 22 live Relay checks including mine replication and remote fragmented death, 59 local menu/AI checks and 12 health spawn rule checks passed (125 total). The Windows build and shareable ZIP are updated. Resources/MineExplosion.wav is an original procedural sound with no third-party samples.

Mine playtest correction: expanding solid smoke meshes were removed. The blast now has a 0.12-second flash and tiny outward sparks that only shrink and disappear within 0.25 seconds. All four recruits use a 1.05-second, 1-metre-high jump (about 1.6 metres horizontally at normal walking speed). Bots take off earlier. PlaytestMineJump.cs uses actual virtual-keyboard A/D + Space events: it reproduced the old 0.65-second jump failing at 0.95 metres, then passed ten crossings with the revised jump in both directions at 0.5, 0.65, 0.8, 0.95 and 1.1 metre takeoff distances. The collider and clearance threshold were kept the same. Fifteen jump checks, 32 mine checks and 22 live Relay checks also pass. Network protocol 4 requires updated builds on both ends.

Browser / GitHub Pages: install Web Build Support for Unity 6000.6.9f1. Use LeftRight > Rebuild > Build GitHub Pages game to build Main into Builds/WebGL. WebBuildTools uses a single-threaded WebAssembly build, gzip with JavaScript decompression fallback, and explicit exception support so Pages needs no custom encoding/isolation headers. Browser Relay connections use WSS; native players retain DTLS. The page loads straight into the game and fills the browser viewport, without a surrounding header/footer or an extra Play screen. Native fullscreen is optional; iPhone browsers still fill their available viewport without that API. Touch players use compact translucent round thumb controls: left/jump at bottom-left and jump/right at bottom-right. Each jump button supports simultaneous movement and jumping. There is no extra browser fullscreen button or fullscreen-help overlay. Room entry uses a native phone keyboard over the in-game code field, and copying a room code uses the browser clipboard. Only public lobby/game presentation state reaches the page, never authentication tokens. Browser penalties and animation use the audio DSP clock rather than the compressed clip sample cursor.

After committing source changes, run powershell -File Tools/Web/PublishPages.ps1 to publish the build to the separate gh-pages branch and configure GitHub Pages. Compiled browser files stay out of master. To test before publishing, serve Builds/WebGL over HTTP and run node Tools/Web/VerifyBrowser.cjs http://127.0.0.1:8123; install Playwright under ~/.codex/tmp/leftright-web-qa and set CHROME_PATH if using an existing Chromium installation. The test drives two independent browsers through the real host/join UI. Logs/screenshots stay in ignored Logs/WebQA. Run node Tools/Web/VerifyMobile.cjs for phone viewport/input checks and set MOBILE_PEER=1 when running VerifyBrowser.cjs to join Relay using touch controls and the mobile room field. Install Playwright WebKit for the iPhone-sized layout check. Windows WebKit lacks Web Audio, so that check covers layout/menu/input only; Chromium covers actual touch gameplay, audio and spike movement. Physical iPhone Safari still needs a device check.

Browser verification: the compressed release build passed two independent Chromium instances using WSS Relay hosting/joining, matching two-player lobbies, match start, host-authoritative remote movement/jump and continued play beyond the first mine spawn. No browser runtime errors were reported. Runtime CapsuleCollider/SphereCollider types are preserved for mine/victory primitives. Browser connection deadlines use Unity frame waits rather than managed timer threads. The deployed build is about 20 MB before browser caching.

Editor audio output suspension is disabled in Audio settings: an idle/suspended output previously froze the DSP clock and prevented the scheduled countdown from completing.

Atmospheric wind has been removed; the game uses music, voice and gameplay effects only. Web artifacts use content-addressed filenames to keep cached audio/code/data versions consistent between releases.

Mobile web orientation: touch devices must rotate to landscape before using the game. #rotate-phone covers portrait screens and makes underlying controls inert; rotation clears held movement/jump input. Landscape reveals the existing game without a reload. This is a browser rotation prompt, rather than a forced OS orientation lock, so it also works without native fullscreen on Safari. Desktop windows retain their normal responsive layout. VerifyMobile.cjs checks the prompt, input gating and rotation back during gameplay in Chromium, plus iPhone-sized WebKit layout.

Survival lightning: SurvivalLightning allows one strike per single-lane Survival round, randomized between 30 and 40 seconds of audible gameplay. A three-second rumble and pulsing board tint mark two adjacent planks before the bolt, thunderclap and wood break/fall recording. The actual walkway mesh is split into its disconnected components (the FBX is readable); exactly two planks fall under gravity and leave a permanent jumpable gap. Grounded crossings slide the recruit halfway through the hole with a scream; they stay alive, wedged and kicking until the spike capture/squeeze finishes them. Only hole entry plays a scream; later spike capture and squeezing use their impact effects without restarting the voice. Jump clearance is swept between frames, so low frame rates cannot skip gap contact. Timing pauses with music, and replay/menu restore the original deck and reset the allowance. Mines and crates avoid warned or missing ground. Other modes retain the original intact walkway. Timing and clips are editable on the environment prefab. The supplied audio sources and edits are documented in Assets/Rebuild/Audio/Lightning-Sources.md; the bolt material is referenced from Resources so its shader survives web stripping. SharedLightningAudio owns a single course-wide rumble/impact mix and accepts each phase only once per round, so multiple lane requests cannot stack or restart thunder or wood sounds. Only course round events reset this audio; individual lane cleanup does not interrupt it. VerifySurvivalLightning.cs covers 29 timing, geometry, sound-reference, gap/jump, single-strike, spawn and reset checks.

Survival rain: SurvivalRain listens to the actual lightning strike and schedules one shared shower 5-10 audio-clock seconds later, lasting a random 8-12 seconds. Each intact lane gets up to three irregular puddles, which grow over three seconds, drip from its ledges through a capped shared particle pool, then shrink/dry over 12 seconds after rain ends. Placement avoids the lightning hole. The rain volume stays over the camp and away from the follow camera; materials in Resources retain their web shader references. Wet patches ease horizontal acceleration/braking, allowing a small coast and delayed reversal; input still determines direction-order penalties. Traction returns shortly after leaving water, jumping removes wet contact, and dry movement retains instant response. Replay/menu clear all water and momentum. Delay, duration, puddle count and drying time are editable on the environment prefab. VerifySurvivalRain.cs covers 19 timing, pooling, puddle, movement, pause and reset checks.

Hole trap sequence: RecruitHoleTrap owns the short waist-height slide and procedural kicking pose, while RecruitController blocks movement/jumping and ordinary missed beats keep the spike banks closing. The first spike bakes the posed skin/equipment and clips the actual triangles at the waist into two capped snapshots: only the upper body follows the bank, while the lower half falls independently onto the ground with blood. The second bank uses the existing elimination, flattening, retraction and flexible corpse logic on the upper snapshot. Survival scoring continues while wedged and freezes on that final squeeze; VictoryDirector.holeResultsDelaySeconds (4.5 seconds) allows the death effects to finish before results. Reset restores original renderers, joints and the complete model after clearing the ragdoll. VerifyHoleTrap.cs covers 31 state, beat, capture, mesh, blood, floor, scoring and cleanup checks, including all four recruit models.

Fourth victory: InstructorBottleVictory is a separate available asset in the equal 1/N pool (currently four entries, 25% each). OfficerVodkaBottle.prefab stands beside the instructor from scene load, with a faceted green shell, VODKA label and a half-filled liquid mesh. Playback reaches for that existing prop, parents it to the fist with a fixed grip aligned as an extension of the forearm, and uses extended two-bone arm IK for the clockwise wind-up/head smash; there is no independent bottle rotation. The supplied glass hit plays once at impact, the body shatters while the neck stays held, and bounded glass/vodka particles, head blood, a cut mark and a small lens splatter follow. The winner remains untouched. Completion/cancellation restore the same bottle, pose and camera, and clear temporary effects. InstructorBottleSetup rebuilds the saved prop/meshes/materials and registers the asset through its Editor menu without duplicate props. Audio provenance is in Assets/Rebuild/Audio/Bottle-Sound-Sources.md. VerifyInstructorBottleVictory.cs covers 35 selection, persistent-prop, grip, alignment, clockwise/contact, sound/effect, skipped-frame and reset checks. The original three sequence checks remain independent of the size of the expanded pool.

Randomized openings: StartSceneDirector selects one distinct, available StartSequence asset with equal 1/N probability per round, independently of gameplay randomness. Assets/Rebuild/Starts currently contains the original camera zoom and InstructorDrinkStart (50% each). Add a separate asset/playback implementation and register it on the environment prefab to extend the pool; one available opening runs every time. The host selects once online and sends the asset index and countdown duration to peers.

Both openings sample the existing DSP-clock countdown rather than delaying music. Production lead-ins last three seconds by default and are capped at five. The drinking opening picks up the persistent vodka bottle with a rigid fist/forearm grip, plays the supplied sip and burp, returns it to its exact floor position with one glass impact, then pulls the camera back quickly. Sound sources are scheduled on the same audio clock as music. At the first beat the director restores the instructor and hands the camera back at its exact gameplay pose, before the first direction cue. Menu/cancellation stop pending sounds and restore the actor and prop. Late peers skip elapsed sounds; externally scheduled sub-three-second test countdowns skip the cinematic. Audio provenance is in Assets/Rebuild/Audio/Opening-Sound-Sources.md. VerifyStartScenes.cs covers 35 selection, timing, grip, sound, camera, cancellation and replicated-selection checks; it does not exercise a live network connection.

Electrical tripwire: ObstacleSpawner.electricWireChance defaults to 0.5, sharing existing beat-grid opportunities, warning/expiry, lane occupancy and safe-placement rules with mines. Each wire has two edge poles with lightning warning signs and a shin-height live cable. A swept contact below 0.38 units of jump clearance consumes the wire and applies a lock from the current masterbeat to exactly two beats later; crossing above it uses the normal jump. Burned poles disappear after two beats. Health, holes and spikes are excluded from placement. AI uses the same normal jump request and mistake chance for visible wires.

RecruitShock owns the temporary shaking pose, real procedural skull/ribs/limb meshes, four skeleton flashes, supplied electrical loop and restoration. It preserves facing and blocks walking/jumping; wrong-direction penalties pause while shocked, while normal spike contact/recovery still operate. Beat bounds pause with music; there is no independent seconds timer. The host replicates wire ID/arming/expiry/spent state and absolute shock bounds. Repeated snapshots do not restart playback, and clients never evaluate wire contact independently. Pinning, death, victory, menu and replay clear the effect before mesh capture or character reset. VerifyElectricWire.cs covers 31 spawn, jump, contact, beat duration, pause, motion/audio/flash, all-four-model, cleanup and snapshot checks; live remote-peer testing is separate. Sound provenance: Assets/Rebuild/Audio/Electrocution-Sound-Sources.md.

Couch drill and menus: the first screen offers YOU vs. Computer, Couch Drill, Join Online Drill, Create Online Drill, Survival and Settings. Join shows code entry and public room discovery; Create shows capacity and the public-by-default option. Both retain the existing Relay lobby and host-only match start. Couch selects 2?4 actual human recruits with independent key banks, keeps all participants visible, and preserves ownership on rematch. Menu exit restores the normal solo/AI ownership. Keyboard groups are left / jump / right: P1 A/S/D, P2 T/Y/U, P3 N/M/comma, P4 O/P/?. The Swedish layout key beside P is resolved by display name with the physical LeftBracket position as fallback. Online ownership always uses bank P1, regardless of server lane. Gamepad/touch input belongs only to P1, and Space no longer jumps. VerifyCouchDrill.cs covers 50 keyboard, 2?4 roster, camera, rematch, mode-reset and online-ownership checks with real virtual-keyboard events. Pages fills its browser viewport with no fullscreen button or help overlay.

Host departure: leaving an active hosted room through Back/Escape, results Main Menu or the settings Leave Drill button opens OnlineSessionDialog. Stay retains the room; Leave & Kick marks it closing, stops advertising, rejects new joins/starts, sends a reliable host-ended notice, and gives transport 0.25 seconds to flush before shutdown. A connection-attempt guard prevents an old teardown from closing a later room. Joined guests get a persistent notice on the main menu for both deliberate host exit and unexpected host loss; guest-side admission failures before the first snapshot remain separate. Online simulation continues while confirmation is open. Browser overlays/touch controls are hidden behind the modal, including native result panels. Browser navigation gets a native beforeunload warning where supported; pagehide attempts cleanup, while visibilitychange never ends a match. Abrupt browser/device termination cannot guarantee an immediate cloud delete; inactive listings still rely on service expiry. VerifyHostLeave.cs covers 23 confirmation, cancellation, unlisting, closing-guard, countdown, settings, notice and rehosting checks. Tools/Web/VerifyHostLeave.cjs adds 14 real-cloud browser checks, including successful Lobby deletion and reliable guest notices during waiting and gameplay; see docs/qa/host-departure-2026-11-19.md.

Releases

Packages

Contributors

Languages