fgsfdsfgs / doukutsupsx

port of Cave Story to the PlayStation, based on CSE2
Other
101 stars 4 forks source link

Russian translation #9

Closed 10522 closed 1 year ago

10522 commented 1 year ago

I found Russian translation for PC version here and here. Is it possible to add it to PS1 version?

fgsfdsfgs commented 1 year ago

The port doesn't support localization currently. Theoretically you could do this without modifying the game source itself by generating a new FontAscii.pbm using fontgen (you'll have to replace ANSI_CHARSET with RUSSIAN_CHARSET in fontgen.cpp), then regenerating all the stage banks and the main gfx bank using the data files from the Russian version you linked. In this case the menu will be still in English though.

Dima353 commented 1 year ago

Can you tell us in more detail how to edit *.stg files?

fgsfdsfgs commented 1 year ago

.stg files are stage banks generated by the stagepack utility. To build it and other utilities you'll need a MSYS2/MinGW install on Windows or gcc and make on Linux. When you have that set up, execute this in the MINGW64 prompt on Windows or your terminal on Linux:

cd tools
make

Copy the data directory from the PC version of CS to the tools directory (do not overwrite anything) and make the necessary changes to it. You can then rebuild the stagebanks like so:

./stagepack.exe  stagelists/stage_all.lst data ../data

All the .stg files in doukutsupsx/data will be updated.

You will need to edit the font as well. It can't actually be expanded to include Cyrillic characters without modifying the source code, but maybe you can just replace the Latin characters. The font is located in tools/data/FontAscii.pbm, which is just a 4 bit BMP file. After editing it, you need to regenerate the main.gfx graphics bank:

./surfpack.exe surflists/surf_main.lst ../data/main/main.gfx

If you wish, you can try modifying tools/src/fontgen.cpp to generate a bigger font that includes Cyrillic first, but I can't say if this will require any extra modifications for anything. This is the command that was used to generate FontAscii.pbm:

./fontgen.cpp -a "MS Gothic" 6 12 FontAscii.pbm
Dima353 commented 1 year ago

Thanks for the instructions! I get an error when rebuilding *.stg Even if I use the original files.

dima353@DESKTOP-80NUHMS:~/cave/doukutsupsx/tools$ ./stagepack.exe  stagelists/stage_all.lst data ../data
surf page 0 limited by rect: (0, 0, 704, 256)
surf page 1 limited by rect: (0, 0, 80, 240)
clut page 0 limited by rect: (0, 0, 320, 16)

parsed 95 stages from 'stagelists/stage_all.lst'

