modl.ai
Bot configuration

A bot represents a player that explores your levels during test runs. To use a bot in your project you need to assign a player prefab for modl to control as your bot, define input variables and configure the exploration space within your game. The modl:test plugin provides the exploratory algorithm for your bot to use.

The information below describes the properties in the bot configuration window and how to configure a bot.

The bot configuration window

To open the bot configuration window, go to modl > Bot Configuration. The table below describes the properties in the window and how to use them:

Section Property Description
modl Project ID (Asset Store only) Add your project ID. You can find your project ID in the modl.ai platform URL after.
Bot Control Configure your bot, assign input variables and start a preview.
Player Select a Player prefab from your game as the bot.
Input variables Select input variables that you want modl to use to operate your bot.
Preview Bot Input Preview modl:test operating your with the input variables you defined.
Exploration Behavior Configure and preview the classes you want modl:test to report on.
Exploration space Configure an exploration space for the bot to explore. The exploration space defines what you want the bot to explore and how modl:test knows if your bot reaches a new state. The bot tries to reach as many different exploration states as possible.
Interval Adjust how many Unity units modl:test counts as a game state.
During test runs, your bot compares two recorded game states and determines if they are different based on the interval size you set. One interval is one Unity unit.
Preview Exploration Space Preview your bot in the exploration space.
Game State Variables Add the classes and parameters you want modl:test to report on and restore within a game state. For example, if you want to receive more detailed information about where the bot has been in your level, add the player position class.
You must add any variables you’ve defined in the exploration space.
Enable Read Only if you want to track a property for reporting but don’t want to reset the same property when modl restores the game state.
You must not enable Read Only on any game state variables that control exploration, such as position.
Preview Game State Variables Preview your game reloading into previous states. Manually move your character around the scene to record game states and observe if modl resets your tracked variables as expected.
Full Bot Preview Preview your bot configuration. In-editor modl testing uses a random exploration to preview your configuration. To use the AI exploration, upload your build to the modl.ai platform. Make sure you can see your bot moving around and game states reloading.
Save Setup Save your configuration settings.

Configure an exploratory bot

To assign a bot, add input variables, configure the exploration space and configure any game state variables in your project, use the following steps:

  1. Go to modl > Bot Configuration
  2. Fill in the ProjectID field.
  3. In Player > Player Prefab, add your player prefab. Your player becomes your modl:test exploratory bot.
  4. In Input Variables, select + to add any input class that you want modl to use to operate your bot.
  5. In Exploration Behavior > Exploration Space, select + to add any variables that you want modl:test to track and report on.
  6. In Game State Variables, select + to add any variables that you want modl:test to keep track of and record in the exploration data.
  7. Select Preview Bot Input to check that modl:test can operate your bot. Your bot should move using your chosen input variables.
  8. Select Preview Exploration Space to check if modl:test is previewing reporting behavior. Your bot should move and your console should output observations.
  9. Select Preview Game State Variables to check if the game states reload with the variables you chose.
  10. Select Full Bot Preview to allow your project to preview all of your bot configuration settings. Note: preview behavior uses a random exploration. You need to upload your build to the modl platform to use AI exploration.
  11. Select Save Setup to save your configuration settings.

If you notice that your bot isn’t moving in preview, make sure your input code includes the MODL_AUTOMATIC_TESTING scripting define to allow modl:test to control your bot. For more information, refer to Configure your code.