I am working on a tile based game. I have a board generator and on the hard level I have to create 900 game tiles and add them to the screen. This takes about 3 to 4 seconds to complete. I started moving the UI code to C++ but ran into tons of issues and read that UI in C++ isn't recommended as its bug prone and difficult to work with. So I moved it back to blueprints and to avoid hogging all the CPU for 3 to 4 seconds I implemented a system to layout the board one row at a time with a short delay between to free up the CPU. This works beautifully and the board is laid out one row at a time and with the delay the FPS still hangs around 50 while doing it so sweet.
But I am running into a problem with the delay nodes. I layout a row, delay for a short period and layout the next row and so on. The proplem is as soon as I hit the first delay node, execution picks up AFTER the event containing the delays finishes.
1. While debugging, this breakpoint is the first one hit as expected.
2. Execution then enters the Layout10x10EasyBoard event as it should where a delay is triggered between rows.
3. Before the delay is finished execution picks up here and continues down the line before the delay even finishes.
4. Then this breakpoint is hit and we continue showing the rest of the game tiles.
It's my understanding that execution will stop at a delay so what I think should happen is the Layout10x10EasyBoard should finish execution before picking up at number 3. But that is not happening. The code at the end of the line requires all the tiles to be created before continuing and since the delay seems to have no effect on execution, that code is not working correctly. Does anyone know why the delay is not stopping execution?