Skip to content

PIUS format

Rodrigo Alfonso edited this page Dec 8, 2023 · 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 {
  SET_FAKE,
  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)

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

  u8 chartCount;  // 0x53 if no message, 0xBE otherwise (u8)
  Chart* charts;  // 0x54 if no message, 0xBF otherwise ("chartCount" times)

  // custom fields:
  u32 index;
  std::string audioPath;
  std::string backgroundTilesPath;
  std::string backgroundPalettePath;
  std::string backgroundMapPath;
} Song;

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

  u32 eventChunkSize;

  u32 rythmEventCount;
  Event* rythmEvents;  // ("rythmEventCount" times)

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

  // custom fields:
  bool isDouble;  // type == ChartType::DOUBLE_CHART ||
                  // type == ChartType::DOUBLE_COOP_CHART
} Chart;

typedef struct {
  int timestamp;  // in ms
  u8 data;
  /*  {
        [bits 0-2] type (see EventType)
        [bits 3-7] 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 most note-related events)

  // custom fields:
  u32 index = 0;
  bool handled[GAME_MAX_PLAYERS];
} Event;

Event params

Event param param2 param3
HOLD_START hold length in ms (or 0) - -
SET_FAKE fake enabled (1 or 0) - -
SET_TEMPO bpm scroll bpm change (*1) autovelocity factor (*2)
SET_TICKCOUNT tick count - -
STOP stop length in ms async (1 or 0) -
WARP warp length in ms - -
  • (*1) scroll bpm (low 16 bits) / how many frames it should take (high 16 bits)
  • (*2) slowdown factor, only used in the AutoVelocity mod (0xffffffff * a number between 0 and 1)
Clone this wiki locally