Using AsyncComputeTaskPool to create a large map without Halting game. #594
Unanswered
miketwenty1
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm for some reason unable to replicate the performance of a single TilemapBundle vs chunking attempts. Whenever I chunk in many TilemapBundles to create an overall larger landscape, the game is not nearly as performant as a single 1 shot TilemapBundle using a single tile_storage.
The problem I'm having is a single large TilemapBundle, which has 1,000,000 tiles, can take many seconds to create. I would like to give the user a simple interface while they wait for the map to load without halting the entire game for many seconds on the spawn/creation frame.
I was thinking AsyncComputeTaskPool would be a solution, but I'm a little confused on how to get it to work:
My idea was to pass a single TileStorage as a Resource, then have a handler set the position of the incoming entity TileBundle. After completing the TileStorage value, I would then finally create the TilemapBundle. I however can't get a working PoC.
Here is my current attempt, currently resulting in:
https://github.com/miketwenty1/wonder15/tree/async-attempt
Any help would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions