extends Node const GENERATOR := preload("res://scripts/planets/surface_generator.gd") const TITLES := {"fissure":"Spękana ziemia", "meteor_crater":"Ślad meteorytu", "abandoned_hamlet":"Opuszczona osada", "weathered_stones":"Zwietrzałe kamienie", "dry_hollow":"Wyschnięte oczko"} func _ready() -> void: var examples := {} var profile: Dictionary = preload("res://scripts/planets/planet_profiles.gd").generate(99, 0, "Podgląd") profile.temperature = 20 profile.easy = true profile.oxygen = 90 profile.flora = 0 for seed_value in 180: var data := GENERATOR.generate(seed_value, profile) for landmark in data.landmarks: if not examples.has(landmark.kind): examples[landmark.kind] = {"seed":seed_value, "position":landmark.position} if examples.size() == TITLES.size(): break assert(examples.size() == TITLES.size()) var sheet := Image.create(1280, 1080, false, Image.FORMAT_RGBA8) var progress: Resource = GameState.captain.expedition var kinds: Array = TITLES.keys() kinds.append("scale") for index in kinds.size(): var kind: String = kinds[index] profile.name = "Skala budynków i drzew" if kind == "scale" else TITLES[kind] progress.lander_hp = 100 assert(progress.begin_visit(profile)) progress.visit_seed = 200 if kind == "scale" else int(examples[kind].seed) var surface := Control.new() surface.set_script(preload("res://scripts/planets/surface_screen.gd")) surface.captain = GameState.captain surface.progress = progress add_child(surface) surface.set_process(false) surface.set_physics_process(false) var target: Vector2 = (surface.world.data.structures[0].position if not surface.world.data.structures.is_empty() else Vector2.ZERO) if kind == "scale" else examples[kind].position surface.lander.position = target+Vector2(-120, 80) surface.lander.reset_physics_interpolation() surface.camera.position = target surface.camera.reset_smoothing() surface.world.refresh_pois(target) for spec in preload("res://scripts/planets/surface_landmarks.gd").SPECS: var texture: Texture2D = load("res://assets/planets/landmarks/%s.png" % spec.kind) assert(texture.get_image().has_mipmaps()) assert(texture.get_image().get_pixel(0,0).a < 0.01) for frame in 5: await get_tree().process_frame await RenderingServer.frame_post_draw var screenshot := get_viewport().get_texture().get_image() screenshot.save_png("res://artifacts/landmark_%s.png" % kind) screenshot.convert(Image.FORMAT_RGBA8) screenshot.resize(640, 360, Image.INTERPOLATE_LANCZOS) sheet.blit_rect(screenshot, Rect2i(0,0,640,360), Vector2i(index%2*640,index/2*360)) progress.finish_visit(GameState.captain, true) surface.queue_free() await get_tree().process_frame sheet.save_png("res://artifacts/landmarks_overview.png") print("LANDMARK PREVIEW PASS: five new props, smaller buildings and trees, transparent textures, mipmaps") get_tree().quit()