I'm currently working on a tile based game and the grid of tiles can be 10x10, 20x20 or 30x30. When the user clicks on a tile, I have implemented a flood fill algorithm that will search adjacent tiles for matching criteria and add them to a list. For the 10x10 and the 20x20 grid this works fine without any issues. But when I do 30x30 it crashes with an infinite loop error. I have tried increasing the max loop iteration in Project Settings->Engine->General Settings->Max Loop Iteration Count. It was defaulted at 1,000,000 so I tried 2,000,000, 10,000,000 and 1,000,000,000 but I still keep getting this error on the 30x30 grid.
I added two images one of where the function is called from and one of the function itself. Does anyone have any suggestions on how to avoid this? Is there another why I can implement this algorithm without running into infinite loop error?
I added two images one of where the function is called from and one of the function itself. Does anyone have any suggestions on how to avoid this? Is there another why I can implement this algorithm without running into infinite loop error?
Comment