Skip to content

PIUS format

Rodrigo Alfonso edited this page Sep 15, 2024 · 23 revisions

Definition

// PIU Steps (*.pius)

enum Channel { ORIGINAL, KPOP, WORLD };
enum DifficultyLevel { NORMAL, HARD, CRAZY, NUMERIC };
enum ChartType { SINGLE_CHART, DOUBLE_CHART, DOUBLE_COOP_CHART };
enum EventType {
  NOTE,
  HOLD_START,
  HOLD_END,
  SET_TEMPO,
  SET_TICKCOUNT,
  STOP,
  WARP,
};

typedef struct {
  u8 id;                // 0x00
  char* title;          // 0x01 (31 bytes - including \0)
  char* artist;         // 0x20 (27 bytes - including \0)
  Channel channel;      // 0x3B (u8)
  u32 lastMillisecond;  // 0x3C (u32)
  u32 sampleStart;      // 0x40 (u32 - in ms)
  u32 sampleLength;     // 0x44 (u32 - in ms)
  int videoOffset;      // 0x48 (int - in ms)

  u8 applyTo[3];   //   0x4C
  u8 isBoss;       //   0x4F
  u8 pixelate;     //   0x50
  u8 jump;         //   0x51
  u8 reduce;       //   0x52
  u8 bounce;       //   0x53
  u8 colorFilter;  //   0x54
  u8 speedHack;    //   0x55
  u8 hasMessage;   //   0x56
  char* message;   //   0x57 (optional - 107 bytes - including \0)

  u8 chartCount;  // 0x57 if no message, 0xC2 otherwise (u8)
  Chart* charts;  // 0x58 if no message, 0xC3 otherwise ("chartCount" times)
} Song;

typedef struct {
  DifficultyLevel difficulty;  // u8
  u8 level;                    // (0~99)
  char variant;                // '\0' or 'a', 'b', ... (for repeated levels)
  char offsetLabel;  // '\0' or 'a', 'b', ... (to identify different offsets)
  ChartType type;    // u8

  u32 eventChunkSize;

  u32 rhythmEventCount;
  Event* rhythmEvents;  // ("rhythmEventCount" times)

  u32 eventCount;
  Event* events;  // ("eventCount" times)
} Chart;

typedef struct {
  u32 timestampAndData;
  /*  {
        [bit 0]      is fake (only note types)
        [bits 1-23]  timestamp (signed int)
        [bits 24-26] type (see EventType)
        [bits 27-31] data (5-bit array with the arrows)
      }
  */
  u8 data2;  // another 5-bit arrow array (only present in double charts)

  u32 param;
  u32 param2;
  u32 param3;
  // (params are not included in note-related events)
} Event;

Event params

Event param param2 param3
HOLD_START hold length in ms (or 0) - -
SET_TEMPO bpm and duration (*1) scroll bpm change (*2) autovelocity factor (*3)
SET_TICKCOUNT tick count - -
STOP stop length in ms async (1 or 0) async stopped time (*4)
WARP warp length in ms - -
  • (*1) bpm (low 20 bits) / beat duration in frames (high 12 bits)
  • (*2) scroll bpm (low 16 bits) / how many frames it should take (high 16 bits)
  • (*3) slowdown factor, only used in the AutoVelocity mod (0xffffffff * a number between 0 and 1)
  • (*4) total amount of time spent in async stops (#SCROLLS=...=0)
Clone this wiki locally