Memories of Mars

Memories of Mars

Not enough ratings
Creating a MoM Private Server for Windows
By Merykh
The purpose of this guide is to help those who wish to set up their own private server to play Memories of Mars. It is based on my own testing and uses the default settings provided by the official Dedicate Server manual along with some customization I've done to include automatic updating and backups.

It is my hope that this guide will demystify the server configuration process and get you out there uncovering the mysteries buried beneath the harsh Martian surface as quickly as possible.
   
Award
Favorite
Favorited
Unfavorite
Preamble
This guide makes certain assumptions that should be taken into account when being followed. Those assumptions include, but are not limited to:
  • The assumption that the reader is installing the server on Windows 10.
  • The reader has a working knowledge of the Windows 10 operating system, Windows Command Line Interface (CMD), Windows Firewall, Task Scheduler and batch files.
  • The reader has a working knowledge of their router configuration and at least a rudimentary understanding of Windows networking.
  • The reader has a working knowledge of how to read and edit configuration files used by games developed using the Unreal 4 Engine.
  • The reader acknowledges that this is only a guide and chooses to follow it of their own free will. The author cannot be held responsible for any potential damage and does not guarantee it will work 100% of time.
  • Updates to the game after the publishing of this guide may render it obsolete.
Prerequisites
Documentation and Programs necessary to install and configure the MoM Dedicated Server:
Installation
Using SteamCMD versus Steam Tools

While installing the server via Steam Tools is provided as an option in the official manual, I have found it's functionality to be problematic at best, and completely non-functional at worst. For that reason, this guide will walk you through using the SteamCMD version of the server. That being said, there shouldn't be any reason why this guide won't work for the Steam Tools version. You'll just have to modify the directory structure to those used by the Steam Client.

  1. Installing SteamCMD:
    • Download the installer using the link provided in the "Prerequisites" section of this guide.
    • Extract the contents of the SteamCMD zip file to your preferred location. For the purposes of this guide, we will be using:
      C:\SteamCMD
      .
  2. Install the MoM Dedicated Server:
    • For the purposes of this guide we will be installing the server to:
      C:\SteamCMD\servers\mom
    • Open a Command Prompt window with Administrative Privileges and change directory to:
      C:\SteamCMD
    • Install the server files by entering the following at the Command Prompt:
      steamcmd.exe +login anonymous +force_install_dir C:\SteamCMD\servers\mom +app_update 897590 +quit
      SteamCMD will automatically exit once it completes downloading the MoM Dedicated Server files.

  3. Running the Server for the first time
    • At the Command Prompt, change directory to:
      C:\SteamCMD\servers\mom\
    • At the Command Prompt, key in Run Server.bat and press Enter to start the server. The first time the server runs it should open a console window displaying the server output. It will also create the DedicatedServerConfig.cfg and CustomRuleSet.cfg files used to complete the server configuration.
    • Once the server has completely loaded, press CTRL+C with the Server Console in focus to shutdown the server. Alternatively, you can open the Windows Task Manager and End Task on MemoriesOfMarsServer.exe.
    • In the Command Prompt window press CTRL+C to force the Run Server.bat file to exit
