-
-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Milestone
Description
As a first step, lets make this extremely simple:
- Energy distribution grid is represented as an un-directed graph.
- The graph may consist of multiple connected components.
- Edges in the graph represent energy interlinks. I.e. power may flow from node to node over the edges.
- Nodes in the graph are buildings & units.
- Every two neighboring nodes in the graph:
- Are entities whose distance is less than X meters.
- At least one of them is a power hub.
- The graph is maximal in respect to the above condition. I.e. when the conditions are met, then the two entities must be neighbors in the graph.
- The graph representation allows:
- Updating with every game tick (despawned entities are removed, spawned entities are added, neighbors are updated for moving entities).
- Is efficient: thousands of moving units should not cause massive resource usage.
- Supports common graph algorithms. Especially maximum flow and related algorithms.