Results 1 to 14 of 14
  1. #1 Reply With Quote
    research NicoDE's Avatar
    Join Date
    Dec 2004
    Posts
    7,404
    lianzifu (连字符) has been developed for Risen 3, but the binary string table format hasn't been changed for ELEX.

    Main thread: [release] Risen 3 string table [un]packer (lianzifu)

    Please use this thread for ELEX-related discussions.

    ELEX-specific issues:
    • PB changed the STB version with a patch (from 6 to 7)
      (the BIN isn't accepted by the game if the version doesn't match)
    • there is no string identifier hash map for ELEX yet
      (ask Piranha Bytes to create them with lianzifu or create your own)
    • there were some damaged strings in the original BINs
      (has been fixed by PB with one of the latest patches)
    "Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor
    NicoDE is offline Last edited by NicoDE; 01.02.2018 at 11:54.

  2. #2 Reply With Quote
    research NicoDE's Avatar
    Join Date
    Dec 2004
    Posts
    7,404
    With the current patch (2955) the string tables are split into several files (still STB file format with version 7):

    data/compiled/localization/de.str German(_Text|_StageDir)
    data/compiled/localization/en.str English(_Text|_StageDir)
    data/compiled/localization/fr.str French(_Text|_StageDir)
    data/compiled/localization/it.str Italian(_Text|_StageDir)
    data/compiled/localization/sp.str Spanish(_Text|_StageDir)
    data/compiled/localization/pl.str Polish(_Text|_StageDir)
    data/compiled/localization/ru.str Russian(_Text|_StageDir)
    data/compiled/localization/cz.str Czech(_Text|_StageDir)
    data/compiled/localization/ch.str Chinese(_Text|_StageDir)
    data/compiled/localization/kor.str Korean(_Text|_StageDir)

    It might make sense to add an optional column filter to lianzifu's --save-bin command...
    "Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor
    NicoDE is offline Last edited by NicoDE; 07.02.2018 at 16:14.

  3. #3 Reply With Quote
    research NicoDE's Avatar
    Join Date
    Dec 2004
    Posts
    7,404
    Quote Originally Posted by NicoDE View Post
    It might make sense to add an optional column filter to lianzifu's --save-bin command...
    done, has been added in version 2.1
    "Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor
    NicoDE is offline

  4. #4 Reply With Quote
    research NicoDE's Avatar
    Join Date
    Dec 2004
    Posts
    7,404
    Example script (lianzifu-unpack.elex.cmd) to unpack the current string tables:
    Code:
    @ECHO OFF
    VERIFY OTHER 2>NUL
    SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
    IF "%ERRORLEVEL%"=="0" GOTO BEGIN
    ECHO.
    ECHO This script requires command extensions and
    ECHO delayed environment variable expansion [NT].
    ECHO.
    IF NOT "%1"=="--no-prompt" PAUSE
    EXIT
    :BEGIN
    REM 'run as admin' and UNC paths require manually switching into the directory
    PUSHD "%~dp0"
    
    SET LIANZIFU_ARGS=--read-ini "data/ini/loc.ini"
    REM load id name map files if present
    FOR %%B IN ("%~dpn0*.csv") DO (
      ECHO # found idmap file ^(%%~nxB^)
      SET LIANZIFU_ARGS=!LIANZIFU_ARGS! --read-map "%%~nxB"
    )
    REM read (old) full string table if present
    REM (to include Korean strings if kor.str is missing)
    FOR %%B IN (data/compiled/localization/?_strings.bin) DO (
      ECHO # found full table ^(data/compiled/localization/%%~nxB^)
      SET LIANZIFU_ARGS=!LIANZIFU_ARGS! --read-bin "data/compiled/localization/%%~nxB"
    )
    REM read (new) language specific string tables if present
    FOR %%L IN (de en fr it sp pl ru cz ch kor) DO (
      IF EXIST "data/compiled/localization/%%L.str" (
        ECHO # found lang table ^(data/compiled/localization/%%L.str^)
        SET LIANZIFU_ARGS=!LIANZIFU_ARGS! --read-bin "data/compiled/localization/%%L.str"
      )
    )
    
    IF NOT "%1"=="--no-prompt" (
      ECHO.
      ECHO Existing data/raw/strings/*.csv will be overridden!
      ECHO -----  press [Ctrl+C] to cancel this script  -----
      ECHO.
      PAUSE
    )
    
    ECHO running lianzifu...
    lianzifu.exe %LIANZIFU_ARGS% --save-csv --exit 1> "%~dpn0.log" 2>&1
    
    SET /A EXITCODE="%ERRORLEVEL%"
    IF NOT "%EXITCODE%"=="0" (
      TYPE "%~dpn0.log"
      IF NOT "%1"=="--no-prompt" PAUSE
    )
    POPD
    ENDLOCAL && EXIT /B %EXITCODE%
    Without a map file (lianzifu-unpack.elex.csv) all the strings will be in the data/raw/strings/strings.csv
    "Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor
    NicoDE is offline Last edited by NicoDE; 13.02.2018 at 21:22. Reason: support multiple idmap files

  5. #5 Reply With Quote
    research NicoDE's Avatar
    Join Date
    Dec 2004
    Posts
    7,404
    Attached you'll find string identifier map files that include two-thirds of the current x64 release (the batch script from the previous post is also included).

    lianzifu-unpack.elex.zip

    Put all the files and the lianzifu.exe in the root directory of the game, extract the BIN and/or all STR into data/compiled/localization and run the lianzifu-unpack.elex.cmd .

    Well, two-thirds is better that nothing. If you want a complete map, you'll have to ask PB (they could run lianzifu --read-ini data/ini/loc.ini --read-csv --save-map lianzifu-unpack.elex.[platform].csv for every platform).

    ps: My map files contain more information than required (everything after the first | is ignored). To support later merging I included the hash value and the source file, where the string has been found.
    NicoDE is offline Last edited by NicoDE; 22.06.2018 at 10:57.

  6. #6 Reply With Quote
    Lehrling
    Join Date
    Jun 2011
    Posts
    38
    I started to figure out in this, extracted strings to csv, & managed to write a cmd file to put it back to the bin. It worked in game, but I have a few questions about it, to be shoore everything is okey.

    1) As I understand, everything which not present in map csv files, goes to strings.csv.
    This file has a lot of empty lines with addres. Is it normal?

    2) Order of text fields is different from the map csv. Mostly it just turned upside down. It makes uncomfortable to work with it, especially with dialogs. Could it be fixed somehow?

    3) Here is my cmd script, is everything okey in it?

    Spoiler:(zum lesen bitte Text markieren)
    @ECHO OFF
    ECHO Packing Elex (Windows 64-bit) string table...

    CD /D "%~dp0"
    lianzifu.exe ^
    --read-ini "data/ini/loc.ini" ^
    --read-csv ^
    --save-bin x64 7 "data/compiled/localization/ru.str" ^
    --save-map "#%~n0.csv" ^
    --exit 1> "%~dpn0.log" 2>&1

    IF ERRORLEVEL 1 (
    TYPE "%~dpn0.log"
    PAUSE
    )

    4) After pack string back to the bin, it's size is different from the original bin:
    1.45 mb vs 1.55 (org). That part troubles me. Although the game works fine with it, I fear that something may be missed or assemble not properly. I'll put here an archive with this files & will be wait for your opinion.
    elex_ru_loc.rar
    STARK1LLER is offline Last edited by STARK1LLER; 20.06.2018 at 18:43.

  7. #7 Reply With Quote
    research NicoDE's Avatar
    Join Date
    Dec 2004
    Posts
    7,404
    Quote Originally Posted by STARK1LLER View Post
    1) As I understand, everything which not present in map csv files, goes to strings.csv.
    They are added to the first entry in the loc.ini.

    For most users this is
    Code:
    [default]
    prefix=default
    csv=#G3:/Data/Raw/Strings/strings.csv
    bin=#G3:/Data/Compiled/Strings/strings.tab
    During testing I used:
    Code:
    [unknown]
    prefix=unknown
    csv=#G3:/Data/Raw/Strings/unknown.csv
    bin=#G3:/Data/Compiled/Strings/unknown.tab
    You are completely free to organize your CSVs. In the end the prefix doesn't matter for the game, because all CSV entries are merged into one big table with identifier hashes as rows and the language(s) as columns.

    The map file feature is only present to restore the identifier strings from the hashes in the compiled BIN files.

    Quote Originally Posted by STARK1LLER View Post
    This file has a lot of empty lines with addres. Is it normal?
    Yes, there are a lot of empty values in the table. That's normal and expected.

    Quote Originally Posted by STARK1LLER View Post
    2) Order of text fields is different from the map csv.
    As mentioned above, the map files are only of interest for unpacking compiled BINs.
    (usually you unpack the original BINs once and start working with the CSVs, and later to track the changes in the official patches - well, I don't expect that many in the future...)

    The identifier hashes in the BINs have to be stored in descending order. There is no information left from which CSV the entry was read (in fact, for multi-language BINs the values for one identifier could be read from different CSVs).
    I don't want to change the order on unpacking or map file export, because it would make it harder to track the changes (I recommend using a version control system like Subversion, Git, ...).

    Quote Originally Posted by STARK1LLER View Post
    3) Here is my cmd script, is everything okey in it?
    The script is fine.

    But you can skip the map file export (you already have the CSVs with the identifiers - however, a map file would be useful for other users if you introduce new identifiers and want to share it with the community ).

    Since you're creating a single language BIN, you might add a column filter for the --save-bin. Add 9 (the current default compression level) and "Russian_Text" (AFAIK the game doesn't use the *_StageDir columns - the default is "*_Text;*_StageDir").

    Quote Originally Posted by STARK1LLER View Post
    4) After pack string back to the bin, it's size is different from the original bin:
    That's fine
    I implemented several compression methods in lianzifu. The current default compression level is 9 (best), which usually results in a better compression ration than the method that PB used. The PB-like compression method is currently selected with level 4. However, to get the same out, you have to have the same CSV files in the same order as PB (with this method the encoding dictionary is full after 25% of the data and the following entries have to be encoded with this dictionary).

    I'm working on an even better compression method, but don't expect a public release soon (currently it's too slow and I'm on vacation for several weeks).
    "Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor
    NicoDE is offline Last edited by NicoDE; 21.06.2018 at 10:12.

  8. #8 Reply With Quote
    Lehrling
    Join Date
    Jun 2011
    Posts
    38
    Thanks for the reply. After my previous post, I started to fix some localization errors. It works fine.
    I wonder how to add new text variables properly? As I understood, game uses text line addresses to identify them. And the most properer way is to declare new csv at the end of ini? For example:
    Spoiler:(zum lesen bitte Text markieren)
    [new]
    prefix=new
    csv=#G3:/Data/Raw/Strings/new.csv
    bin=#G3:/Data/Compiled/Strings/new.tab

    Then add new text variables to that csv file. And when it'll be pack to the bin, it should be at the end, and do not interfere with the rest data.
    How much memory is available for this?
    STARK1LLER is offline

  9. #9 Reply With Quote
    research NicoDE's Avatar
    Join Date
    Dec 2004
    Posts
    7,404
    Quote Originally Posted by STARK1LLER View Post
    I wonder how to add new text variables properly?
    You're free to put them everywhere. Of course it makes sense to create a my_mod.csv for your new strings.
    The separation into different CSV files just helps finding things.
    You could use a single CSV with all strings and all languages if you like.
    For the game it doesn't matter: It loads the column for the selected language from the BIN on start, and when a localized string is requested, the hash of the identifier is calculated, and the value for the hash is read.
    "Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor
    NicoDE is offline

  10. #10 Reply With Quote
    Lehrling
    Join Date
    Jun 2011
    Posts
    38
    So it's a hash of a variable. I thought it some king of an address.
    So knowing of the hash algorithm may help to restore missing string variable names?
    STARK1LLER is offline

  11. #11 Reply With Quote
    research NicoDE's Avatar
    Join Date
    Dec 2004
    Posts
    7,404
    Quote Originally Posted by STARK1LLER View Post
    So it's a hash of a variable. I thought it some king of an address.
    So knowing of the hash algorithm may help to restore missing string variable names?
    It's the DJB2 hash of the lower-cased string identifier (first column in the CSV).

    Have a look at post #5.
    Extract the latest BIN and all the latest STRs and run the script. This will create CSVs with all languages (and many hashes are resolved to identifier strings). The German_StageDir and English_StageDir might give you additional hints what the string is used for. Since all languages are included, you should specify the filter Russian_Text for the --save-bin command when creating the ru.str.
    "Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor
    NicoDE is offline Last edited by NicoDE; 21.06.2018 at 19:07.

  12. #12 Reply With Quote
    Ranger InnerMoon's Avatar
    Join Date
    Feb 2008
    Posts
    187
    Hello there.

    I've managed to modify (and enhance) the Spanish text of the game (I've been fixing a lot of errors and things that were not translated correctly). Howeve I have a problem:

    I tried to fix the subtitles of the intro video but the changes I made do not work. When I start a new game the subtitles of the intro video are still the vanilla ones (not the ones I change in the mod).

    How can I fix this?
    InnerMoon is offline

  13. #13 Reply With Quote
    Lehrling
    Join Date
    Nov 2017
    Posts
    17
    Quote Originally Posted by InnerMoon View Post
    Hello there.

    I've managed to modify (and enhance) the Spanish text of the game (I've been fixing a lot of errors and things that were not translated correctly). Howeve I have a problem:

    I tried to fix the subtitles of the intro video but the changes I made do not work. When I start a new game the subtitles of the intro video are still the vanilla ones (not the ones I change in the mod).

    How can I fix this?
    Здравствуйте..
    Для того чтобы изменить субтитры в интро видео вам необходимо изменить их в следующем файле prologue.spanish.srt расположенном по следующему пути Elex\data\extern\video. Их можно изменить с помощью простого блокнота.

    Yandex-Translation: Hello there.In order to change the subtitles in the Intro video you need to change them in the following file prologue.spanish.srt located on the following path Elex\data\extern\video.
    They can be changed with a simple Notepad.
    Asloner is offline

  14. #14 Reply With Quote
    Ranger InnerMoon's Avatar
    Join Date
    Feb 2008
    Posts
    187
    Man, I love you. Thanks.
    InnerMoon is offline

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •