Skip to content

Understanding Level Files

ADOFAI's level file .adofai is essentially a JSON file.

Top-Level Structure

json
{
  "settings": { ... },      // Level settings: BPM, song title, author, etc.
  "angleData": [ ... ],     // Path angle for each floor
  "pathData": "...",        // Path data string
  "actions": [ ... ],       // Event list: judgment, effects, rotation, etc.
  "decorations": [ ... ]    // Decorations
}

Common Fields

FieldDescription
settings.bpmLevel BPM
settings.artistLevel author
settings.songSong name
angleDataAngle data for each tile
actionsEvent list, e.g. Twirl, MoveTrack, SetSpeed

Event Example

json
{
  "floor": 10,
  "eventType": "Twirl",
  "twirl": true
}

The event above means: execute a Twirl (direction reversal) at the 10th tile.

Path Data Encoding

pathData is a string where ADOFAI uses characters to represent path directions, e.g. "REJW"; angleData is an array of angle values for each tile. Both convey the same information and can be converted between each other.

Standard Direction Characters → Absolute Angles

CharacterAngleCharacterAngleCharacterAngleCharacterAngle
R0p15J30E45
T60o75U90q105
G120Q135H150W165
L180x195N210Z225
F240V255D270Y285
B300C315M330A345
!999 (endpoint)

Special Offset Characters → Relative Angles

CharacterOffsetCharacterOffset
5+726-72
7+528-52
9-30h+120
j-120t+60
y+300

Offset characters are not absolute angles, but rather changes relative to the previous angle:

result = previous_angle + offset

Unknown characters use the current angle as-is.

Example

"REJW" conversion result (using R=0, E=45, J=30, W=165):

[0, 45, 30, 165]

Converting with Libraries

Each library provides the ability to convert between pathData and angleData, for example ADOFAI-JS:

ts
import { pathData } from 'adofai'

pathData.pathDataTable                       // Character → angle mapping table
const angleData = pathData.parseToangleData("REJW")  // [0, 45, 30, 165]

Why Libraries Are Needed

Directly manipulating level files with JSON is cumbersome: non-standard formatting (trailing commas, newlines in strings), poor performance with large files, and many event types. This is why libraries like ADOFAI-JS and SharpFAI exist.

An organization that researches and expands the functions of ADOFAI