Add vote-based events #140

Merged
sermuns merged 2 commits from events into main 2026-10-23 15:14:25 +00:00
Owner

Adds vote-based events. Hold N to open a radial picker (like the Z emote wheel), pick an event, and it starts once a second peer votes yes — a lone player can never start one. Voters teleport to their starting spots on the countdown; everyone else keeps free-roaming, watches, and cannot touch the board.

How it works

  • The server owns the phase (idle, voting, starting, running, results), the tally and the scoreboard (liuverse-server::events). The catalog and the starting spots are derived from the baked campus (liuverse-world::event), so both ends build the same events from the same file with no extra message.
  • Players stay client-authoritative: the server publishes the phase, and a client that voted yes teleports its own body on the way into the countdown, exactly as the map click teleports. The server never moves a player.
  • Non-participants are dropped from scoring and from position-based progress, so a free-roamer's ball never reaches the board.

Events

Event Objective
Ball at the goals Most goals through the campus goals.
Märkesbacken run First to the top of the emblem slope.
Hold the hill Most time inside the Isovalen oval's center circle.
Hide and seek Forces night; the lowest-id seeker is blinded through a head start, then tags hiders by proximity. Last hider standing wins.

Positions are read from the poses already on the wire, so nothing new rides the wire for scoring.

Wire

Adds ClientMsg::{Vote, EventScore}, ServerMsg::{EventState, EventScores} and an event field on Welcome. New server tags are undecodable by an older client, so this is a breaking wire change: it drives the batch's single major bump to 2.0.0.

Testing

just check passes. New tests cover the vote/quorum rules, one vote per player, the phase clock, participant-only scoring, the race, the hill hold, the seeker tagging a hider, and that a night event dims the server sky and restores the daytime it found. Visuals were not tested; the seeker blackout is drawn on Order::Foreground, so it covers the HUD windows too.

Merged

Merged into main as part of the batch (order: #136, #142, #137, #138, #141, #139, #140, #143). The batch carries a single major bump, 1.1.2 → 2.0.0, so this branch's own bump commit was dropped when it was rebased; PROTOCOL_VERSION stays 2. assets/baked/valla.bin was rebaked once at the end of the batch.

Adds vote-based events. Hold `N` to open a radial picker (like the `Z` emote wheel), pick an event, and it starts once a second peer votes yes — a lone player can never start one. Voters teleport to their starting spots on the countdown; everyone else keeps free-roaming, watches, and cannot touch the board. ## How it works - The server owns the phase (idle, voting, starting, running, results), the tally and the scoreboard (`liuverse-server::events`). The catalog and the starting spots are derived from the baked campus (`liuverse-world::event`), so both ends build the same events from the same file with no extra message. - Players stay client-authoritative: the server publishes the phase, and a client that voted yes teleports its own body on the way into the countdown, exactly as the map click teleports. The server never moves a player. - Non-participants are dropped from scoring and from position-based progress, so a free-roamer's ball never reaches the board. ## Events | Event | Objective | | --- | --- | | Ball at the goals | Most goals through the campus goals. | | Märkesbacken run | First to the top of the emblem slope. | | Hold the hill | Most time inside the Isovalen oval's center circle. | | Hide and seek | Forces night; the lowest-id seeker is blinded through a head start, then tags hiders by proximity. Last hider standing wins. | Positions are read from the poses already on the wire, so nothing new rides the wire for scoring. ## Wire Adds `ClientMsg::{Vote, EventScore}`, `ServerMsg::{EventState, EventScores}` and an `event` field on `Welcome`. New server tags are undecodable by an older client, so this is a breaking wire change: it drives the batch's single major bump to 2.0.0. ## Testing `just check` passes. New tests cover the vote/quorum rules, one vote per player, the phase clock, participant-only scoring, the race, the hill hold, the seeker tagging a hider, and that a night event dims the server sky and restores the daytime it found. Visuals were not tested; the seeker blackout is drawn on `Order::Foreground`, so it covers the HUD windows too. ## Merged Merged into `main` as part of the batch (order: #136, #142, #137, #138, #141, #139, #140, #143). The batch carries a single major bump, `1.1.2` → `2.0.0`, so this branch's own bump commit was dropped when it was rebased; `PROTOCOL_VERSION` stays 2. `assets/baked/valla.bin` was rebaked once at the end of the batch.
An event is a server-owned clock that players vote to start. Hold N to open
a radial picker, pick an event, and it begins once a second peer agrees, so a
lone player cannot drag the server into one. The voters teleport to their
starting spots on the countdown; everyone else keeps free-roaming, watches,
and cannot touch the board.

The catalog is derived from the baked campus, so both ends build the same
events from the same file. Ball at the goals scores through the campus goals
(client-reported, participant-only), the Märkesbacken run ranks the first to
the emblem slope's top from the server's own reads of the poses, and the
Kårallen mingle is a plainer meet-up.
The Kårallen mingle was a teleport and nothing else. In its place, Hold the
hill puts the holding circle in the middle of the Isovalen oval and scores
seconds inside it; stepping out stops the clock.

Hide and seek plays in the dark. The server dims the sky for the event and
puts back the daytime it found when it ends, and the lowest-id participant
seeks while the HUD blacks out their screen through a head start long enough
to hide. The seeker tags hiders by proximity; the last one standing wins.

Both read the poses already on the wire, like the run, so nothing new rides
the wire for them. The catalog gains a night flag and a head-start length.
Sign in to join this conversation.
No description provided.