Skip to content

PIUS format

Rodrigo Alfonso edited this page Nov 23, 2020 · 23 revisions

Definition

// PIU Steps (*.pius)

enum Channel { ORIGINAL, KPOP, WORLD };
enum DifficultyLevel { NORMAL, HARD, CRAZY, NUMERIC };
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 decolorize;   //   0x4F
  u8 randomSpeed;  //   0x50
  u8 ___;          //   0x51 (unused)
  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)
  bool isDouble;

  u32 eventChunkSize;
  u32 eventCount;
  Event* events;  // ("eventCount" times)
} 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 present in note-related events)

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

Event params

Event param param2 param3
SET_FAKE fake enabled (1 or 0) - -
SET_TEMPO bpm scroll bpm how many frames it should take
SET_TICKCOUNT tick count - -
STOP stop length in ms judgeable (1 or 0) -
WARP warp length in ms - -
Clone this wiki locally