rimlike/scenes/world/world.tscn
megaproxy 9cf9b7dbfd Phase 13: Rooms + Auto-roof + Beauty + Dirtiness + Cleaning
Three-agent fan-out — Opus pre-wrote Room class, World.rooms/room_at_tile/is_indoor,
4 EventBus signals before dispatch so the slices ran fully parallel.

DECISION: Big-room UX = bump auto-roof cap to 16, banner above. Cabin
(24 tiles) intentionally exceeds cap to exercise the warning path; a
5×5 test shed (9 interior tiles) was added to exercise the roof path.

Room detection (Agent A):
- scenes/world/room.gd — class_name Room, tiles/bounds/is_under_roof,
  contains_tile() bounds-then-list-checked, recompute_bounds()
- scenes/world/room_detector.gd — class_name RoomDetector, BFS 4-dir
  from floor/door tiles, walls/terrain as boundary, doors counted as
  room interior. Detects up to 4× cap; auto-roofs only ≤16.
- World.mark_wall_tile/mark_floor_tile/mark_door_tile hook BFS recompute
- Door._complete() now erases wall-layer stamp + registers door tile
- Designation.TOOL_NO_ROOF paint mode wired (UI button deferred Phase 17)
- EventBus.room_changed / room_too_large signals

Indoor/Shelter (Agent B):
- Pawn._is_sheltered() rerouted: World.is_indoor() first, floor-proxy fallback
- IndoorTintOverlay Node2D — _draw fills roofed-room tiles at α=0.10 warm
- Crop._on_sim_tick skips stage advance when World.is_indoor(tile)

Beauty + Dirtiness + Cleaning + Room thoughts (Agent C):
- BeautySystem sparse map, linear falloff radius=3, Quality multiplier
  (SHODDY 0.5 → LEGENDARY 2.5). Base: Bed +2, Workbench +1, Torch +3, Hearth +4
- DirtinessSystem 0-100, tier crossings (clean<25/dirty<60/filthy≥60)
  emit tile_dirtiness_changed. bump/bump_clean/bump_pawn_traffic API
- CleaningProvider priority=2, KIND_CLEAN toil, 2.5 dirt/tick for ~40 ticks
- Bed/Torch/Workbench _complete() now register with BeautySystem
- 7 room mood thoughts: clean_room (+2), dirty_room (-3), filthy_room (-6),
  beautiful_room (+4), ugly_room (-3), slept_in_room (+3 EVENT, wires Ph 17),
  ate_without_table (-3 EVENT, wires Ph 17)
- Pawn._sync_room_thoughts called from _process_thoughts after cold block,
  defensive against null rooms/systems

Integration recovery (Opus):
- Agent C's BeautySystem/DirtinessSystem/CleaningProvider/IndoorTintOverlay
  instantiation in world.gd never landed (only field declarations + entity
  hooks survived). Added preloads + runtime add_child + autoload bindings +
  CleaningProvider registration + furniture pre-seed in _ready
- Added _prestamp_test_shed_for_room_detector with _spawn_complete_wall/floor
  helpers so a 5×5 visible shed exercises the auto-roof path at boot

MCP runtime verified:
- Rooms: cabin Room#2 size=24 roofed=false (room_too_large fires),
  shed Room#3 size=9 roofed=true (auto-roof active)
- beauty_map size=50 around prebuilt furniture; bed at (47,24) beauty=4.0
- Bram teleported to (36, 25) in shed → indoor=true, sheltered=true,
  thoughts=[clean_room +2], mood=52.0
- Screenshot: shed walls + brown floor visible; cabin warmly torch-lit;
  Spring 1/12 indicator; Day 1 07:52

Delegation: 3× gdscript-refactor (Sonnet) agents in parallel;
integration recovery + MCP verify on Opus.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 17:19:23 +01:00

103 lines
4 KiB
Text