Congratulations! You've now installed the Memories Of Mars Dedicated Server! On to Configuration...
Configuration
  1. Opening Ports on your Router
    • On your router, forward the following ports to the IP address of your server:
      • 7777 UDP
      • 15000 UDP
      Note: These ports are configurable. See below under Modifying the DedicatedServerConfig.cfg file.

  2. Configuring the Run Server.bat file for Online Multiplayer
    Note: You should not need to modify the Run Server.bat file if you are playing SP on the same PC or LAN as the server.
    • Open Windows Explorer and browse to:
      C:\SteamCMD\servers\mom
    • Open the Run Server.bat file in your preferred Text Editor and change the line:
      START /w \Game\Binaries\Win64\MemoriesOfMarsServer.exe
      to:
      START /w \Game\Binaries\Win64\MemoriesOfMarsServer.exe -PublicIP=<WAN IP Address> -MULTIHOME=<LAN IP Address>
      Note: You can google "What is my IP" to get your WAN IP address. The LAN IP is the IP Address of the server.

  3. Configuring the Windows Firewall
    • Make sure that MemoriesofMarsServer.exe is allowed to communicate through the Windows Firewall.
      • Windows should prompt you to do this automatically the first time the server is run.
      • I recommend allowing it through both Public and Private networks.

  4. Modifying the DedicatedServerConfig.cfg file
    Note: Please refer to the manual for a detailed decription of what each setting does.
    • The most important variables of note in this file are:
      • Port
      • PublicPort
      • BeaconPort
      • PublicBeaconPort
      If you wish to use ports other than the defaults you can change them here by changing the "PublicPort": and "PublicBeaconPort": variables to match the ports you have defined in your router port forwarding table. I don't recommend changing the default Port and BeaconPort variables unless you're running more than one MoM Server on the same network.
    • Be sure to add your Account ID located in the lower left corner of the Game Menu to the "Admins": section to give you access to the Admin menu in-game. If you wish to have more than one Admin, separate the Player IDs using the pipe "|" symbol.

  5. Modifying the CustomRuleSet.cfg file
    The default values used by this file are completely doable in SP but there are a couple of sections you may wish to modify, FLOP Events Rules and Building Ranks. Note: Please refer to the manual for a detailed description of what each setting does. Mind the commas! They are important!
    • FLOP Events Rules:
      "FlopEventRules": [ { "PlayersRequired": 4, "EventsActive": 1 }, { "PlayersRequired": 16, "EventsActive": 2 } ] },
      If you want a FLOP event to start while playing solo, you'll need to edit the PlayersRequired variable to 1 for the first event rule (shown above).
    • Building Ranks
      "BuildingRanks": [ { "RequiredFlops": 50, "MaxSupportedStructures": 25, "BoundarySphereRadius": 50, "ProtectionTimeInDays": 2 }, { "RequiredFlops": 100, "MaxSupportedStructures": 50, "BoundarySphereRadius": 75, "ProtectionTimeInDays": 4 }, { "RequiredFlops": 500, "MaxSupportedStructures": 100, "BoundarySphereRadius": 100, "ProtectionTimeInDays": 8 }, { "RequiredFlops": 1000, "MaxSupportedStructures": 250, "BoundarySphereRadius": 150, "ProtectionTimeInDays": 12 }, { "RequiredFlops": 5000, "MaxSupportedStructures": 500, "BoundarySphereRadius": 200, "ProtectionTimeInDays": 16 }, { "RequiredFlops": 10000, "MaxSupportedStructures": 1000, "BoundarySphereRadius": 250, "ProtectionTimeInDays": 24 } ]
      You can change each of the variables for each level to match your personal play style. You cannot remove or add ranks however. There must be six levels defined and only six. You can set the FLOPs required for the first level to 0 if you want though. Your base starts at level one when you build the admin panel so the amount defined in the cfg file is ignored.

That's really it. You can tweak the other settings in the CustomRuleSet.cfg as you see fit. Just check the manual for a description of what each does and how they are configured.
Advanced Configuration and Automation
In order to automate updates, starting the server and backing up the database I have created a couple of custom batch files that I manage via a scheduled task.

Here is what I have done:
  • Installed 7zip on the server
  • Created a directory on the root of C:\ called MoMServer
  • Created a directory in the C:\MoMServer directory called Backups
  • Copied Run Server.bat from C:\SteamCMD\servers\mom to C:\MoMServer
  • Edited the Run Server.bat file as follows:
    @echo off PATH=%PATH%;%~dp0 REM Use Windows Powershell to get the Public IP. Helpful if your WAN IP is assigned using DHCP by your ISP (most are) FOR /f %%a in ('powershell Invoke-RestMethod api.ipify.org') DO SET pIP=%%a SET stCMD=C:\SteamCMD\steamcmd.exe SET User=anonymous REM SET Pass= SET sDIR=C:\SteamCMD\servers\mom SET AppID=897590 SET svrEXE=%sDIR%\Game\Binaries\Win64\MemoriesOfMarsServer.exe SET sARG1=-PublicIP=%pIP% SET sARG2=-MULTIHOME=LAN IP Address SET bDIR=C:\MoMServer\Backups :START ECHO Server Public IP Address: %pIP% ECHO. ECHO Checking for Server update... START /WAIT %stCMD% +login %User% +force_install_dir %sDIR% +app_update %AppID% +quit ECHO. ECHO Update Complete. ECHO. ECHO Starting Memories of Mars Server... START /WAIT %svrEXE% %sARG1% %sARG2% ECHO. ECHO Server has shut down. If this was NOT the daily restart, please check the ECHO %sDIR%\Game\Saved\Logs and %sDIR%\Game\Saved\Crashes folders for more info. ECHO. ECHO Backing up ServerDB and Configs... ECHO. ECHO Zipping Server files to %bDIR%... START /I /WAIT /B .\momBackup.bat ECHO. ECHO Backup complete. ECHO. ECHO Server will automatically restart in 10 seconds. Press any key to cancel. TIMEOUT /T 10 /NOBREAK CLS GOTO :START :EOF
  • Created new text file in Notepad and added the following:
    @ECHO OFF SET dbDir=C:\SteamCMD\servers\mom\Game\Saved SET buDir=C:\MoMServer\Backups SET buFile=mom_saved_%date:~-4,4%%date:~-7,2%%date:~-10,2%_%time:~-11,2%%time:~-8,2%%time:~-5,2%.zip :START ECHO Zipping Server files... START /WAIT C:\PROGRA~1\7-Zip\7z.exe a -tzip %buDir%\%buFile% %dbDir%\* ECHO. ECHO Archive completed ECHO. :EOF EXIT
    Saved file as momBackup.bat in the C:\MoMServer directory.
  • Set "Headless": to true, in the DedicatedServerConfig.cfg
  • Created a Scheduled Task using the following settings:
    • General Tab
      • Name "Start MoM Server"
      • Security Options
        • User Account: System
        • Run with highest privileges checked
    • Triggers Tab
      • At System Startup
    • Actions Tab
      • Start A Program "C:\MoMServer\Run Server.bat"

