Cytopia icon indicating copy to clipboard operation
Cytopia copied to clipboard

Implement floodfill distribution for power / water supply

Open SimplyLiz opened this issue 2 years ago • 3 comments

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.

SimplyLiz avatar Apr 21 '22 10:04 SimplyLiz

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 avatar May 24 '22 03:05 iaGuoZhi

@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

SimplyLiz avatar May 24 '22 11:05 SimplyLiz

@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!

iaGuoZhi avatar May 24 '22 12:05 iaGuoZhi