Cytopia
Cytopia copied to clipboard
Implement floodfill distribution for power / water supply
Distribute water / power via floodfill, if apower area's power/water consumption exceeds power/water production to only black out tiles that are the farthest away.
Hi, @SimplyLiz power consumption has been finished? Are you wand do finish water consumption by yourself, or you may want to assign that task to others?
@iaGuoZhi If you like to do this would be great! So far i'm done with gameplay managers besides this task. Right now I'm still finishing he map rework and a few other things. But Water Manager should be a seperate task (please create one), this one here is for distribution of "power/water/..." Right now all connected tiles are either connected (if there is enough) or not (if not). If there is too little power or water, all the tiles next to the power/water source(s) from the grid should be powered/watered until there is not enough power/water.
Floodfill or Dijkstra seems a good option for this.
Since the water manager will almost be a 1:1 copy of power Manager, i think this distribution should be planned and implemented first so there is less redundancy
@iaGuoZhi If you like to do this would be great! So far i'm done with gameplay managers besides this task. Right now I'm still finishing he map rework and a few other things. But Water Manager should be a seperate task (please create one), this one here is for distribution of "power/water/..." Right now all connected tiles are either connected (if there is enough) or not (if not). If there is too little power or water, all the tiles next to the power/water source(s) from the grid should be powered/watered until there is not enough power/water.
Floodfill or Dijkstra seems a good option for this.
Since the water manager will almost be a 1:1 copy of power Manager, i think this distribution should be planned and implemented first so there is less redundancy
OK, I see, I should implement a shortest-path algorithm for power manager, Then copy the power manager's logic to water manager? This task is interesting, just assign to me!