Files
gamedev-the-steward/tools/generate_jajce_terrain_seed.gd
admin 4463e524aa style: apply gdformat formatting across the entire project
Auto-format all GDScript files using gdformat from gdtoolkit.
This is a baseline formatting pass to ensure consistent style:

- Normalizes indentation and spacing
- Wraps long lines to 100 characters
- Removes trailing whitespace
- Standardizes blank lines between functions

68 files reformatted, 8 files left unchanged (3rd-party addon files
with parse errors excluded).
2026-07-05 23:06:23 +02:00

36 lines
909 B
GDScript

extends SceneTree
const REGION_SIZE := 256
const TERRAIN_SIZE := 512
const DATA_DIRECTORY := "res://terrain/jajce/data"
func _initialize() -> void:
call_deferred("_run")
func _run() -> void:
var camera := Camera3D.new()
camera.current = true
root.add_child(camera)
var terrain := Terrain3D.new()
terrain.region_size = REGION_SIZE
root.add_child(terrain)
terrain.set_camera(camera)
await process_frame
var height_map := Image.create_empty(TERRAIN_SIZE, TERRAIN_SIZE, false, Image.FORMAT_RF)
height_map.fill(Color(0.0, 0.0, 0.0, 1.0))
var images: Array[Image]
images.resize(Terrain3DRegion.TYPE_MAX)
images[Terrain3DRegion.TYPE_HEIGHT] = height_map
terrain.data.import_images(
images, Vector3(-TERRAIN_SIZE / 2.0, 0.0, -TERRAIN_SIZE / 2.0), 0.0, 1.0
)
terrain.data.save_directory(DATA_DIRECTORY)
print("[TOOL] Generated flat Jajce Terrain3D seed data in ", DATA_DIRECTORY)
quit(0)