You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Always load the 8 neighbor chunks around the current chunk
When current chunk is changed to another chunk, it loads the new chunks and unloads the unused chunks.
Proposed new behaviour
How many chunks to have active at once?:
Based on the screen width/height and chunk width/height calculate the amount of chunks needed active at all times.
Calculation could be something like:
We need x amount of chunks to fill the whole screen, how many chunks
do we still need to fill all the chunks outside of the direct screen borders,
so centering is not triggering new chunk loads on the main thread?
When centering:
Load all the calculated chunks based on the center coordinate
Unload unneeded chunks based on the center coordinate
Threading default behaviour
Visible chunks on the screen should be loaded on the main thread
Invisible chunks that are not on the screen should be loaded on a seperate thread
This effectively means that when the grid is gradually centered to a certain direction and new chunks need to be loaded,
these new chunks are most likely to be situated not yet in the screen bounds as we always load extra chunks around the screen bounds.
These new chunks don't immediately need to be visible for the screen so the overhead on the main thread
is not needed.
This should keep performance drain to a minimal during movement on the grid, (ideally only loading outer chunks off-threaded) not impacting the main thread while moving.
The only times chunks should be loaded on the main thread, is when a big jump is done, eg jump from one position to another somewhere in a region where no or insufficient chunks have been loaded.
This is because the player needs immediate visual input on the chunks visible.
Full threading option
An option to load all chunks on a seperate thread should also be available.
This implies we simply display black cells on the screen before the thread is started, for the screen region that has no valid cells visible yet.
The text was updated successfully, but these errors were encountered:
Current behaviour
Proposed new behaviour
How many chunks to have active at once?:
Calculation could be something like:
We need x amount of chunks to fill the whole screen, how many chunks
do we still need to fill all the chunks outside of the direct screen borders,
so centering is not triggering new chunk loads on the main thread?
When centering:
Threading default behaviour
This effectively means that when the grid is gradually centered to a certain direction and new chunks need to be loaded,
these new chunks are most likely to be situated not yet in the screen bounds as we always load extra chunks around the screen bounds.
These new chunks don't immediately need to be visible for the screen so the overhead on the main thread
is not needed.
This should keep performance drain to a minimal during movement on the grid, (ideally only loading outer chunks off-threaded) not impacting the main thread while moving.
The only times chunks should be loaded on the main thread, is when a big jump is done, eg jump from one position to another somewhere in a region where no or insufficient chunks have been loaded.
This is because the player needs immediate visual input on the chunks visible.
Full threading option
An option to load all chunks on a seperate thread should also be available.
This implies we simply display black cells on the screen before the thread is started, for the screen region that has no valid cells visible yet.
The text was updated successfully, but these errors were encountered: