Core GameSystems
Master the advanced mechanics that make Avalanche Trivia engaging and strategic.
Avalanche Trivia combines question answering with tactical game mechanics. Understanding shields, danger zones, weather changes, and checkpoints is essential for advanced hosting.
Danger zones & weather
- Danger zones correspond to the centres listed in `constants/gameSettings.ts` (10, 19, 24, 27, 32, 39, 44, 52, 58, 65, 68, 72, 84, 87, 93).
- Sunny keeps the zone to that tile only. Snow grows the zone one tile downhill. Blizzard extends one tile both uphill and downhill.
- When a wrong answer happens on any active tile, the player document receives `pendingAvalancheId` and the host board animates the matching path.
- You can enable or disable specific centres by updating the `dangerZones` array on the game document – the Options modal handles this for you.
Tip: Need a calmer round? Set the weather to Sunny and clear the `dangerZones` array except for the tiles you want to emphasise.
Checkpoints
- Checkpoints prevent players from sliding all the way back to the base after an avalanche.
- Default frequency is every 25 tiles. The Options modal lets you specify up to eight custom checkpoint positions.
- When a player moves, the client recalculates `lastCheckpoint` and writes it to their document so resets are instant if an avalanche hits.
- The host board displays checkpoints as yellow markers, helping you narrate when someone reaches a safety milestone.
Tip: In teaching scenarios, add more checkpoints so beginners do not lose motivation after a single mistake in the higher altitude zones.
Shield streaks
- Whenever a player answers correctly, the client increments a local streak counter. Three correct answers inside the configured window unlock the shield.
- The shield window defaults to the first half of the question set, but the host can set `powerupsConfig.shieldOfferStartIndex` and `shieldOfferEndIndex` to fine-tune it.
- Once a shield is unlocked, the player document stores `powerups.shield = 'available'`. The next pending avalanche gives that player the shield prompt.
- Spending the shield writes `shieldUsedFor` and `shieldUsedAt` back to Firestore so the host log shows who burned their protection.
Tip: Encourage teams to hold shields for the high-number danger zones (65+). Losing 20 tiles late in the game hurts more than an early mistake.
Map & Compass inventory
- Each player receives a personalised Map & Compass spawn between tiles 1-15. The placement avoids checkpoints and danger zones so the event stays reachable without extra tweaking.
- Landing on the marked tile opens a Map & Compass challenge modal. Answer correctly to add the tool to your inventory; miss it and the event resolves with no penalty.
- If you already own the Map & Compass, replaying the event grants a small +1 position confidence boost while keeping the item equipped for later encounters.
- Inventory records live on the player document (`inventory.map_compass`). Hosts can see when a player secures the tool and plan fork-side support accordingly.
Tip: Highlight the early-event when onboarding new players—securing the Map & Compass makes the mid-game fork dramatically safer.
Fork in the Road event
- Fork tiles appear around positions 31-50 and trigger once per player. Choosing left or right without tools has a 50% success rate and moves you forward 4-8 spaces on a win.
- Using the Map & Compass reveals the safe route instantly and awards the same 4-8 space advance without risk, consuming the tool for that decision.
- Picking the wrong path launches a side quest instead of an immediate penalty. Players can seek a hermit (2 quick answers to avoid a setback), forge ahead alone (three answers for a +10 win or -15 loss), or solve a 3×3 sliding puzzle if they held onto the Map & Compass.
- All fork outcomes update the player document with telemetry and event flags so the host log captures who chose which option and how far they moved.
Tip: Coach teams to save their Map & Compass until the fork shows up—skipping the side quest keeps momentum and protects late-game streaks.
Tunnel shortcuts
- Tunnel offers now open up to three times per match, usually between positions 51-70 (configurable via `tunnelOfferWindow`).
- Offer frequency scales with performance: trailing players get up to a 50% chance after a correct answer, while leaders see the original 10% baseline.
- Successful tunnel answers leap players ahead 8-24 spaces by default, with deficit-aware math capping jumps at the summit so catch-up feels fair.
- Declining or missing the tunnel simply advances to the next question—the progression system adds the tunnel question to the normal cycle so nothing is lost.
Tip: Encourage players in the back half to accept tunnels—the adaptive jump is tuned specifically to close large gaps without handing out instant wins.
Host options & logs
- The Options modal updates the live game document. All changes propagate immediately to every connected client.
- The Events feed is simply the `games/{gameId}/events` collection. It now records Map & Compass pickups, fork outcomes, and tunnel jumps in addition to avalanches and manual host actions.
- Audio controls on the host board manage the avalanche and background tracks. They run entirely in the browser – no extra services required.
- Use the log to troubleshoot desync. If you see a player trigger an avalanche but they say nothing happened, have them refresh and rejoin using the same code.
Tip: Need to test without players? Add yourself as a player in a second tab, start the game, and use the Options modal to fire manual avalanches while watching the logs.
Data & persistence
- Player documents store `questionsAnswered`, `correctAnswers`, `percentageCompleted`, `currentPosition`, and board coordinates alongside `inventory` and `eventFlags` for Map & Compass, fork, and tunnel tracking.
- Question progress now loops continuously. `questionProgress.order` is randomised per player and resets seamlessly when the end of the list is reached, preventing dead-ends after marathon sessions.
- Game-wide settings such as weather, checkpoint positions, and danger zones live on the game document, so reloading the host page restores state immediately.
- If you delete a player document manually, their browser will treat the next refresh as a fresh join and create a new record.