diff options
author | dusoleil <howcansocksbereal@gmail.com> | 2022-09-18 07:45:13 -0400 |
---|---|---|
committer | dusoleil <howcansocksbereal@gmail.com> | 2022-09-18 07:45:13 -0400 |
commit | 3ac2fb62b67b6446ab31b2455a4cb74069f1c54f (patch) | |
tree | 4764fa39466d7fd0d4ac9133e5a237dd1576a487 /World.tscn | |
parent | 5923cd97dfafd7fee2784a91e81d7d55ed28448e (diff) | |
download | game_jam49-3ac2fb62b67b6446ab31b2455a4cb74069f1c54f.tar.gz game_jam49-3ac2fb62b67b6446ab31b2455a4cb74069f1c54f.zip |
Add ChunkLoader to World Generation
Break up world gen into chunk and offload generating them to a Chunk Loader.
The World figures out which chunks should be loaded and gives this to the Chunk Loader.
The Chunk Loader frees any chunks out of render distance.
It also picks an unloaded chunk and gives it to a worker thread to generate it.
Diffstat (limited to 'World.tscn')
-rw-r--r-- | World.tscn | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -1,17 +1,24 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=9 format=2] [ext_resource path="res://World.gd" type="Script" id=1] [ext_resource path="res://Chunk.tscn" type="PackedScene" id=3] -[sub_resource type="BoxShape" id=23] - [sub_resource type="SphereShape" id=24] -radius = 300.0 +radius = 500.0 + +[sub_resource type="BoxShape" id=23] [node name="World" type="Spatial"] script = ExtResource( 1 ) acceleration = 50.0 +[node name="ChunkRenderDistance" type="Area" parent="."] +collision_layer = 0 +collision_mask = 32 + +[node name="Radius" type="CollisionShape" parent="ChunkRenderDistance"] +shape = SubResource( 24 ) + [node name="Chunks" type="RigidBody" parent="."] collision_layer = 0 collision_mask = 0 @@ -29,11 +36,4 @@ shape = SubResource( 23 ) visible = false collision_layer = 0 -[node name="ChunkRenderDistance" type="Area" parent="."] -collision_layer = 0 -collision_mask = 32 - -[node name="Radius" type="CollisionShape" parent="ChunkRenderDistance"] -shape = SubResource( 24 ) - [connection signal="area_exited" from="ChunkRenderDistance" to="." method="_on_ChunkRenderDistance_area_exited"] |