GRAV
60 ratings
Creating & Managing a server with Game Server Manager
By jimbobslimbob
Takes you through the process of setting up a GRAV server with Game Server Manager - which automates things & provides a host of useful tools & features to make setting up & running your server easier.
   
Award
Favorite
Favorited
Unfavorite
Initial Setup
Game Server Manager features - an overview
- Automatic update checking and applying via SteamCMD (with configurable delay and server warning message)
- Players online graph
- Built-in Telnet and RCON client, which can be used manually or set to automatically send messages and commands (such as shutdown and shutdown notices) to the server
- Auto-restart if server goes down
- Message/command broadcast system
- Discord message broadcasting for server state and player changes.
- Player list showing everyone online, including ping, score, team and time online.
- INI File Parser, which displays a list of all ini file settings (across multiple files) in a list that you can sort, filter, edit, import and export as you wish.
- CPU and RAM usage display, with graph
- Network bandwidth monitor, with graph
- Ability to output status, players online and server name to a file - formatted however you want
- Single-click access to configuration.
- Detailed server information
- Internal and external IP address display
- Server up-time display
- Optional timed daily server restart.
- Timed incremental backups. Perform a daily backup of game data to a zip file.
- Automatically update game - Ability to run a maintenance / update program between restarts. e.g. SteamCMD to perform daily updates automatically. The server will start back up again when this program finished / ends so you minimise downtime.
- Option to delay timed restarts. i.e. The server will be turned off and the program will wait X seconds before attempting to restart it.
- Telnet to server
- 1 click backup and maintenance
- Remote commands to start, stop, backup, update and send commands to your server.
- Game Profiles - Multiple instances of the program can be run with multiple configurations.
- Designed to be "universal" and work with a multitude of games.

Getting Started

It probably goes without saying that you first need to download the game. If you haven't, do that now! You can do that via the main Steam GUI or using SteamCMD.

