Post tutorial RSS Setting up a (dedicated) server

We've gotten some requests asking how to set up a (dedicated) server. Follow these 5 simple step to get one running!

Posted by on - Basic Management

Setting up a normal server:

A normal server is one which you start from within the game, where you can play along without starting an extra client. This is usually done in settings like a LAN party.

  1. Edit your Configuration file (see below)
  2. Open/Forward port 3410 on your router, if you want people from the internet to join
  3. Start the game
  4. Press 'S' to run the server.
  5. Give people your IP-address to join.*

Setting up a dedicated server:

A dedicated server is one that you can set up, but can't actually play along with. Usually used when your want to let the server run for a longer time.

  1. Make sure you have Lua and Luasocket installed (I'm using Lua version 5.1.5, but others might work)
  2. Edit your configuration file (see below)
  3. Open/Forward port 3410 on your router, if you want people from the internet to join
  4. Get the source version of the game
  5. In the game folder, run the dedicated.lua with Lua. For example, on Linux, run:
    cd ~/Games/GridCars
    lua dedicated.lua
  6. Give people your IP-address to join.*

Configuration File:

To configure a server, locate the config.txt file. Make sure to run the game at least once, so that the file is run. There are a few places where the config file might be, depending on your setup:

  • Win: Config file is either at %APPDATA%/GridCars/config.txt or %APPDATA%/LOVE/GridCars/config.txt
  • Linux: Config file should be at ~/.local/share/love/GridCars/config.txt

If you're running a normal server, editing this file is enough. If you want to run a dedicated server, make sure to copy the config.txt to the game's directory (where the dedicated.lua is) before editing!

Settings in the configuration file which are relevant for the server:

  • ROUND_TIME: The time (in seconds) a player has to make their moves (Default: 10 seconds)
  • LAPS: The number of laps a user needs to finish before winning (Default: 1 Lap)
  • MAX_PLAYERS: The number of allowed connections. Note: The maps shipped with the game can't allow more than 16 players (they don't have more starting positions). Make sure to add your own maps with more starting positions if you want to allow more players to join.
  • SKIP_ROUNDS_ON_CRASH: The number of rounds a player has to skip when crashed. (Default: 2)
  • PORT: The port the game is connected to. NOTE: DO NOT CHANGE! At the moment, all clients will connect at port 3410, so if you change this port, connections will fail.
  • COUNTDOWN: Number of seconds the server waits before starting the round. This countdown is started if at least one player is ready. It is skipped when all players are ready. This is a simply method to prevent idling players from blocking the start of a round and at the same time allow everyone to have enough time to get ready for the next round. (Default: 60)

Custom Maps:

The "normal" server allows you to choose which map you want to play by pressing the number keys.On the dedicated server, the maps are automatically chosen (in a loop).
If you want to change the maps on the dedicated server, simply add or remove them in the maps/ subfolder. The current maps all support at least 16 players.
Note: You can easily add your own, custom maps. A tutorial on that will follow soon.

*At the point of writing, there is no online server list. So in the LAN, you need to give players your own LAN address. If playing through the web, you'll need to give them your web address, or use a service like hamachi. Sorry for this inconvenience, but keep in mind this was made for a 72 hour game jam.We might add a server list in the next few weeks.
Nagging about it might speed things up: gridcars [at]

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.