Skip to content

Latest commit

 

History

History
148 lines (102 loc) · 7.2 KB

File metadata and controls

148 lines (102 loc) · 7.2 KB

Data Extraction Scripts

Scripts for syncing game data into the JSON files consumed by the app.

For the end-to-end pipeline and source ownership, see:

Primary Pipeline

Start with master.mdb to establish what's live on Global, then sync GameTora for the full catalog:

bun run db:fetch        # 1. Download latest master.mdb
bun run extract:all     # 2. Extract course geometry from master.mdb
bun run sync:data       # 3. Sync entity catalog (skills, umas, cards) from GameTora

What that produces:

  • sync:data writes GameTora snapshots under src/modules/data/json/gametora/
  • extract:all writes src/modules/data/json/course_data.json
  • course extraction also updates data-manifest.json (masterDb.extractedAt, and masterDb.resourceVersion when provided or resolved)

Current Source Ownership

Source Owns Command
GameTora snapshots skills, character cards, support cards, support effects, training events, reward dictionaries bun run sync:data
master.mdb course geometry only bun run extract:all or bun run extract:course-data

Prerequisites

  • bun
  • master.mdb — required for extract:all / extract:course-data
  • Network access — required for sync:data; optional for fetch:support-events

Database Location

Place master.mdb in a db/ directory at the project root (gitignored):

uma-sim/
├── db/
│   └── master.mdb
├── scripts/
└── ...

All extract scripts auto-detect this path. You can also pass a custom path:

bun scripts/data-extract/extract-course-data.ts /path/to/master.mdb

Platform defaults:

  • Windows: %APPDATA%\..\LocalLow\Cygames\Umamusume\master\master.mdb
  • macOS/Linux (Steam): ~/.local/share/Steam/steamapps/compatdata/[AppID]/pfx/.../master.mdb

Scripts

Primary Commands

Script Command Role
sync-gametora.ts bun run sync:data Sync GameTora snapshots for the entity catalog
extract-all.ts bun run extract:all Primary master.mdb pipeline; currently runs course extraction only
extract-course-data.ts bun run extract:course-data Extract course geometry directly

Standalone master.mdb Fallback Tools

These scripts still work, but they are no longer part of the recommended pipeline because entity catalog data now comes from GameTora snapshots.

Script Command Output
extract-skills.ts bun run extract:skills src/modules/data/json/skills.json
extract-support-cards.ts bun run extract:support-cards src/modules/data/json/support-cards.json
extract-uma-info.ts bun run extract:uma-info src/modules/data/json/umas.json

Legacy / Redundant Helper

Script Command Status
fetch-support-events.ts bun run fetch:support-events Redundant for the main pipeline; support card events now come from GameTora snapshots

fetch:support-events is kept for now as a standalone utility, but it is no longer required for normal data syncs.

Resource Version Tracking

Course extraction updates data-manifest.json after a successful run.

# Use a known resource version
bun run extract:all -- --resource-version 10004010

# Resolve the latest version from uma.moe before writing the manifest
bun run extract:all -- --resolve-resource-version

The same flags also work with bun run extract:course-data.

Output Files

Primary Pipeline Outputs

File Source Produced by
src/modules/data/json/gametora/*.json GameTora bun run sync:data
src/modules/data/json/course_data.json master.mdb bun run extract:all / bun run extract:course-data
data-manifest.json sync metadata bun run sync:data, then updated by course extraction

Standalone Fallback Outputs

File Source Produced by
src/modules/data/json/skills.json master.mdb bun run extract:skills
src/modules/data/json/support-cards.json master.mdb bun run extract:support-cards
src/modules/data/json/umas.json master.mdb bun run extract:uma-info
src/modules/data/json/support-events.json GameTora bun run fetch:support-events

Merge vs Replace

Course extraction still supports the existing modes:

Mode Behavior Use when
Merge (default) Updates courses found in master.mdb, preserves others Regular updates
Replace (--replace) Overwrites with only current master.mdb courses Clean rebuild
bun run extract:all
bun run extract:all -- --replace

Shared Libraries

  • scripts/master-data/shared.ts — JSON I/O, key sorting, DB path resolution
  • scripts/master-data/database.ts — SQLite helpers
  • scripts/master-data/uma-api.ts — latest resource version lookup via uma.moe

Troubleshooting

  • "Failed to open database" — check the master.mdb path, permissions, and whether the game is locking the file.
  • "Could not read courseeventparams" — ensure the courseeventparams/ directory exists with course JSON files.
  • sync:data network errors — retry when connectivity is restored.
  • fetch:support-events network errors — the script falls back to .cache/gametora/ automatically.