OpenGorky

OpenGorky is a native PC port of Gorky 17 for Windows, Linux, and macOS that runs at high resolution with modern save locations.

README

OpenGorky icon

OpenGorky

An open-source reimplementation of the Gorky 17 engine
(Odium in North America, Metropolis Software, 1999)
for macOS, Linux and Windows, written in Zig + SDL3.

Download · Playing · Configuration · Building · Tools


OpenGorky aims to be an exact port: the battle rules, AI, scripts, effects and timings are reconstructed from the original gorky17.exe, and gameplay is bit-identical across build modes and CPU architectures. On top of that it runs natively on modern systems, at high resolution, with fullscreen scaling and a modern save location.

You need the original game files (for example the GOG version). None are included in this repository or in the release packages.

Download

Prebuilt packages are on the latest release page:

PlatformPackageHow to run
macOS 13+ (Apple Silicon and Intel)OpenGorky-macos-x86_64-arm64.zipUnzip and open OpenGorky.app. Choose the game folder in its launcher window once.
Windows 10+ (x86_64)opengorky-windows-x86_64.zipUnzip and run OpenGorky.exe. Choose the game folder in its launcher window once. SmartScreen may warn: More info → Run anyway.
Linux x86_64 / aarch64 (glibc 2.36+: Debian 12, Ubuntu 24.04 and newer)opengorky-linux-<arch>.tar.xzUnpack and run ./opengorky (the launcher window) or ./opengorky <game dir> (straight into the game). Nothing to install on a desktop system: SDL3 is in the package and loads X11 or Wayland and the sound server (PipeWire, PulseAudio or ALSA) the system has. An icon and a .desktop file are included.

The level editor is a separate download: OpenGorky-Editor-macos-x86_64-arm64.zip (OpenGorky Editor.app), opengorky-editor-windows-x86_64.zip (OpenGorkyEditor.exe), opengorky-editor-linux-<arch>.tar.xz (./opengorky-editor). It starts empty: choose a copy of the game folder in its Settings tab.

Game files

Point OpenGorky at the folder of your Gorky 17 installation. It uses only:

WhatWhy
dat/levels, battles, common/ graphics, sounds, voices, texts, scripts
avi/videos and some music (*.asf)
adjust.kdtengine tuning (weapons, effects, sound, camera); without it defaults are used

Nothing else (gorky17.exe, DLLs, installer) is used. Original saves are not read.

Other editions on the same engine work too, e.g. the Russian «Горький-18»: file names are case-insensitive and fonts follow the edition language.

Playing

