PuzzleServer / mainpuzzleserver

The main repo for the Puzzle Hunt and Puzzleday servers.
MIT License
9 stars 32 forks source link

Easier timed unlocks #924

Open morganbr opened 9 months ago

morganbr commented 9 months ago

Add a new "unlock wave" concept for puzzles -- an unlock wave sets a relative date and an absolute time (e.g. day 1 at noon). Puzzles can be assigned to an unlock wave and when that date and time occurs, the puzzle unlocks (regardless of whether prerequisites are satisfied). The relative date is to allow multi-date events (e.g. for an event starting on Saturday morning, you can set a 10AM Sunday unlock by setting it to day 2).

This needs to work both on the day of the event and on preceding betas. To do that, each event should have a start time that can control the relative dates. For betas and archival, there may also be teams in different time zones; we should also add an optional field to a team that offsets the times (e.g. so that the East Coast beta team can do everything 3 hours earlier than the West Coast beta team in the same beta).

Vroo commented 7 months ago

Maybe less necessary in light of #919 (Autostarting Event support) since that allows us to reliably set a puzzle to unlock at a specic time relative to the event start time.

vidapour commented 7 months ago

Problem: If an event has pregame puzzles, then the event needs to be "started" in the database in order to have the puzzles appear to/be solvable by the player. This leads to a problematic inconsistency where the date we advertise to players as when the event officially starts is not the time in the database that the event is considered "started".

Proposed solution: Have a new "pregame start time" database field for the event, as well as new fields for every puzzle that tell whether the puzzle should be made visible by the pregame start time or the event start time. Note that this will be different than the current Group field, which is just a simple string used to group puzzles together on the player's view. There could also be a new field on the event to say whether or not pregame puzzles should be visible during the actual event.

Going further, we could also add a datetime field to each puzzle to act as its auto-unlock time, which could allow for a staggered pregame, for example, where a puzzle will only be visible if both the pregame/event has started AND its unlock time has passed. We could also add a field to Teams and/or the event as to whether the start time is local to their timezone or universal (PST, for example).