Systems and Tools
The following systems are required to run FlowFields (listed in the same order as they are in
FlowFieldPathfinderSystem_Requests: single thread system. Adds new destinations to
FlowFieldControllerswhen requested by
FlowFieldMapSystem_UpdateMap: multi threaded system. Recalculates dirty controllers. A controller is dirty when the cost or portal has changed and when new destinations were added by
FlowFieldPathfinderSystem_RequestPath: multi threaded system. Calculates the identifier (used for path caching) for a requested path (combination of start position and destination) and registers the request to
FlowFieldMap. When two pathfinders requests paths with the same identifier, in the same frame, the position and destination of pathfinder with the lowest entity index is used for the first step of the navigation (A*).
FlowFieldMapSystem_FindPaths: multi threaded system. Calculates paths requested by
FlowFieldPathfinderSystem_RequestPathand adds them to the path cache.
FlowFieldPathfinderSystem_CopyPaths: single threaded system. Copies paths calculated by
FlowFieldPathfinderSystem_SmoothPath: multi threaded system. Calculates the next smooth corner for each pathfinder who has new a destination or already arrived to its current smooth corner.
FlowFieldPathfinderSystem_Removes: single threaded system. Removes the destination requests from
FlowFieldMapSystem_ClearCache: single threaded system. Clears cached paths when their count gets too high. The cache can't get too big because late join/reconnect snapshots might get too big.
FlowFieldPathfinderSystem: signals only system. Initializes and deinitializes `FlowFieldPathfinder*.
Tool which shows the A* graph used for navigation between controllers.
Debug view of the
Can show the following data:
- Cost Original - cost of the tiles without dynamic modifiers;
- Cost - cost of the tiles with dynamic modifiers applied;
- Integration - tiles integration (only contains data of the last calculated flow, one array is used for the entire Controller);
- Flow - tiles directions towards the specified Destination or Portal;
- Controller Location - tile location within the Controller;
- Map Location - tile location within the Map;