From 1c12ea35676b0ea4a4d30d992c67a2c284eba740 Mon Sep 17 00:00:00 2001 From: William Stuckey Date: Tue, 30 Dec 2025 20:42:57 -0600 Subject: [PATCH] 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 --- Docs/LIBRARY_INTEGRATION.md | 246 +++++++++++ LICENSE | 121 ++++++ Scenes/Player/Player.tscn | 18 + Scenes/Testing/EnhancedTestMap.md | 65 +++ Scenes/Testing/LibraryTest.tscn | 388 +++++++++++++++++- Scenes/Testing/README.md | 156 +++++++ Scenes/Testing/TEST_MAP_GUIDE.md | 255 ++++++++++++ Scenes/UI/DebugHUD.tscn | 65 +++ Scripts/Player/Player.cs | 216 ++++++++++ Scripts/Player/Player.cs.uid | 1 + Scripts/Testing/LibraryTest.cs | 4 +- Scripts/Testing/TestGameManager.cs | 74 ++++ Scripts/Testing/TestGameManager.cs.uid | 1 + Scripts/UI/DebugHUD.cs | 16 + Scripts/UI/DebugHUD.cs.uid | 1 + Voider.csproj | 1 + addons/kenney_prototype_textures/LICENSE.txt | 23 ++ .../dark/texture_01.png | Bin 0 -> 2004 bytes .../dark/texture_01.png.import | 40 ++ .../dark/texture_02.png | Bin 0 -> 1333 bytes .../dark/texture_02.png.import | 40 ++ .../dark/texture_03.png | Bin 0 -> 1954 bytes .../dark/texture_03.png.import | 40 ++ .../dark/texture_04.png | Bin 0 -> 7015 bytes .../dark/texture_04.png.import | 40 ++ .../dark/texture_05.png | Bin 0 -> 8833 bytes .../dark/texture_05.png.import | 40 ++ .../dark/texture_06.png | Bin 0 -> 2092 bytes .../dark/texture_06.png.import | 40 ++ .../dark/texture_07.png | Bin 0 -> 1912 bytes .../dark/texture_07.png.import | 40 ++ .../dark/texture_08.png | Bin 0 -> 635 bytes .../dark/texture_08.png.import | 40 ++ .../dark/texture_09.png | Bin 0 -> 2039 bytes .../dark/texture_09.png.import | 41 ++ .../dark/texture_10.png | Bin 0 -> 6154 bytes .../dark/texture_10.png.import | 40 ++ .../dark/texture_11.png | Bin 0 -> 6051 bytes .../dark/texture_11.png.import | 40 ++ .../dark/texture_12.png | Bin 0 -> 6411 bytes .../dark/texture_12.png.import | 40 ++ .../dark/texture_13.png | Bin 0 -> 6635 bytes .../dark/texture_13.png.import | 40 ++ .../green/texture_01.png | Bin 0 -> 6706 bytes .../green/texture_01.png.import | 40 ++ .../green/texture_02.png | Bin 0 -> 2004 bytes .../green/texture_02.png.import | 40 ++ .../green/texture_03.png | Bin 0 -> 1333 bytes .../green/texture_03.png.import | 40 ++ .../green/texture_04.png | Bin 0 -> 1954 bytes .../green/texture_04.png.import | 40 ++ .../green/texture_05.png | Bin 0 -> 7015 bytes .../green/texture_05.png.import | 40 ++ .../green/texture_06.png | Bin 0 -> 8841 bytes .../green/texture_06.png.import | 40 ++ .../green/texture_07.png | Bin 0 -> 2092 bytes .../green/texture_07.png.import | 40 ++ .../green/texture_08.png | Bin 0 -> 1916 bytes .../green/texture_08.png.import | 40 ++ .../green/texture_09.png | Bin 0 -> 635 bytes .../green/texture_09.png.import | 40 ++ .../green/texture_10.png | Bin 0 -> 2007 bytes .../green/texture_10.png.import | 40 ++ .../green/texture_11.png | Bin 0 -> 6101 bytes .../green/texture_11.png.import | 40 ++ .../green/texture_12.png | Bin 0 -> 6079 bytes .../green/texture_12.png.import | 40 ++ .../green/texture_13.png | Bin 0 -> 6479 bytes .../green/texture_13.png.import | 40 ++ .../light/texture_01.png | Bin 0 -> 1333 bytes .../light/texture_01.png.import | 40 ++ .../light/texture_02.png | Bin 0 -> 1954 bytes .../light/texture_02.png.import | 40 ++ .../light/texture_03.png | Bin 0 -> 7015 bytes .../light/texture_03.png.import | 40 ++ .../light/texture_04.png | Bin 0 -> 7498 bytes .../light/texture_04.png.import | 40 ++ .../light/texture_05.png | Bin 0 -> 2092 bytes .../light/texture_05.png.import | 40 ++ .../light/texture_06.png | Bin 0 -> 1912 bytes .../light/texture_06.png.import | 40 ++ .../light/texture_07.png | Bin 0 -> 635 bytes .../light/texture_07.png.import | 40 ++ .../light/texture_08.png | Bin 0 -> 2007 bytes .../light/texture_08.png.import | 40 ++ .../light/texture_09.png | Bin 0 -> 6072 bytes .../light/texture_09.png.import | 40 ++ .../light/texture_10.png | Bin 0 -> 6068 bytes .../light/texture_10.png.import | 40 ++ .../light/texture_11.png | Bin 0 -> 6415 bytes .../light/texture_11.png.import | 40 ++ .../light/texture_12.png | Bin 0 -> 6194 bytes .../light/texture_12.png.import | 40 ++ .../light/texture_13.png | Bin 0 -> 2004 bytes .../light/texture_13.png.import | 40 ++ .../orange/texture_01.png | Bin 0 -> 6688 bytes .../orange/texture_01.png.import | 40 ++ .../orange/texture_02.png | Bin 0 -> 2004 bytes .../orange/texture_02.png.import | 40 ++ .../orange/texture_03.png | Bin 0 -> 1333 bytes .../orange/texture_03.png.import | 40 ++ .../orange/texture_04.png | Bin 0 -> 1954 bytes .../orange/texture_04.png.import | 40 ++ .../orange/texture_05.png | Bin 0 -> 7015 bytes .../orange/texture_05.png.import | 41 ++ .../orange/texture_06.png | Bin 0 -> 8844 bytes .../orange/texture_06.png.import | 40 ++ .../orange/texture_07.png | Bin 0 -> 2092 bytes .../orange/texture_07.png.import | 40 ++ .../orange/texture_08.png | Bin 0 -> 1916 bytes .../orange/texture_08.png.import | 40 ++ .../orange/texture_09.png | Bin 0 -> 635 bytes .../orange/texture_09.png.import | 40 ++ .../orange/texture_10.png | Bin 0 -> 2007 bytes .../orange/texture_10.png.import | 40 ++ .../orange/texture_11.png | Bin 0 -> 6104 bytes .../orange/texture_11.png.import | 40 ++ .../orange/texture_12.png | Bin 0 -> 6073 bytes .../orange/texture_12.png.import | 40 ++ .../orange/texture_13.png | Bin 0 -> 6465 bytes .../orange/texture_13.png.import | 40 ++ .../purple/texture_01.png | Bin 0 -> 6615 bytes .../purple/texture_01.png.import | 40 ++ .../purple/texture_02.png | Bin 0 -> 2004 bytes .../purple/texture_02.png.import | 40 ++ .../purple/texture_03.png | Bin 0 -> 1333 bytes .../purple/texture_03.png.import | 40 ++ .../purple/texture_04.png | Bin 0 -> 1954 bytes .../purple/texture_04.png.import | 40 ++ .../purple/texture_05.png | Bin 0 -> 7015 bytes .../purple/texture_05.png.import | 40 ++ .../purple/texture_06.png | Bin 0 -> 8841 bytes .../purple/texture_06.png.import | 40 ++ .../purple/texture_07.png | Bin 0 -> 2092 bytes .../purple/texture_07.png.import | 40 ++ .../purple/texture_08.png | Bin 0 -> 1916 bytes .../purple/texture_08.png.import | 40 ++ .../purple/texture_09.png | Bin 0 -> 635 bytes .../purple/texture_09.png.import | 40 ++ .../purple/texture_10.png | Bin 0 -> 2007 bytes .../purple/texture_10.png.import | 40 ++ .../purple/texture_11.png | Bin 0 -> 6107 bytes .../purple/texture_11.png.import | 40 ++ .../purple/texture_12.png | Bin 0 -> 6078 bytes .../purple/texture_12.png.import | 40 ++ .../purple/texture_13.png | Bin 0 -> 6449 bytes .../purple/texture_13.png.import | 40 ++ .../red/texture_01.png | Bin 0 -> 6703 bytes .../red/texture_01.png.import | 40 ++ .../red/texture_02.png | Bin 0 -> 2004 bytes .../red/texture_02.png.import | 40 ++ .../red/texture_03.png | Bin 0 -> 1333 bytes .../red/texture_03.png.import | 40 ++ .../red/texture_04.png | Bin 0 -> 1954 bytes .../red/texture_04.png.import | 40 ++ .../red/texture_05.png | Bin 0 -> 7015 bytes .../red/texture_05.png.import | 40 ++ .../red/texture_06.png | Bin 0 -> 8833 bytes .../red/texture_06.png.import | 40 ++ .../red/texture_07.png | Bin 0 -> 2092 bytes .../red/texture_07.png.import | 40 ++ .../red/texture_08.png | Bin 0 -> 1916 bytes .../red/texture_08.png.import | 40 ++ .../red/texture_09.png | Bin 0 -> 635 bytes .../red/texture_09.png.import | 40 ++ .../red/texture_10.png | Bin 0 -> 2007 bytes .../red/texture_10.png.import | 40 ++ .../red/texture_11.png | Bin 0 -> 6107 bytes .../red/texture_11.png.import | 40 ++ .../red/texture_12.png | Bin 0 -> 6073 bytes .../red/texture_12.png.import | 40 ++ .../red/texture_13.png | Bin 0 -> 6427 bytes .../red/texture_13.png.import | 40 ++ project.godot | 87 +++- texture_01_normal.png | Bin 0 -> 28055 bytes texture_01_normal.png.import | 40 ++ texture_02_normal.png | Bin 0 -> 62368 bytes texture_02_normal.png.import | 40 ++ 178 files changed, 4934 insertions(+), 6 deletions(-) create mode 100644 Docs/LIBRARY_INTEGRATION.md create mode 100644 LICENSE create mode 100644 Scenes/Player/Player.tscn create mode 100644 Scenes/Testing/EnhancedTestMap.md create mode 100644 Scenes/Testing/README.md create mode 100644 Scenes/Testing/TEST_MAP_GUIDE.md create mode 100644 Scenes/UI/DebugHUD.tscn create mode 100644 Scripts/Player/Player.cs create mode 100644 Scripts/Player/Player.cs.uid create mode 100644 Scripts/Testing/TestGameManager.cs create mode 100644 Scripts/Testing/TestGameManager.cs.uid create mode 100644 Scripts/UI/DebugHUD.cs create mode 100644 Scripts/UI/DebugHUD.cs.uid create mode 100644 addons/kenney_prototype_textures/LICENSE.txt create mode 100644 addons/kenney_prototype_textures/dark/texture_01.png create mode 100644 addons/kenney_prototype_textures/dark/texture_01.png.import create mode 100644 addons/kenney_prototype_textures/dark/texture_02.png create mode 100644 addons/kenney_prototype_textures/dark/texture_02.png.import create mode 100644 addons/kenney_prototype_textures/dark/texture_03.png create mode 100644 addons/kenney_prototype_textures/dark/texture_03.png.import create mode 100644 addons/kenney_prototype_textures/dark/texture_04.png create mode 100644 addons/kenney_prototype_textures/dark/texture_04.png.import create mode 100644 addons/kenney_prototype_textures/dark/texture_05.png create mode 100644 addons/kenney_prototype_textures/dark/texture_05.png.import create mode 100644 addons/kenney_prototype_textures/dark/texture_06.png create mode 100644 addons/kenney_prototype_textures/dark/texture_06.png.import create mode 100644 addons/kenney_prototype_textures/dark/texture_07.png create mode 100644 addons/kenney_prototype_textures/dark/texture_07.png.import create mode 100644 addons/kenney_prototype_textures/dark/texture_08.png create mode 100644 addons/kenney_prototype_textures/dark/texture_08.png.import create mode 100644 addons/kenney_prototype_textures/dark/texture_09.png create mode 100644 addons/kenney_prototype_textures/dark/texture_09.png.import create mode 100644 addons/kenney_prototype_textures/dark/texture_10.png create mode 100644 addons/kenney_prototype_textures/dark/texture_10.png.import create mode 100644 addons/kenney_prototype_textures/dark/texture_11.png create mode 100644 addons/kenney_prototype_textures/dark/texture_11.png.import create mode 100644 addons/kenney_prototype_textures/dark/texture_12.png create mode 100644 addons/kenney_prototype_textures/dark/texture_12.png.import create mode 100644 addons/kenney_prototype_textures/dark/texture_13.png create mode 100644 addons/kenney_prototype_textures/dark/texture_13.png.import create mode 100644 addons/kenney_prototype_textures/green/texture_01.png create mode 100644 addons/kenney_prototype_textures/green/texture_01.png.import create mode 100644 addons/kenney_prototype_textures/green/texture_02.png create mode 100644 addons/kenney_prototype_textures/green/texture_02.png.import create mode 100644 addons/kenney_prototype_textures/green/texture_03.png create mode 100644 addons/kenney_prototype_textures/green/texture_03.png.import create mode 100644 addons/kenney_prototype_textures/green/texture_04.png create mode 100644 addons/kenney_prototype_textures/green/texture_04.png.import create mode 100644 addons/kenney_prototype_textures/green/texture_05.png create mode 100644 addons/kenney_prototype_textures/green/texture_05.png.import create mode 100644 addons/kenney_prototype_textures/green/texture_06.png create mode 100644 addons/kenney_prototype_textures/green/texture_06.png.import create mode 100644 addons/kenney_prototype_textures/green/texture_07.png create mode 100644 addons/kenney_prototype_textures/green/texture_07.png.import create mode 100644 addons/kenney_prototype_textures/green/texture_08.png create mode 100644 addons/kenney_prototype_textures/green/texture_08.png.import create mode 100644 addons/kenney_prototype_textures/green/texture_09.png create mode 100644 addons/kenney_prototype_textures/green/texture_09.png.import create mode 100644 addons/kenney_prototype_textures/green/texture_10.png create mode 100644 addons/kenney_prototype_textures/green/texture_10.png.import create mode 100644 addons/kenney_prototype_textures/green/texture_11.png create mode 100644 addons/kenney_prototype_textures/green/texture_11.png.import create mode 100644 addons/kenney_prototype_textures/green/texture_12.png create mode 100644 addons/kenney_prototype_textures/green/texture_12.png.import create mode 100644 addons/kenney_prototype_textures/green/texture_13.png create mode 100644 addons/kenney_prototype_textures/green/texture_13.png.import create mode 100644 addons/kenney_prototype_textures/light/texture_01.png create mode 100644 addons/kenney_prototype_textures/light/texture_01.png.import create mode 100644 addons/kenney_prototype_textures/light/texture_02.png create mode 100644 addons/kenney_prototype_textures/light/texture_02.png.import create mode 100644 addons/kenney_prototype_textures/light/texture_03.png create mode 100644 addons/kenney_prototype_textures/light/texture_03.png.import create mode 100644 addons/kenney_prototype_textures/light/texture_04.png create mode 100644 addons/kenney_prototype_textures/light/texture_04.png.import create mode 100644 addons/kenney_prototype_textures/light/texture_05.png create mode 100644 addons/kenney_prototype_textures/light/texture_05.png.import create mode 100644 addons/kenney_prototype_textures/light/texture_06.png create mode 100644 addons/kenney_prototype_textures/light/texture_06.png.import create mode 100644 addons/kenney_prototype_textures/light/texture_07.png create mode 100644 addons/kenney_prototype_textures/light/texture_07.png.import create mode 100644 addons/kenney_prototype_textures/light/texture_08.png create mode 100644 addons/kenney_prototype_textures/light/texture_08.png.import create mode 100644 addons/kenney_prototype_textures/light/texture_09.png create mode 100644 addons/kenney_prototype_textures/light/texture_09.png.import create mode 100644 addons/kenney_prototype_textures/light/texture_10.png create mode 100644 addons/kenney_prototype_textures/light/texture_10.png.import create mode 100644 addons/kenney_prototype_textures/light/texture_11.png create mode 100644 addons/kenney_prototype_textures/light/texture_11.png.import create mode 100644 addons/kenney_prototype_textures/light/texture_12.png create mode 100644 addons/kenney_prototype_textures/light/texture_12.png.import create mode 100644 addons/kenney_prototype_textures/light/texture_13.png create mode 100644 addons/kenney_prototype_textures/light/texture_13.png.import create mode 100644 addons/kenney_prototype_textures/orange/texture_01.png create mode 100644 addons/kenney_prototype_textures/orange/texture_01.png.import create mode 100644 addons/kenney_prototype_textures/orange/texture_02.png create mode 100644 addons/kenney_prototype_textures/orange/texture_02.png.import create mode 100644 addons/kenney_prototype_textures/orange/texture_03.png create mode 100644 addons/kenney_prototype_textures/orange/texture_03.png.import create mode 100644 addons/kenney_prototype_textures/orange/texture_04.png create mode 100644 addons/kenney_prototype_textures/orange/texture_04.png.import create mode 100644 addons/kenney_prototype_textures/orange/texture_05.png create mode 100644 addons/kenney_prototype_textures/orange/texture_05.png.import create mode 100644 addons/kenney_prototype_textures/orange/texture_06.png create mode 100644 addons/kenney_prototype_textures/orange/texture_06.png.import create mode 100644 addons/kenney_prototype_textures/orange/texture_07.png create mode 100644 addons/kenney_prototype_textures/orange/texture_07.png.import create mode 100644 addons/kenney_prototype_textures/orange/texture_08.png create mode 100644 addons/kenney_prototype_textures/orange/texture_08.png.import create mode 100644 addons/kenney_prototype_textures/orange/texture_09.png create mode 100644 addons/kenney_prototype_textures/orange/texture_09.png.import create mode 100644 addons/kenney_prototype_textures/orange/texture_10.png create mode 100644 addons/kenney_prototype_textures/orange/texture_10.png.import create mode 100644 addons/kenney_prototype_textures/orange/texture_11.png create mode 100644 addons/kenney_prototype_textures/orange/texture_11.png.import create mode 100644 addons/kenney_prototype_textures/orange/texture_12.png create mode 100644 addons/kenney_prototype_textures/orange/texture_12.png.import create mode 100644 addons/kenney_prototype_textures/orange/texture_13.png create mode 100644 addons/kenney_prototype_textures/orange/texture_13.png.import create mode 100644 addons/kenney_prototype_textures/purple/texture_01.png create mode 100644 addons/kenney_prototype_textures/purple/texture_01.png.import create mode 100644 addons/kenney_prototype_textures/purple/texture_02.png create mode 100644 addons/kenney_prototype_textures/purple/texture_02.png.import create mode 100644 addons/kenney_prototype_textures/purple/texture_03.png create mode 100644 addons/kenney_prototype_textures/purple/texture_03.png.import create mode 100644 addons/kenney_prototype_textures/purple/texture_04.png create mode 100644 addons/kenney_prototype_textures/purple/texture_04.png.import create mode 100644 addons/kenney_prototype_textures/purple/texture_05.png create mode 100644 addons/kenney_prototype_textures/purple/texture_05.png.import create mode 100644 addons/kenney_prototype_textures/purple/texture_06.png create mode 100644 addons/kenney_prototype_textures/purple/texture_06.png.import create mode 100644 addons/kenney_prototype_textures/purple/texture_07.png create mode 100644 addons/kenney_prototype_textures/purple/texture_07.png.import create mode 100644 addons/kenney_prototype_textures/purple/texture_08.png create mode 100644 addons/kenney_prototype_textures/purple/texture_08.png.import create mode 100644 addons/kenney_prototype_textures/purple/texture_09.png create mode 100644 addons/kenney_prototype_textures/purple/texture_09.png.import create mode 100644 addons/kenney_prototype_textures/purple/texture_10.png create mode 100644 addons/kenney_prototype_textures/purple/texture_10.png.import create mode 100644 addons/kenney_prototype_textures/purple/texture_11.png create mode 100644 addons/kenney_prototype_textures/purple/texture_11.png.import create mode 100644 addons/kenney_prototype_textures/purple/texture_12.png create mode 100644 addons/kenney_prototype_textures/purple/texture_12.png.import create mode 100644 addons/kenney_prototype_textures/purple/texture_13.png create mode 100644 addons/kenney_prototype_textures/purple/texture_13.png.import create mode 100644 addons/kenney_prototype_textures/red/texture_01.png create mode 100644 addons/kenney_prototype_textures/red/texture_01.png.import create mode 100644 addons/kenney_prototype_textures/red/texture_02.png create mode 100644 addons/kenney_prototype_textures/red/texture_02.png.import create mode 100644 addons/kenney_prototype_textures/red/texture_03.png create mode 100644 addons/kenney_prototype_textures/red/texture_03.png.import create mode 100644 addons/kenney_prototype_textures/red/texture_04.png create mode 100644 addons/kenney_prototype_textures/red/texture_04.png.import create mode 100644 addons/kenney_prototype_textures/red/texture_05.png create mode 100644 addons/kenney_prototype_textures/red/texture_05.png.import create mode 100644 addons/kenney_prototype_textures/red/texture_06.png create mode 100644 addons/kenney_prototype_textures/red/texture_06.png.import create mode 100644 addons/kenney_prototype_textures/red/texture_07.png create mode 100644 addons/kenney_prototype_textures/red/texture_07.png.import create mode 100644 addons/kenney_prototype_textures/red/texture_08.png create mode 100644 addons/kenney_prototype_textures/red/texture_08.png.import create mode 100644 addons/kenney_prototype_textures/red/texture_09.png create mode 100644 addons/kenney_prototype_textures/red/texture_09.png.import create mode 100644 addons/kenney_prototype_textures/red/texture_10.png create mode 100644 addons/kenney_prototype_textures/red/texture_10.png.import create mode 100644 addons/kenney_prototype_textures/red/texture_11.png create mode 100644 addons/kenney_prototype_textures/red/texture_11.png.import create mode 100644 addons/kenney_prototype_textures/red/texture_12.png create mode 100644 addons/kenney_prototype_textures/red/texture_12.png.import create mode 100644 addons/kenney_prototype_textures/red/texture_13.png create mode 100644 addons/kenney_prototype_textures/red/texture_13.png.import create mode 100644 texture_01_normal.png create mode 100644 texture_01_normal.png.import create mode 100644 texture_02_normal.png create mode 100644 texture_02_normal.png.import diff --git a/Docs/LIBRARY_INTEGRATION.md b/Docs/LIBRARY_INTEGRATION.md new file mode 100644 index 0000000..059f9d8 --- /dev/null +++ b/Docs/LIBRARY_INTEGRATION.md @@ -0,0 +1,246 @@ +# EinSoftworks Library Integration + +This document describes how all EinSoftworks utility libraries are integrated into the Voider project. + +## Integrated Libraries + +All six EinSoftworks libraries are fully integrated and working together: + +### ✅ EinSoftworks.Movement +- **Location**: `Libraries/movement` +- **Usage**: `FirstPersonController` for player movement +- **Features**: Bunny hopping, air strafing, crouching, sprinting +- **Integration**: TestPlayer.cs extends FirstPersonController + +### ✅ EinSoftworks.Input +- **Location**: `Libraries/input` +- **Usage**: Input management via InputManager singleton +- **Features**: Action-based input, device detection, remapping +- **Integration**: Automatic via InputManager.Instance + +### ✅ EinSoftworks.Events +- **Location**: `Libraries/events` +- **Usage**: Event system for decoupled communication +- **Features**: MovementEvents, EventBus, state notifications +- **Integration**: TestGameManager subscribes to movement events + +### ✅ EinSoftworks.StateManagement +- **Location**: `Libraries/state-management` +- **Usage**: Movement state machine (idle, walking, airborne, crouching) +- **Features**: State transitions, hierarchical states +- **Integration**: Built into CharacterController + +### ✅ EinSoftworks.Camera +- **Location**: `Libraries/camera` +- **Usage**: First-person camera with mouse look +- **Features**: Camera effects, smooth transitions +- **Integration**: CameraMount node in FirstPersonController + +### ✅ EinSoftworks.Utilities +- **Location**: `Libraries/utilities` +- **Usage**: Math and physics helper functions +- **Features**: Vector operations, physics calculations +- **Integration**: Used internally by movement system + +## Test Scene + +**Location**: `Scenes/Testing/LibraryTest.tscn` + +The test scene demonstrates all libraries working together in a fully functional first-person movement system. + +### Components + +1. **TestPlayer** (FirstPersonController) + - Full movement with all advanced mechanics + - Real-time UI updates + - Event publishing + +2. **TestGameManager** + - Event subscription management + - Game state coordination + - Player reset functionality + +3. **TestUI** + - Live stats display + - FPS counter + - Control instructions + +4. **Environment** + - Floor, ramps, platforms + - Testing geometry for all movement types + +## Project Configuration + +### Voider.csproj +```xml + + + + + + + + +``` + +### project.godot +Input actions configured: +- `move_forward` (W) +- `move_back` (S) +- `move_left` (A) +- `move_right` (D) +- `jump` (Space) +- `crouch` (Ctrl) +- `sprint` (Shift) +- `walk` (Ctrl) + +Autoload configured: +- `EventManager` - Global event management + +## Usage Examples + +### Creating a Player Controller + +```csharp +using EinSoftworks.Movement; + +public partial class MyPlayer : FirstPersonController +{ + public override void _Ready() + { + base._Ready(); + + Config = new MovementConfig + { + MaxSpeed = 320f, + EnableBunnyHopping = true + }; + + SubscribeToStateChanges(OnStateChanged); + } + + private void OnStateChanged(MovementStateChangedEvent evt) + { + GD.Print($"State: {evt.StateName}"); + } +} +``` + +### Subscribing to Events + +```csharp +using EinSoftworks.Movement; + +public override void _Ready() +{ + MovementEvents.PlayerJumped += OnPlayerJumped; + MovementEvents.SpeedChanged += OnSpeedChanged; +} + +private void OnPlayerJumped() +{ + PlayJumpSound(); +} + +public override void _ExitTree() +{ + MovementEvents.ClearAllSubscriptions(); +} +``` + +### Using Input Manager + +```csharp +using EinSoftworks.Input; + +private InputManager _input; + +public override void _Ready() +{ + _input = InputManager.Instance; +} + +public override void _Process(double delta) +{ + if (_input.IsActionJustPressed("jump")) + { + Jump(); + } +} +``` + +## Build Status + +✅ **Build Successful** +``` +Build succeeded. + 0 Warning(s) + 0 Error(s) +``` + +All libraries compile and integrate without errors. + +## Testing + +To test the library integration: + +1. Open the Voider project in Godot +2. Run the scene: `Scenes/Testing/LibraryTest.tscn` +3. Test movement mechanics: + - Walk around with WASD + - Jump with Space + - Sprint with Shift + - Crouch with Ctrl + - Try bunny hopping (jump + strafe) + - Test air strafing +4. Observe UI updates in real-time +5. Check console for event notifications + +## Performance + +Target: 60+ FPS +All libraries are optimized for real-time game performance. + +## Future Integration + +These libraries can be used throughout the Voider project: + +- **Player Systems**: Use Movement + Input for all player characters +- **Camera Systems**: Use Camera library for different camera modes +- **UI Systems**: Use Events for UI updates and notifications +- **AI Systems**: Use StateManagement for enemy AI +- **Game Systems**: Use Events for game state management + +## Troubleshooting + +### Build Errors +- Ensure all library references are correct in .csproj +- Verify all libraries are in `../../libraries/` relative path +- Run `dotnet restore` if needed + +### Runtime Errors +- Check that EventManager autoload is configured +- Verify input actions are defined in project.godot +- Ensure all using statements are present in scripts + +### Movement Issues +- Verify collision shapes are properly configured +- Check that InputManager is available +- Ensure CameraNode is set on the controller + +## Documentation + +Each library has comprehensive documentation in its README: +- `/libraries/movement/README.md` +- `/libraries/input/README.md` +- `/libraries/events/README.md` +- `/libraries/state-management/README.md` +- `/libraries/camera/README.md` +- `/libraries/utilities/README.md` + +## Support + +For issues or questions about library integration, refer to: +1. Individual library READMEs +2. Test scene implementation (`Scripts/Testing/`) +3. Library planning document (`documentation/planning/UTILITY_PLANNING.md`) diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0e259d4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,121 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. diff --git a/Scenes/Player/Player.tscn b/Scenes/Player/Player.tscn new file mode 100644 index 0000000..3607cbc --- /dev/null +++ b/Scenes/Player/Player.tscn @@ -0,0 +1,18 @@ +[gd_scene load_steps=3 format=3 uid="uid://bpyaqm4xwxqk"] + +[ext_resource type="Script" path="res://Scripts/Player/Player.cs" id="1_script"] + +[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_player"] +radius = 0.4 +height = 1.8 + +[node name="Player" type="CharacterBody3D"] +script = ExtResource("1_script") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +shape = SubResource("CapsuleShape3D_player") + +[node name="CameraMount" type="Node3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.6, 0) + +[node name="Camera3D" type="Camera3D" parent="CameraMount"] diff --git a/Scenes/Testing/EnhancedTestMap.md b/Scenes/Testing/EnhancedTestMap.md new file mode 100644 index 0000000..145b47c --- /dev/null +++ b/Scenes/Testing/EnhancedTestMap.md @@ -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 diff --git a/Scenes/Testing/LibraryTest.tscn b/Scenes/Testing/LibraryTest.tscn index 141d380..ab320e6 100644 --- a/Scenes/Testing/LibraryTest.tscn +++ b/Scenes/Testing/LibraryTest.tscn @@ -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")] diff --git a/Scenes/Testing/README.md b/Scenes/Testing/README.md new file mode 100644 index 0000000..39f2b58 --- /dev/null +++ b/Scenes/Testing/README.md @@ -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 diff --git a/Scenes/Testing/TEST_MAP_GUIDE.md b/Scenes/Testing/TEST_MAP_GUIDE.md new file mode 100644 index 0000000..64a0887 --- /dev/null +++ b/Scenes/Testing/TEST_MAP_GUIDE.md @@ -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) diff --git a/Scenes/UI/DebugHUD.tscn b/Scenes/UI/DebugHUD.tscn new file mode 100644 index 0000000..84bca33 --- /dev/null +++ b/Scenes/UI/DebugHUD.tscn @@ -0,0 +1,65 @@ +[gd_scene load_steps=2 format=3 uid="uid://cx3oppvfp20t"] + +[ext_resource type="Script" path="res://Scripts/UI/DebugHUD.cs" id="1_script"] + +[node name="DebugHUD" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_script") + +[node name="StatsPanel" type="PanelContainer" parent="."] +layout_mode = 1 +anchors_preset = 2 +anchor_top = 1.0 +anchor_bottom = 1.0 +offset_left = 5.0 +offset_top = -125.0 +offset_right = 205.0 +offset_bottom = -5.0 +grow_vertical = 0 + +[node name="VBoxContainerLabels" type="VBoxContainer" parent="StatsPanel"] +layout_mode = 2 +size_flags_horizontal = 0 +alignment = 1 + +[node name="SpeedLabel" type="Label" parent="StatsPanel/VBoxContainerLabels"] +layout_mode = 2 +text = " Speed:" + +[node name="StateLabel" type="Label" parent="StatsPanel/VBoxContainerLabels"] +layout_mode = 2 +text = " State:" + +[node name="PositionLabel" type="Label" parent="StatsPanel/VBoxContainerLabels"] +layout_mode = 2 +text = " Position:" + +[node name="VelocityLabel" type="Label" parent="StatsPanel/VBoxContainerLabels"] +layout_mode = 2 +text = " Velocity:" + +[node name="VBoxContainerValues" type="VBoxContainer" parent="StatsPanel"] +layout_mode = 2 +size_flags_horizontal = 8 +alignment = 1 + +[node name="SpeedVal" type="Label" parent="StatsPanel/VBoxContainerValues"] +layout_mode = 2 +text = "0.0 u/s" + +[node name="StateVal" type="Label" parent="StatsPanel/VBoxContainerValues"] +layout_mode = 2 +text = "Idle" + +[node name="PositionVal" type="Label" parent="StatsPanel/VBoxContainerValues"] +layout_mode = 2 +text = "(0, 0, 0)" + +[node name="VelocityVal" type="Label" parent="StatsPanel/VBoxContainerValues"] +layout_mode = 2 +text = "(0, 0, 0)" diff --git a/Scripts/Player/Player.cs b/Scripts/Player/Player.cs new file mode 100644 index 0000000..970bcd9 --- /dev/null +++ b/Scripts/Player/Player.cs @@ -0,0 +1,216 @@ +using EinSoftworks.Events; +using EinSoftworks.Input; +using EinSoftworks.Movement; +using Godot; + +namespace Voider.Player; + +public partial class Player : FirstPersonController +{ + [Export] + public Label SpeedVal { get; set; } + + [Export] + public Label StateVal { get; set; } + + [Export] + public Label PositionVal { get; set; } + + [Export] + public Label VelocityVal { get; set; } + + private float _lastSpeed = 0f; + + public override void _Ready() + { + // InputManager is initialized by the library + InputManager = InputManager.Instance; + + // Assign CameraNode from scene before calling base._Ready() + if (CameraNode == null) + { + CameraNode = GetNode("CameraMount"); + } + + // Set FOV and camera settings before base._Ready() + BaseFov = 75f; + MouseSensitivity = 0.35f; + ControllerSensitivity = 3.0f; + MinPitch = -89f; + MaxPitch = 89f; + EnableDebugOutput = true; + + base._Ready(); + + // Try to find UI labels if they're not already assigned + // This allows the scene to work standalone or with external UI + if (SpeedVal == null || StateVal == null || PositionVal == null || VelocityVal == null) + { + // Try to find DebugHUD in the scene tree + var ui = GetNodeOrNull("/root/LibraryTest/UI/DebugHUD"); + if (ui == null) + { + ui = GetNodeOrNull("/root/Main/UI/DebugHUD"); + } + + if (ui != null) + { + SpeedVal = ui.GetNodeOrNull