Available in the Gaming / Industries Circle
quantum | v2 switch to V1  

Flow Fields Sample

Level Advanced

This sample demonstrates how to use the quantum flow fields addon.

Download

Version Release Date Download
2.1.5 May 11, 2023 Flow Fields Sample 2.1.5 Build 195

Back To Top
 

Basic Example

The simple example showcases only one moving unit in a static predefined map.

Example Basic

Back To Top
 

Where To Look?

  • The example is implemented in the 'ExampleBasic' scene;
  • \quantum_unity\Assets\Photon\FlowFields\ExampleBasic;
  • \quantum_code\quantum.code\ExampleBasic

Back To Top
 

Controls

  • Right Mouse Button - sets unit's new destination

Back To Top
 

Map Definition

  • FlowFieldMap is created when simulation starts from static data (ExampleBasicSystem.cs)

Back To Top
 

Advanced Example

The advanced example showcases multiple units with avoidance and final destination grouping.

Example Advanced

Back To Top
 

Where To Look?

  • The example is implemented 'ExampleAdvanced' scene;
  • \quantum_unity\Assets\Photon\FlowFields\ExampleAdvanced;
  • \quantum_code\quantum.code\ExampleAdvanced

Back To Top
 

Controls

  • Left Mouse Button - click/drag to select single/multiple units;
  • Right Mouse Button - set a new destination for selected unit;
  • WASD/arrows - camera movement;
  • scroll wheel - camera zoom;
  • Q - spawn a new unit on the cursor position;
  • E - change the cost of the tile on cursor position (between 1 a 255)

Back To Top
 

Map Definition

  • The Map parameters are defined in TileMapSetup (\Assets\Photon\FlowFields\ExampleAdvanced\Resources\DB\ExampleAdvancedTileMapSetup);
  • The Map cost field is baked via TileMapBaker - based on Static Box and Circle colliders placed in scene;
  • FlowFieldMap is created when the simulation starts (TileMapSystem.cs)

Back To Top
 

Movement

Units are moved by setting their velocity based on data provided by FlowFieldPathfinder.

Back To Top
 

Avoidance

Avoidance between units is done with physics. The Physics Solver Iterations are set to 0. To tweak the behaviour you can play with Penetration Allowance and Penetration Correction in Simulation Config.

  • Penetration Allowance - Allow a certain degree of penetration to improve the stability of the physics simulation.
  • Penetration Correction - How much of the exceeding penetration (above allowance) should be corrected in a single frame. 0 = no correction, 1 = full correction.

Back To Top
 

UnitGroup

When multiple units are controlled at the same time they are put into a UnitGroup. Units still move on their own (they can choose different paths towards the destination) but their final destination is stored in the formation.

Back To Top
 

Release Notes

Based on Quantum version 2.1.5 Stable 1144


To Document Top