English patch for the 2002 Technical Demo

The technical demo is a very early version of Pathologic 1, demonstrating basic capabilities of the in-house 3D engine (Plague City); an early version of some of the game's mechanics, such as the Actor system; and, presumably, a draft of the plot, the characters, and the dynamics between them.


Description 🔗︎

The English patch provides a human-made translation of the in-game dialogue, inventory descriptions, and the diary.

You can download the translated techdemo here (click on Download all).

Installing the font 🔗︎

Aryal Cyr font file is included with the download. This font is referenced by name in the .exe file, but was not actually included with the demo, probably implying it was already installed on all computers that the demo was supposed to run on...

Installing it will let you see the text how it was supposedly intended to be seen. Running the demo without it will have it use a default font of your system's, but it might make some text look less pretty.

Running on Linux 🔗︎

You must have Wine already installed, which you can usually get from your distro's repositories.

Instead of running directly the PlagueCity.exe file, make the file launch.sh executable, then run it:

chmod +x launch.sh
./launch.sh
            

If your desktop environment allows it, you can also double-click on the launch.sh file to start it, instead of having to type its name in terminal.


Following information might not be of interest to the broad audience.

Applying the translation manually 🔗︎

If you wish to patch your own copy of the techdemo instead of relying on this patch, you will only require the /patch folder from the link above.

As a good amount of the strings is stored directly in the binary (.EXE file), it requires to be modified in order to change some of the text. The /patch subdirectory includes a .bdf file which contains all necessarily modifications to the strings. It can be applied via bspatch (or maybe via one of these, although I haven't used any of them personally) to the original PlagueCity.exe file.

All dialogues with NPCs are stored as text files. You can swap the Dialogues folder from /patch with the original folder in /Data/Text/.

Notes on creating a patch like this 🔗︎

As mentioned before, many strings of text are hard-coded into the .exe file. Editing them is, theoretically, rather straightforward: you can open the .exe in a hex editor (I use ImHex), search for the strings, and replace them with your desired ones.

There are, however, a couple things to keep in mind when placing strings:

  • All strings are limited in length, are packed in the .exe rather tightly, and must start exactly with the address that the program looks for them at.
  • Strings of different UI elements are usually bundled together, and are separated with empty bytes (00). Not separating the strings like so might lead to unexpected results.

There are a couple notable roadblocks when working with Cyrillic strings in the demo.

The first one is related to searching for their location in hex code: location - they all are encoded in Windows-1251, or CP1251 encoding. If your hex editor of choice doesn't allow specifying string encoding, likely it will be looking for strings only in UTF-8, the standart encoding. This poses a problem, since different encoding will have the same Cyrillic text looking entirely different when converted to raw bytes.

The solutions for that are: 1. find a hex editor that will allow you to specify encoding; 2. if your most favourite already chosen hex editor doesn't support that, but can just search for patterns of bytes, you could use this Python script that I wrote for translating any string to CP-1251 hexcode, so that you could then just search for those bytes.

To make the text more-or-less universal for all users, it's recommended to stick to encoding all strings in the .exe to UTF-8.

But that doesn't solve the other roadblock, which is related to the externally stored text, aka the files in Data/Texts/Dialogues: the game will always read them in CP1251. A future patch could *probably* fix this, but it's going to take much more effort to find out where does the demo store the encoding it's told to use (naively assuming it's built as straightforward as that).

(Although - lucky to this project, all of these problems don't affect the English language, because UTF-8 and CP1251 have the Latin symbols mapped the same way.)

To open and reference the unmodified demo how it's originally meant to be viewed, you will have to deal with the Windows-1251 encoding again. If you don't use a Russian language Windows, some tools exist that could allow you to make a specific program to run with a different encoding than that on your system.

If you use Linux or MacOS with Wine, no extra tools are required as you can just export the encoding before running the demo, like so:

LC_ALL=ru_RU.CP1251 ./PlagueCity.exe
            

I used bspatch4 to create a .bdf patch; this format seems to be somehow common in the ROM hacking scene and seems to be appropriate here, and it was also pretty easy to make. To create a .bdf file like this, you need to preserve the original .exe file and place it next to your modified .exe file, then run bsdiff to create a .bdf file that contains the differences between the two versions of the techdemo. This file can then be applied to an .exe.

However, the .bdf patches are more common over in the ROM hacking scene because distributing any editions of ROMs is usually forbidden by the copyright law, requiring modders and translators to only share the patches, leaving the end-user to "legally" secure the ROM-to-be-patched themselves. As such, since the techdemo's distribution isn't exactly... controlled?, in this case it might be easier to just directly share the modified .exe file.

Patches *could* still come in useful - for example, if someone creates a patch to change in-game controls, and a user would like to play both with the updated controls and the English localization: they could then just apply two non-conflicting patches to one .exe. But as that situation seems to be kind of theoretical right now (I'm not aware of any other techdemo mods existing at the time that would also modify the .exe), I left the .bdf file and these notes as more of a "what if" or as a starting point for someone else's tinkering, than something that everyone would have to sit through in order to play the demo in English. :^)