Make a loading screen for PCG tasks?

I’m making a random procedural level, Game will freeze when preparing PCG tasks. I’m aware of that there are some ways to make loading screen for Async load levels, but PCG tasks are not included.

You’re experiencing freezes because complex PCG tasks often run synchronously on the game thread, blocking updates like a loading screen UI.

To show a loading screen effectively:

  1. Run PCG Asynchronously: The best approach is to execute your PCG generation graph on a background thread. This requires setting up asynchronous tasks, often involving C++ or specific asynchronous Blueprint nodes if available for PCG. This frees the game thread to update your loading screen widget.

  2. Break Down the Task: If full async isn’t feasible, try breaking the PCG generation into smaller chunks or stages. Execute one chunk per frame (or every few frames) using timers or Tick events. This prevents a long freeze, allowing the loading screen UI to remain responsive between chunks.

Both methods aim to prevent blocking the game thread for extended periods, enabling your loading screen to display and animate correctly.