catchouli/better_tactics

Puzzle rush mode

Opened this issue · 0 comments

If you start over from a fresh database, with the default rating of 500, it makes for a good puzzle rush mode. You start out at 500 rating and your rating increases reasonably quickly at first so each puzzle gets progressively harder. We could add this as a feature quite easily.

The rating works well for picking new puzzles and we could just have a rating per run since, it'll only go up and never down since the run ends when a puzzle is failed. We might just want to tweak how the rating system works for it as the current strategy of awarding 0.66 points for 'good' and 1.0 for 'easy' wouldn't make sense for it, (we wouldn't have any scores, just whether the user completed the puzzle or not), and the rating deviation might eventually get too low and stop the rating from going up appropriately, so we might also just want to ignore rating deviation for these ratings too.

API would be e.g.

GET /api/tactics/run - lists the user's runs
GET /api/tactics/run/{id} - gets the stats for the given run, puzzles played, success rate, etc
POST /api/tactics/run/start - starts a new run if the user doesn't have one in progress and returns the ID and first puzzle
GET /api/tactics/run/next - marks the current puzzle as complete and gets the next puzzle
GET /api/tactics/run/end - marks the current puzzle as failed and ends the run (setting the puzzle's end time to the current time)

To implement this we should store the user's current run in the database, (e.g. rating, end time, current puzzle), and then every time they solve a puzzle the api would return from them a new puzzle and the time remaining.

Then it's nice and stateless and the client can just start a new run, display the time left and the puzzle, and submit puzzle completions and get the next puzzle when required. We can also add a page that lists runs, and a page that lists the stats for each run and the puzzles completed/failed.