OndrejNepozitek / Edgar-Unity

Unity Procedural Level Generator
https://ondrejnepozitek.github.io/Edgar-Unity/docs/introduction
MIT License
817 stars 70 forks source link

How to make a loading screen and track the progress of the dungeon generator? #56

Closed longtran2904 closed 4 years ago

longtran2904 commented 4 years ago

I want to make a loading screen for the generator. First i just simply want to track the progress of it (Maybe use something like a list of AsyncOperation), do your script use Coroutine in it? How to make something like this? After this maybe i can do something more specific like show the current task it is working on.

OndrejNepozitek commented 4 years ago

Unfortunately, the underlying algorithm is very non-linear so it's quite hard to track its progress. It often needs to backtrack to its previous internal configuration if it gets to a dead end (something similar happens in wave function collapse (WFC) if you know that algorithm). So for the outside world, the progress is essentially something like this:

  1. Setup the input
  2. Generate the internal representation of the level (this is the non-linear phase)
  3. Post process 3.1 Post process task 1 3.2 Post process task 2 3.n Post process task n

And it seems to me like it's really not interesting because most of the interesting stuff happens in the generator but cannot be easily tracked to show some linear progress.

So I'd probably suggest doing something like in Enter the Gungeon (https://www.youtube.com/watch?v=groXyd5Y4YU) where they just show a loading animation instead of telling us what their procedural generator currently does.

What do you think?

longtran2904 commented 4 years ago

I think that is a good idea, it mean that there will be less work to do. For me, i will just put a static background for placeholder now.