[gd_scene load_steps=19 format=3 uid="uid://rimlike_world"]
[ext_resource type="Script" path="res://scenes/world/world.gd" id="1_world"]
[ext_resource type="PackedScene" uid="uid://rimlike_camera_rig" path="res://scenes/world/camera_rig.tscn" id="2_camera"]
[ext_resource type="Script" path="res://scenes/world/pathfinder.gd" id="3_pathfinder"]
[ext_resource type="Script" path="res://scenes/world/selection.gd" id="4_selection"]
[ext_resource type="Script" path="res://scenes/ai/rest_provider.gd" id="5_rest_provider"]
[ext_resource type="Script" path="res://scenes/ai/chop_provider.gd" id="6_chop_provider"]
[ext_resource type="Script" path="res://scenes/ai/mine_provider.gd" id="7_mine_provider"]
[ext_resource type="Script" path="res://scenes/ai/hauling_provider.gd" id="8_hauling_provider"]
[ext_resource type="Script" path="res://scenes/ai/construction_provider.gd" id="9_construction_provider"]
[ext_resource type="Script" path="res://scenes/world/designation.gd" id="10_designation"]
[ext_resource type="Script" path="res://scenes/ai/crafting_provider.gd" id="11_crafting_provider"]
[ext_resource type="Script" path="res://scenes/ai/plant_provider.gd" id="12_plant_provider"]
[ext_resource type="Script" path="res://scenes/ai/eat_provider.gd" id="13_eat_provider"]
[ext_resource type="Script" path="res://scenes/ai/sleep_provider.gd" id="14_sleep_provider"]
[ext_resource type="Script" path="res://scenes/ai/doctor_provider.gd" id="15_doctor_provider"]
[ext_resource type="Script" path="res://scenes/ai/wolf_spawner.gd" id="16_wolf_spawner"]
[ext_resource type="PackedScene" uid="uid://rimlike_rain_overlay" path="res://scenes/world/rain_overlay.tscn" id="17_rain_overlay"]
[ext_resource type="Script" path="res://scenes/world/room_detector.gd" id="18_room_detector"]
[node name="World" type="Node2D"]
y_sort_enabled = true
script = ExtResource("1_world")
[node name="DarkOverlay" type="CanvasModulate" parent="."]
color = Color(1, 1, 1, 1)
[node name="Terrain" type="TileMapLayer" parent="."]
z_index = 0
[node name="Floor" type="TileMapLayer" parent="."]
z_index = 1
visible = false
[node name="Wall" type="TileMapLayer" parent="."]
z_index = 2
visible = false
[node name="Designation" type="TileMapLayer" parent="."]
z_index = 3
[node name="Roof" type="TileMapLayer" parent="."]
z_index = 4
visible = false
[node name="Fog" type="TileMapLayer" parent="."]
z_index = 5
visible = false
[node name="Pathfinder" type="Node" parent="."]
script = ExtResource("3_pathfinder")
[node name="Selection" type="Node" parent="."]
script = ExtResource("4_selection")
[node name="DesignationCtl" type="Node" parent="."]
script = ExtResource("10_designation")
[node name="RestProvider" type="Node" parent="."]
script = ExtResource("5_rest_provider")
rest_tile = Vector2i(50, 50)
[node name="ChopProvider" type="Node" parent="."]
script = ExtResource("6_chop_provider")
[node name="MineProvider" type="Node" parent="."]
script = ExtResource("7_mine_provider")
[node name="HaulingProvider" type="Node" parent="."]
script = ExtResource("8_hauling_provider")
[node name="ConstructionProvider" type="Node" parent="."]
script = ExtResource("9_construction_provider")
[node name="CraftingProvider" type="Node" parent="."]
script = ExtResource("11_crafting_provider")
[node name="PlantProvider" type="Node" parent="."]
script = ExtResource("12_plant_provider")
[node name="EatProvider" type="Node" parent="."]
script = ExtResource("13_eat_provider")
[node name="SleepProvider" type="Node" parent="."]
script = ExtResource("14_sleep_provider")
[node name="DoctorProvider" type="Node" parent="."]
script = ExtResource("15_doctor_provider")
[node name="WolfSpawner" type="Node" parent="."]
script = ExtResource("16_wolf_spawner")
[node name="RoomDetector" type="Node" parent="."]
script = ExtResource("18_room_detector")
[node name="WeatherLayer" type="CanvasLayer" parent="."]
layer = 5
[node name="RainOverlay" parent="WeatherLayer" instance=ExtResource("17_rain_overlay")]
[node name="CameraRig" parent="." instance=ExtResource("2_camera")]
position = Vector2(640, 640)