Key
Escmenu; skip video or scene; close windows
Spacenext dialogue line; outside scenes toggle the panel
I / Ginventory / give
1–6select hero
Fcamera to the selected hero
W A S, arrows, screen edgescroll (Shift faster)
Battle: Tab / Q / X or D / E or Enter / Pgrid / next weapon / defend / end turn / push
Right buttoncancel; in battle enter aim mode
F10scaling: integer / sharp / smooth / stretch / adaptive / stretch-blur
F11, Alt+Enter, Cmd+Enterfullscreen
` or F2debug console, only with console = 1 or --dev

Configuration

Launcher

Started without arguments (the macOS app, OpenGorky.exe, ./opengorky), the game first shows a launcher window. Its home view has Play (or Enter), the Game choice and the game folder's state (with Choose folder when it is not found); the gear opens the settings in three tabs — Display, Game, Advanced (the game folder is there too). Play saves the settings to opengorky.cfg and starts the game; Esc (back from the settings, then quit) or closing the window leaves the file unchanged. With launcher = 0 it is skipped; hold Shift while starting to see it anyway (macOS and Windows), or set the key back to 1. It always appears while no usable game folder is set. Any command-line argument skips it.

The Game choice picks what Play starts: the original game, or an OpenGorky package (.ogp, a project's dist/<id>.ogp) found in a mods folder — the game folder's (<game>/mods/) or the settings folder's (below). A package plays over the chosen game folder's assets; one made for a newer OpenGorky is listed but cannot be started.

Where files live
Settings opengorky.cfg, modsSaves
macOS~/Library/Application Support/OpenGorky/~/Library/Application Support/OpenGorky/saves/
Linux$XDG_CONFIG_HOME/opengorky/ (default ~/.config/opengorky/)$XDG_DATA_HOME/opengorky/saves/ (default ~/.local/share/opengorky/saves/)
Windows%APPDATA%\OpenGorky\%APPDATA%\OpenGorky\saves\
opengorky.cfg

A plain text file with key = value lines; # starts a comment. It is created with defaults and explanations on the first launch. If a newer version adds keys, the file is rewritten on startup with them added: your values are kept, your own comments are not. Unknown keys and bad values are ignored. Scaling (F10) and fullscreen toggles made in the game are saved back to it.

scaling = integer
hires = 1
upscale = xbr
fullscreen = 0
fps_limit = 60
fps_background = 15
pause_background = 1
log = warn
debug = 0
console = 0
launcher = 1
game_path = /path/to/Gorky 17
package =
KeyDefaultMeaning
scalingintegerHow the 640×480 frame fills the window: integer — integer zoom, crisp pixels, may leave borders; sharp — fill the window with sharp pixels; smooth — fill the window, smoothed; stretch — stretch to the whole window or screen with no borders (4:3 is distorted on wide screens); adaptive — the world fills the window: large locations show more at the sides, battles and rooms are zoomed in to fill the width (top and bottom scroll with the mouse at the edges), the UI stays in the middle, the menu and inventory stand over a blurred copy; stretch-blur — 4:3 in the middle over a blurred, darkened copy of the frame instead of black borders
hires11 — models, shadows and effects are drawn at window resolution (backgrounds and UI keep their pixels); 0 — 640×480 like the original
upscalexbrUI, icons and portraits with hires: xbr — smoothed edges (xBR); off — the original pixels, just larger
fullscreen0Start in fullscreen (in the game: F11, Alt+Enter, Cmd+Enter, Ctrl+Cmd+F)
fps_limit60Frame cap in the focused window; 0 — display rate (vsync). The world always runs at 30 ticks per second, like the original
fps_background15Frame cap when the window is not focused; 0 — same as focused. A minimized or fully covered window is not drawn at all
pause_background1Pause the game and sound when the window loses focus or is minimized
logwarnTerminal messages: none, warn, info
debug0Debug overlays: battle status line, health bars, F1 line
console0Developer console (` or F2) with debug commands: heal, win the battle, give items…
launcher1Show the launcher window when started without arguments; 0 — straight into the game (Shift at startup shows it anyway)
game_pathemptyThe game folder, used when none is given at launch. Set automatically on the first launch with a path or after picking the folder
packageemptyThe OpenGorky package to play (its file name, e.g. gorky.ogp, in the game's or the settings folder's mods/), set by the launcher's Game choice; empty — the original game. Not found: the original game starts

On/off keys accept 1/0, on/off or true/false.

Environment variables
VariableEffect
OPENGORKY_SAVESSaves folder instead of the default one
OPENGORKY_MODSMods folder instead of <settings folder>/mods
OPENGORKY_MUTESet (to any value): no sound, as --mute
OPENGORKY_NO_SFXSet: no sound effects or voices, music only, as --no-sfx
OPENGORKY_GAMEmacOS app: the game folder, overriding game_path
Command line
opengorky-viewer <game dir> --play [options]   # Linux: opengorky <game dir> [options]
OptionEffect
--mute, --no-sfxNo sound; no sound effects or voices
--fps NFrame cap instead of fps_limit (0 — display rate)
--hires NFixed frame detail 1–4× instead of following the window size
--upscale xbr|offInstead of the upscale setting
--window W,HInitial window size in points (default 1280,960)
--devEnable the developer console even with console = 0
Mods

Scripts and objects placed in <game>/mods or <config dir>/mods (or $OPENGORKY_MODS) are looked up before the game archives, so levels, fighters and weapons can be changed or added without touching the original files. Custom fighters use the generic class (classType = 100): attacks, AI and resistances come from their .ftr/.wpn fields.

OpenGorky projects

