rimlike/scenes/world/world.tscn
megaproxy 96f4982dd3 Phase 5 cabin polish — door, floor, interior crate, double-render fix
Make the demo cabin readable as a real building so the rendering pattern
is solid before Phase 6+ adds more building types.

Demo seed (world.gd._seed_phase5_demo_buildings):
- 8×6 stone cabin at (44, 23) — 23 walls (perimeter minus door slot) +
  1 door (south wall centre at (47, 28)) + 24 wood-floor designations
  for the interior. ConstructionProvider picks them all up; pawns build
  the whole thing.
- One pre-built crate inside at (50, 24) so the interior reads as a
  furnished room on first frame.
- Two external stockpile-target crates unchanged at (17, 60) / (18, 60).

Door visual rewrite (door.gd):
- Was the old 16×24 bottom-anchored shape that encroached on the cell
  above. Now fits strictly within its 16×16 tile, matching the wall's
  3/4 band layout (5 px lit lintel + 11 px shaded frame + inset panel
  + hinge dot). Door and walls now share a top horizon line so they
  line up visually.

Designation gained TOOL_BUILD_DOOR + atlas mapping; world.gd's
_on_designation_added now branches on build_door to spawn a Door entity.

THE DOUBLE-RENDER BUG (caught by MCP inspection):
- World.mark_floor_tile stamps the Floor TileMap with atlas (2, 0) which
  is *stone-grey* in the placeholder atlas, regardless of material name.
- The Floor TileMap layer was visible=true with z_index=1, so it drew
  ON TOP of the brown Floor entity sprites underneath.
- Result before fix: interior tiles looked gray-stone, not wood.
- Fix: set Floor TileMap layer visible=false (data-only, same as Wall).
  Entities own the visual; the TileMap retains tile-level data for
  Phase 13's room detection + Phase 16's save format.

Pattern locked for future building types: 'render at entity level,
TileMap layers are data-only'. Phase 13's roof and any future wall
materials follow the same template.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 22:46:27 +01:00

66 lines
2.3 KiB
Text

[gd_scene load_steps=11 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"]
[node name="World" type="Node2D"]
y_sort_enabled = true
script = ExtResource("1_world")
[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="CameraRig" parent="." instance=ExtResource("2_camera")]
position = Vector2(640, 640)