Multiplayer - Robosturm/Commander_Wars GitHub Wiki

Disclaimer

Dedicated Server Support

With Beta Release 15 Commander Wars supports hosting a dedicated server. This faction will deal with the features of this server and setting it up. For starting a dedicated server. You can go to the option menu and select the server checkbox. Starting the game again will launch the server which listens on the given server port and all available tcp/ip connections. The server will support starting as games with any of the mods in the mods folder. However the server should always be started with no mods active. For a better performance it's recommended to start the server with "-noui" as argument. This will disable the graphic updates for the game reducing the cpu/gpu overhead of the server.

How does hosting a game on a server works? Once a client decides to start a game on the server. A slave-game in a new window with disabled ui will be started. This slave game will load all require mods and handle the game progress. Players will be connected via the server with this slave. Despite the routing of the data. Server games and hosting a local multiplayer game behave the same.

Currently no user data is supported or saved on the server. For bug detection each spawned slave game will create a log file which is the same as local log files.

It's possible to create a seperate server-exe however for simplicity reasons i didn't create one right now.

Password safety

Commander Wars always crypts passwords using a Sha3 512 Cryptic Hash. Passwords are always transmitted as this hash. Preventing anyone from getting the original password. The implementation for passwords can be found here: https://github.com/Robosturm/Commander_Wars/blob/master/multiplayer/password.cpp Please refer to the QT documentation for hashes here: https://doc.qt.io/qt-5/qcryptographichash.html or wikipedia here: https://de.wikipedia.org/wiki/SHA-3

General Multiplayer behaviour

The game automatically checks if a client has the same game version and mods loaded. If one or both are different the game automatically disconnects from the server game. If a client doesn't have a map the game tries to send the map to the client. This only works if the client doesn't have a map or map script with the same name in the given folder of the server else the client is disconnected from the server. Quicksaving and Quickloading as well as Console commands are disabled during a multiplayer game.

LAN/VLAN-Multiplayer

This is how to setup a Multiplayer Game without a Gameserver, which is mostlikely a LAN or virtual LAN Game.

  1. Go to the Multiplayer\Lobbymenu by clicking on the Multiplayer Button.
  2. Press the Host Game Button to Host a Game. Select a map and game rules as usually. Currently the Host and the Client need to have the map in the game folder.
  3. After the Host enters the player selection screen. A Client can join the game using the Join Adress Button. You can enter either a IP-Adress or a Hostname-Adress. Commander Wars uses Qt's Network-Name-Resolution. See for more details Qt Connect To Host
  4. Select who plays which player and which CO etc. Some actions are only allowed by the Client or Host. The Functions are disabled on the given side to avoid any confusion. and a screen with Chat...
  5. A client who doesnt own a human player will be automatically disconnected from the game in the player selection screen.
  6. All Clients need to select that they're ready to start the game.
  7. The server starts the game and a countdown starting from 5 seconds shown in the chat window starts.
  8. The game starts and waits for all players to be ready. The first player or Ai can start playing the game once all players are in the game.
  9. A waiting for player popup will be shown while not all clients are ready
  10. A forced disconnection on a client or servers closes the game immediatly for now.

Loading and Saving during a Multiplayer game

You can save a game at any time during playing a multiplayer game, similar to a client game. Note: A game is only stored at the client or host who wants to save the game.

  • Loading a save game go to the multiplayer menu.
  • Select host a game
  • Select the Load Savegame Button and selecet the savegame-file you want to play
  • All players can now join the game just as normal. The only difference is that you can only change who plays as which player but nothing else.
  • Start the game and have fun. 👍

FAQ Connecting Problems

  1. Do i need any other tools to play CoW-Multiplayer? You can play a Multiplayer Session in a local LAN-Network without a tool If you try to play via the Internet it's recommended to use a Virtual-Lan Tool like Hamachi. Verify if you can ping your friend!
  2. Check if you can ping your multiplayer firend!
    1. Open the command tool in windows by typing cmd into the windows search.
    2. Write ping "IP-Adresse" and replace "IP-Adresse" with the IP-Adresse of your friend.
    3. Press enter. If you recieve only timeout pings. You should use a Virtual-Lan Tool like Hamachi.
  3. I can ping my friend but i can't connect to him. What can i do?
    1. Check if Commander Wars is in the execption list for incoming connections of your windows firewall on both Computers.
    2. Try to change the Local-Gameport for Commander Wars from 9001 to something else greater than 1000. Note: For all players the port must be the same.
  4. Can i play with mods or/and with different gameversions? You can play Commander Wars with any mods in multiplayer as long as both players have the same mods active else the connection will fail. You can't play a multiplayer game with different gameversions though.
  5. Does Commander Wars Host any global game servers? No. Commander Wars has currently no support for a game server who does forwarding and connecting easier for now.