Design: docs/SURVIVAL_DESIGN.md (core loop, systems, architecture, phases). Survival core (M1a): - Items/recipes as data (data/*.json) in the addon SDK's define_item / define_recipe shape; procedural item meshes and offscreen-rendered icons - Inventory class (40 slots, hotbar = row 1) shared by player and chests; click / right-click split / shift-click quick-move - Actions autoload: the intent layer (craft, pickup, harvest_hit, place, transfer) that validates every change; becomes the RPC surface in M2 - Gathering: ground pickups (sticks, stones, flint); trees chopped with an axe fall and leave stumps; boulders mined with a pickaxe shrink per hit - Crafting screen with station checks (workbench); placement mode with green/red ghost, rotation and overlap/slope validation - Pieces: campfire (light, flames, embers), workbench, chest (16 slots) - HUD: hotbar, held tool view model with swing, prompts, toasts Menus and saving: - ESC pause menu: resume, controls, fullscreen, mouse sensitivity, quit - Title screen over a flyover of the island: Continue / New World (name + seed) / Load World (with delete) / Quit - Saves autoload: one folder per world under user://worlds, atomic writes with a .bak; stores only player changes (player, pieces, chest contents, harvested resources, taken pickups) and regenerates the rest from the seed - Autosave every 2 min, Save & Quit to title/desktop, save on window close Fixes: UI screens now fill the viewport (were pinned top-left); title backdrop no longer captures the mouse. Tests: test_survival_core (31 checks), test_save_load (round trip + slots), test_terrain_edges now checks 8 seeds for deep pits / unbanked water.
48 lines
1.7 KiB
Plaintext
48 lines
1.7 KiB
Plaintext
[gd_scene load_steps=6 format=3 uid="uid://c0world0valheim00"]
|
|
|
|
[ext_resource type="Script" path="res://scripts/world/world.gd" id="0_world"]
|
|
[ext_resource type="Script" path="res://scripts/world/terrain.gd" id="1_terrain"]
|
|
[ext_resource type="Script" path="res://scripts/world/props.gd" id="2_props"]
|
|
[ext_resource type="PackedScene" path="res://scenes/player.tscn" id="3_player"]
|
|
[ext_resource type="Environment" path="res://scenes/default_env.tres" id="4_env"]
|
|
|
|
[sub_resource type="LabelSettings" id="Label_1"]
|
|
font_size = 16
|
|
outline_size = 4
|
|
outline_color = Color(0, 0, 0, 0.7)
|
|
|
|
[node name="World" type="Node3D"]
|
|
script = ExtResource("0_world")
|
|
|
|
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
|
environment = ExtResource("4_env")
|
|
|
|
[node name="Sun" type="DirectionalLight3D" parent="."]
|
|
transform = Transform3D(0.819, -0.401, 0.41, 0, 0.715, 0.699, -0.574, -0.573, 0.585, 0, 40, 0)
|
|
light_color = Color(1, 0.95, 0.83, 1)
|
|
light_energy = 1.8
|
|
shadow_enabled = true
|
|
shadow_blur = 1.5
|
|
directional_shadow_mode = 2
|
|
directional_shadow_blend_splits = true
|
|
directional_shadow_max_distance = 160.0
|
|
|
|
[node name="Terrain" type="Node3D" parent="."]
|
|
script = ExtResource("1_terrain")
|
|
|
|
[node name="Props" type="Node3D" parent="."]
|
|
script = ExtResource("2_props")
|
|
|
|
[node name="Player" parent="." instance=ExtResource("3_player")]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 12, 0)
|
|
|
|
[node name="HUD" type="CanvasLayer" parent="."]
|
|
|
|
[node name="Hint" type="Label" parent="HUD"]
|
|
offset_left = 16.0
|
|
offset_top = 12.0
|
|
offset_right = 600.0
|
|
offset_bottom = 60.0
|
|
text = "WASD move · Shift sprint · Space jump · E interact · LMB use/place · R rotate · 1-8 hotbar · Tab inventory & crafting · ESC menu"
|
|
label_settings = SubResource("Label_1")
|