GLSMAC
GLSMAC is an open-source OpenGL/SDL2 reimplementation of Sid Meier's Alpha Centauri and its expansion.
- Type: PC port
- Game: Sid Meier's Alpha Centauri
- Runs on Windows
- By afwbkbc
- Latest release v0.3-db4dbc9, 2026-05-31
- Source: https://github.com/afwbkbc/glsmac
README
GLSMAC
Unofficial open-source OpenGL/SDL2 reimplementation of Sid Meier's Alpha Centauri ( + Alien Crossfire ).

Note: you will still need to own the original game and expansion - GLSMAC will load its resources like images or sounds.
Check Screenshots and Videos for current state and history of project.
GLSMAC discord : https://discord.gg/fWG3xK7cUx
Quickstart
-
Download latest stable release or latest development build for your OS (only 64-bit windows and ubuntu for now)
-
Unpack GLSMAC anywhere
2a) (optional) also unpack GLSMAC_data in same directory if you're (future) modder and want to tweak or change game scripts
- Run (on first launch it will ask you for SMAC installation path)
Why?
SMAC was a great game, possibly the best in 4x genre, but it's outdated so much it barely runs on modern systems. Especially multiplayer (which is based on ancient directplay). Also it can't be modded as thoroughly as many would like.
What will be same between GLSMAC and original game?
Models, images, movies, texts, lore, factions, game rules (such as tech trees, types of armor/weapons etc), UI
What will be completely different?
Graphics engine, network code are fully rewritten to allow it run as smoothly as possible.
What may differ slightly?
Random maps generation, AI, dynamic music, some UI parts. While I'll try to get them as close as possible to original logic, they will still be recreated from scratch.
Compatibility?
Network won't be compatible to original client (so you can't play together with somebody running it).
Maybe I'll make saves and maps compatible, but it's very low priority.
Mod compatibility - it should work with asset mods that replace .PCX, .WAV or other asset files in SMAC directory (later it will also accept upscaled versions). It won't work with mods that modify or link to terranx.exe. Mods that change .txt files - probably not, maybe some settings and rules will be read from original SMAC's .txt but not all of them.
Modding
Early stage of modding support is already here. Under the hood GLSMAC loads ".gls.js" scripts (language similar to JavaScript but simplified and optimized for our needs) for game logic decisions.
All UI and game logic is now written in scripts, for maximum tweaking/modding potential. Communication with game engine is done by writing event handlers and calling specific bindings as needed.
You can check core scripts here: https://github.com/afwbkbc/glsmac/tree/main/GLSMAC_data/default . They are embedded into GLSMAC binary so it can work just by itself, but if it sees GLSMAC_data in working directory it will read and use them instead (so download them too if you want to play around).
I also made 'demo mod' to demonstrate how scripting can be used: https://github.com/afwbkbc/glsmac-demo-mod ( it's a bit outdated atm and doesn't work with recent GLSMAC ).
Other improvements?
Once I replicate original game, I'll focus on other things, such as: larger maps, larger maximum number of players, online services such as game browser or hosting long-turns games (where people can login and make 1 turn per day or so), alternative art packs (used instead of original, this may mean better graphics). See "GLSMAC v2.x+ features" section below.
Contribution guidelines
Pass criteria for any PR (AI or not):
- Code looks nice. (No bloat, duplication, excessive comments, chaotic placement of functions amongst files, ...)
- No theoretical possibilities for vulnerabilities or crashes (in case of C++ changes)
- The result compiles correctly on Linux, Windows, FreeBSD, and (in future) MacOS. (You should test it if your AI decided to modify cmake files or anything related to build.)
- The result works correctly without obvious problems. (Misaligned elements, wrong popup sequence, wrong game logic, crashes, ...)
- The result does not cause unnecessary performance overhead. (For example, in scripts: calling function where it's not needed, splitting something into too many nested functions (scripting language is not fast yet so it will have impact), creating too much single-use variables, ...) For C++ it's more relaxed as compiler will take care of optimization, however I already stumbled across PR that introduces map zoom lags by pushing some rendering stuff into main thread back and forth all the time.
- Code style should match existing. For example camelCase is not welcome.
AI policy
I myself don't and won't use AI-generated code.
Pull requests with AI code will be reviewed the same way as pure human code (no discrimination towards AI but also no 'cutting some slack' for AI)
Any increases of dependency versions after 2025/10/20 will happen only after I manually review changes in them. This means versions will be changed less often and really only if it's actually needed for something (to fix specific bug or to bring specific functionality). This will not affect manual builds without -DVENDORED_DEPENDENCIES=YES (prebuilt releases for windows and ubuntu always use vendored dependencies).
Current Version:
v0.3+
Roadmap
Versions 0.x+: replicating original SMAC gameplay as closely as possible (but without bugs and some technical limitations)
-
v0.1: fundamental engine functions, such as: rendering, UI, netcode, sound system
-
v0.2: basic map functions, such as: tiles, mapgen, creating/saving/loading games, map rendering
-
v0.3: basic multiplayer: ability to host and join games, lobby, save/load games with same players. multiplayer support will be maintained during further steps from now on
-
v0.4: game processing, such as: game turns, units (only scout patrols, formers and colony pods), buildings (only recycling tanks), technologies (only centauri ecology), building of bases (only land bases), terraforming (only farms, mines and solar arrays), unit combat, victory by conquest
-
v0.5: all remaining SMAC units, buildings, terraformings, technologies, etc
-
v0.6: all remaining victory types
-
v0.7: AI (computer opponents, cities automation, units automation, etc) and diplomacy
-
v0.8: alien lifeforms, ecology
-
v0.9: all remaining in-game UI, including game settings
-
v0.10: non-crucial things like movies, interludes, dynamic music
-
v0.11: final polishing and bugfixing
Versions 1.x+: fixing bugs, adding optional small features that weren't present in original SMAC but won't change it's gameplay drastically. See 'GLSMAC v1.x+ features' section at the end
Versions 2.x+: adding all kinds of features, as long as they are worth the time. See 'GLSMAC v2.x+ features' section at the end
Versions 3.x+: not sure yet, probably something cool.
Hardware requirements
Minimum recommended (for at least 60 FPS):
- GPU: Intel HD 4400, AMD Radeon R7, Geforce GT710 or similar
- RAM: 2-4GB
- HDD: 50MB
Requirements may go up slightly as more features are added to game. But I'll try to keep FPS above 60 on low-end cards as above. Amount of RAM will limit maximum size of map you can play on (until some kind of disk caching is implemented, but that will cost performance). Disk space is needed for GLSMAC binary, config files, saves, maybe map files and replays.
Build instructions
Supported platforms:
- GNU/Linux with GCC compiler
- FreeBSD with Clang compiler
- Windows ( Visual Studio + Clang )
- Windows ( MinGW )
Other platforms/toolchains weren't tested but you can try and please report results if you do (or pull request if you manage to get it running on more OSes).
Linux / FreeBSD
You will need CMake and working compiler (gcc or clang).
You will also need following libraries (unless you build with -DVENDORED_DEPENDENCIES=YES):
- FreeType
- SDL2
- SDL2_image
- GL
- GLU
- GLEW
- uuid-ossp
- yaml-cpp
Gentoo: emerge cmake libsdl2 sdl2-image freetype glu glew ossp-uuid yaml-cpp
Ubuntu: apt install cmake build-essential libfreetype-dev libsdl2-dev libsdl2-image-dev libglu-dev libglew-dev libossp-uuid-dev libyaml-cpp-dev
ArchLinux:
pacman -Syu cmake base-devel freetype2 sdl2 sdl2_image glew yaml-cpp (you'll need to install ossp-uuid manually because it's not in repos)
AUR-package: https://aur.archlinux.org/packages/uuid
FreeBSD: pkg install pkgconf cmake sdl2 sdl2_image glew ossp-uuid yaml-cpp
Fedora: dnf install cmake make automake gcc gcc-c++ freetype-devel SDL2-devel SDL2_image-devel glew-devel uuid-devel yaml-cpp-devel
OpenSUSE: zypper install -t pattern devel_basis && zypper install cmake-full freetype2-devel SDL2-devel SDL2_image-devel glew-devel uuid-devel yaml-cpp-devel
It is highly recommended to build project using CMake and make (ninja works too) instead of adding .cpp and .h files manually to IDE (don't report bugs if you try the latter).
It is recommended to build in separate directory. For example: cmake -S . -B build (remove build directory when you'll want a clean build for some reason).
For release build (default): cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && make -C build
For debug build: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug && make -C build
For 'fast debug' build (gdb and most asserts work, removed expensive checks and sanitation): cmake -S . -B build -DCMAKE_BUILD_TYPE=FastDebug && make -C build
( for debug or 'fast debug' build you can also add -DSANITIZER=YES to use asan, it does not work reliably on all OSes so is disabled by default. an alternative is to use valgrind tool )
For portable build (binary that can be executed on different machines): cmake -S . -B build -DCMAKE_BUILD_TYPE=Portable64 && make -C build ( or Portable32 for 32-bit )
For same build as before (or Release if it's first build): cmake -S . -B build && make -C build
Add -j parameter to make to speed up if you have multiple cores, i.e. make -C build -j9 for 8 cores.
Optionally, add -DVENDORED_DEPENDENCIES=YES to cmake parameters to download and build all required libraries, instead of using system-installed ones. By default this is enabled on Windows and disabled on other OSes. You can't disable it on Windows. Portable32 and Portable64 enable vendored dependencies automatically.
Optionally, use VERBOSE=1 make -C build to see actual compiling/linking commands (useful when build fails)
You can also just download binary releases from github, they are built for ubuntu but will run on most linux distros (only 64-bit for now). Windows and other binaries coming soon :)
Apple/Mac
In order to build it on Mac install XCode from AppStore - it is free, no Apple Development Program is required. Then install the following dependencies:
- Brew as a package manager from https://brew.sh
brew install cmake PkgConfig sdl2 sdl2_image ossp-uuid glew yaml-cpp freetype- In case of missing packages just install it using brew.
Package ossp-uuid is visible as uuid. Additionally we must link with OpenGL framework (dependency added to make file)
Then we can follow with build commands as for Linux versions: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug && make -C build
Game is build correctly however there are problems related to OpenGL currently which crashes the game.
Windows
Visual Studio
Building with Visual Studio is recommended for windows. You will need git (for example, Git SCM) and Visual Studio 2022 installed. Use the Visual Studio Installer, select Desktop development with C++. Then click modify->individual components on Visual Studio 2022.
You will need to install the following C++ CMake tools for windows, C++ Clang Compiler for windows, C++ Clang-cl, Windows 11 SDK (10.2.22621.0), Windows Universal CRT SDK, Windows Universal C Runtime.
Once that is done you should clone the git, then open the folder. Press the top button Project->Configure, then the output should open. Wait for it to say "CMake generation finished.". On top you'll see build configuration dropdown, select either x64 Debug or x64 Release. Then press 'build' button (or usually it's F10 or Shift+F10 hotkey), wait until build is finished. Once that is done (without errors) select the build target GLSMAC.exe and press the debug button.
You are going to want to add your path to the start argument when running, to do that open the Solution Explorer and press Show all files. Then go to out\build\x64-debug-win-clang\bin, right click GLSMAC.exe and select Add Debug Configuration->Default.
It should open launch.vs.json file, make it look similar to this (debug and release entries, add more arguments as necessary):
{
"version": "0.2.1",
"defaults": {},
"configurations": [
{
"type": "default",
"project": "out\\build\\x64-debug-win-clang\\bin\\GLSMAC.exe",
"projectTarget": "",
"currentDir": ".",
"name": "GLSMAC.exe",
"args": [
"--smacpath C:\\smac"
]
},
{
"type": "default",
"project": "out\\build\\x64-release-win-clang\\bin\\GLSMAC.exe",
"projectTarget": "",
"currentDir": ".",
"name": "GLSMAC.exe",
"args": [
"--smacpath C:\\smac",
]
}
]
}
Replace the path to SMAC installation with your own path to the game. It's not required anymore because GLSMAC will show prompt asking where is your SMAC installation, on first launch.
Alternatively, set working directory to that of your SMAC installation, it will work without --smacpath argument then.
currentDir above is needed because GLSMAC will load scripts from ./GLSMAC_data in runtime so you can tweak and change them and see changes reflected immediately after game restart. Portable builds have GLSMAC_data embedded, but if you are building GLSMAC manually they have to exist during compilation.
Then you are done and can run the game in Visual Studio.
MinGW
Building on Windows with MinGW is possible, but tricky. You need to install all those libraries manually, and also FreeGLUT. Double-check that you download libraries compiled for MinGW (and not MSVC). GLEW may need to be compiled from source (because they only ship MSVC version). Make sure to have threads-enabled version of MinGW. Maybe this guide will help you - https://github.com/induktio/mingw-glsmac
MSVC
Wasn't tested. Feel free to test, but I have feeling it will require many changes to code to be compatible.
Launch
Just run GLSMAC binary without arguments.
If this is your first launch it will ask you for SMAC location and save it in profile. Just can also specify smac location on command line: ./GLSMAC --smacpath <smac_directory>
You can also put GLSMAC file into your SMAC directory and it will detect SMAC installation.
Run ./bin/GLSMAC --help to see full list of options. Debug builds have extra options that aren't available for release builds.
Supported SMAC releases: GOG, Steam (Planetary Pack), Loki, Legacy (if you have something else and it doesn't work - double-check that you have SMACX expansion and then create issue with details of your specific SMAC version)
Reporting problems
If you encountered problem, first thing to try is to update to newest version, maybe it was already fixed.
Next step is to try Stable branch. Main branch contains latest code that may be unfinished or partially finished, and/or contain bugs aswell. Stable branch is supposed to be consistent and bug-free.
Until GLSMAC is v1.0 please do not comment on tiny glitches, sometimes I postpone them bit. Only important game-breaking bugs.
Check existing issues, maybe this bug is already known. Then it would be nice if you comment on existing one with your system specs and maybe other details.
If this feature was working correctly earlier - maybe you can find latest commit where it still worked, it will make fixing faster.
If it fails to build: create issue with errors from build log.
If it crashes: 1) use debug build 2) run gdb --args ./bin/GLSMAC <smac_directory>, type "r", make it crash, then type "bt" and create issue with this backtrace and steps to reproduce.
If it freezes: 1) use debug build 2) run gdb --args ./bin/GLSMAC <smac_directory>, get to where it freezes, then press Ctrl+C, type "bt" and create issue with backtrace and steps to reproduce.
If it behaves incorrectly: create issue and specify: 1) steps to reproduce 2) expected behavior 3) actual behavior ; attach screenshots if needed.
Update: on Linux you can use --gdb argument for debug build to start inside gdb automatically
If you're using debug build - it will create files tmp/lastmap.seed, tmp/lastmap.gsm (map file) and tmp/lastmap.dump (full dump of initialized map), attach them too if your issue is related to map. Make sure to gzip lastmap.dump, it's huge otherwise.
Copyright disclaimer
GLSMAC does not include any copyrighted assets from original SMAC, it is designed to use assets of existing SMAC installation on user's computer. It will also work with any third-party assets, as long as they are in same format and in same directory structure as original SMAC.
GLSMAC code is created from scratch and tries to imitate original SMAC logic while not actually containing any of it. It does not disassemble original SMAC binaries and does not link to any of SMAC libraries.
GLSMAC requires user to have original SMAC (+expansion) installed in order to operate in a way similar to original SMAC.
All rights for SMAC/SMACX assets belong to their respective owners, same for game mechanics, lore and other content (except for new GLSMAC features which didn't exist in original SMAC). AGPL license you see here only applies to GLSMAC code (and maybe custom-made assets in the future if I decide to make them).
More information
Primary source of information is git log.
Then there's discord where updates are frequent, sometimes I'll explain technical details or plans and also put screenshots of newly added features. There you can also ask me questions and coordinate development if you decide to participate.
Then there's this README but I'll only put generic stuff here and won't update often.
Finally, there are multiple threads on various forums and reddits but I don't have enough time to update them often and may be slow to reply.
About features - they aren't promises with guarantees, they are ideas that I'm thinking of implementing once base game is finished. No specific priorities or deadlines (most complex to implement will usually come last). They are also up for discussing on discord, you can also propose your own ideas and I'll add them if they are good.
All features that change SMAC gameplay will be optional and can be enabled/disabled per game, there will also be "Force Classic Mode" checkbox in settings that will conveniently disable all game-altering additions, for classic SMAC experience.
Emphasis on graphics is average, that means I try to make it look modern and not ugly, but will postpone time-consuming improvements to after v1.0 at least. That means graphics you see now is not final version, it will be better, but now gameplay is higher priority.
GLSMAC v1.x+ features
Art upscaling
SMAC art is 256-color and sounds are of 22khz mono quality. Maybe it's possible to upscale them and improve quality in runtime. Voice can be generated with something like https://beta.elevenlabs.io/
Replays
Easy recording of replays (maybe even 'auto-record replay' checkbox in options), then they can be saved, sent to others and watched, alone or as multiplayer game (host game