An OpenGorky project is a folder of OG Script (docs/og-script.md): opengorky.mod (format = ogs, the installed game's path in game, $OPENGORKY_GAME over it), src/ (the texts and the project's own assets) and dist/ (what players get). The game's own assets are read from the installed game, never copied. gorky-tool convert <game> <out> converts a Classic game into a new project (the game is not changed); gorky-tool build <project> checks it and packs dist/<id>.ogp; gorky-tool play <project> --start location:<level> plays it. Among its texts:

  • src/rules/*.ogs — the engine's rules (what the original keeps in its code) as rows over empty tables; Campaign(…) is the campaign: the location and heroes a new game starts with, the arrival area and scene, intro videos, the videos before the menu, the menu logo and music, the credits. The main menu shows the manifest's title.
  • src/game.ogs — the game's hooks, components for game: OnDamage(attacker, target, weapon, amount), OnResist(target, kind, amount), OnTurnStart(side, turn), OnBattleEnd(won), OnItemUse(user, item, target), OnLevelEnter(level).
  • src/texts/*.ogs — the texts (UiText, Examine, AreaExamine), UTF-8.

A package (dist/<id>.ogp) handed to players goes into <game>/mods/ or the settings folder's mods/ and is chosen on the launcher's home view (or passed as the first argument: opengorky-viewer gorky.ogp --play). It finds the installed game in the game folder chosen in the launcher (or $OPENGORKY_GAME), not the author's game path; without one the viewer says so. Saves of a project restore its objects from their blocks and archetypes, with the values their vars had in play: lists, records and references too (to another location's objects as well), its components' vars and its event subscriptions (docs/og-script.md §4.2).

The editor opens a project read-only for now.

Building

Requirements: Zig 0.17.0, SDL3 and pkg-config (brew install sdl3 / apt install libsdl3-dev). Videos (MS-MPEG4 + WMA/MP3) and the editor's video and music imports use the FFmpeg libraries if found (brew install ffmpeg / libav*-dev, linked as shared libraries; imports need libmp3lame in that FFmpeg). -Dffmpeg-prefix=<dir>/prefix links our own static build instead (scripts/build-ffmpeg.sh, as the packages do). With -Dffmpeg=false videos play through an external ffmpeg program in PATH and the editor cannot import.

zig build                                # Debug: zig-out/bin/opengorky-viewer, opengorky-editor, gorky-tool
zig build -Drelease                      # optimized, for playing and the checks
zig build test
zig build viewer -Drelease -- <game dir> --play # build and play
  • Plain zig build builds everything Debug: fast to rebuild while working, but the viewer (software model rendering) and gorky-tool's game runs are ~10× slower.
  • -Drelease: the viewer and the editor ReleaseFast with debug info, gorky-tool ReleaseSafe (-Dviewer-optimize=…, -Dtool-optimize=… set either). ReleaseSmall is avoided: LLVM's MachineOutliner miscompiles on arm64 with Zig 0.17. -Dstrip=true drops debug info.
  • Gameplay does not depend on the build mode or the CPU (no @setFloatMode).

Regression checks with the game data (they build -Drelease into zig-out/release and use it, unless $GORKY_TOOL names a tool): scripts/regress.sh <game dir>, scripts/fullgame.sh <game dir> (full playthrough), scripts/linux/check.sh <game dir> (everything in a Linux container).

Packages
scripts/dist-macos.sh            # zig-out/dist/OpenGorky.app + zip (universal arm64 + x86_64)
scripts/dist-linux.sh [game dir] # zig-out/dist/opengorky-linux-<arch>.tar.xz (Docker)
scripts/dist-windows.sh          # zig-out/dist/opengorky-windows-x86_64.zip (Docker, cross build)

Each script also packs the level editor separately from the same build: OpenGorky Editor.app + OpenGorky-Editor-macos-<arch>.zip, opengorky-editor-linux-<arch>.tar.xz, opengorky-editor-windows-x86_64.zip — the editor, SDL3 and licenses.

  • FFmpeg: scripts/build-ffmpeg.sh builds static FFmpeg 9.0.1 libraries (all decoders, demuxers and parsers; MS-MPEG4 v3, WMA v1 and MP3 encoders with LAME 3.100; ASF and MP3 muxers; swscale, swresample; LGPL, no GPL or non-free parts), and -Dffmpeg-prefix links them into the viewer and the editor: videos play and imports convert in-process (src/editor/transcode.zig), no FFmpeg files or programs are shipped. Sources are checked by SHA-256.
  • SDL3: macOS and Linux use their own build (scripts/build-sdl3.sh; on Linux X11, Wayland, ALSA, PulseAudio and PipeWire are dlopened, so the package hard-depends only on glibc), Windows the official mingw release.
  • macOS: ad-hoc signed; set SIGN_IDENTITY and NOTARY_PROFILE for Developer ID signing and notarization. An ad-hoc build downloaded from the internet is blocked by Gatekeeper ("Apple could not verify…"): open it via System Settings → Privacy & Security → Open Anyway, or xattr -dr com.apple.quarantine OpenGorky.app.
  • Linux: built on Debian 12 bookworm (scripts/linux/dist.Dockerfile; glibc 2.36), SDL3 in lib/ with an $ORIGIN/lib rpath.
  • Windows: the viewer is cross-built with Zig, FFmpeg with mingw-w64.
  • CI: .github/workflows/release.yml builds all packages; pushing a v* tag, or running it manually with a tag (gh workflow run release.yml -f tag=v0.1.1), publishes a GitHub release.

Tools

Resource viewer
zig build viewer -- <game dir> [01_port/sprite.dat] [--image N] [--shot out.png]

Without --play: [ ] archive, ↑ ↓ resource, ← → frame, Space animate, L level mode. --shot renders one frame and exits (--level, --scroll X,Y, --time MS, --hide-objects). --launcher-shot out.png [--launcher-tab play|display|game|advanced] renders the launcher window instead (play: the home view, the others a settings tab; an optional game dir argument fills its folder).

gorky-tool
gorky-tool list    <game>/dat/common/other.dat           # archive contents
gorky-tool extract <game>/dat/01_port/other.dat out/01_port
gorky-tool export  <game>/dat/01_port/sprite.dat png/01_port
gorky-tool check   <game>                                # decode all game data
gorky-tool sortdat <game>                                # repair archives saved by older editors (order, times, script marks)
gorky-tool scripts <game> [--api]
gorky-tool world   <game> 01_port 100
gorky-tool listen  <game> 01_port 30 port.wav 1700,200
gorky-tool play    <game> 01_port …                      # headless play scenarios
Level editor (work in progress)
zig build editor -- [<game dir>] [--level NAME] [--lang en|ru] [--shot out.png]

The interface is in English or Russian (Settings tab, or --lang). Without a game folder the editor starts empty; choose one in the Settings tab ("Choose…"), which reopens the editor on it. The language, the folder (chosen there or given on the command line), the program Play runs, the interface scale and the pane sizes are kept in editor.cfg in the settings folder.

Edits a Classic game folder in place (its .dat archives), so work on a copy; an OpenGorky project opens read-only. Every edit in every tab goes into one undo stack (Ctrl+Z); a save (Ctrl+S) writes the shown tab's edits (closing a tab with edits (its × or Ctrl+W / Cmd+W) or the editor asks to save them); only the numbers and lines an edit touches change, the rest of every script stays byte for byte.

  • Battles / Locations: the level with its battle grid and objects (wheel zooms, drag empty space pans, F fits). In battles drag an enemy, hero start, barrel or prop to move it (red tiles: blocked or occupied), Delete removes it. "Add enemy" copies the first fighter of a class (its .ftr and weapons under a new name such as sphinx_1) onto the first free tile. A selected enemy's parameters are edited for this enemy only (lines after the class #include in its .ftr/.wpn, × drops them) or for its whole class.
  • Enemies: enemy classes (classes\ft_*.ss in dat/common/other.dat): parameters, resistances (shown only: the exe's table by nameID), the damage of their weapons (wp_*.ss), look (act_*.ss: model and animations; the class keeps its own nameID, so name and special rules stay) and "Make a copy" — a new class that battles can then add.
  • Items: weapon, ammo and item classes (cw_*, ca_*, ci_*): numbers, icon, model in hand, damage type, behaviour class and ammo; recharge turns and effect on hit are shown only (the exe sets them by the behaviour class).
  • Heroes: starting values of the heroes (gamestart\*.hro and those joining later).

"Edit…" by an icon (items, enemy report icons, heroes' portraits) opens its sprite frame by frame: a frame from a PNG or to one, and pixel editing zoomed in (pencil, eraser, eyedropper on the right button, the sprite's colours); a stroke is one step, Save writes it in the game's format. An enemy's kill icon in the battle report comes from the exe's table by nameID (not from spriteFile): the page shows it and replaces or edits that very file; a nameID missing from the table (the shoggoth's) has none. An enemy or hero page has four parts: its values, the model (drag it to turn it), its animations and the chosen one's frame sounds. The edges between panes and lists drag to resize, and the sizes are kept in editor.cfg. Tabs keep their state: the battle and the location open stay open each, and each of enemies, items and heroes shows the entry left there. Under it are the animation's frame sounds (gfx_3d\<model>.ani, shared by every look with that model): they play with the preview as in the game, and each can be swapped for another sound.dat sound, moved by frames or removed, and new ones added; the .ani is written back in the game's format. The Sounds tab lists common/sound.dat with search: listening, which animation frames play each, saving one as WAV, and importing a WAV or MP3 of one's own — converted to the game's own format (PCM 16-bit mono 22050 Hz) to put on frames. Enemy classes no battle of the game has but able to strike (the shogoth) can be added too: the editor builds the fighter as the battles' own and gives it a close attack (wp_cutterpillshort.ss), shown on the class page. A battle enemy's weapon class can be swapped under its damage in the parameters (another wp_*.ss of the same reach, close or long; that enemy's .wpn only). On the enemy class page the same swap goes to