Purpose

Configure a scalability test with generic in-game agents in real-time and record performance data locally and in the cloud for later analysis.

How to Use

Allow the terrain in the scene to populate. Once finished, the Run Test 01 button will appear in the upper left. Upon click, this will initialize a brief test that spawns 100 instances of the full_genericAvatar model. Ideally, these models will appear to walk smoothly in a circle depending on hardware capability. If running the scene in the Unity editor, you may observe the scene’s frame rate in real-time with the Stats overlay.

The current test will last for 5 seconds, and when complete, will automatically generate a performance output file using the Unity Profiler utility in .json format that will save to the following location within the project directory on disk: /Assets

Additionally, a copy of the output file will upload automatically to the RIDE AWS and Azure cloud storages.

Example output file content:

"$id": "1",
"os": "Windows 10 (10.0.0) 64bit",
"numProcessors": 8,
"sysMemorySize": 32.696,
"gfxDeviceName": "NVIDIA GeForce GTX 1080",
"gfMemorySize": 8079,
"usedHeapSize": 440311680.0,
"resolutionWidth": 1280,
"resolutionHeight": 720,
"scenario": "ExampleVGLStressTest",
"numCivs": 100,
"duration": 5.0,
"civVertCountSingle": 42547,
"civVertCountTotal": 4254700,
"avgfps": 74.2840652 

Note, no user specific information is contained within the file.

Using REST to Control the Scenario

This scenario can be controlled via REST. After the scenario loads, enter the following url into your browser:

http://127.0.0.1:9157/ScenarioService/BeginSimulation/?civs=100&duration=5

civs = The number of civilians to spawn

duration = The length of time to run the simulation before clearing the scenario and logging the performance data

Scene Location & Name

Assets/Scenes/PatternsOfLife/VGL/ExampleVGLStressTest.unity

Setup Requirements 

Utilize a similar scalability test for your scene and specific assets by adding the ExampleVGLStressTest script, ScenarioMenu UI and ResourceLoader (GOList) prefab.

ExampleVGLStressTest Script

First, add this script to an object in your scene to enable the example test and output file generation.

ScenarioMenu, ResourceLoader Prefab and Supporting Objects

Manually invoke the test through a simple UI by adding the ScenarioSettingsMenu script to an empty game object. In the Scenario field, choose your scene (ExampleVGHStressTest). Next, follow the example Panel construction to create the necessary buttons. Hide the ScenarioMenu object by unchecking its box in the Inspector so that it will not appear until after terrain load.

Instance the ResourceLoader prefab (commonly renamed as GOList) and add entries under Scene Game Objects for what you wish to spawn. In this example, VGL_Civilian00 and VGL_Civilian01. Instance these objects in the scene, but uncheck the box in the Inspector to hide them by default at start.

This examples scene contains the following prefabs and scripts related to terrain:

  • TerrainLoader
  • TerrainCamera
  • RazishNavmesh

The Waypoint layer contains multiple Waypoint_AutoAddToRide prefab objects used to move scene objects to a destination at run-time. In the example, waypoints are placed in a circle around a central point of interest in the terrain map.

Scroll Up