Debugging MP missions

By Spooner & Mandoble

Logging via scripts

One of the standard ways to debug scripts is to use hint or sideChat to output debugging messages. This is still a valid way to debug scripts running on the clients, but it will not work on the server, since anything requested to be displayed on the server is just ignored by the game. The only way to see messages generated by the server is to transmit it to the clients so that they can see it.

_message = "Detected someone in zone 2";
global_command = format ["hint ""%1"";", _message];
publicVariable "global_command";

Just as in single-player mode, this method has severe limitations, since the hint/chat areas are only of limited size and if many debug messages are shown in a short space of time, then messages might be missed. This will be even more of a problem in MP since you are monitoring both the client and server debug messages from one client. To overcome this, you could build your own server debug log dialog or use one of the user-made debug logs such as the one included in the SPON Core pack.

Viewing the ArmA logs

The game maintains its own logs, which contain records of errors on clients and servers. The log made by the server can be found at "C:\Documents and Settings\\Local Settings\Application Data\ArmA\arma_server.RPT". The client version is called "arma.RPT" and is to be found in the same directory.

Testing MP missions on a single computer

Make a shortcut to start the ArmA server using a config file (the path might be different for you). The shortcut's Target should be:

"C:\Program Files\Bohemia Interactive\ArmA\arma_server.exe" -config=server.cfg

and its Start In:

"C:\Program Files\Bohemia Interactive\ArmA"

The server.cfg file:

// Anyone connecting can become admin with a simple "#login"
passwordAdmin = "";

// Prevent server from broadcasting its existance to GameSpy, so there won't be any
// random people trying to connect, even if the game is on the Internet

reportingIP = "<>";

// Allow multiple clients to connect using just one copy of ArmA
kickduplicate = 0;

When running multiple clients on the same machine, it is often best to open them in a window ("arma.exe -window") so that you can switch between them very easily. Although alt-tab can be used for this, it is slower and can cause the game to crash if it is used too much.

ArmA console commands

There is only one console command that is particularly useful for testing MP games, which is #monitor. This can be used by the server administrator (someone who has logged in using #login) to monitor the server from a client machine. This shows several useful items of information about the server machine:

  • The FPS (frames per second) on the server. Although the server doesn't render any graphics, it still runs scripts and calculates all of the object positions and relations, just like the clients do, once every frame. The lower this number, the more strain is being placed on the server by a number of factors, including mission complexity, number of players and the number and complexity of running scripts.
  • The memory used by the server.
  • The outward bandwidth used (kbps). This is the amount of data travelling from the server to the clients.
  • The inward bandwidth used (kbps). This is the total amount of data travelling from all the clients to the server.

The bandwidth values can give a good indication of whether scripts within a mission are using global commands too frequently, though, like the FPS value, they are severely affected by the number of players and mission complexity.