Please enable JavaScript.
Coggle requires JavaScript to display documents.
TileGen, { world_data }, set_render_area(), Trigger chunk generation, set…
TileGen
_process():
Check if player has entered a new chunk
update_chunks():
load_chunks():
Loads chunks in front of the player
Check if the chunks exist in WorldData
false
generate_chunk():
generate_noise
cave walls
cave ore
generate_falloff():
generate_walker():
generate_start_area():
3 more items...
return Array
1 more item...
dungeon walls
1 more item...
return Array
{update_boundary}
map boundary
return Array
{update_rock}
set_cell
ground rubble
{update_ore}
true
Get ChunkData and
set cells accordingly
ChunkData
value = Array
walls atlas coordinates
ceiling atlas coordinates
ground atlas coordinates
key = Vector2i coordinates
unload_chunks():
Unloads the chunks behind the player
Save ChunkData and add to WorldData
{ world_data }
value = Dictionary{ chunk_data }
{ chunk_data }
key = Vector2i(
cell coordinates
)
value = Dictionary{ cell_chunk_data }
{ chunk_cell_data }
"Wall Atlas" = Vector2i
"Ceiling Atlas" = Vector2i
"Ground Atlas" = Vector2i
"Ground Source" = int
"Wall Source" = int
"Ceiling Source" = int
key = Vector2i(
chunk coordinates
)
set_render_area()
set chunks_to_render
set chunks_to_remove
update_chunks()
does the chunk exist in world_data?
load_chunk()
add chunk_queue
Trigger chunk generation
Add chunk location to queue
Generate chunk changesets
Process chunk changesets
Apply chunk changesets
Generate border changesets
Process border changesets
Apply border changesets
Move to the next chunk in the queue
get chunk location
set_chunk():
remove_chunk():
clear_chunks():
get_chunk():