AI character and coordinate card format - RobotsOnDrugs/LibMai GitHub Wiki

[Note: this document is incomplete and is primarily for my own use at the moment to understand and improve code I wrote a couple years ago]

General Layout

Character, coordinate, and scene card files typically begin with a PNG image, but it is not strictly required. If the file begins with a PNG header, the file is read until the PNG footer. This data is used as the image in PNG format. Otherwise, the beginning of the file is considered the start of the character, coordinate, or scene data.

This document outlines the binary data in order and specifies the data type used in the API.

Card Type Header

This header is used to determine the type of card and to verify that the card is valid. See ParseAiCharaTypeData in https://github.com/RobotsOnDrugs/LibMai/blob/master/IllusionCards/AI/Cards/AiCharaType.cs for the code that parses this.

  • int Load product number which always equals 100
  • string Identifier: 【AIS_Chara】, 【AIS_Clothes】, and 【StudioNEOV2】 indicate character, coordinate, and scene data respectively
  • Version Load version which always equals 1.0.0
  • int Language
  • string User ID
  • string Data ID

Data Header

This header outlines the position of all the data objects contained in the card. See the constructor in https://github.com/RobotsOnDrugs/LibMai/blob/master/IllusionCards/AI/Chara/AiChara.cs for the code that parses this.

  • int Size in bytes of all combined (contiguous) Block headers
  • BlockHeader MessagePack object containing a list of information objects for object data stored in the card

AI/HS2 Character objects

string "Custom"

  • Face
    • Version version
    • float[] shapeValueFace
    • int headId
    • int skinId
    • int detailId
    • float detailPower
    • int eyebrowId
    • Color eyebrowColor
    • Vector4 eyebrowLayout
    • float eyebrowTilt
    • ChaFileFace.EyesInfo[] pupil
    • bool pupilSameSetting
    • float pupilY
    • int hlId
    • Color hlColor
    • Vector4 hlLayout
    • float hlTilt
    • float whiteShadowScale
    • int eyelashesId
    • Color eyelashesColor
    • int moleId
    • Color moleColor
    • Vector4 moleLayout
    • ChaFileFace.MakeupInfo makeup
    • int beardId
    • Color beardColor
  • Body
  • Hair Coordinate Parameter GameInfo Status ParameterVerson2 GameInfoVersion2