Files
CosmicClash/Game/scenes/arena_02.tscn
T
Josh Creek 18fdb0f232 feat(arena): resize for 5v5, cut a real goal-wall hole, and bake collision geometry
Retraining from scratch removes the constraint that blocked these: the
existing checkpoints in Game/bots/promoted/ no longer need byte-identical
geometry.

- Fix the goal aperture constants (were 1.85/1.65, now match
  objects/goal.tscn's actual sensor exactly at 1.75/1.5) so a ball crossing
  the visible edge can't fail to score.
- Cut a real navigable hole in each end wall's collision
  (_build_end_wall_colliders), replacing the previous solid box — the ball
  now genuinely enters the net instead of triggering the sensor a hair
  before hitting a solid wall. Correct for both FLOOR and ELEVATED goal
  modes via _goal_surround_bounds. A separate, slightly wider
  GOAL_VISUAL_APERTURE_* pair keeps the collision hole exact while still
  giving goal.gd's bezel/rim frame clearance to be seen against the hull cut.
- Resize the play volume 1.5x (INNER_HALF_X/Z/HEIGHT 12/18/12 -> 18/27/18) to
  comfortably fit a 5v5 roster: updates every hand-authored literal in
  arena_boundary.tscn/arena_base.tscn/the elevated arena variants that
  doesn't derive from those constants, adds 5 spawn markers per team, and
  rescales ship_observations.gd's normalization scales and arena_02's
  cosmetic decoration/nebula-dust shader uniforms to match.
- Bake the ~170 runtime-generated CollisionShape3D nodes into the scene via
  a new bake_colliders()/tools/bake_arena_boundary.gd instead of rebuilding
  them on every load — a real load-time cost repeated in every parallel
  headless training env. Colliders must be direct children of the
  StaticBody3D to register at all, so bake_colliders() parents them onto
  self and tags them with a group for idempotent re-baking, rather than
  grouping them under an intermediate container node. _ready() self-heals:
  it skips regenerating only when an existing bake's goal_mode metadata
  matches the current one, so the FLOOR-mode bake in the shared scene is
  never silently reused by an ELEVATED arena variant.
2026-08-05 09:17:13 +01:00

116 lines
4.6 KiB
Plaintext

[gd_scene load_steps=13 format=3]
[ext_resource type="PackedScene" path="res://scenes/arena_base.tscn" id="1_base"]
[ext_resource type="Texture2D" path="res://assets/textures/sky_nebula.png" id="7_nebula"]
[ext_resource type="PackedScene" path="res://assets/models/nebula_station.glb" id="8_station"]
[ext_resource type="PackedScene" path="res://assets/models/nebula_debris.glb" id="9_debris"]
[ext_resource type="Texture2D" path="res://assets/textures/particle_glow.png" id="10_dust"]
[ext_resource type="PackedScene" path="res://assets/models/nebula_planet.glb" id="11_planet"]
[ext_resource type="Shader" path="res://shaders/nebula_dust.gdshader" id="12_dust_shader"]
[sub_resource type="PanoramaSkyMaterial" id="PanoramaSkyMaterial_nebula"]
panorama = ExtResource("7_nebula")
[sub_resource type="ShaderMaterial" id="ShaderMaterial_dust"]
shader = ExtResource("12_dust_shader")
shader_parameter/albedo_tex = ExtResource("10_dust")
shader_parameter/core_bias_color = Color(1, 0.6, 0.85, 1)
shader_parameter/core_bias_amount = 0.35
shader_parameter/emission_strength = 2.5
shader_parameter/soft_fade_distance = 1.0
[sub_resource type="QuadMesh" id="QuadMesh_dust"]
material = SubResource("ShaderMaterial_dust")
size = Vector2(0.4, 0.4)
[sub_resource type="Gradient" id="Gradient_dust"]
offsets = PackedFloat32Array(0, 0.15, 0.85, 1)
colors = PackedColorArray(1, 1, 1, 0, 1, 1, 1, 0.55, 1, 1, 1, 0.55, 1, 1, 1, 0)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_dust"]
gradient = SubResource("Gradient_dust")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_dust"]
emission_shape = 3
emission_box_extents = Vector3(39, 16.5, 42)
direction = Vector3(0, 1, 0)
spread = 180.0
initial_velocity_min = 0.1
initial_velocity_max = 0.45
gravity = Vector3(0, 0, 0)
turbulence_enabled = true
turbulence_noise_strength = 0.7
turbulence_noise_scale = 0.6
turbulence_influence_min = 0.35
turbulence_influence_max = 0.65
scale_min = 0.5
scale_max = 1.6
color_ramp = SubResource("GradientTexture1D_dust")
[node name="Arena" instance=ExtResource("1_base")]
sky_material = SubResource("PanoramaSkyMaterial_nebula")
ambient_light_color = Color(0.65, 0.35, 0.75, 1)
ambient_light_energy = 0.45
glow_intensity = 0.8
glow_strength = 1.0
glow_bloom = 0.03
glow_hdr_threshold = 1.1
[node name="Boundary" parent="." index="0"]
field_tint = Color(0.78, 0.55, 1, 1)
field_intensity = 0.1
[node name="DirectionalLight3D" parent="." index="1"]
light_color = Color(0.85, 0.75, 1, 1)
[node name="FillLight" parent="." index="2"]
light_color = Color(0.55, 0.35, 0.65, 1)
light_energy = 0.45
[node name="NebulaDust" type="GPUParticles3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 7.5, 0)
amount = 500
lifetime = 22.0
preprocess = 8.0
randomness = 1.0
visibility_aabb = AABB(-45, -21, -48, 90, 42, 96)
process_material = SubResource("ParticleProcessMaterial_dust")
draw_pass_1 = SubResource("QuadMesh_dust")
[node name="Decoration" type="Node3D" parent="."]
[node name="NebulaStationA" parent="Decoration" instance=ExtResource("8_station")]
transform = Transform3D(1.8, 0, 0, 0, 1.8, 0, 0, 0, 1.8, 42, 7.5, -9)
rotation = Vector3(0, -0.436332, 0)
[node name="NebulaDebrisA" parent="Decoration" instance=ExtResource("9_debris")]
transform = Transform3D(1.2, 0, 0, 0, 1.2, 0, 0, 0, 1.2, -33, 13.5, 16.5)
rotation = Vector3(0.261799, 0.698132, 0.087266)
[node name="NebulaDebrisB" parent="Decoration" instance=ExtResource("9_debris")]
transform = Transform3D(0.8, 0, 0, 0, 0.8, 0, 0, 0, 0.8, 51, 4.5, 22.5)
rotation = Vector3(-0.174533, 1.919862, 0.349066)
[node name="NebulaDebrisC" parent="Decoration" instance=ExtResource("9_debris")]
transform = Transform3D(1.5, 0, 0, 0, 1.5, 0, 0, 0, 1.5, -45, 16.5, -31.5)
rotation = Vector3(0.087266, -1.047198, -0.261799)
[node name="NebulaStationB" parent="Decoration" instance=ExtResource("8_station")]
transform = Transform3D(1.5, 0, 0, 0, 1.5, 0, 0, 0, 1.5, -48, 10.5, 13.5)
rotation = Vector3(0.05, 1.134464, -0.02)
[node name="NebulaStationC" parent="Decoration" instance=ExtResource("8_station")]
transform = Transform3D(1.3, 0, 0, 0, 1.3, 0, 0, 0, 1.3, 13.5, 12, 63)
rotation = Vector3(-0.03, 2.740167, 0.06)
[node name="NebulaDebrisD" parent="Decoration" instance=ExtResource("9_debris")]
transform = Transform3D(1.0, 0, 0, 0, 1.0, 0, 0, 0, 1.0, 19.5, 22.5, -52.5)
rotation = Vector3(0.4, 1.3, -0.2)
[node name="NebulaDebrisE" parent="Decoration" instance=ExtResource("9_debris")]
transform = Transform3D(0.9, 0, 0, 0, 0.9, 0, 0, 0, 0.9, -16.5, 6, 49.5)
rotation = Vector3(-0.3, -0.9, 0.15)
[node name="NebulaPlanet" parent="Decoration" instance=ExtResource("11_planet")]
transform = Transform3D(30, 0, 0, 0, 30, 0, 0, 0, 30, -82.5, 57, -120)