Stronghold 2 Multiplayer AI Enabler is an unofficial tool for Stronghold 2 Steam Edition that lets you add AI opponents to multiplayer matches. This feature was originally in the game, but at some point the developers decided to remove it. Many people enjoy playing cooperatively against the AI, so this tool makes it possible again.
You can download this as either 64-bit or 32-bit windows executable. This tool also works on Linux, but it needs to be compiled from source for Linux. Windows users can also compile from source if so desired. More information on compiling is found further down on this page.
Older version of this tool (not recommended):
Download 64-bit windows executable: sh2_mp_ai_enabler_x86_64-0.2.exe
Download 32-bit windows executable: sh2_mp_ai_enabler_x86-0.2.exe
Version 0.2 source code: https://gitlab.com/Daerandin/sh2_mp_ai_enabler/-/releases/0.2
64-bit windows executable: sh2_mp_ai_enabler_x86_64-0.1.exe
32-bit windows executable: sh2_mp_ai_enabler_x86-0.1.exe
Version 0.1 source code: https://gitlab.com/Daerandin/sh2_mp_ai_enabler/-/releases/0.1
Only the game host should use this tool. Other players joining the game should not be running this tool.
This tool is very simple to use, requiring no interaction.
This should be working without issues, but in case there are problems you can report it on the Stronghold 2 steam forums: https://steamcommunity.com/app/40960/discussions/0/6021892758162858172/
If you are hesitant to just download and run stuff from the internet (you should be), then you might want to compile it yourself. If you, or anyone you know, can read C code then it is a simple matter to audit the code for this software. The code is quite small so it should be simple for anyone with familiarity with C. After having checked the code, then you can compile it yourself. This is a great way to verify that software does what it claims to do.
Before you can compile anything, you need to download the source code. Ideally you will want the source code for the newest release.
On Linux, ensure you have basic build tools installed (gcc, binutils, make), then simply enter the 'src' directory and type:
This will create an executable named "sh2_mp_ai_enabler". You can omit the last part with CFLAGS="-s" but I recommend it as it will create a smaller executable without unneeded symbols.
I am not particularly familiar with Windows or developing on Windows. With the help of others, I've gotten the code to a state where it will compile cleanly in Visual Studio, however, I have no experience with compiling this way.
My personally recommended way for compiling C code on Windows would be MSYS2 as it includes all the tools required for preparing and compiling source code the Unix way. It will create a native Windows executable. It also has full support for typical C makefiles.
MSYS2 can be downloaded and installed from here: https://www.msys2.org/
For detailed compilation instructions: Compiling Stronghold 2 AI fix from source
Make sure to read and follow the installation instructions to the letter. Once it is properly set up, you need to 'cd' into the 'src' directory for this tool, and then build it with a single command:
make windows CFLAGS="-s"
This will create the executable for the program which you can then move anywhere you like. The CFLAGS="-s" part is not required, but I still recommend it for creating a smaller executable without uneeded symbols.