SourceCoop
GamesSourceCoop is a cooperative server-side-only mod for multi-player Source Engine games (like Black Mesa), that enables players to play together on single-player campaigns or maps. This Egg currently supports official Black Mesa maps only, but can be easily modified to support more (see Egg README for details).
README
SourceCoop
Egg Authors / Contributors
Server Description
From their Github:
SourceCoop is a cooperative server-side-only mod for multi-player Source Engine games (like Black Mesa), that enables players to play together on single-player campaigns or maps.
[!IMPORTANT]
This Egg only supports official Black Mesa maps, but it can easily be modified to support custom BM maps (see Manual Configuration Topics for details).
Support for other Source Engine games (eg. HL2) may be added in the future to SourceCoop and this Egg, but Black Mesa is currently the only formally supported game.
Egg Capabilities
- Configuration of basic server settings via Startup Variables. This includes:
- Server Name
- Max Players
- Server Password
- Note: Clients may need to enter
password <your_password>in their console before joining.
- Note: Clients may need to enter
- Starting Map
- and Enable Friendly Fire
- Fix for some maps potentially crashing on Linux via "[Advanced] Enable
mod_forcetouchdata" Startup Variable.- See SourceCoop issue #121 for details.
- Fine-tune configuration of which versions/builds to download of SourceCoop and its dependencies (helpful in the event of SourceCoop updating).
Installation/System Requirements
| Bare Minimum | Recommended | |
|---|---|---|
| Processor | Recent x86/64 (AMD/Intel) processor. No ARM support. | ---- |
| RAM | 512 MiB | 2048-4096 MiB |
| Storage | 29696 MiB | 32768 MiB |
| Game Ownership | Not required at all. | ---- |
Server Ports
- Default server ports are listed below, but they can be changed freely.
- RCON will share the Game port and is only required if the server owner enables/uses RCON.
| Port | Default | Protocol |
|---|---|---|
| Game | 27015 | UDP |
| RCON | (Same as Game) | TCP |
Manual Configuration Topics
The following are various topics covering manual configuration procedures the Egg does not handle automatically that may be useful to server owners:
Additional Config. / Addons / Plugins
This is best documented by their Github:
Custom Maps
As stated above, this Egg formally supports official Black Mesa maps only. However, custom maps can still be loaded by editing the Egg's "Starting Map" Startup Variable to have an input rule of only required|string. This will allow custom map names to be entered. Here is a link to a list of currently supported (by SourceCoop) custom maps.
Different Games/Builds
As stated above, this Egg only formally supports the game Black Mesa. However, different builds of SourceCoop that support different games can be installed via the "[Advanced] SourceCoop Release Build Tag" Startup Variable. This tag should match text in the name of the release asset. Heavy, manual modification of the Egg would be required to make this work though.
Docker Images (1)
| Name | Image |
|---|---|
ghcr.io/ptero-eggs/steamcmd:debian | ghcr.io/ptero-eggs/steamcmd:debian |
Startup Command
./srcds_run -console -game bms -secure -ip 0.0.0.0 -port {{SERVER_PORT}} +maxplayers {{MAX_PLAYERS}} +mp_teamplay 1 +exec server.cfg +map {{STARTING_MAP}} -strictportbind -norestart Variables (12)
Server Name
Server name to show in server list.
- Environment:
SERVER_NAME- Default:
Black Mesa: Coop- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string|max:128
Max Players
The maximum amount of players allowed on your game server.
- Environment:
MAX_PLAYERS- Default:
10- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|integer|min:1|max:128
Server Password
Password required to join the server. Set to 0 to have no password.
- Environment:
SERVER_PASSWORD- Default:
0- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string
Starting Map
Map name for the server to load when it starts. Please use the following link for a guide on Black Mesa's map names: https://steamcommunity.com/sharedfiles/filedetails/?id=1920599249
- Environment:
STARTING_MAP- Default:
bm_c0a0a- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string|in:bm_c0a0a,bm_c0a0b,bm_c0a0c,bm_c1a0a,bm_c1a0b,bm_c1a1a,bm_c1a1b,bm_c1a1c,bm_c1a1d,bm_c1a1e,bm_c1a2a,bm_c1a2b,bm_c1a2c,bm_c1a3a,bm_c1a3b,bm_c1a3c,bm_c1a4a,bm_c1a4b,bm_c1a4c,bm_c1a4d,bm_c1a4e,bm_c2a1a,bm_c2a1b,bm_c2a2a,bm_c2a2b,bm_c2a2c,bm_c2a2a,bm_c2a2a1,bm_c2a2a2,bm_c2a2b,bm_c2a2b1,bm_c2a2b2,bm_c2a2c,bm_c2a3a,bm_c2a3b,bm_c2a3c,bm_c2a4a,bm_c2a4b,bm_c2a4c,bm_c2a4e,bm_c2a4f,bm_c2a4g,bm_c2a4h,bm_c2a5a,bm_c2a5b,bm_c2a5c,bm_c2a5d,bm_c2a5e,bm_c2a5f,bm_c2a5g,bm_c2a5h,bm_c2a5i,bm_c3a1a,bm_c3a1b,bm_c3a2a,bm_c3a2b,bm_c3a2c,bm_c3a2d,bm_c3a2e,bm_c3a2f,bm_c3a2g,bm_c3a2h,bm_c3a2i,bm_c4a1a,bm_c4a1a1,bm_c4a1b,bm_c4a1b1,bm_c4a1c,bm_c4a1c1,bm_c4a2a,bm_c4a2b,bm_c4a2c,bm_c4a3a,bm_c4a3a1,bm_c4a3b,bm_c4a3b1,bm_c4a3b2,bm_c4a3c,bm_c4a3c1,bm_c4a3c2,bm_c4a3d,bm_c4a3d1,bm_c4a4a,bm_c5a1,credits
Enable Friendly Fire
(1 Enable | 0 Disable)
- Environment:
FRIENDLY_FIRE- Default:
0- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
boolean
[Advanced] Enable `mod_forcetouchdata`
Enables pre-caching of map data (eg. models, etc.). Disabling this may resolve crashing/hanging on certain maps (namely `bm_c4a4a` - Nihilanth), but may cause performance issues on other maps.
- Environment:
MOD_FORCETOUCHDATA- Default:
1- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
boolean
[Advanced] Black Mesa Dedicated Server App ID
Steam App ID used for installation and updates. Rarely needs to be changed.
- Environment:
SRCDS_APPID- Default:
346680- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|integer|in:346680
[Advanced] Update Black Mesa Dedicated Server
Checks for any Black Mesa dedicated server updates on startup, and updates if necessary. This is off by default, because an update of the Black Mesa server will typically require an update of SourceCoop as well (which requires re-installing the server). An update of SourceCoop may also require an update of Metamod and SourceMod (see these settings for more info). Note: Clients that have updated may not be able to join an outdated server. (1 Enable | 0 Disable)
- Environment:
AUTO_UPDATE- Default:
0- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
boolean
[Advanced] SourceCoop Release Version Tag
Which SourceCoop release (based on tag) to download from https://github.com/ampreeT/SourceCoop/releases during install/re-install. Note: If using `latest`, ensure you have specified the recommended Metamod and SourceMod builds (see these settings for more details).
- Environment:
VERSION- Default:
latest- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string
[Advanced] SourceCoop Release Build Tag
Which SourceCoop build (based on keyword in release asset) to download from https://github.com/ampreeT/SourceCoop/releases during install/re-install. Note: Only Black Mesa is currently supported.
- Environment:
MATCH- Default:
bms- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string
[Advanced] Metamod:Source Build
Which Metamod:Source 1.11 build number to download during install/re-install. May need to be changed if SourceCoop updates, but otherwise rarely needs to be changed. Refer to the following link for the latest recommended build: https://github.com/ampreeT/SourceCoop?tab=readme-ov-file#installation-guide
- Environment:
MMS_BUILD- Default:
1148- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|integer|min:1131
[Advanced] SourceMod Build
Which SourceMod 1.11 build number to download during install/re-install. May need to be changed if SourceCoop updates, but otherwise rarely needs to be changed. Refer to the following link for the latest recommended build: https://github.com/ampreeT/SourceCoop?tab=readme-ov-file#installation-guide
- Environment:
SM_BUILD- Default:
6960- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|integer|min:6940
Installation Script
ghcr.io/ptero-eggs/installers:debian/bin/bash#!/bin/bash
## File: SourceCoop Egg - egg-source-coop.json
## Authors: David Wolfe (Red-Thirten)
## Date: 2024/05/14
## License: MIT License
## Image to install with is 'ghcr.io/ptero-eggs/installers:debian'
# Download and install SteamCMD
export HOME=/mnt/server
cd /tmp
mkdir -p $HOME/steamcmd $HOME/steamapps
curl -sSL -o steamcmd.tar.gz https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xzvf steamcmd.tar.gz -C $HOME/steamcmd
cd $HOME/steamcmd
# SteamCMD fails otherwise for some reason, even running as root.
# This is changed at the end of the install process anyways.
chown -R root:root /mnt
# Install/Verify game server using SteamCMD
if [[ "${STEAM_USER}" == "" ]] || [[ "${STEAM_PASS}" == "" ]]; then
echo -e "[SteamCMD] Steam user is not set. Using anonymous user."
STEAM_USER=anonymous
STEAM_PASS=""
STEAM_AUTH=""
fi
./steamcmd.sh +force_install_dir $HOME +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '+@sSteamCmdForcePlatformType windows' ) +app_update ${SRCDS_APPID} $( [[ -z ${SRCDS_BETAID} ]] || printf %s "-beta ${SRCDS_BETAID}" ) $( [[ -z ${SRCDS_BETAPASS} ]] || printf %s "-betapassword ${SRCDS_BETAPASS}" ) ${INSTALL_FLAGS} validate +quit
# Set up 32 and 64 bit libraries
mkdir -p $HOME/.steam/sdk{32,64}
cp -v linux32/steamclient.so $HOME/.steam/sdk32/steamclient.so
cp -v linux64/steamclient.so $HOME/.steam/sdk64/steamclient.so
## Install Metamod:Source
echo -e "Installing Metamod:Source (1.11.0-git${MMS_BUILD})..."
cd /tmp
curl -L https://mms.alliedmods.net/mmsdrop/1.11/mmsource-1.11.0-git${MMS_BUILD}-linux.tar.gz -o mmsource-1.11.0-git${MMS_BUILD}-linux.tar.gz
tar -xzvf mmsource-1.11.0-git${MMS_BUILD}-linux.tar.gz -C $HOME/bms
## Install SourceMod
echo -e "Installing SourceMod (1.11.0-git${SM_BUILD})..."
cd /tmp
curl -L https://sm.alliedmods.net/smdrop/1.11/sourcemod-1.11.0-git${SM_BUILD}-linux.tar.gz -o sourcemod-1.11.0-git${SM_BUILD}-linux.tar.gz
tar -xzvf sourcemod-1.11.0-git${SM_BUILD}-linux.tar.gz -C $HOME/bms
## Install SourceCoop
echo -e "Installing SourceCoop (${VERSION}-${MATCH})..."
cd /tmp
# this is a simple script to use the github API for release versions.
# this requires the egg has a variable for GITHUB_PACKAGE, VERSION and MATCH (match is to match the filename in some way)
# this supports using oauth/personal access tokens via GITHUB_USER and GITHUB_OAUTH_TOKEN (both are required.)
# if you are getting hit with GitHub API limit issues then you need to have the user and token set.
GITHUB_PACKAGE="ampreeT/SourceCoop"
if [ -z "${GITHUB_USER}" ] && [ -z "${GITHUB_OAUTH_TOKEN}" ] ; then
echo -e "using anon api call"
else
echo -e "user and oauth token set"
alias curl='curl -u ${GITHUB_USER}:${GITHUB_OAUTH_TOKEN} '
fi
# get release info and download links
LATEST_JSON=$(curl --silent "https://api.github.com/repos/${GITHUB_PACKAGE}/releases/latest")
RELEASES=$(curl --silent "https://api.github.com/repos/${GITHUB_PACKAGE}/releases")
if [ -z "${VERSION}" ] || [ "${VERSION}" == "latest" ]; then
DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url | grep -i ${MATCH})
else
VERSION_CHECK=$(echo ${RELEASES} | jq -r --arg VERSION "${VERSION}" '.[] | select(.tag_name==$VERSION) | .tag_name')
if [ "${VERSION}" == "${VERSION_CHECK}" ]; then
DOWNLOAD_URL=$(echo ${RELEASES} | jq -r --arg VERSION "${VERSION}" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i ${MATCH})
else
echo -e "defaulting to latest release"
DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)
fi
fi
curl -L ${DOWNLOAD_URL} -o sourcecoop.zip
unzip sourcecoop.zip -d $HOME/bms
## Create custom server.cfg
echo -e 'Creating custom "server.cfg" configuration file...'
cd $HOME/bms/cfg
rm -f server.cfg
cat > server.cfg << EOF
// Black Mesa server.cfg file
hostname "Black Mesa: Coop"
sv_password 0
// provides lag-free noblock, shows teammates as friendly
// and puts an arrow above their head (srccoop handles team switching)
mp_teamplay 1
// set 1 if you hate your friends
mp_friendlyfire 0
// setting 1 disables sprinting
sv_always_run 0
// disables map timelimit
mp_timelimit 0
// changes maps in empty server
mp_mapcycle_empty_timeout_seconds 3600
// Uncomment to loop back to the first map after finishing a campaign
// Leave commented to use nextmap (mapcycle) instead
sourcecoop_homemap "bm_c0a0a"
// Enables pre-caching of map data (eg. models, etc.)
// Disabling this may resolve crashing/hanging on certain maps (namely bm_c4a4a), but may cause performance issues on other maps.
mod_forcetouchdata 1
rcon_password "" // disable rcon
sv_tags "custom, coop, sourcecoop"
sv_cheats 0
sv_alltalk 1
EOF
## Check for successful installation.
cd $HOME/bms/addons
if [ -d "metamod" ] && [ -d "sourcemod" ] && [ -f "sourcemod/plugins/srccoop.smx" ]; then
echo -e "\nSourceCoop Dedicated Server successfully installed!\n"
else
echo -e "\n\n[Error] One or more SourceCoop dependancies failed to install!"
echo -e "\tTry checking your [Advanced] startup settings and/or reinstalling the server again.\n"
exit 1
fi