Author Topic: How to distribute fan made translation?  (Read 2988 times)

0 Members and 1 Guest are viewing this topic.

Offline ZvikaZ

How to distribute fan made translation?
« on: February 11, 2021, 06:32:44 AM »
Hi.

I've started checking the feasibility of Hebrew translation of AGI games:


I think I can solve most of the problems that I can foresee. However, I'm not sure what's the best way to distribute the translation, once it will be finished.
For the SQ3 project I distributed a zip file, containing a bunch of translated resources.

However, since AGI doesn't have patch file mechanism (or does it have such mechanism? and I'm just wrong here?...), I'd like to hear your opinion as to the preferred way to accomplish that. Or maybe someone already solved that problem?

The options that I currently think of (and their drawbacks):

  • 1. Compile the game in my computer, and distribute the compiled game.
  •     * Problem: It's piracy. And ScummVM won't accept it...
  • 2. Compile the game in my computer, save the binary diff between the result and the original, create a tool that will apply that diff, and distribute the tool with the diff file.
  •     * Problem: PQ1 (2gs version) comes with VOL.0 and VOL.1 files. When compiling with WinAGI, it combines them to a single big VOL.0 file. Opening it in a differ shows no resemblance to the original VOL.0 file. Thus, the 'diff' is actually (almost?) everything. Therefore, it's actually equivalent to the previous option.
  •     * Problem: It will require the user to have specific version. But it's not really an issue.
  • 3. Compile the game in the user's computer. I will distribute the modified resources, and create a script that will open the game in WinAGI in the user's computer, replace the modified resources, and then compile everything.
  •     * Problem: Currently, WinAGI doesn't have batch mode (as far as I know). But, @AGKorson, I assume you can add one in the future ;)
  • 4. Some other solution?
Thanks in advance...



Offline ZvikaZ

Re: How to distribute fan made translation?
« Reply #1 on: February 12, 2021, 02:35:49 AM »
Good morning.

Well, I have now 2 feasible solutions...

5. Append the changed resources at the end of the vol.* files, and just update the corresponding *dir file.
6. After I thought about '5', I've returned to option '2' - compile locally in WinAGI, and use the binary diff - and checked it again - and I was probably wrong in my previous post... I've rechecked it on clean copy of the game, and indeed, it does exactly what expected. Most of vol.* files were the same, there was addition at the end of one of the vol.* files, and small change in the corresponding *dir file.
So, I've probably clicked 'Rebuild VOL files' in my previous attempt.

So, bottom line, problem solved.

Offline Collector

Re: How to distribute fan made translation?
« Reply #2 on: February 14, 2021, 06:57:19 PM »
You could use a binary difference patch that would update a user's game files to your translation. The draw back would be that you would need all of the likely game versions that your users may have. There is such a patcher included with NSIS.
KQII Remake Pic

Offline ZvikaZ

Re: How to distribute fan made translation?
« Reply #3 on: February 15, 2021, 09:06:52 AM »
You could use a binary difference patch that would update a user's game files to your translation. The draw back would be that you would need all of the likely game versions that your users may have. There is such a patcher included with NSIS.

Thanks for the recommendation.

I don't have experience with NSIS (we're talking about https://nsis.sourceforge.io/Main_Page , right?).
Can you please elaborate? Or give link to some instructions?

Offline Collector

Re: How to distribute fan made translation?
« Reply #4 on: February 15, 2021, 07:21:17 PM »
Yes, that is the right page. Install it and in the "bin" subdirectory you can run "VPatchGUI.exe". Select whether you want the patch to be an EXE, DLL or simply a patch file. TYhen click the "Add new version" button and select your updated vol/dir and any other modified files. It will then ask you to select the old or original versions and click the "Generate button. I have multiple patches in my ultimate KQ4 installer, one for each of the most common DOS versions of the game. Each was made against NewRisingSun's hacked version of the game. The installer detects which version the user has and applies the appropriate patch to that copy of the game.

https://nsis.sourceforge.io/Docs/VPatch/Readme.html

When you get to that point, if you need help with the NSIS scripting, let me know.
KQII Remake Pic

Offline ZvikaZ

Re: How to distribute fan made translation?
« Reply #5 on: February 17, 2021, 03:13:54 AM »
Yes, that is the right page. Install it and in the "bin" subdirectory you can run "VPatchGUI.exe". Select whether you want the patch to be an EXE, DLL or simply a patch file. TYhen click the "Add new version" button and select your updated vol/dir and any other modified files. It will then ask you to select the old or original versions and click the "Generate button. I have multiple patches in my ultimate KQ4 installer, one for each of the most common DOS versions of the game. Each was made against NewRisingSun's hacked version of the game. The installer detects which version the user has and applies the appropriate patch to that copy of the game.

https://nsis.sourceforge.io/Docs/VPatch/Readme.html

When you get to that point, if you need help with the NSIS scripting, let me know.

Thanks for the detailed explanation.
If anything will pop up, I will update.

Offline ZvikaZ

Re: How to distribute fan made translation?
« Reply #6 on: February 21, 2021, 03:59:43 AM »
The GUI isn't installed by default, but it doesn't really matter. I prefer without GUIs ;)

@Collector, it's a great tool, but it'd be nice to elaborate a little in the documentation (e.g, recommend usage of the 'VPatchFile' macro) and give more complete example (e.g., with error catching).

