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

메인 화면으로
 

Basic Example

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

Example Basic

메인 화면으로
 

Where To Look?

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

메인 화면으로
 

Controls

  • Right Mouse Button - sets unit's new destination

메인 화면으로
 

Map Definition

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

메인 화면으로
 

Advanced Example

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

Example Advanced

메인 화면으로
 

Where To Look?

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

메인 화면으로
 

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)

메인 화면으로
 

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)

메인 화면으로
 

Movement

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

메인 화면으로
 

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.

메인 화면으로
 

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.

메인 화면으로
 

Release Notes

Based on Quantum version 2.1.5 Stable 1144


기술 문서 TOP으로 돌아가기