head tsc loaded from 'data/Head.tsc': 1461 bytes
loaded stage '       0' (id 00, size 021x020)
loaded stage '   Pens1' (id 01, size 021x016)
loaded stage '    Eggs' (id 02, size 300x016)
loaded stage '    EggX' (id 03, size 021x016)
loaded stage '    Egg6' (id 04, size 021x016)
loaded stage '    EggR' (id 05, size 021x016)
loaded stage '    Weed' (id 06, size 280x023)
loaded stage '   Santa' (id 07, size 021x016)
loaded stage '   Chako' (id 08, size 021x016)
loaded stage '   MazeI' (id 09, size 025x070)
loaded stage '    Sand' (id 0a, size 240x050)
loaded stage '    Mimi' (id 0b, size 060x060)
loaded stage '    Cave' (id 0c, size 060x045)
loaded stage '   Start' (id 0d, size 021x016)
loaded stage '    Barr' (id 0e, size 021x016)
loaded stage '    Pool' (id 0f, size 040x020)
loaded stage '   Cemet' (id 10, size 040x020)
loaded stage '   Plant' (id 11, size 040x016)
loaded stage '   Shelt' (id 12, size 021x016)
loaded stage '    Comu' (id 13, size 021x016)
loaded stage '   MiBox' (id 14, size 021x016)
loaded stage '  EgEnd1' (id 15, size 021x016)
loaded stage '    Cthu' (id 16, size 021x016)
loaded stage '    Egg1' (id 17, size 021x016)
loaded stage '   Pens2' (id 18, size 021x016)
loaded stage '   Malco' (id 19, size 021x016)
loaded stage '   WeedS' (id 1a, size 021x016)
loaded stage '   WeedD' (id 1b, size 021x016)
loaded stage '    Frog' (id 1c, size 021x020)
loaded stage '   Curly' (id 1d, size 021x016)
loaded stage '   WeedB' (id 1e, size 021x016)
loaded stage '  Stream' (id 1f, size 120x016)
loaded stage '  CurlyS' (id 20, size 021x016)
loaded stage '  Jenka1' (id 21, size 021x016)
loaded stage '    Dark' (id 22, size 021x016)
loaded stage '    Gard' (id 23, size 030x016)
loaded stage '  Jenka2' (id 24, size 021x016)
loaded stage '   SandE' (id 25, size 048x028)
loaded stage '   MazeH' (id 26, size 040x016)
loaded stage '   MazeW' (id 27, size 200x020)
loaded stage '   MazeO' (id 28, size 021x016)
loaded stage '   MazeD' (id 29, size 021x016)
loaded stage '   MazeA' (id 2a, size 032x016)
loaded stage '   MazeB' (id 2b, size 021x038)
loaded stage '   MazeS' (id 2c, size 021x021)
loaded stage '   MazeM' (id 2d, size 134x080)
loaded stage '   Drain' (id 2e, size 021x016)
loaded stage '  Almond' (id 2f, size 080x030)
loaded stage '   River' (id 30, size 160x045)
loaded stage '   Eggs2' (id 31, size 300x016)
loaded stage '   Cthu2' (id 32, size 021x016)
loaded stage '   EggR2' (id 33, size 021x016)
loaded stage '   EggX2' (id 34, size 021x016)
loaded stage '   Oside' (id 35, size 100x180)
loaded stage '  EgEnd2' (id 36, size 021x016)
loaded stage '    Itoh' (id 37, size 021x016)
loaded stage '    Cent' (id 38, size 120x120)
loaded stage '   Jail1' (id 39, size 030x020)
loaded stage '    Momo' (id 3a, size 021x016)
error: could not load map data from 'data/Stage/lounge.pxm'
error: could not load stage 'data/Stage/lounge'
dima353@DESKTOP-80NUHMS:~/cave/doukutsupsx/tools$
fgsfdsfgs commented 1 year ago

If you're on Linux or maybe WSL, this might be because the stage file is called Lounge instead of lounge, in which case you can just rename it either on disk or in tools/data/stagelists/stage_all.lst. If you're actually missing that file for whatever reason and you're sure it's not necessary, you'll have to delete the whole line where it's mentioned from tools/data/stagelists/stage_all.lst.

Dima353 commented 1 year ago

Yes, the renaming worked.

Next I get this

loaded stage '  e_Blcn' (id 5d, size 021x016)
loaded stage '   Clock' (id 5e, size 021x016)

error: could not read 'data/sfxbnk/ending.sfx'
error: could not write bank for stage '0' (0)

These files are nowhere to be found

fgsfdsfgs commented 1 year ago

You'll need to regenerate the instrument banks for the music then. For that you need the Wave.dat file and the .org music files, which are embedded into Doukutsu.exe in the PC version. You can open the EXE with Resource Editor or 7-zip, the .dat file is called WAVE100. Extract it and place it at tools/data/Wave.dat. The .org files are in 1041/ORG.

If you don't want to bother, I've attached my .org files and wave.dat. Just extract the zip into the tools/data folder. data.zip

Afterwards, run

cd tools
mkdir -p data/sfxbnk
./make_banks.sh data/org data/Wave.dat data/sfxbnk 484912

Then run stagepack again.

Dima353 commented 1 year ago

Thank you for your help! I went to do :) E-n938AJLWc

Dima353 commented 1 year ago

Successfully translated dialogs and menus I can't find the names of the levels. Checked all files in src/game UPD: Found \tools\stagelists\stage_all.lst

Dima353 commented 1 year ago

It seems that the file Armsites.tsc does not get into the new banks image how to regenerate ArmsItem.bsc? UPD: oh... VS Code...

After editing Armsites.bsc and opening the menu with weapons, the game freezes... shit...

fgsfdsfgs commented 1 year ago

If you saved it as UTF-8 or something, that won't work. The extra TSC files (Credit.tsc, ArmsItem.tsc, StageSel.tsc) have to be recompiled into BSC if you change them, e.g.:

cd tools
./tscc.exe data/ArmsItem.tsc ../data/main/ArmsItem.bsc
Dima353 commented 1 year ago

Done https://github.com/Dima353/doukutsupsx/releases/tag/v1.0