If it's interesting anyone, I'm pasting my code, complete with backing up the original files, a handy macro, an uninstaller, removing of previous installation before installing a new one, and registering to Windows Add/Remove programs.

Code: [Select]
# In order to create the patches, run:
#
# "C:\Program Files (x86)\NSIS\Bin\GenPat.exe" C:\Zvika\Games\PoliceQuest\AGI.check\WORDS.TOK C:\Zvika\Games\PoliceQuest\AGI\WORDS.TOK WORDS.TOK.patch
# "C:\Program Files (x86)\NSIS\Bin\GenPat.exe" C:\Zvika\ames\PoliceQuest\AGI.check\LOGDIR C:\Zvika\Games\PoliceQuest\AGI\LOGDIR logdir.patch
# "C:\Program Files (x86)\NSIS\Bin\GenPat.exe" C:\Zvika\Games\PoliceQuest\AGI.check\VOL.0 C:\Zvika\Games\PoliceQuest\AGI\VOL.0 VOL.0.patch

!include MUI2.nsh

!define BACKUPDIR "SIERRA_ORIG_ENGLISH"
!define UNINSTALLER_NAME "pq1_heb_uninsaller.exe"

!macro BackupAndUpdateFile FILE
    IfFileExists "$INSTDIR\${BACKUPDIR}\*.*" +2
        CreateDirectory "$INSTDIR\${BACKUPDIR}"
    IfFileExists "$INSTDIR\${BACKUPDIR}\${FILE}" +2
        CopyFiles "$INSTDIR\${FILE}" "$INSTDIR\${BACKUPDIR}\${FILE}"

    DetailPrint "Updating ${FILE} using patch..."
    !insertmacro VPatchFile ${FILE}.patch "$INSTDIR\${FILE}" "$INSTDIR\${FILE}.tmp"

    IfErrors 0 +2
        abort
!macroend

Name "התרגום העברי של PQ1"

OutFile "pq1-hebrew-installer.exe"

BrandingText "הרפתקה עברית"
 
Unicode true

InstallDir "C:\Zvika\Games\PoliceQuest\AGI.check"  #TODO remove this

!define MUI_TEXT_WELCOME_INFO_TEXT "ברוכים הבאים.$\r$\n \
$\r$\n \
לפני שנמשיך, יש לוודא כי:$\r$\n$\r$\n  \
• יש ברשותך עותק תקין של PQ1 בגרסה המקורית עם ממשק הקלדת פקודות (ניתן לקנות ב GoG)$\r$\n \
• מותקנת גרסת Daily של ScummVM$\r$\n \
• המשחק באנגלית רץ בצורה תקינה ב ScummVM" ;" ; gvim get's confused without that extra "

!define MUI_FINISHPAGE_TEXT  "ההתקנה הושלמה בהצלחה.$\r$\n$\r$\n \
נשמח לשמור על קשר! $\r$\n \
חפשו 'הרפתקה עברית' בפייסבוק.$\r$\n \
מוזמנים להצטרף לדיונים, או סתם לראות איך דברים נראים מאחורי הקלעים, בערוץ הדיסקורד שלנו \
(קישור בתחתית העמוד)." ;"

!define MUI_FINISHPAGE_LINK "הצטרפות לדיסקורד 'הרפתקה עברית'"
!define MUI_FINISHPAGE_LINK_LOCATION https://discord.gg/yvr2m2jYRG

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH

!insertmacro MUI_LANGUAGE "Hebrew"

; The text to prompt the user to enter game's directory
DirText "בחר את התיקייה שקבצי PQ1 נמצאים בה"

!include "VPatchLib.nsh"

Section "Update file"
    ; Set output path to the installation directory
    SetOutPath $INSTDIR

    !insertmacro BackupAndUpdateFile VOL.0
    !insertmacro BackupAndUpdateFile LOGDIR
    !insertmacro BackupAndUpdateFile WORDS.TOK
    File agi-font-dos.bin
    File PQ1.WAG

    WriteUninstaller $INSTDIR\${UNINSTALLER_NAME}

    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PQ1_Hebrew" \
                     "DisplayName" "PQ1 Hebrew translation"
    WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PQ1_Hebrew" \
                     "UninstallString" "$INSTDIR\${UNINSTALLER_NAME}"
   
SectionEnd

Section "Uninstall"
    Delete $INSTDIR\agi-font-dos.bin
    Delete $INSTDIR\PQ1.WAG
    CopyFiles "$INSTDIR\${BACKUPDIR}\*.*" $INSTDIR
    Rmdir /r "$INSTDIR\${BACKUPDIR}"
    Delete $INSTDIR\${UNINSTALLER_NAME}
    DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PQ1_Hebrew"
SectionEnd
 
Function .onInit
    IfFileExists $INSTDIR\${UNINSTALLER_NAME} 0 +3
        MessageBox MB_OK "יש להסיר תחילה את ההתקנה הישנה"
        Exec $INSTDIR\${UNINSTALLER_NAME}
FunctionEnd



Offline Collector

Re: How to distribute fan made translation?
« Reply #7 on: February 21, 2021, 07:55:10 PM »
You can find more on the NSIS Wiki and there is the NSIS subforum on the Winamp forum if you need more guidance.
KQII Remake Pic


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.036 seconds with 22 queries.