So it basically works now, except that I wish to do this flood fill very often, since it is supposed to be like an air leak or something. And this is very performance heavy.
As seen in the picture, once the flood fills starts, performance is horrible.
The calls, 691, is how many times cells attempt to add themselves to the stack.
By using a TSet, I check if a cell is in the Tset, if it is not - add it to the set and to the stack. If is, drop it. So most of them, 558, are dropped.
133 is how many cells that are affected by the flood fill so the size of the stack that Is looped through.
This amount of calls, is that good or bad? I mean, I have to query somehow if they have been processed or not. And each cell has to check 8way cells. I tried adding a boolean to the cells instead but it's the same result.
Can this at all be performant enough to do like 10 times/s?
With the concept being that any cell may cause an air leak, and of course a map that consists of these cells, any other methods to achieve this?
Leave a comment: