Skip to content
mos9527 edited this page Sep 28, 2024 · 23 revisions

Preface

DISCLAIMER: DO NOT use this tool to generate profit, or to hurt the original IP by leaking, or redistributing the game's otherwise protected assets in unprotected/source form.

  • With any asset you'd generate with the tool, make sure their usage qualifies as Fair Use.
  • And make sure the right entites are credited for your (derivative) work. This plugin (or its creator) doesn't have to be one of them.

And as always, update your installation and read the latest help text (sssekai -h) before moving on.

In Game Assets

The game loads its assets on-demand.

However, you can use abcache to download selected assets offline, instead of extracting it from your own device.

Notes

  • As of 2024/09/17, only the latest version pair can function.
  • You'll need the game's version number (i.e. 3.8.1) and its app hash (i.e. for 3.8.1, 3f8a6157-fe09-d1f9-1ff4-4e4f251c6b5c) to download the assets. See the table below for details.
  • The files may take up a lot of storage space (e.g. it's ~70GB for 3.8.1). Make sure enough is reserved since there's no free space checks in the script

Game Versions And Their Hashes

  • This table will probably remain not up-to-date and/or incomplete. PRs are welcome for additions.
  • The platform does not seem to matter for now. (e.g. ios or android)
version appHash
4.0.0 46a895b6-1adf-d443-faeb-4b12cd35305f
3.8.1 3f8a6157-fe09-d1f9-1ff4-4e4f251c6b5c
3.8.0 6a32c1dd-bc3e-69f0-c66e-8dd33e3b1ba2
3.7.0 7558547e-4753-6ebd-03ff-168494c32769
3.6.5 c5e69328-dcfd-fa80-8ec2-b478ed0719d0
3.6.0 7558547e-4753-6ebd-03ff-168494c32769
3.5.0 5e9fea31-2613-bd13-1723-9fe15156bd66

Bonus: How to extract appHash from the Android releases

With sssekai apphash (i.e. the apphash subcommand) you can automatically determine the game's version and appHash.

  • With a pre-exisiting game package (APK/XAPK supported)
$ python -m sssekai apphash -s 380.xapk
Package Type: STAMP_TYPE_DISTRIBUTION_APK
Version: 3.8.0
6a32c1dd-bc3e-69f0-c66e-8dd33e3b1ba2 production_android
6a32c1dd-bc3e-69f0-c66e-8dd33e3b1ba2 production_ios
  • Download the latest package online w/o writing it to disk
$ python -m sssekai apphash
Fetching latest game package from APKPure.
Downloading 160566896/160566896
Package Type: STAMP_TYPE_DISTRIBUTION_APK
Version: 3.8.0
6a32c1dd-bc3e-69f0-c66e-8dd33e3b1ba2 production_android
6a32c1dd-bc3e-69f0-c66e-8dd33e3b1ba2 production_ios

Downloading the assets

NOTE: Please read the latest sssekai abcache -h help text before continuing on.

Updating the metadata cache

  • AbCache by itself doesn't store (nor check) the downloaded bundles themselves. Only the asset metadata is stored.
  • This is needed, however, to download and resolve asset dependencies on demand. Which is not unlike how the game handles this itself.
  • Example: Updating and saving the metadata cache to /.sssekai/abcache.db
sssekai abcache --db ~/.sssekai/abcache.db --app-version ... --app-appHash ...
  • Note that --app-version and --app-appHash are required when (and only when) updating the cache index. (i.e. not loading from an existing one)
  • Loading from a existing cache index (which contains these values) supercedes these arguments

Using AbCache to download bundle files

The metadata cache may be updated everytime. In practice, however, it's advised to load the previously cached metadata to avoid extra data/time cost.

  • To load the previously cachced data, you can specify --no-update to skip the update process.
  • You can specify where to store the downloaded data with --download-dir
  • Example: Downloading all available game assets, using a pre-cached metadata set
sssekai abcache --db ~/.sssekai/abcache.db --no-update --download-dir ~/.sssekai/bundles/

In most cases you probably only want a subset of the game's files. You can filter which bundles to download with --download-filter, which takes a regex as its input

  • In this case, the bundles themselves may require other bundles (i.e. dependencies) as well. To automatically resolve this issue, use --download-ensure-deps, which would download them alongside the selected ones.
  • Example: Download all v2 PV models for character 31 (25-ji Miku), including the dependencies
sssekai abcache --no-update --db ~/.sssekai/abcache.db --download-filter .*characterv2/.*/31.* --download-ensure-deps --download-dir ~/.sssekai/bundles

The downloaded bundles are obfuscation-free, meaning you can load them (e.g. by folder) directly into Unity bundle loaders (i.e. AssetStudio), while specifying the Unity version to use. (2022.3.21f1 since 3.6.0 and onwards, 2020.3.21.f1 otherwise).

Using the assets

NOTE: Please read the latest sssekai <script name> -h help text before continuing on.

Streaming Live Files

A functional parser/converter is available as rla2json command. Please take a look here if you're interested in helping with the implementation. The parser processes streamling_live bundles, or ZIP archives containing sekai.rlh sekai_xx_xxxxxx.rla... files.

  • Convert all RLA packets into seperate JSON files
sssekai rla2json streaming_live/archive/1st_live_vbs-1 streaming_live/archive/1st_live_vbs-1_src
  • Dump audio data (in CriWare HCA segments/frames) into seperate files
sssekai rla2json streaming_live/archive/1st_live_vbs-1 streaming_live/archive/1st_live_vbs-1_hca

NOTE: The resultant files may be further decoded with sssekai_streaming_hca_decoder into WAV format. Once you have it installed:

sssekai_streaming_hca_decoder streaming_live/archive/1st_live_vbs-1_src streaming_live/archive/1st_live_vbs-1.wav

You will find a single, large WAV file (44100Hz, 1ch, 128kbps) located at streaming_live/archive/1st_live_vbs-1.wav

Path Purpose (Assumed)
streaming_live/archive Archival bundles for past Virtual Live shows. Contains chat log, character animations (skeletal/blendshape),streamed audio, etc. See 3D Assets for more info.

Spine2D Related Files

NOTE: You'll need Spine2D SDK 4.x to load these.

Path Purpose (Assumed)
area_sd Spine2D model files Can be extracted with sssekai spineextract

CriWare Related Files

NOTE: USM/HCA files, mainly. For the videos usmdemux can handle it by itself. For audio tracks try vgmstream

Path Purpose (Assumed)
live/2dmode/original_mv Video, Original PV/MVs for selected tracks. Can be extracted with sssekai usmdemux. Filenames are the MV IDs which can be queried by mvdata.
live/2dmode/sekai_mv Video, PV/MVs tailor made for proseka, for selected tracks. Can be extracted with sssekai usmdemux Filenames are the MV IDs which can be queried by mvdata.
music/short Audio, Preview track for the songs.
music/long Audio, Songs that plays in rhythm game or PV viewer.
music/jacket Images, The cover art for the songs.

SUS (Chart) Files

You can find them in music/music_score in SUS Format

OSS Viewers exist for this format. For example:

Live2D Related Files

NOTE: Cubism's Live2D edtior comes with a viewer which you can use to view these things

Path Purpose (Assumed)
live2d/model Cubism Live2D model files. Can be extracted with sssekai live2dextract
live2d/motion Animation files for the models. Again, Can be extracted with sssekai live2dextract

3D Assets

NOTE: Assets flagged with * can be imported by sssekai_blender_io into Blender

Path Purpose (Assumed)
live_pv/model 3D Assets for real-time rendered PVs
live_pv/model/character *Character models
live_pv/model/characterv2 *Also character models. (w/ slightly more modern NPR techniques e.g. SDF Face shadows, eye specular and so on)
live_pv/model/stage *Stage models.
live_pv/model/stage_decoration *Stage decoration models (of course). Per-PV. Can be queried by mvdata
live_pv/model/music_item *PV Props. Bone weights are missing for some reason.
model3d/model/stage_object *PV Props, again. With the same aforementioned issues.
live_pv/timeline/... *Animation data for character, stage objects, camera, and more.
streaming_live/archive *Streaming Live (Virtual Live) recording archives, contains character motion data & shapekey expressions, and more.

Game Master Data

Master data (hereby referred to as DB) is the game's monolithic database for states,events,etc.

  • You can download the DB with the following command:
sssekai abcache --app-version ... --app-appHash ... --dump-master-data <directory name>

The files (in JSON format) will be stored in the specified directory, in a structure similar to https://github.com/Sekai-World/sekai-master-db-diff