Fix mkdocs nav, update DDR parser and add DDR import guide (#1307)

* docs: fix pages that weren't in the navigation bar

* seeds: update DDR parsing scripts to use arguments

* docs: fix minor mistake

* docs: add all supported DDR versions

* docs: add DDR musicdb import guide
This commit is contained in:
auxbh
2025-06-18 20:18:08 +01:00
committed by GitHub
parent 60285648aa
commit 3be081abcf
8 changed files with 130 additions and 60 deletions
@@ -0,0 +1,77 @@
# Merging DDR data into seeds
!!! important
You need to have a working setup of Tachi to use this script.
For instructions on how to do that, see [Tachi Setup](../setup.md).
## Using `musicdb.xml`
We have a script that already exists for parsing a `musicdb.xml` file and merging it with the database seeds.
This is convenient for when you want to provide an update for DDR based off data you have.
### Importing DDR gamedata
Navigate to `seeds/scripts/rerunners/ddr`.
The file you're looking to run is `parse-gameData-xml.ts`, but it needs two arguments:
- `--input`, which is the location of the `musicdb.xml` file you're looking to parse.
- `--version`, what version of the game this music db is from. For a list of versions, see the [DDR Config](../../game-support/games/ddr-SP.md#versions).
You can run this script by typing `ts-node parse-gameData-xml.ts --input YOUR_INPUT_HERE --version YOUR_VERSION_HERE` in the terminal.
For example, if your file is in the same directory as the script, and you're importing from DDR World:
`ts-node parse-gameData-xml.ts --input ./musicdb.xml --version world`
!!! warning "Warning"
If all the difficulties in your XML file are set to `255`, you will need to enter them manually before importing.
Otherwise, the song won't be imported properly, and the difficulties won't show up.
If the song is also in DDR Konaste, and you have the relevant json file, you can copy the values over.
Alternatively, you can use [RemyWiki](https://remywiki.com/). Look up the song's name, then copy the difficulties manually from the table.
- Search for your song on RemyWiki.
- Scroll down to "Difficulty & Notecounts", then look for the table containing your game version.
- Manually copy the difficulties from it.
For example, with [Cheerleader](https://remywiki.com/Cheerleader):
The difficulty in `musicdb.xml` is set to `<diffLv __type="u8" __count="10">255 255 255 255 255 0 255 255 255 255</diffLv>`, which is incorrect.
After following these steps, you should end up with `<diffLv __type="u8" __count="10">2 6 9 13 15 0 6 9 13 15</diffLv>`.
Notes: There are 10 numbers, each one corresponding to a level of difficulty.
The first 5 are for SP, and the remaining are for DP.
The difficulty levels range from *BEGINNER*, *BASIC*, *DIFFICULT*, *EXPERT*, to *CHALLENGE*.
Any difficulty above 19 will be ignored, and a difficulty of 0 means that the song does not have it.
The *BEGINNER* field for DP is always set to 0 because it doesn't exist.
### Updating stepCounts
Step counts are generated from SSQ files. You're on your own to find them.
Place all of your SSQ files in the `ssq` folder. The name of each file should correspond to the `basename` of each song, which is a 4~5 characters identifier.
Then, run `ts-node parse-charts.ts`
## Using a JSON file
We have a script that already exists for parsing a JSON file and merging it with the database seeds.
This is convenient for when you want to provide an update for DDR based off data you have.
!!! danger "Important"
JSON files are usually used for Konaste game data, and therefore won't have all arcade songs.
Due to encoding differences, songs may contain Unicode characters in them instead of their actual names. You will have to manually fix this.
Additionally, the basename of existing songs may be edited incorrectly.
Therefore, this option is **not** recommended.
Navigate to `seeds/scripts/rerunners/ddr`.
The file you're looking to run is `parse-gameData-json.ts`, but it needs two arguments:
- `--input`, which is the location of the JSON file you're looking to parse.
- `--version`, what version of the game this music db is from. For a list of versions, see the [DDR Config](../../game-support/games/ddr-SP.md#versions).
You can run this script by typing `ts-node parse-gameData-json.ts --input YOUR_INPUT_HERE --version YOUR_VERSION_HERE` in the terminal.
For example, if your file is in the same directory as the script, and you're importing from DDR Konaste:
`ts-node parse-gameData-json.ts --input ./music.json --version konaste`
+1 -1
View File
@@ -1,7 +1,7 @@
# Merging a SDVX music_db.xml into seeds
We have a script that already exists for parsing a `music_db.xml` file and merging it with the database seeds.
This is convenient for when you want to provide an update for SDVX based off of data you have.
This is convenient for when you want to provide an update for SDVX based off data you have.
!!! important
You need to have a working setup of Tachi to use this script.
+4
View File
@@ -76,7 +76,11 @@ The following judgements are defined:
| ID | Pretty Name |
| :: | :: |
| `a` | A |
| `a20` | A20 |
| `a20plus` | A20+ |
| `a3` | A3 |
| `world` | WORLD |
| `konaste` | Konaste |
## Supported Match Types
+4
View File
@@ -76,7 +76,11 @@ The following judgements are defined:
| ID | Pretty Name |
| :: | :: |
| `a` | A |
| `a20` | A20 |
| `a20plus` | A20+ |
| `a3` | A3 |
| `world` | WORLD |
| `konaste` | Konaste |
## Supported Match Types
+7 -1
View File
@@ -37,10 +37,12 @@ nav:
- "contributing/components/issues.md"
- "contributing/components/documentation.md"
- "contributing/components/seeds.md"
- "contributing/components/core.md"
- Cookbook:
- "contributing/cookbook/iidx-mdb.md"
- "contributing/cookbook/sdvx-mdb.md"
- "contributing/cookbook/ddr-mdb.md"
- "contributing/cookbook/bms-tables.md"
- Supporting New Games:
@@ -55,6 +57,7 @@ nav:
- "game-support/server-impl.md"
- "game-support/client-impl.md"
- "game-support/seeds.md"
- Game Information:
- "game-support/games/iidx-SP.md"
@@ -78,6 +81,8 @@ nav:
- "game-support/games/itg-Stamina.md"
- "game-support/games/arcaea-Touch.md"
- "game-support/games/ongeki-Single.md"
- "game-support/games/ddr-SP.md"
- "game-support/games/ddr-DP.md"
- Wiki:
- "wiki/index.md"
@@ -130,7 +135,7 @@ nav:
- Infrastructure:
- "codebase/infrastructure/logging.md"
- "codebase/infrastructure/branches.md"
- "codebase/infrastructure/seeds.md"
- "codebase/infrastructure/database-seeds.md"
- OAuth2:
- "codebase/infrastructure/api-clients.md"
@@ -147,6 +152,7 @@ nav:
- "codebase/batch-manual/direct-manual.md"
- Score Importing:
- "codebase/import/overview.md"
- "codebase/import/main.md"
- "codebase/import/import-types.md"
- "codebase/import/parse-conv.md"
-37
View File
@@ -1,37 +0,0 @@
# Import DDR Gamedata
1) Generate gamedata under the following XML format :
```xml
<?xml version="1.0" encoding="UTF-8"?>
<mdb>
<music>
<mcode __type="u32">999</mcode>
<basename>randomsong</basename>
<title>This song doesn't exist</title>
<title_yomi>thissongdoesntexist</title_yomi>
<artist>Some Artist</artist>
<bpmmax __type="u16">120</bpmmax>
<series __type="u8">2</series>
<bemaniflag __type="u32">1</bemaniflag>
<limited_cha __type="u8">1</limited_cha>
<diffLv __type="u8" __count="10">3 5 6 9 0 0 6 8 8 0</diffLv>
</music>
<music>
...
</music>
...
</mdb>
```
File must be stored in the same folder as the script with the name `musicdb.xml`
2) At the last line of the script, eventually change the version if necessary. Current supported versions are `a3` and `konaste` (which are very similar since konaste is based on a3)
3) Run `ts-node parse-gameData-xml.ts`
# Update stepCounts
Step counts are generated from SSQ files. You're on your own to find them.
1) Put all your SSQ files in the `ssq` folder. The name of each file should correspond to the `basename` of each song (a 4~5 characters identifier)
2) Run `ts-node parse-charts.ts`
@@ -1,20 +1,21 @@
import fs from "fs";
import {Music, parseGameData} from "./parse-gameData";
import { Music, parseGameData } from "./parse-gameData";
import { Command } from "commander";
interface JsonMusic {
mcode: number,
basename: string,
title: string,
title_sort: string,
artist: string,
bpmmax: number,
bpmmin: number,
level_str: string,
editable: boolean,
seriesid: number,
ac_seriesid: number,
limited_cha: number,
bemaniflag: number,
mcode: number;
basename: string;
title: string;
title_sort: string;
artist: string;
bpmmax: number;
bpmmin: number;
level_str: string;
editable: boolean;
seriesid: number;
ac_seriesid: number;
limited_cha: number;
bemaniflag: number;
}
function jsonMusicToMusic(jsonMusic: JsonMusic): Music {
@@ -29,9 +30,16 @@ function jsonMusicToMusic(jsonMusic: JsonMusic): Music {
bemaniflag: jsonMusic.bemaniflag,
limited_cha: jsonMusic.limited_cha,
diffLv: jsonMusic.level_str,
}
};
}
const gameData = JSON.parse(fs.readFileSync("music.json", "utf-8")).map(jsonMusicToMusic);
const program = new Command();
program.requiredOption("-i, --input <musicdb.xml>");
program.requiredOption("-v, --version <the version this mdb is for, a3, world, konaste, etc.>");
parseGameData("konaste", gameData);
program.parse(process.argv);
const options = program.opts();
const gameData = JSON.parse(fs.readFileSync(options.input, "utf-8")).map(jsonMusicToMusic);
parseGameData(options.version, gameData);
@@ -1,9 +1,17 @@
import {XMLParser} from "fast-xml-parser";
import { XMLParser } from "fast-xml-parser";
import fs from "fs";
import {Music, parseGameData} from "./parse-gameData";
import { Music, parseGameData } from "./parse-gameData";
import { Command } from "commander";
const parser = new XMLParser();
const gameData: Music[] = parser.parse(fs.readFileSync("musicdb.xml")).mdb.music;
const program = new Command();
program.requiredOption("-i, --input <musicdb.xml>");
program.requiredOption("-v, --version <the version this mdb is for, a3, world, konaste, etc.>");
parseGameData("world", gameData);
program.parse(process.argv);
const options = program.opts();
const gameData: Music[] = parser.parse(fs.readFileSync(options.input)).mdb.music;
parseGameData(options.version, gameData);