Much stuff wow

This commit is contained in:
Dan Baker 2025-06-27 11:58:59 +01:00
parent 7255cbdf64
commit 734730beee
45 changed files with 697 additions and 119 deletions

View file

@ -463,11 +463,12 @@ anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
stretch = true
stretch_shrink = 2
[node name="SubViewport" type="SubViewport" parent="SubViewportContainer"]
transparent_bg = true
handle_input_locally = false
size = Vector2i(1152, 648)
size = Vector2i(576, 324)
render_target_update_mode = 4
[node name="Player" type="CharacterBody3D" parent="SubViewportContainer/SubViewport" groups=["player"]]
@ -771,7 +772,7 @@ draw_pass_1 = SubResource("QuadMesh_hvb1l")
[node name="OmniLight3D" type="OmniLight3D" parent="SubViewportContainer/SubViewport/VFX/Fire"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.000509977, 0.121094, -0.00151992)
light_color = Color(0.89, 0.461613, 0.2136, 1)
light_energy = 0.849132
light_energy = 0.668778
light_indirect_energy = 1.084
light_volumetric_fog_energy = 3.764
light_size = 0.105

View file

@ -5,15 +5,45 @@ extends Control
@onready var loaded_ojects_label = $PanelContainer/VBoxContainer/LoadedTreesLabel
func _ready() -> void:
update_map_size()
update_cell_count()
func _process(delta: float) -> void:
func _process(_delta: float) -> void:
update_map_size()
update_loaded_cells_count()
update_loaded_objects()
func update_map_size() -> void:
map_size_label.text = 'Map Dimensions: ' + str(Global.map_height) + 'x' + str(Global.map_width)
var player_pos = %Player.position
var cell_x = int(player_pos.x / 2.0)
var cell_z = int(player_pos.z / 2.0)
# Get biome data for current cell
var biome_info = ""
if Global.biome_data != null and not Global.biome_data.is_empty():
# Check bounds to avoid errors
var moisture_img = Global.biome_data.get("moisture")
var temp_img = Global.biome_data.get("temperature")
var elev_img = Global.biome_data.get("elevation")
if moisture_img != null and temp_img != null and elev_img != null:
# Make sure coordinates are within image bounds
var img_width = moisture_img.get_width()
var img_height = moisture_img.get_height()
if cell_x >= 0 and cell_x < img_width and cell_z >= 0 and cell_z < img_height:
var moisture = moisture_img.get_pixel(cell_x, cell_z).r
var temperature = temp_img.get_pixel(cell_x, cell_z).r
var elevation = elev_img.get_pixel(cell_x, cell_z).r
biome_info = "\nMoisture: %.2f | Temp: %.2f | Elevation: %.2f" % [moisture, temperature, elevation]
else:
biome_info = "\nBiome: Out of bounds"
else:
biome_info = "\nBiome: Data not available"
else:
biome_info = "\nBiome: Not initialized"
map_size_label.text = 'X: %.1f, Z: %.1f | Cell: (%d, %d)%s' % [player_pos.x, player_pos.z, cell_x, cell_z, biome_info]
func update_cell_count() -> void:
cell_count_label.text = 'Cell Count: ' + str(Global.map_height * Global.map_width)
@ -81,13 +111,3 @@ func format_bytes(bytes: float) -> String:
return str(int(bytes / 1024)) + "KB"
else:
return str(int(bytes / (1024 * 1024))) + "MB"
# Add to your debug script
func track_orphan_creation():
# Hook into the scene tree to catch orphan creation
get_tree().node_removed.connect(_on_node_orphaned)
func _on_node_orphaned(node: Node):
print("Orphan created: ", node.name, " (", node.get_class(), ")")
if node.get_script():
print(" Script: ", node.get_script().resource_path)