Skip to content

WilliamVenner/stronghold2-ultimate-multiplayer-ai-patch

Repository files navigation

🛡️ Stronghold 2 Ultimate Multiplayer AI Patch

This program permanently patches Stronghold 2 (Steam Edition, v1.5) to:

  • Enable adding AI players in multiplayer Kingmaker mode
  • Enable AI player sieges in multiplayer Kingmaker mode
  • (Optional) Allow players and AI to build Siege Camps outside their estate

How is this different from other multiplayer AI patches?

Previous patches only fixed not being able to add AI players in multiplayer Kingmaker mode.

This patch fixes that, but also fixes AI players not being able to start sieges or place Siege Camps.

Additionally, this patch is a permanent patch that is applied directly to the Stronghold 2 executable — no need to run the program every time you boot up Stronghold 2!

Requirements

Instructions

Windows

  1. Download Stronghold2_Ultimate_Multiplayer_AI_Patch.exe from the releases page
  2. Run the program. You may need to allow the program to run when prompted by Windows Defender SmartScreen (click "More info" then "Run anyway")
  3. Follow the instructions in the console window. The program will automatically detect the location of your Stronghold 2 installation.
  4. Launch the game. You should see "Multiplayer (Ultimate AI Patch)" on the main menu. If so, the patch has worked! Enjoy playing with AI players in multiplayer Kingmaker mode :D

Linux

  1. Download Stronghold2_Ultimate_Multiplayer_AI_Patch_Linux from the releases page
  2. Make the file executable by running chmod +x Stronghold2_Ultimate_Multiplayer_AI_Patch_Linux in a terminal.
  3. Run the executable.
  4. Follow the instructions in the console window. The program will automatically detect the location of your Stronghold 2 installation.
  5. Launch the game. You should see "Multiplayer (Ultimate AI Patch)" on the main menu. If so, the patch has worked! Enjoy playing with AI players in multiplayer Kingmaker mode :D

Uninstallation

The program creates a backup of the original Stronghold2.exe executable called Stronghold2.exe.bak, stored in the same directory.

You can restore this backup using Stronghold 2 Ultimate Multiplayer AI Patch. Run the program and press "Y" when prompted to restore the backup.

Alternatively, first make sure you have file extensions enabled in Windows Explorer, then simply delete Stronghold2.exe and rename Stronghold2.exe.bak to Stronghold2.exe.

If you've somehow lost this backup, Verify Integrity of Game Files on Steam to restore the original Stronghold2.exe.

Media

Console Window

Main Menu

Multiplayer Setup Screen

Siege Camps Outside Estate

AI Siege

How does it work?

Under the hood, Stronghold 2 does actually support AI in multiplayer; it's simply just been hidden away with various features disabled. Perhaps the developers didn't have enough time to polish the AI for multiplayer, or perhaps they had performance concerns, we will probably never know.

I have identified the code in the executable that checks whether the game is in multiplayer mode in order to disable AI. This program simply patches the executable to skip these checks. That's all there is to it!

The relevant code for this can be found here.

Compiling from source

First, install Rust.

Then, simply clone and build in release mode:

git clone https://github.com/WilliamVenner/stronghold2-ultimate-multiplayer-ai-patch.git
cd stronghold2-ultimate-multiplayer-ai-patch
cargo build --release

The compiled binary can be found in stronghold2-ultimate-multiplayer-ai-patch/target/release/.