I started launching the server using a batch file outside of the game directory after a major update reset the batch file to the games default. I don't think this happens anymore, but I figured better safe than sorry. I've also started backing up my Backups folder to a cloud drive so that I minimize data loss if the hard drive on the server crashes. I am aware of the inherent risk using the Windows System account so feel free to create a user account just to run the server. Have fun!
Troubleshooting and Follow-up
If you encounter an error referencing VCRUNTIME140.dll or MSVCP140.dll when you first launch your server, you'll need to install the Visual C++ Redistributable for Visual Studio 2015. You should be able to download it here:https://www.microsoft.com/en-gb/download/details.aspx?id=48145

If you can't see or connect to your server, check the log file. Confirm that you've allowed the server through the Windows Firewall and the ports are forwarded correctly.

The most common problem I've found is that either a switch is misconfigured at the command line or I missed a comma in one of the configuration files. Occasionally, it's network or firewall related. Barring that, feel free to leave a comment or post in the Discussions forum.

Happy hunting!
13 Comments
Merykh  [author] 15 Mar, 2022 @ 7:02am 
Hey everyone, Limbic\505 Games have made it clear by their silence that they've abandoned this project. Because of this, I am no longer maintaining this guide nor monitoring it for comments. Please refer to the Community Discussions board or the official wiki for assistance. Thanks!
Es Kella 23 Nov, 2021 @ 7:44am 
Oh, yes! This is exactly what I was looking for! Thank you very much!
Merykh  [author] 22 Nov, 2021 @ 12:33pm 
I'm sorry but I have not played this game in a long time. I think you rename the server directory and that resets everything, but it's a total server wipe. (<YourGameServer>\mom\Game\Saved\DB\<server_id_name>) If you only want to reset the protocols, achievements, etc., without losing the buildings, I don't think it's possible. Hope that helps!
Es Kella 22 Nov, 2021 @ 6:47am 
How to reset achievements to zero? All protocols, all pumping and branches of the development tree, inventory and flops - reset. Is there such a setting in the server files?

Как сбросить достижения в ноль? Все протоколы, все прокачки и ветки дерева развития, инвентарь и флопсы - обнулить. Есть такая настройка в файлах сервера?
Merykh  [author] 5 Nov, 2021 @ 3:01pm 
If you want the item spawn rate to be fast increase the number. However, the higher you set the number will affect server performance and could cause it to crash. 0.1 = 5 hrs and 10 = 3 mins. the default 0 = 30 mins.
Dunaria 5 Nov, 2021 @ 8:32am 
about "ItemSpawnRate": 1, If I want item spam faster do I go 0.1 or 10?
Товарищъ 23 Apr, 2021 @ 9:52am 
Yep
Merykh  [author] 23 Apr, 2021 @ 7:17am 
Never said that wasn't the case. This guide is for those that either don't have or don't want to invest the money to rent one. Especially now, since the game hasn't received any attention from the devs in almost a year.
Товарищъ 27 Feb, 2021 @ 12:46pm 
Арендуйте свой сервер, да это будет стоить 11 евро в месяц, зато уйму проблем можно избежать. При этом у вас будет хорошая скорость и пинг, как и у ваших друзей.
Merykh  [author] 27 Feb, 2021 @ 11:13am 
You're welcome!