Performance Tuning - IsaacMulcahy/RPG-AI-SYSTEM-WIKI GitHub Wiki

Settings

Culling

Mode

There are two modes: Dynamic and Tick Mode. Dynamic requires the culling to calculate the distance itself making it more accurate but more resource intensive, tick mode uses the grouping distance data to show and hide

Tick Rate

How often the culling is processed and NPCs are updated

Distance

How far the NPCs are from camera/s

Auto Include All Camera in culling

Automatically include all cameras within the scene, if left unticked then it will use the Orchestrator

Batching & Grouping

Max Batch

The max number of NPCs that are processed in one go Tick Rate – How often the main loop of the NPC is run Need Tick Rate – How often the values of the needs are updated

Grouping Distance

This is used within the tick rate and culling mode tick rate. Within the main loop each tick will do the current level and below. Within the culling mode being tick rate it will render the first group and hide all the other groups.

For example:

We have three grouping distances (1: 50, 2: 100, 3: 150)

  • Tick 1 -> Group 1
  • Tick 2 -> Group 1, 2
  • Tick 3 -> Group 1, 2, 3
  • Tick 1 -> Group 1 Etc.

Distance Batching Tick Rate

How often the NPC grouping distance runs

Tips

  • If the NPCs seem to be out of sync animation wise with their actions or take too long to update this is down to the tick rate and batch count being too low
  • Culling Tick rate should be high (2-5 minutes) if NPC and the character will belong in a similar area for a long time. If there is lot’s of moving around and changing of locations this should be smaller (20 seconds or so)
  • Need Tick rate is separate to the main loop and is applied at a constant rate and is not affected by the grouping distance
  • If you are seeing large spikes in the profiler the first thing to try is lowering the Max Batch count, this should lower the spikes and flatten out the fps.