Add Movement library integration with comprehensive test environment: include Movement.csproj reference, create LibraryTest scene with player controller, multiple test areas (bunny hop platforms, surf ramps, vertical tower, speed corridor), advanced lighting setup, input mappings for WASD/gamepad movement controls, and DebugHUD integration

This commit is contained in:
William Stuckey
2025-12-30 20:42:57 -06:00
parent 1b5a3aeeb3
commit 1c12ea3567
178 changed files with 4934 additions and 6 deletions

View File

@@ -0,0 +1,65 @@
# Enhanced Movement Test Map
## Design Philosophy
This test map is specifically designed to test Source Engine-style movement mechanics:
- Bunny hopping
- Air strafing
- Strafe jumping
- Surfing
- Crouch jumping
- Speed preservation
## Map Sections
### 1. Central Hub (Spawn)
- Large 100x100m floor
- Clear sightlines to all test areas
- Color-coded sections for easy navigation
### 2. Strafe Jump Course (Front-Right)
- Series of platforms requiring air strafing
- Progressive difficulty (gaps get wider)
- Tests momentum preservation and air control
### 3. Vertical Tower (Back-Left)
- Multi-level structure
- Tests jump height and climbing
- Crouch-jump challenges
### 4. Speed Corridor (Right)
- 50m straight corridor
- Distance markers every 10m
- Tests acceleration and max speed
### 5. Surf Ramps (Left)
- Multiple angled surfaces
- Tests surfing mechanics
- Speed gain/loss on slopes
### 6. Bunny Hop Track (Back)
- Flat area with markers
- Tests consecutive jumps
- Speed preservation measurement
### 7. Obstacle Course (Front-Left)
- Mixed challenges
- Stairs, walls, gaps, ramps
- Real-world movement scenarios
## Color Coding
- **Blue (Cyan with glow)**: Jump targets/platforms
- **Orange**: Ramps and slopes
- **Brown**: Stairs and steps
- **Red**: Walls and boundaries
- **Dark Gray**: Main floor
- **Green**: Speed markers (to be added)
## Recommended Additions
1. **Distance markers** - Visual indicators every 5-10m
2. **Height markers** - Show platform heights
3. **Speed zones** - Areas that show your speed
4. **Checkpoints** - For timing runs
5. **Respawn points** - Quick return to sections

View File

