Debug/Modding/Pathologic

From Pathologic Wiki
Jump to navigation Jump to search

This entry refers to content from the original Pathologic (2005) and the Pathologic Classic HD remaster. It has nothing to do with the sequel.

This page provides tutorials for modifying Pathologic. Please be aware that the Pathologic Wiki does not provide technical support, and all modding endeavors are at your own risk.

All guides on this page work for both Pathologic (2005) and Pathologic Classic HD unless otherwise noted.

Extracting Game Files

The data of Pathologic is stored in .vfs archives, which must be unpacked to access the original files. In the folder (Pathologic installation)\data, you will see several VFS files titled according to their contents, and one or more folders of the same name. Items within folders have precedence over files in the VFS archives, meaning they will override the game's defaults when the game is loaded.

The Russian program morconverter provides a graphical interface for unpacking .vfs files. Alternatively, somevideoguy's parser is a Python command-line program which supports .vfs extraction as well as conversion of the Strings\main.dat file, which is crucial for modifying dialogue.

Replacing Textures

Textures in Pathologic are generally stored with DXT1 or DXT3 compression (as .tex files), so editing and exporting them requires some legwork. The open-source image editor GIMP supports editing images with DXT compression, and a plugin from NVIDIA is required for Photoshop; the Microsoft DirectX Texture Tool can also be used to export images with DXT compression. The website aconvert can convert the .tex into a .png, but not the other way around; adblock is strongly recommended on this site.

About Textures

There are two categories of .tex files: for each "texture_name.tex", there is a matching "texture_name_LQ.tex", which is used only for low graphics settings. It's up to you whether to edit both, but most modern players will see only the high-quality versions.

  • The Bound's textures are split across multiple files. Each has a generic texture which refers to their body and outfit, a HEAD texture which refers to their face, eyes, and teeth, and one or more HAIR textures (with the exception of Rubin, Oyun, and Big Vlad, whose hair (if any) is painted onto their HEADs).
  • Non-speaking NPC textures, as well as most object textures, are stored as single files.

Building and environment details are stored as many separate files, generally with similar names among a set.

  • Textures used in the inventory are located in the UI subfolder and not compressed (they use the .png extension).
  • The skybox has six different states: dawn, day, day_clear, day_rain, night, and night_rain. Each state has five associated textures: up, front, back, left, and right. The dawn state is apparently used during both morning and evening. Note that by default, these skybox states gradually fade into each other!

Editing Textures

Load the image (either as .dds, or as decompressed .png) into an image editing program, and make your changes!

The type of compression used will be listed in the filename: either DXT1 or DXT3. After making your changes, export the file with the matching compression type. Make sure the resulting filename is the same as the original texture! You may need to export as .dds and rename the file to end with .tex.

You don't need to export with mipmaps; this may be confusing, since the original texture included mipmaps, but it doesn't have an impact on gameplay.

However, make sure the height-width ratio of the edited texture is the same as the original file. In GIMP, be sure to merge all edited layers into one before exporting the file. If the dimensions of the texture change, the texture will map onto different parts of its model, causing very messy unintended effects.

Loading Textures

The new texture needs to be placed in the (Pathologic installation)\data\Textures folder. If this Textures folder doesn't already exist, create a new folder in data named Textures.

Pathologic should now read the texture from this folder on startup, replacing the default texture. Congratulations!

Common errors:

  • The texture may appear completely gray if it hasn't been exported in the right format. Double-check whether you've compressed it as DXT1 or DXT3, matching the file name.
  • The texture may not be loaded at all. Check that the filename exactly matches the original texture.
  • If the texture still isn't loaded, open data\config.ini. Near the end of the file, change the line "Textures = VFS" to "Textures = FS". This forces Pathologic to load textures from the filesystem instead of archives. If you do this, you must put all extracted textures in the data\Textures folder, not just the edited one!


Missing walkthrough with screenshots.


Replacing Audio

Audio files in Pathologic are stored as Ogg Vorbis (.ogg) files, which are supported by most editor programs - DarkAudacity is a convenient and free one.

  • Sound effects are named according to their use. For example: "bdie" and "fdie" effects are played when an NPC dies, "wood_door_opened" plays when a door is opened, and "ReputationUp" plays when the player's reputation increases.
  • Most music files are named according to where they are played. For example: andrei_kabak.ogg contains music played in Andrey Stamatin's Pub, and MainMenu.ogg contains the pause menu theme.
  • Unique voice lines have the name format healername_NPC_day_quest, where healername is the route (burah, danko or klara), NPC is the speaking Bound, day is "d" followed by two digits representing the day (01-11), and num is an integer referring to whether they have multiple unique lines on that day.
  • Generic voice lines have a similar name format: mono_NPCnum. num is an integer that differentiates between files; it has no known impact on the order these lines are said.

The length of audio files does not matter [citation needed]; as long as the filename matches, any audio can replace sounds from Pathologic. Once you've edited a file, just save it as an ogg file of exactly the same name.

The new file needs to be placed in the (Pathologic installation)\data\Sounds folder. If this Sounds folder doesn't already exist, create a new folder in data named Sounds. The game should load the file on startup.

Modifying Text

Text in Pathologic is stored in the Strings folder. Several of these are .txt files which can easily be edited in any text editor:

  • map.txt contains the names of locations on the map. (It doesn't contain quest-specific hover information; this is found in main.dat.)
  • ui.txt contains various UI elements such as the text that appears at the start and end of each day, the scrolling text at the start of the game, and the end credits.
  • keys.txt contains the names of keyboard/controller inputs used to control the game.

However, the majority of the game's text, including dialogue, quest descriptions, mail, and item descriptions are stored in main.dat. Although a hex editor can theoretically be used to modify main.dat, it is far easier to use somevideoguy's parser to convert it to an .xml file and edit it with a text editor before converting it back to .dat format, as this is both easier to edit and handles string length automatically.

Note that the text for some UI elements is stored in textures.


Missing detail on how to use the parser, install python etc.