Raised This Month: $32 Target: $400
 8% 

Guide to gameinfo cloning - alternative way of forking servers


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nosoop
Veteran Member
Join Date: Aug 2014
Old 09-19-2019 , 19:52   Guide to gameinfo cloning - alternative way of forking servers
Reply With Quote #1

Disclaimer: This is a completely unsupported configuration. Various things may break.

This currently segfaults with CS:GO servers when a player joins. I don't do CS:GO, so I'm not going to try diagnosing the issue (especially since they lack symbols). Please post if you've experimented with this and managed to get a stable setup.

Thanks to Gamecube762 for pointing out this method; I've been using it to spin up fresh TF2 servers for various plugin projects.

At its core, gameinfo cloning is pretty straightforward: You copy / symlink a bunch of base files that SRCDS needs, but you point gameinfo.txt to a "core" installation of files, which the game will read from.

The result is effectively an empty game directory for each new "server", besides your configuration files and addons.

Installation, the long way:
  1. Create a fresh install of your game of choice. The installation folder will be your "core" instance; the only thing you should be doing is running updates to these.
  2. Create a new, empty folder
  3. Symlink the game install's bin/ directory, plus the srcds_run and game/steam.inf files to your new folder. On Windows, you'll want SeCreateSymbolicLinkPrivilege privileges.
  4. Copy srcds_run, steam_appid.txt, and $game/steam.inf to your new folder.
  5. Copy gameinfo.txt to your new folder, then modify the SearchPaths subsection as follows:
    • Any paths to VPKs should be changed to a full path name or one pointing to the path of your "core" installation.
    • All instances of |all_source_engine_paths| should be replaced with the path to your core installation.
    • If any are present, keep game_write and mod_write directories as-is, to ensure that files intended to be written are saved to your cloned installation.
    • For my brief testing with CS:GO, I just added a new "Game" entry directed at my core's csgo/ subdirectory. Feel free to experiment with the other search paths, as I'm not sure which folder CS:GO will end up writing to by default.
  6. Launch your cloned game's srcds_run and assert that it works.
  7. Install MM:S and SM under your cloned install.
  8. In the case of TF2, MM:S doesn't load automatically (probably only loads from a particular search directory). Add +plugin_load /full/path/to/addons/metamod/bin/server. SourceMod loads fine. Source.Python needs the game's server binary symlinked to tf/bin/.
  9. When you need to update the game, force_install_dir in your core game path as you did the first time.

Installation, the short way:

Here's a set of quick-install scripts for TF2, and CS:GO. Follow the instructions in the comments.

If anything goes wrong during the installation, you'll want to look over the long installation method. If anything is problematic while the server is running, well, you're probably on your own at that point.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)

Last edited by nosoop; 09-19-2019 at 19:53.
nosoop is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 09-20-2019 , 02:39   Re: Guide to gameinfo cloning - alternative way of forking servers
Reply With Quote #2

Quote:
Originally Posted by nosoop View Post
Disclaimer: This is a completely unsupported configuration. Various things may break.

This currently segfaults with CS:GO servers when a player joins. I don't do CS:GO, so I'm not going to try diagnosing the issue (especially since they lack symbols). Please post if you've experimented with this and managed to get a stable setup.

Thanks to Gamecube762 for pointing out this method; I've been using it to spin up fresh TF2 servers for various plugin projects.

At its core, gameinfo cloning is pretty straightforward: You copy / symlink a bunch of base files that SRCDS needs, but you point gameinfo.txt to a "core" installation of files, which the game will read from.

The result is effectively an empty game directory for each new "server", besides your configuration files and addons.

Installation, the long way:
  1. Create a fresh install of your game of choice. The installation folder will be your "core" instance; the only thing you should be doing is running updates to these.
  2. Create a new, empty folder
  3. Symlink the game install's bin/ directory, plus the srcds_run and game/steam.inf files to your new folder. On Windows, you'll want SeCreateSymbolicLinkPrivilege privileges.
  4. Copy srcds_run, steam_appid.txt, and $game/steam.inf to your new folder.
  5. Copy gameinfo.txt to your new folder, then modify the SearchPaths subsection as follows:
    • Any paths to VPKs should be changed to a full path name or one pointing to the path of your "core" installation.
    • All instances of |all_source_engine_paths| should be replaced with the path to your core installation.
    • If any are present, keep game_write and mod_write directories as-is, to ensure that files intended to be written are saved to your cloned installation.
    • For my brief testing with CS:GO, I just added a new "Game" entry directed at my core's csgo/ subdirectory. Feel free to experiment with the other search paths, as I'm not sure which folder CS:GO will end up writing to by default.
  6. Launch your cloned game's srcds_run and assert that it works.
  7. Install MM:S and SM under your cloned install.
  8. In the case of TF2, MM:S doesn't load automatically (probably only loads from a particular search directory). Add +plugin_load /full/path/to/addons/metamod/bin/server. SourceMod loads fine. Source.Python needs the game's server binary symlinked to tf/bin/.
  9. When you need to update the game, force_install_dir in your core game path as you did the first time.

Installation, the short way:

Here's a set of quick-install scripts for TF2, and CS:GO. Follow the instructions in the comments.

If anything goes wrong during the installation, you'll want to look over the long installation method. If anything is problematic while the server is running, well, you're probably on your own at that point.
if i'm reading it correctly currently this won't work for csgo, right?
__________________
8guawong is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 09-20-2019 , 04:50   Re: Guide to gameinfo cloning - alternative way of forking servers
Reply With Quote #3

Quote:
Originally Posted by 8guawong View Post
if i'm reading it correctly currently this won't work for csgo, right?
I figured the red text would stand out.

As far as the scripts go, this currently does not work for CS:GO as-is. Feel free to experiment with the setup to see if you can make it work. Worth a shot to get rid of 60GB of duplicate server copies, right?

I've managed to get the server launched, MM:S and SM installed in the cloned server's directory works (as far as meta version and sm version does), but attempting to join a playing team after connecting causes it to segfault (spectate is fine). Placing the core directory's path first makes everything except MM:S and SM load.

Might need to symlink more files / folders. It might just be that it expects something in that path that is currently missing. Hard to really say, because the CS:GO developers don't provide help in that aspect.

Maybe CS:GO straight-up actually lacks the facilities that make it viable for other Source game servers to be cloned in this way.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)
nosoop is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 09-20-2019 , 09:35   Re: Guide to gameinfo cloning - alternative way of forking servers
Reply With Quote #4

Quote:
Originally Posted by nosoop View Post
I figured the red text would stand out.

As far as the scripts go, this currently does not work for CS:GO as-is. Feel free to experiment with the setup to see if you can make it work. Worth a shot to get rid of 60GB of duplicate server copies, right?

I've managed to get the server launched, MM:S and SM installed in the cloned server's directory works (as far as meta version and sm version does), but attempting to join a playing team after connecting causes it to segfault (spectate is fine). Placing the core directory's path first makes everything except MM:S and SM load.

Might need to symlink more files / folders. It might just be that it expects something in that path that is currently missing. Hard to really say, because the CS:GO developers don't provide help in that aspect.

Maybe CS:GO straight-up actually lacks the facilities that make it viable for other Source game servers to be cloned in this way.
guess you noticed my complaint in discord
__________________
8guawong is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:49.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode