This project is an effort to migrate the classic game Cossacks: Back to War to modern systems. The goal is to refactor and update the original source code to ensure compatibility with contemporary hardware and software environments while preserving the original gameplay experience.
Cossacks: Back to War is the greatest RTS game ever made, in my opinion. However, the game is showing its age and is becoming increasingly difficult to run on modern systems. The goal of this project is to ensure that the game remains accessible to both old and new players alike.
Done doesn't mean it's perfect, it just means it works. The list is not exhaustive and will be updated as the project progresses.
| Description | Status | Comments |
|---|---|---|
| Migrate from DirectDraw to SDL | ✅ Done | There are some visual artifacts on some screens (e.g. loading, game menu), not affecting the gameplay |
| Migrate from DirectSound to SDL | ✅ Done | The sounds are a little "crunchy" |
| Remove DirectPlay | ✅ Done | Hidden under the NODPLAY definition (lobby works, but the gameplay was not tested) |
| Migrate Music system (MCI CD audio) to SDL | ✅ Done | |
| Remove Windows-specific symbols and types | ⏳ In Progress | Things left to be migrated: DLL loading, FS management, registry management, misc. |
| Migrate window management from Win32 to SDL | ✅ Done | DirectPlay still seems to need an HWND pointer |
| Migrate from Winsock to cross-platform sockets | ⏳ In Progress | httpcomm, the UDP hole puncher, and the CommCore library now build through the socket shim; the IChat library project still needs the same treatment |
| Remove or replace binary dependencies | 🚧 Not Started | Known so far: Pinger.lib, unrar.dll, gw_server.dll, dplayx.lib (when NODPLAY is not defined) |
| Recreate the AI | ⏳ In Progress | |
| Rewrite assembler code to C++ | ⏳ In Progress | x86 asm is guarded so Linux compiles; GP blitters, FastDraw, fog, VirtualScreen and the DialogsSystem draw path are translated to C++ — the Linux build now boots to a fully-rendered main menu. In-game rendering (unit/terrain draws) is the next runtime layer |
| Migrate build system to CMake | ⏳ In Progress | Linux CMake compiles, links, and runs the active target to a rendered menu via temporary Linux bridge/stub files; in-game playability work remains |
| Migrate to other platforms | ⏳ In Progress | Linux build runs to the main menu; macOS untouched |
The fully playable build is produced with Visual Studio on Windows. A cross-platform CMake build
(CMakeLists.txt, see docs/Ubuntu.md) now compiles, links, and boots to a rendered main menu
on Linux (run ./cossacks /window from a directory holding the game's all.gsc). It still uses
temporary Linux-only stubs for unported systems and is not yet playable past the menu.
Dependency locations are read from environment variables instead of hardcoded paths. Set these
once (System Properties → Environment Variables, or setx) before opening the solution:
| Variable | Points to | Must contain |
|---|---|---|
SDL3_DIR |
SDL3 3.2.0+ root | include\, lib\x86\ |
SDL3_IMAGE_DIR |
SDL3_image 3.1.1+ root | include\, lib\x86\ |
BOOST_DIR |
Boost 1.82.0+ root | headers, and import libs under lib32-msvc-14.3\ |
Then:
- Open
src/Cossacks.slnin Visual Studio 2022 (Win32 / x86 platform). - Build the
Cossacksproject (Release|Win32). Output:src/Testing/dmcr.exe. - Copy
dmcr.exeinto a backup copy of your Cossacks: Back to War game folder (work on a backup to avoid corrupting your install), then run it.
SDL3.lib, SDL3_image.lib, and ws2_32.lib are already wired into the linker inputs.
Contributions from the community are welcomed! If you are interested in helping with the migration or have any suggestions, please feel free to open an issue or submit a pull request.
This project is an unofficial modification of Cossacks: Back to War aimed at improving compatibility with modern systems. The original game and its assets are copyrighted by their respective owners.
- This repository does not distribute the original game.
- This project does not grant permission to redistribute, modify, or use the code for commercial purposes.
- The modifications and improvements in this repository are intended only for personal use.
- The modifications provided here are meant to be applied to a legally obtained copy of the game.
- I do not encourage or support any unauthorized distribution of the original game or its source code.