@@ -1,6 +1,386 @@
[gd_scene load_steps=2 format=3 uid="uid://c8yv7qm3xwxqj"]
[gd_scene load_steps=30 format=3 uid="uid://c8yv7qm3xwxqj"]
[ext_resource type="Script" path="res://Scripts/Testing/LibraryTest.cs" id="1_library_test"]
[ext_resource type="Script" uid="uid://dc5vhsqbhnpea" path="res://Scripts/Testing/TestGameManager.cs" id="1_test_manager"]
[ext_resource type="Texture2D" uid="uid://d2xg4ujj8ho6p" path="res://addons/kenney_prototype_textures/dark/texture_09.png" id="2_cr4a3"]
[ext_resource type="PackedScene" uid="uid://bpyaqm4xwxqk" path="res://Scenes/Player/Player.tscn" id="2_player"]
[ext_resource type="PackedScene" uid="uid://cx3oppvfp20t" path="res://Scenes/UI/DebugHUD.tscn" id="3_debug_hud"]
[ext_resource type="Texture2D" uid="uid://cpm5xlowyxqjj" path="res://addons/kenney_prototype_textures/orange/texture_05.png" id="3_x2nju"]
[node name="LibraryTest" type="Node"]
script = ExtResource("1_library_test")
[sub_resource type="Environment" id="Environment_1"]
background_mode = 1
background_color = Color(0.15, 0.18, 0.22, 1)
ambient_light_source = 2
ambient_light_color = Color(0.8, 0.85, 1, 1)
ambient_light_energy = 0.4
tonemap_mode = 2
tonemap_exposure = 1.3
ssao_enabled = true
ssao_radius = 1.5
glow_enabled = true
glow_strength = 1.2
glow_bloom = 0.3
[sub_resource type="BoxShape3D" id="BoxShape3D_floor"]
size = Vector3(200, 2, 200)
[sub_resource type="BoxMesh" id="BoxMesh_floor"]
lightmap_size_hint = Vector2i(2018, 1048)
uv2_padding = 9.38
size = Vector3(200, 2, 200)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_x2nju"]
albedo_texture = ExtResource("2_cr4a3")
metallic = 0.4
roughness = 0.6
uv1_scale = Vector3(200, 200, 200)
[sub_resource type="BoxShape3D" id="BoxShape3D_platform"]
size = Vector3(6, 1, 6)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ocbyc"]
albedo_texture = ExtResource("3_x2nju")
[sub_resource type="BoxMesh" id="BoxMesh_platform"]
size = Vector3(6, 1, 6)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_r1pjp"]
albedo_texture = ExtResource("3_x2nju")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_platform"]
albedo_color = Color(0.1, 0.6, 0.9, 1)
albedo_texture = ExtResource("3_x2nju")
metallic = 0.5
roughness = 0.4
emission_enabled = true
emission = Color(0.05, 0.3, 0.5, 1)
emission_energy_multiplier = 0.5
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_i8e4c"]
albedo_texture = ExtResource("3_x2nju")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_xwclk"]
albedo_texture = ExtResource("3_x2nju")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_eg5h4"]
albedo_texture = ExtResource("3_x2nju")
[sub_resource type="BoxShape3D" id="BoxShape3D_ramp"]
size = Vector3(12, 1, 25)
[sub_resource type="BoxMesh" id="BoxMesh_ramp"]
size = Vector3(12, 1, 25)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ramp"]
albedo_color = Color(0.9, 0.5, 0.2, 1)
metallic = 0.2
roughness = 0.7
emission_enabled = true
emission = Color(0.3, 0.15, 0.05, 1)
emission_energy_multiplier = 0.2
[sub_resource type="BoxShape3D" id="BoxShape3D_step"]
size = Vector3(8, 0.5, 8)
[sub_resource type="BoxMesh" id="BoxMesh_step"]
size = Vector3(8, 0.5, 8)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_step"]
albedo_color = Color(0.6, 0.4, 0.2, 1)
metallic = 0.1
roughness = 0.9
[sub_resource type="BoxShape3D" id="BoxShape3D_wall"]
size = Vector3(2, 5, 2)
[sub_resource type="BoxMesh" id="BoxMesh_wall"]
size = Vector3(2, 5, 2)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_wall"]
albedo_color = Color(0.8, 0.2, 0.2, 1)
metallic = 0.3
roughness = 0.8
emission_enabled = true
emission = Color(0.3, 0.05, 0.05, 1)
emission_energy_multiplier = 0.3
[sub_resource type="CylinderShape3D" id="CylinderShape3D_pillar"]
height = 10.0
radius = 1.5
[sub_resource type="CylinderMesh" id="CylinderMesh_pillar"]
top_radius = 1.5
bottom_radius = 1.5
height = 10.0
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_pillar"]
albedo_color = Color(0.3, 0.8, 0.4, 1)
metallic = 0.6
roughness = 0.3
emission_enabled = true
emission = Color(0.1, 0.3, 0.15, 1)
emission_energy_multiplier = 0.4
[node name="LibraryTest" type="Node3D"]
[node name="GameManager" type="Node" parent="."]
script = ExtResource("1_test_manager")
[node name="Environment" type="Node3D" parent="."]
[node name="WorldEnvironment" type="WorldEnvironment" parent="Environment"]
environment = SubResource("Environment_1")
[node name="DirectionalLight_Main" type="DirectionalLight3D" parent="Environment"]
transform = Transform3D(0.866025, -0.5, 0, 0.25, 0.433013, 0.866025, -0.433013, -0.75, 0.5, 0, 20, 0)
light_color = Color(1, 0.95, 0.85, 1)
light_energy = 1.5
shadow_enabled = true
shadow_bias = 0.03
shadow_blur = 2.0
[node name="DirectionalLight_Fill" type="DirectionalLight3D" parent="Environment"]
transform = Transform3D(-0.5, -0.866025, 0, -0.433013, 0.25, 0.866025, -0.75, 0.433013, -0.5, 0, 15, 0)
light_color = Color(0.6, 0.7, 1, 1)
light_energy = 0.3
[node name="OmniLight_Center" type="OmniLight3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 10, 0)
light_energy = 3.0
shadow_enabled = true
omni_range = 50.0
[node name="OmniLight_North" type="OmniLight3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 8, -40)
light_color = Color(0.3, 0.5, 1, 1)
light_energy = 4.0
shadow_enabled = true
omni_range = 35.0
[node name="OmniLight_South" type="OmniLight3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 8, 40)
light_color = Color(1, 0.5, 0.3, 1)
light_energy = 4.0
shadow_enabled = true
omni_range = 35.0
[node name="OmniLight_East" type="OmniLight3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 40, 8, 0)
light_color = Color(0.5, 1, 0.3, 1)
light_energy = 4.0
shadow_enabled = true
omni_range = 35.0
[node name="OmniLight_West" type="OmniLight3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -40, 8, 0)
light_color = Color(1, 0.3, 0.8, 1)
light_energy = 4.0
shadow_enabled = true
omni_range = 35.0
[node name="Geometry" type="Node3D" parent="."]
[node name="MainFloor" type="StaticBody3D" parent="Geometry"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/MainFloor"]
shape = SubResource("BoxShape3D_floor")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Geometry/MainFloor"]
mesh = SubResource("BoxMesh_floor")
surface_material_override/0 = SubResource("StandardMaterial3D_x2nju")
[node name="BunnyHopCourse" type="Node3D" parent="Geometry"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -50, 0, 0)
[node name="Platform1" type="StaticBody3D" parent="Geometry/BunnyHopCourse"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/BunnyHopCourse/Platform1"]
shape = SubResource("BoxShape3D_platform")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Geometry/BunnyHopCourse/Platform1"]
material_override = SubResource("StandardMaterial3D_ocbyc")
mesh = SubResource("BoxMesh_platform")
surface_material_override/0 = SubResource("StandardMaterial3D_x2nju")
[node name="Platform2" type="StaticBody3D" parent="Geometry/BunnyHopCourse"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, -10)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/BunnyHopCourse/Platform2"]
shape = SubResource("BoxShape3D_platform")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Geometry/BunnyHopCourse/Platform2"]
material_override = SubResource("StandardMaterial3D_r1pjp")
mesh = SubResource("BoxMesh_platform")
surface_material_override/0 = SubResource("StandardMaterial3D_platform")
[node name="Platform3" type="StaticBody3D" parent="Geometry/BunnyHopCourse"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, -20)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/BunnyHopCourse/Platform3"]
shape = SubResource("BoxShape3D_platform")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Geometry/BunnyHopCourse/Platform3"]
material_override = SubResource("StandardMaterial3D_i8e4c")
mesh = SubResource("BoxMesh_platform")
surface_material_override/0 = SubResource("StandardMaterial3D_platform")
[node name="Platform4" type="StaticBody3D" parent="Geometry/BunnyHopCourse"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, -32)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/BunnyHopCourse/Platform4"]
shape = SubResource("BoxShape3D_platform")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Geometry/BunnyHopCourse/Platform4"]
material_override = SubResource("StandardMaterial3D_xwclk")
mesh = SubResource("BoxMesh_platform")
surface_material_override/0 = SubResource("StandardMaterial3D_platform")
[node name="Platform5" type="StaticBody3D" parent="Geometry/BunnyHopCourse"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, -46)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/BunnyHopCourse/Platform5"]
shape = SubResource("BoxShape3D_platform")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Geometry/BunnyHopCourse/Platform5"]
material_override = SubResource("StandardMaterial3D_eg5h4")
mesh = SubResource("BoxMesh_platform")
surface_material_override/0 = SubResource("StandardMaterial3D_platform")
[node name="SurfRamps" type="Node3D" parent="Geometry"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 50, 0, 0)
[node name="Ramp1" type="StaticBody3D" parent="Geometry/SurfRamps"]
transform = Transform3D(1, 0, 0, 0, 0.866025, 0.5, 0, -0.5, 0.866025, 0, 5, 0)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/SurfRamps/Ramp1"]
shape = SubResource("BoxShape3D_ramp")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Geometry/SurfRamps/Ramp1"]
mesh = SubResource("BoxMesh_ramp")
surface_material_override/0 = SubResource("StandardMaterial3D_ramp")
[node name="Ramp2" type="StaticBody3D" parent="Geometry/SurfRamps"]
transform = Transform3D(-1, 0, 0, 0, 0.866025, 0.5, 0, 0.5, -0.866025, 0, 5, -30)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/SurfRamps/Ramp2"]
shape = SubResource("BoxShape3D_ramp")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Geometry/SurfRamps/Ramp2"]
mesh = SubResource("BoxMesh_ramp")
surface_material_override/0 = SubResource("StandardMaterial3D_ramp")
[node name="VerticalTower" type="Node3D" parent="Geometry"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -60)
[node name="Level1" type="StaticBody3D" parent="Geometry/VerticalTower"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/VerticalTower/Level1"]
shape = SubResource("BoxShape3D_step")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Geometry/VerticalTower/Level1"]
mesh = SubResource("BoxMesh_step")
surface_material_override/0 = SubResource("StandardMaterial3D_step")
[node name="Level2" type="StaticBody3D" parent="Geometry/VerticalTower"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/VerticalTower/Level2"]
shape = SubResource("BoxShape3D_step")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Geometry/VerticalTower/Level2"]
mesh = SubResource("BoxMesh_step")
surface_material_override/0 = SubResource("StandardMaterial3D_step")
[node name="Level3" type="StaticBody3D" parent="Geometry/VerticalTower"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 5, 0)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/VerticalTower/Level3"]
shape = SubResource("BoxShape3D_step")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Geometry/VerticalTower/Level3"]
mesh = SubResource("BoxMesh_step")
surface_material_override/0 = SubResource("StandardMaterial3D_step")
[node name="Level4" type="StaticBody3D" parent="Geometry/VerticalTower"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 7, 0)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/VerticalTower/Level4"]
shape = SubResource("BoxShape3D_step")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Geometry/VerticalTower/Level4"]
mesh = SubResource("BoxMesh_step")
surface_material_override/0 = SubResource("StandardMaterial3D_step")
[node name="SpeedCorridor" type="Node3D" parent="Geometry"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 60)
[node name="WallLeft" type="StaticBody3D" parent="Geometry/SpeedCorridor"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8, 2.5, 0)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/SpeedCorridor/WallLeft"]
shape = SubResource("BoxShape3D_wall")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Geometry/SpeedCorridor/WallLeft"]
mesh = SubResource("BoxMesh_wall")
surface_material_override/0 = SubResource("StandardMaterial3D_wall")
[node name="WallRight" type="StaticBody3D" parent="Geometry/SpeedCorridor"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 8, 2.5, 0)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/SpeedCorridor/WallRight"]
shape = SubResource("BoxShape3D_wall")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Geometry/SpeedCorridor/WallRight"]
mesh = SubResource("BoxMesh_wall")
surface_material_override/0 = SubResource("StandardMaterial3D_wall")
[node name="Pillars" type="Node3D" parent="Geometry"]
[node name="Pillar1" type="StaticBody3D" parent="Geometry/Pillars"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -30, 5, -30)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/Pillars/Pillar1"]
shape = SubResource("CylinderShape3D_pillar")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Geometry/Pillars/Pillar1"]
mesh = SubResource("CylinderMesh_pillar")
surface_material_override/0 = SubResource("StandardMaterial3D_pillar")
[node name="Pillar2" type="StaticBody3D" parent="Geometry/Pillars"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 30, 5, -30)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/Pillars/Pillar2"]
shape = SubResource("CylinderShape3D_pillar")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Geometry/Pillars/Pillar2"]
mesh = SubResource("CylinderMesh_pillar")
surface_material_override/0 = SubResource("StandardMaterial3D_pillar")
[node name="Pillar3" type="StaticBody3D" parent="Geometry/Pillars"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -30, 5, 30)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/Pillars/Pillar3"]
shape = SubResource("CylinderShape3D_pillar")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Geometry/Pillars/Pillar3"]
mesh = SubResource("CylinderMesh_pillar")
surface_material_override/0 = SubResource("StandardMaterial3D_pillar")
[node name="Pillar4" type="StaticBody3D" parent="Geometry/Pillars"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 30, 5, 30)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/Pillars/Pillar4"]
shape = SubResource("CylinderShape3D_pillar")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Geometry/Pillars/Pillar4"]
mesh = SubResource("CylinderMesh_pillar")
surface_material_override/0 = SubResource("StandardMaterial3D_pillar")
[node name="Player" parent="." instance=ExtResource("2_player")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0)
[node name="UI" type="CanvasLayer" parent="."]
[node name="DebugHUD" parent="UI" instance=ExtResource("3_debug_hud")]

156
Scenes/Testing/README.md Normal file
View File

@@ -0,0 +1,156 @@
# Library Integration Test Scene
This test scene demonstrates all EinSoftworks utility libraries working together in a single integrated environment.
## Libraries Tested
-**EinSoftworks.Movement** - First-person character controller with bunny hopping and air strafing
-**EinSoftworks.Input** - Input management and action handling
-**EinSoftworks.Events** - Event system for state changes and notifications
-**EinSoftworks.StateManagement** - Movement state machine (idle, walking, airborne, crouching)
-**EinSoftworks.Camera** - First-person camera with mouse look
-**EinSoftworks.Utilities** - Math and physics helpers
## Reusable Scene Files
### TestPlayer.tscn
A reusable first-person player character scene that can be instantiated in any level.
**Features:**
- Full movement system with advanced mechanics (bunny hopping, air strafing, crouching)
- Integrated camera with smooth crouch transitions
- Gamepad and keyboard/mouse support
- Optional UI integration (works standalone or with TestUI)
**Usage:**
```gdscript
# Instance the player scene
var player = preload("res://Scenes/Testing/TestPlayer.tscn").instantiate()
add_child(player)
player.position = Vector3(0, 2, 0)
# Optionally connect UI labels
player.SpeedVal = $UI/TestUI/StatsPanel/VBoxContainerValues/SpeedVal
player.StateVal = $UI/TestUI/StatsPanel/VBoxContainerValues/StateVal
# etc...
```
### TestUI.tscn
A reusable debug UI overlay showing real-time movement statistics.
**Features:**
- Stats panel with speed, state, position, and velocity
- Clean, non-intrusive bottom-left placement
- Automatically updates when connected to TestPlayer
**Usage:**
```gdscript
# Instance the UI scene
var ui_layer = CanvasLayer.new()
add_child(ui_layer)
var test_ui = preload("res://Scenes/Testing/TestUI.tscn").instantiate()
ui_layer.add_child(test_ui)
```
## Scene Components
### LibraryTest.tscn
The main integration test scene demonstrating all libraries working together.
**Components:**
- TestPlayer instance with full movement capabilities
- TestUI instance showing real-time stats
- TestGameManager for event handling and player reset
- Test environment (floor, ramp, platforms, walls)
### TestGameManager
- Manages game state and event subscriptions
- Listens to movement events
- Provides player reset functionality (Home key)
### Environment
- Large floor for movement testing
- Ramp for testing slope movement and surfing
- Multiple platforms for jump testing
- Wall boundaries
## Controls
| Key | Action |
|-----|--------|
| W/A/S/D | Move forward/left/back/right |
| Space | Jump |
| Shift | Sprint |
| Ctrl | Crouch |
| Mouse | Look around |
| ESC | Toggle mouse capture |
| Home | Reset player position |
## Testing Features
### Movement Mechanics
1. **Basic Movement**: Walk around using WASD
2. **Sprinting**: Hold Shift while moving for increased speed
3. **Crouching**: Hold Ctrl to crouch (reduces speed and height)
4. **Jumping**: Press Space to jump
5. **Bunny Hopping**: Jump repeatedly while strafing to gain speed
6. **Air Strafing**: Strafe left/right while in air and turn mouse to gain speed
7. **Surfing**: Run up the ramp and maintain speed on the slope
### State Management
Watch the State label change as you:
- Stand still (Idle)
- Move (Walking)
- Jump (Airborne)
- Crouch (Crouching)
### Event System
Check the console output for event notifications:
- Movement state changes
- Jump events
- Speed change events
## Expected Behavior
1. **Smooth Movement**: Character should accelerate and decelerate smoothly
2. **Air Control**: Should be able to change direction slightly while airborne
3. **Speed Preservation**: Speed should be maintained between jumps (bunny hopping)
4. **State Transitions**: States should change smoothly without glitches
5. **UI Updates**: All UI elements should update in real-time
6. **Event Flow**: Console should show event notifications
## Performance
Target: 60+ FPS on modern hardware
The FPS counter in the top-right shows current performance.
## Troubleshooting
### Mouse Not Captured
- Press ESC to toggle mouse capture mode
- Mouse must be captured for camera look to work
### Character Not Moving
- Verify input actions are defined in project.godot
- Check console for any error messages
- Ensure all libraries are properly referenced
### No UI Updates
- Check that UI labels are properly connected to TestPlayer
- Verify TestUI script is attached to the UI Control node
### Events Not Firing
- Check console output for event messages
- Verify EventManager autoload is configured
- Ensure event subscriptions in TestGameManager._Ready()
## Development Notes
This scene serves as both a test environment and a reference implementation for integrating all EinSoftworks libraries. You can use this as a template for your own game scenes.
The scene demonstrates:
- Proper library initialization
- Event subscription/unsubscription patterns
- UI integration with game systems
- State management integration
- Input handling best practices

View File

@@ -0,0 +1,255 @@
# Library Test Map Guide
This test map is designed to comprehensively test all movement mechanics from the EinSoftworks.Movement library.
## Map Layout
### Spawn Area (Center)
- **Location**: (0, 2, 0)
- **Purpose**: Starting point with clear view of all test areas
- **Features**: Large open floor for basic movement testing
### Test Areas
#### 1. Stairs (Right Side - Position: 10, 0, -10)
- **Purpose**: Test vertical movement and step climbing
- **Features**: 4 steps, each 0.5m high
- **Tests**:
- Walking up stairs smoothly
- Step height handling
- Momentum preservation on steps
- Crouch movement on stairs
#### 2. Jump Gap (Left Side - Position: -20, 0, 0)
- **Purpose**: Test jump distance and height
- **Features**: Two platforms with 12m gap between them
- **Tests**:
- Basic jump distance (should NOT be able to cross without sprint)
- Sprint + jump distance (should be able to cross)
- Landing mechanics
- Edge detection
#### 3. Speed Test Corridor (Right Side - Position: 20, 0, 0)
- **Purpose**: Test acceleration and max speed
- **Features**: 20m long corridor with walls
- **Tests**:
- Acceleration from standstill
- Time to reach max speed
- Sprint speed comparison
- Friction/deceleration when stopping
#### 4. Gentle Ramp (Right Front - Position: 15, 2, 0)
- **Purpose**: Test slope movement
- **Features**: ~30° incline ramp
- **Tests**:
- Walking up slopes
- Sliding down slopes
- Speed preservation on slopes
- Basic surfing mechanics
#### 5. Steep Ramp (Left Back - Position: -15, 3, 10)
- **Purpose**: Test steep slope handling and surfing
- **Features**: 45° incline ramp
- **Tests**:
- Steep slope climbing
- Advanced surfing
- Speed gain on steep surfaces
- Slope angle limits
#### 6. Original Platforms (Left Back - Positions: -10, 2, -10 and -10, 4, -20)
- **Purpose**: Test vertical jumping and platforming
- **Features**: Two platforms at different heights
- **Tests**:
- Single jump height (2m)
- Double platform jumping
- Precision landing
- Air control
## Movement Testing Checklist
### Basic Movement
- [ ] Walk forward/back/left/right smoothly
- [ ] Diagonal movement works correctly
- [ ] Stopping is responsive (friction works)
- [ ] Movement speed feels appropriate
### Sprint
- [ ] Sprint increases speed noticeably
- [ ] Sprint + jump covers more distance
- [ ] Can sprint in all directions
- [ ] Sprint speed cap is working
### Jumping
- [ ] Jump height is consistent (~1.5-2m)
- [ ] Can jump while moving
- [ ] Landing doesn't cause stutter
- [ ] Jump cooldown works (if enabled)
### Crouching
- [ ] Crouch reduces height
- [ ] Crouch reduces speed
- [ ] Can move while crouched
- [ ] Can't stand up when blocked
### Air Control
- [ ] Can change direction slightly in air
- [ ] Air strafing works
- [ ] Momentum is preserved
- [ ] Gravity feels natural
### Stairs
- [ ] Can walk up stairs smoothly
- [ ] No stuttering on steps
- [ ] Can jump up stairs
- [ ] Can crouch on stairs
### Slopes
- [ ] Can walk up gentle slopes
- [ ] Slides down steep slopes appropriately
- [ ] Surfing mechanics work
- [ ] Speed changes on slopes feel right
### Bunny Hopping (if enabled)
- [ ] Can chain jumps
- [ ] Speed increases with successful hops
- [ ] Direction control while hopping
- [ ] Speed cap is enforced
## Recommended Movement Values
Based on testing, here are suggested value ranges:
### Speed Settings (m/s)
```csharp
MaxSpeed = 5f; // Base walking speed
MaxSprintSpeed = 8f; // Sprint speed (1.6x walk)
MaxWalkSpeed = 3f; // Slow walk
MaxCrouchSpeed = 2f; // Crouch speed (0.4x walk)
```
### Acceleration & Friction
```csharp
Acceleration = 8f; // How fast you reach max speed
AirAcceleration = 2f; // Air control strength
Friction = 6f; // How fast you stop
StopSpeed = 1f; // Speed threshold for friction
```
### Jump & Gravity
```csharp
JumpVelocity = 5f; // Initial jump speed (gives ~1.5m height)
Gravity = 15f; // Downward acceleration
```
## Testing Procedures
### 1. Basic Movement Test (2 minutes)
1. Spawn in center
2. Walk in all 8 directions
3. Test stopping from full speed
4. Try diagonal movement
5. **Expected**: Smooth, responsive movement
### 2. Sprint Test (1 minute)
1. Sprint forward in Speed Test Corridor
2. Time how long to reach max speed
3. Try sprint jumping
4. **Expected**: Noticeable speed increase, ~1-2 seconds to max speed
### 3. Jump Test (3 minutes)
1. Jump in place 5 times
2. Jump while moving forward
3. Try to cross Jump Gap without sprint (should fail)
4. Sprint + jump across Jump Gap (should succeed)
5. **Expected**: Consistent jump height, gap requires sprint
### 4. Stairs Test (2 minutes)
1. Walk up stairs normally
2. Sprint up stairs
3. Jump up stairs
4. Crouch on stairs
5. **Expected**: Smooth climbing, no stuttering
### 5. Slope Test (3 minutes)
1. Walk up Gentle Ramp
2. Run down Gentle Ramp
3. Try to walk up Steep Ramp
4. Surf down Steep Ramp
5. **Expected**: Can climb gentle, slides on steep, surfing works
### 6. Advanced Test (5 minutes)
1. Try bunny hopping across main floor
2. Test air strafing while jumping
3. Try crouch jumping for extra height
4. Test edge cases (corners, tight spaces)
5. **Expected**: Advanced mechanics work as designed
## Tuning Guide
### Movement Feels Too Slow
- Increase `MaxSpeed` and `MaxSprintSpeed`
- Increase `Acceleration`
- Decrease `Friction`
### Movement Feels Too Fast
- Decrease `MaxSpeed` and `MaxSprintSpeed`
- Decrease `Acceleration`
- Increase `Friction`
### Can't Climb Stairs
- Decrease `StepHeight` in config
- Increase `Acceleration`
- Check collision shape height
### Jumps Too High/Low
- Adjust `JumpVelocity` (higher = higher jumps)
- Adjust `Gravity` (higher = falls faster)
- Test with: height = (JumpVelocity²) / (2 * Gravity)
### Slides Too Much
- Increase `Friction`
- Decrease `StopSpeed`
- Check surface friction values
### Air Control Issues
- Adjust `AirAcceleration` (higher = more control)
- Adjust `AirSpeedCap` (limits air speed gain)
- Check `AirControl` value
## Debug Commands
While testing, these debug outputs are helpful:
```csharp
EnableDebugOutput = true; // Shows speed and state in console
```
Watch for:
- Speed values (should match expected ranges)
- State transitions (idle → walking → airborne)
- OnFloor status (true when grounded)
## Known Issues to Test For
1. **Stuck on edges**: Can player get stuck on platform edges?
2. **Stair stuttering**: Does movement stutter when climbing stairs?
3. **Slope sliding**: Does player slide uncontrollably on slopes?
4. **Air control**: Can player change direction reasonably in air?
5. **Speed capping**: Does bunny hopping break speed limits?
6. **Crouch stuck**: Can player get stuck in crouch state?
## Performance Targets
- **FPS**: Maintain 60 FPS with debug output enabled
- **Input Latency**: Movement should feel instant (<1 frame delay)
- **State Transitions**: Should be smooth and immediate
- **Physics**: No jittering or stuttering during normal movement
## Next Steps
After testing this map:
1. Document any issues found
2. Adjust movement values in `TestPlayer.cs`
3. Test specific mechanics that felt off
4. Create additional test scenarios if needed
5. Consider adding visual markers (distance indicators, height markers)