Skip to Content
Writing Tests
Multiplayer

Multiplayer Tests

Our automation framework allows you to write and execute multiplayer tests, enabling multiple AI agents to play your game simultaneously. This is essential for testing functionality that requires player interaction, such as lobbies, friend systems, trading, cooperative gameplay, and competitive features.

Writing a Multiplayer Test

To write a multiplayer test, we first need to add more players to a test. This can be done by clicking the “Add Player” button in the test editor action bar.

Adding a player

Each player represents a separate game instance controlled by an independent AI agent. You can add as many players as your project has agents available, though keep in mind that:

  • More players increase test complexity and maintenance overhead
  • Additional players require more computational resources (fewer other tests can run simultaneously + you need more agent hours for the multiplayer test)
  • Coordination between many players can be challenging to manage

Step Synchronization

All players in a multiplayer test must have the same number of steps. The AI agents execute steps synchronously, meaning all players complete Step 1 before any player moves to Step 2, and so on.

This synchronization ensures that:

  • Players can interact with each other reliably
  • Test outcomes are predictable and reproducible

In this example, we have a multiplayer test with two players. To ensure that the second player only tries to claim the item after the other player started sharing it, we synchronize the steps. In step 1, the first player initiates an item trade. In step 2, the second player interacts with player 1 to receive the item. This way, we can ensure that the second player only tries to receive the item after player 1 has initiated the trade. Step Synchronization Example

Player Communication

Players can communicate through a shared message channel using broadcast functions. This allows agents to:

  • Exchange information (lobby codes, friend IDs, coordinates)
  • Coordinate timing (“ready to start”, “waiting at location”)
  • Share game state updates (“collected the item”, “reached checkpoint”)

To demonstrate player communication, we can create a simple test where two players exchange messages. The first player sends a message with a list of pokemons, and the second player chooses their favorite pokemon from that list and sends back a response. Mesage Test Example

Here we can see the agents messages in the live chat of the test run. The first player sends a list of pokemons, and the second player responds with marshtomp as their favorite pokemon. Test Result

Last updated on