Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

Install Civ2 with UI Additions on GNU/Linux

For the readers in the United States, happy Independence Day! In my environment, the bigger games that aren't easy to fit into a package get an install.txt with code snippets for copy-pasting into a terminal. Today, I will show you how I install Civ2 MGE from an ISO made from the original CD. Scan
of Civ2 MGE cd

Steps

## Variables
export GAME_WINEPREFIX=~/.wine
export GAME_NAME="Civ2"
export GAME_CD_IMAGE=/mnt/public/CDROMs/Games/Civ/2/MGE/Civ2MGE_2.vcd.D00
export GAME_CD_DIR="${GAME_WINEPREFIX}/cdroms/civ2"
export GAME_CD_NEEDED=1
export GAME_DIR="${GAME_WINEPREFIX}/drive_c/Program Files/MicroProse Software/Civilization II Multiplayer Gold Edition"
export GAME_ITEM_COUNT=2
export GAME_ITEM1_MENU=~/.local/share/applications/Civ2.desktop
export GAME_ITEM1_NAME="Civ 2 MGE with UI Additions"
export GAME_ITEM1_COMMENT="4X strategy game"
export GAME_ITEM1_SCRIPT="${GAME_WINEPREFIX}/civ2.sh"
export GAME_ITEM1_ICON="/mnt/public/CDROMs/Games/Civ/2/MGE/CIV2MGE.ICO"
export GAME_ITEM1_STRING="${HOME}/.wine/drive_c/Program Files/MicroProse Software/Civilization II Multiplayer Gold Edition/Civ2UIALauncher.exe"
export GAME_ITEM1_CATEGORIES="Game;StrategyGame;"
export GAME_ITEM1_OPTS=' -play -exe "C:\Program Files\MicroProse Software\Civilization II Multiplayer Gold Edition\Civ2.exe" -dll "C:\Program Files\MicroProse Software\Civilization II Multiplayer Gold Edition\Civ2UIA.dll"'

Install wine (on Devuan that needs to be the wine32:i386 package). The native package should work, but using the winehq version is fine too. The full instructions for that are beyond the scope of this documentation.

export WINEPREFIX="${GAME_WINEPREFIX:-${HOME}/.wine}"
export WINEARCH="${GAME_WINEARCH:-win32}"
export WINEEXEC=/usr/bin/wine

Mount the iso and install the game.

sudo mkdir -p "${GAME_CD_DIR}"
sudo mount -v "${GAME_CD_IMAGE}" "${GAME_CD_DIR}"
wine "${GAME_CD_DIR}/"Setup.exe

Simulate a reboot.

wineboot -r
sudo umount -v "${GAME_CD_DIR}"

Install MGE patch 1.3 (weblink 3).

wine "/mnt/public/CDROMs/Games/Civ/2/MGE/Multiplayer Gold Edition - v1.3 US civiimge_uccupdate3.exe"

Download the Civ2 UI Additions project (weblink 1) which depends on the patch we just installed, and install it.

cd "${GAME_DIR}"
7za x "/mnt/public/CDROMs/Games/Civ/2/MGE/Civ2UIA.v1.14.0.65.zip"

Build a script for easy invocation.

touch "${GAME_ITEM1_SCRIPT}" ; chmod 0755 "${GAME_ITEM1_SCRIPT}"
cat <<EOFSH > "${GAME_ITEM1_SCRIPT}"
#!/bin/sh

# make sure cd is mounted
sudo mkdir -p "${GAME_CD_DIR}" ; sudo mount -v "${GAME_CD_IMAGE}" "${GAME_CD_DIR}"

# run game
env WINEPREFIX="${WINEPREFIX}" WINEARCH="${WINEARCH}" ${WINEEXEC} "${GAME_ITEM1_STRING}" ${GAME_ITEM1_OPTS}
EOFSH

Establish the menu icon.

mkdir -p ~/.local/share/icons
cp -p "${GAME_ITEM1_ICON}" ~/.local/share/icons
touch "${GAME_ITEM1_MENU}" ; chmod 0755 "${GAME_ITEM1_MENU}"
cat <<EOFDESKTOP > "${GAME_ITEM1_MENU}"
[Desktop Entry]
Name=${GAME_ITEM1_NAME}
Exec="${GAME_ITEM1_SCRIPT}"
Type=Application
StartupNotify=true
Path="${GAME_DIR}"
Icon=/home/${USER}/.local/share/icons/$( basename "${GAME_ITEM1_ICON}" )
StartupWMClass=$( basename "${GAME_ITEM1_STRING}" )
Comment=${GAME_ITEM1_COMMENT}
Categories=${GAME_ITEM1_CATEGORIES}
EOFDESKTOP

And that should be it! Xfce menu showing Civ2 with UI Additions in
menu

History

When I first got Civilization II, it was the 2.42 version where the Civilopedia was a separate binary. Also, the AI didn't always hate you (but I think that's an artifact of the 1.3 patch for MGE). Later on, I got the Multiplayer Gold Edition and played with siblings. I even found a few sci-fi scenarios, like Star Trek and Stargate.

References

Weblinks

  1. FoxAhead/Civ2-UI-Additions: Civilization II User Interface Additions
  2. Civilization II MGE User Interface Additions (CIV2UIA) | CivFanatics Forums
  3. Civilization II: Patches and Updates | CivFanatics
  4. Star Trek:Battle for Alpha Quadrant ver 3.1b | CivFanatics Forums
  5. Star Gate:SG1 ver 1.2 | CivFanatics Forums
  6. Alternate location with possibly newer versions of these sci-fi scenarios, and more: https://www.civfanatics.com/civ2/downloads/scenarios/sci-fi/

Comments