Get started with testing multiplayer games

[Update 2022] AltUnity Tester becomes AltTester Unity SDK starting with v. 1.8.0 and similarly, AltUnity Inspector becomes AltTester Desktop starting with v. 1.5.0 and they are both available here

This comes with a series of major changes:

1. AltTester Unity SDK is now available only through our website and is no longer available on the Unity Asset Store

2. We moved the AltTester Unity SDK project from GitLab to GitHub.

Read more about all the major changes in this article and join our Discord Server, if you have any questions or issues with AltTester!


Running some automated tests for multiplayer games can sound like a real challenge for most of us. So we decided to write an article and present how to make the setup to run tests on two devices in parallel.   

You’ll see references to AltUnity tester in this article, as we use it in most of our game testing projects. It’s a UI driven test automation tool, that helps you find objects in your game. You can check out this article for more info.  

Let’s focus on the initial challenge and get started with testing multiplayer features. See below some steps and an example project. 

We chose the tanks reference project sample as it has a multiplayer component where you compete against other opponents in a match. It runs on the following platforms: Windows, Mac, Android and iOS. 

Setting up a build with Altunity Tester 

The first step is to build the game with AltUnity Tester on the desired platform. We wrote some scripts for two different setups: 2 Android devices and one Android, one iOS device, but you can have any setup. For more information about how to build the game with AltUnity Tester check the documentation.

Now that we have the builds, let’s see how we are going to communicate with the build to perform the actions written in the tests. There are two ways to do that. You can forward the device port to your computer port so that you can connect on localhost. This means that your devices are needed to be connected to your computer. More information about this can be found here.

The second option is to connect directly to the device by giving the device’s IP. This means that the devices need to be in the same network with your computer.

We wrote a simple test to see that two devices can play a match together. We start by sending the commands to the players to create and join the server. Once the “players” are in the game we send commands to find each other and to shoot until one of the players wins.

Check out the video below for more info about the setup and test flow:



In our repository, you will find more shell scripts that will install the game on the device, forward the port and run the tests mentioned above which also include the test we discussed above. See more information in the ReadMe file.

Observations

  • We encountered some issues with the sample when building for Android. Some of the packages are deprecated. To solve the problem, we removed all the deprecated references from the project. The main feature that we are interested in was not affected so it wasn’t a problem for us. On our git repository, you can find the Unity project with the deprecated part removed.
  • You might want to change the services to your organization so other users don’t influence your tests. Check this video to see how.

If you have any questions write to us on our discord or google forum or if you discover an issue please write an issue and we will try to fix it as soon as possible.

Subscribe to our newsletter

And get our best articles in your inbox

 Back to top

Leave a Reply

Your email address will not be published. Required fields are marked *