I should also add that you will need to forward the following ports (usually performed from your router's admin page):
27019
7785
7786
These are the default ports. If you alter them then don't forget to alter the port forwarding rules as well.

NOTE: Since "exoplanets" were added to GRAV, it may be necessary to forward additional ports (27000-27040? 7500-7506? - these are guesses) for the extra planets. This[gravonline.com] or this thread may be of use, although as of writing this there is no official information on it. The additional windows that the server spins up do apparently contain the IP and port for the planet in the title.

Download The Game Server Manager

Head to this [www.jimbobslimbob.com]website to download my Game Server Manager[www.jimbobslimbob.com] program. This has been tailored for use with GRAV.

Extract the zip file to a location of your choosing and run the program.

Setting It Up

Upon opening the program you will be asked the location of your server executable file. In this case, it is "CAGGameServer-Win32-Shipping". This is normally found in "C:\Program Files (x86)\Steam\steamapps\common\Grav\Binaries\win32". if you installed the game to a different location, simply locate the required file from there.

Use the command-line below (copy-paste) as a "baseline" and alter it for your needs. This ensures all the basic requirements are met to get the server to work as it should:
brokerstart?PlanetManagerName="FUNTOWN"?adminpassword=myadminpassword?steamsockets?Port=7785?PeerPort=7786?QueryPort=27019?MaxPlayers=32?ServerName="My GRAV server" -seekfreeloadingserver

If you are familiar with and/or have your own command-line ready to go with GRAV, you may want to skip the next step.


Go to the "Game Specific Tools" tab (or "Tools/Settings" tab on older versions) and click "GRAV Command Line Generator". Set up your options for the server and click "Copy" when you are done. You can then close the window.



Head to the "Tools/Settings" tab and click on "Program Settings". Put the command line details in the relevant field (e.g. brokerstart?PlanetManagerName="FUNTOWN"?adminpassword=myadminpassword?steamsockets?Port=7785?PeerPort=7786?QueryPort=27019?MaxPlayers=32?ServerName="My GRAV server" -seekfreeloadingserver). You can paste the command line text given to you in the previous step by the GRAV Command Line Generator here.

NOTE: Since GRAV patch 10, you may be required to name your "metaverse" (the command-line parameter "PlanetManagerName") in order for other planets and moons to be available to clients. The latest version of this program now includes these options in the command line generator for ease of use. There is a topic with more information on it here.

To get the program to correctly query it, enter the IP address of the server and the query port in the relevent field. If you are running your own server this would normally be "127.0.0.1:27019".

One last thing: tick "Detect via query" in the "Monitoring" tab if you want the status of the server to be detected by a server query, rather than seeing if the program is running. This is useful for GRAV, because if the server crashes, Windows likes to keep it open and show an error screen. If the button is not ticked, the program will think there is nothing wrong with the server and will not try to restart it (if necessary).

You should then be good to go.
General Use
To start the server simply click on "Start Server" on the "Main" tab. To stop the server, use the button next to start.

Monitoring and restarting
It is recommended that you tick "Check server status, every" in the "Monitoring" tab under settings. This actively monitors the server and updates the "Main" and "Players Online" tabs and gives you access to the following:

  • Automatically restarting the server if it goes down/crashes
  • Players online graph
  • Performance (RAM and CPU) graph
  • Network bandwidth graph
  • Ability to output the status to a file (to share or embed, for example)
Connecting to your server
There are a few ways of doing this. Currently, it greatly depends on whether your server is passworded or if you have elected to "hide" your server from public view (e.g. altering ports or not forwarding the query port).

If your server is visible on the server browser in GRAV and is not passworded, you can simply connect to it via that.

If your server is either passworded or not visible then the process is slightly more complicated:

1. At the GRAV server browser, press TAB.
2. Get rid of "say" (backspace it out, if it exists).
3. Type "open <yourIPAddress>:7785?password=<yourpassword>", without quotes (and chevrons) and press enter. e.g. open 111.222.333.444:7785?password=mypassword or just open 111.222.333.444:7785 if it does not have a password.

If you have altered the port from 7785 to something else, you obviously need to enter the correct one.

Remember that if you are playing over the internet, you will need to give players your "External IP Address", not your internal one. This is shown on the "Main" tab of the program.
Backing up game data [Optional]
The program has a built in incremental backup system for game files. To use this you must set up the locations first.

Go to "Settings/Tools" and click "Program Settings". Navigate to the "Backup" tab. Click the button to the right of "Folder to backup" ("...") to browse for the GRAV gamedata folder.


The default folder for GRAV game data is "C:\Program Files (x86)\Steam\steamapps\common\GRAV\CAGGame\Cloud".

Next set the location that you want the backups to be saved to in the box below.

Optional: if you want the program to automatically backup game data daily, you can set the relevant option in this screen. Simply tick "Backup data, at" and enter a time (24-hour clock).

You can then manually perform a backup by clicking "Backup Game Data" under the "Settings/Tools" tab.
Updating and timed restarts [Optional]
The program has a built in feature to restart a server at a specific time of day. This can be found in the "Timed Restart" tab under the program settings.


Set up the time you want this to be performed and tick the "Timed restart, at" tickbox if you want to do this.

Even if you do not wish to set a timed restart, you can still make use of this screen. By selecting a program and entering any optional command line parameters in the "Run a program before starting server" section, you can enable updating the server - either manually or automatically.

For example, if you use SteamCMD to update your game, select the SteamCMD executable here and enter any command line details in the relevant box (e.g. "app_update 332500 validate" - to update GRAV). More information on SteamCMD in the next section

Once this is set, you now have the option to perform this action on timed restarts. Great huh? It will do it all for you!

You can then also use "Run Maintenance Program" under the "Settings/Tools" tab to run this program manually at any time.

Additional tip: if you have also set a backup location you can use "Perform Maintenance Now" under the "Settings/Tools" tab to perform the following sequence:
1. Back up game data
2. Stop Server
3. Run the "maintenance" program
4. Start the server back up again.

Go on, give it a try!
Using SteamCMD to update your game [Optional]
Regardless of whether you installed the game via the Steam client or some other method, you can still use SteamCMD to update GRAV. As long as you point SteamCMD to the location of your GRAV installation, it will update it from there.

Download SteamCMD from here.

Head to the "Program Settings" and navigate to "Timed Restart" tab. Select the SteamCMD executable under "Program Location". Next, you need to tell SteamCMD what game we are updating - and where it is. To do this, we can add a number of commands in the command-line parameters field. Here are some of the ones you may need to use (put spaces between seperate commands):

+login <username> <password>
This will log you into Steam and allow the game to be downloaded.
Please note: The first time it is performed on the machine, you may need to enter a "Steam Guard Code" before being allowed access. This is Steam's additional security layer where it will send you an e-mail with a code to input. Input it when prompted by SteamCMD.

+force_install_dir <path>
Tells SteamCMD that the game is located here. Enter the full path of GRAV here (e.g. "C:\Program Files (x86)\Steam\steamapps\common\Grav").

+app_update 332500
Will tell SteamCMD to go ahead and update GRAV

validate
Validate that the game files are all present and correct. Tag this at the end of the above statement, without a "+" sign.

+quit
Tells SteamCMD to quit - this should always be the last command on your list.

So, an example command line could be:
+login <username> <password> +force_install_dir <path> +app_update 332500 validate +quit

Once this has been set up you can use both the "Run Maintenance Program" (simply runs the program) and "Perform Maintenance" (will Back up game data, stop server, run the "maintenance" program, and finally start the server back up again) buttons under the "Settings/Tools" tab to update the game. Moreover, if you have set a timed restart, it will update the game before starting the server back up!

Automatic Updating
Once you have the above set, you can also tell the program to check for game updates at a regular interval. When an update is found it will automatically stop the server, update it and restart it again.

To do this, head to the "SteamCMD Auto-Updates" tab under "Program Settings" and fill out the details on this screen. You will need to enter your Steam username and password here, along with an "appid" (332500) and "branch" (public).

Once entered, select a time frame for how often the program should check for updates and tick the "Check for game updates, every" box. You are now good to go!

You can even make the program delay an update once found, for a configurable time period, in order to broadcast a message to players on your server, warning them of the impending update.
Remote Access [Optional]
There are usually several ways to gain remote access of a game server. Some use Telnet, others have their own specifically designed web panel etc. Currently GRAV does not have either. As such, the relevant buttons in the Game Server Manager are currently not usable for GRAV.

However, there is another way to remotely perform actions on your server through the program. To do this you will need to have access to the folder that the program is running in via VPN, FTP or some other means. I will not cover how to do that here, since that is really another topic altogether. I will assume that for this guide, you already have access to the folder.

How to do it

The program periodically looks to see if any of the files listed below are sitting in the folder with it. If it sees any of them it will perform the corresponding actions (and remove the file). So, to perform any of the actions listed below all you have to do is create/copy a file into the Game Server Manager folder with the corresponding name (contents of file makes no difference). The program will see the file and perform the action. Simple as that!

Start the server
File: start.txt

Stop the server
File: stop.txt

Perform a backup
File: backup.txt

Full maintenance cycle (backup, stop server, run maintenance program, start server)
File: update.txt
Editing Advanced GRAV Server Settings [Optional]
With the introduction of version 3.0.8.0, the program now has a built in settings editor specifically for GRAV (The GRAV INI Parser). This can be found under the "Game Specific Tools" tab. The tool reads values from all ini files that GRAV uses and allows quick access to them. You can add "friendly names" to values that are useful to make finding them later easier. With this tool, every single GRAV configuration value can be edited in a searchable, sort-able list.

I recommend checking out this guide for more information on the various settings.

Some of the "known" settings (settings with friendly names by default) that can be changed here are shown below. Remember it is not limited to these (everything can be altered).
  • Experience Rate (scaling)
  • Backpack drop rates (resources and equipment)
  • Default Speed
  • Food amounts, healing rates from food and more
  • Make placed items and buildings indestructible / destructible
  • Edit the Multitool - change amount harvested, range, rate of fire and more

You can also export your configuration to a separate "backup" file - so that when a patch is released you can import the settings back again (patches overwrite any configuration changes you may have made here).
Basic Port Forwarding Guide [Reference]
Basic (Generic) Guide

NOTE:You only need to perform port forwarding if your server is going to be accessed over the internet. If you are hosting a LAN game then it is not required.

1. Find your hosting machine's LAN (internal) - displayed on the "Main" tab of GSM.

2. Log into your router's admin page in a web browser. This is variable - but most router's by standard, have the details written on the device itself somewhere (a sticker). It will be something like 192.168.0.1 or 192.168.0.255... or whatever. You will undoubtedly require a password, which is no doubt also on the sticker. If there is nothing on the router itself then you may have to get in contact with your ISP (if it's an ISP's router) or Google for the default login details of your specific router model.

3. Once you are into the router's admin pages, search for something called "port forwarding" amongst the menus. Difficult to say exactly where it would be, since all routers are different. Again, Google may be your friend here.

4. Set up a "rule" under the port forwarding screen to direct UDP and TCP traffic from the required ports to the LAN address you found in #1.

5. Save the rules and you should be good go go.

Final Note: If your hosting machine is set up to dynamically retrieve a LAN address on your network then it is possible that subsequent boots will alter your LAN address and cause port forwards to be pointing to the wrong machine. If this happens, you can either alter the port forwards again, or, even better, change your LAN address to static (and set an address manually). Another Google[www.google.co.uk] can help you with this.

Port Forwarding Example Scenarios (Further Reading)

Friend (F) wants to connect to your server (S). To do this (since they are at another location other than your internal LAN) they have to "talk" to your server machine. Your router (R) is the first point of contact for anyone outside your LAN. So the router needs to know where the request from (F) is meant to go to. That's where port forwarding comes in. It's a rule, set on your router that tells it to route/forward all communication (on the specified ports) from (F) to (S). Without it, the router does not know where to send it and the data is "lost" - hence - no connection.

With port forwarding:
(F) Requests to join your server ----> (R) Tells it to forward data to (S) [Connection established]

Without port forwarding:
(F) Requests to join your server ----> (R) Has no idea where to send the data [Connection fails]

With port forwarding pointing to the wrong place:
(F) Requests to join your server ----> (R) Sends data to the wrong computer (not your server) [Connection fails]

Connecting via LAN (no port forwarding required):
Y = You (over LAN)
(Y) Requests to join your server with a LOCAL (LAN) IP address ----> (R) Knows where it should go straight away (you provided info) [Connection established]

Legend
(Y) = You
(F) = Friend
(S) = Your server
(R) = Your router
Final Words
I hope this guide and the Game Server Manager was useful to you.

It may interest you to know that the program has been tried and tested not only with GRAV - it works with 7 Days to Die and Space Engineers too. Infact, any game that uses the standard querying language should work with it. Hopefully now you have read the guide, you will have a good understanding as to how it works if you want to try it out on other games.

The Game Server Manager program is being updated regularly by myself. If you want to see progress or get involved in the discussion, check out this (pinned) forum post in the GRAV form.

I hope you enjoy GRAV!
160 Comments
Vrotdugi Dec 13, 2020 @ 1:15pm 
Example:
Host HomePlanet1 and Moon1 in EUR
Host HomePlanet2 and Moon2 in USA

Then someone from ASIA or AUS can join a Master Server/Instance? which would have access to those servers above?
Vrotdugi Dec 13, 2020 @ 1:03pm 
Hi, I am wondering if its possible to Host multiple servers then connect them so Players from all around the world can play together.
Something like what the One Universe update done for GRAV.
jimbobslimbob  [author] May 25, 2016 @ 12:08am 
Well if you cannot connect to it at all then it is clearly something else. Could you paste your command-line here (you can *** out any passwords) for me to take a look at please.
Ark_Zilong May 25, 2016 @ 12:07am 
Cannot connect to it at all, but IP was put according to instructions, and I suspected that was the cause and attempted multiple times following diferent solutions, but nothing in that field worked
jimbobslimbob  [author] May 25, 2016 @ 12:04am 
OK. Can you connect to the server at all? If the program is saying offline but you CAN connect then you may have an incorrect query IP & port set. What is currently entered in the field - it should be something like "127.0.0.1:27019".
Ark_Zilong May 24, 2016 @ 5:56pm 
I will admit I am not the best at messing with such stuff, but I assume the black, dos-like boxes that start up are normal parts of the sever starting process, and I mean the server manager window keeps sayign the server is offline even after the entire process is completed
jimbobslimbob  [author] May 24, 2016 @ 2:35am 
What do you mean by "Online"? Did these message boxes contain any valid info?
Ark_Zilong May 23, 2016 @ 6:03pm 
@jimbobslimbob not really, I just followed the entire process, would try to start the server up and get the message boxes as it should do, but then the server would never go online
jimbobslimbob  [author] May 23, 2016 @ 12:31am 
@ArmandPeanuts: Looks like a forwarding issue (port 27019) or a firewall isue.
Arkanum Zilong: Any more details you can give me to assess the problem?
ArmandPeanuts May 19, 2016 @ 2:23pm 
Why do I can't see the server in the browser ?