techmania-docs

Documentations of TECHMANIA projects, hosted in a repo so they can be localized.


Project maintained by techmania-team Hosted on GitHub Pages — Theme by mattgraham

Applies to version: 2.3

Records are saved to and loaded from records.json in the TECHMANIA folder. This page explains the specification of this file.

The records.json file contains the format version, an array of pattern records, and an array of setlist records. Each record corresponds to one pattern or setlist under one ruleset.

Contents of a pattern record

Note the lack of max combo. TECHMANIA does not count combo consistently, and it has zero effect on score, therefore we decided to not include it in records.

Contents of a setlist record

Pattern fingerprint

To ensure that changes to a pattern invalidates all records on it, each record contains a fingerprint of the pattern(s) it’s on. When reading records, the fingerprint is calculated again from the pattern and compared with the one in the record, and the record is only considered valid if they match. The fingerprint also somewhat prevents fabrication of records, though it’s not its main purpose.

The algorithm to calculate the fingerprint is as follows:

  1. Minimize the pattern to only include the following fields:
    • Control scheme
    • Number of playable lanes
    • Initial BPM
    • BPS
    • BPM events
    • Time stops
    • Notes
  2. Serialize the pattern as a string
  3. Take an SHA256 hash of the string

Updating records

When the player achieves a valid score on a pattern or setlist, the game will check and potentially create / update the record on it.

A score is considered invalid if any of the following conditions are met:

When updating a record, score and clear medal are updated separately. This means if the player achieved a better medal than the old record but not a better score, the medal would still be updated.