Commit Graph

11 Commits (8dea0b05bd8ddfeecb164e7c68ad929ee481b2e7)

Author SHA1 Message Date
Nikolay Petrov 8dea0b05bd refactor file structure 2026-01-20 21:54:27 +05:00
Nikolay Petrov 98a7722a91 feat(camera): add camera zone volume for dynamic config switching
- Add BP_CameraZone actor for trigger-based camera transitions
  * Constructor accepts TengriCameraConfig parameter
  * OnBeginOverlap: Apply zone's camera config to character
  * OnEndOverlap: Restore character's default camera config
- Designed for level design workflow
  * Place zones in world with BoxCollision volumes
  * Assign different configs per zone (e.g. combat, puzzle, cinematic)
  * Automatic smooth transitions via CameraManager interpolation

Example use cases:
- Combat arena: Switch to over-the-shoulder view on entry
- Puzzle room: Switch to side-scroller/fixed angle view
- Cinematic area: Apply custom camera settings for dramatic effect

Enables seamless camera behavior changes without code modifications.
2026-01-07 01:03:03 +05:00
Nikolay Petrov ea132ed92b rework TengriMovementConfig 2026-01-07 00:52:30 +05:00
Nikolay Petrov d89e3fb3b3 feat(character): integrate camera system with aiming mode
Character (C++):
- Add camera components to character (SpringArm, Camera, CameraManager)
  * Initialize camera manager in BeginPlay with component references
  * SpringArm attached to capsule with 60cm vertical offset
  * Camera attached to SpringArm socket
- Add AimingCameraConfig for over-the-shoulder aiming view
  * Switch to aiming config when RMB/L2 pressed
  * Return to default config when aim button released
- Improve OnThrowInput code clarity
  * Simplify controller validation flow
  * Clean up trajectory calculation comments
- Add forward declarations for camera classes
- Update class documentation to mention camera integration

Blueprint:
- Remove legacy camera component (AC_Camera)
  * Camera rotation now handled by C++ TengriCameraComponent
  * SpringArm interpolation managed by camera config system
- Update look input to use native controller input
  * AddControllerYawInput/PitchInput for FreeLook mode
  * Skip input in side-scroller mode (camera is fixed)
- Remove camera-related variables (moved to C++ config)
- Simplify EventTick (camera logic now in C++ component)
- Pass DA_CameraAiming config to character constructor

Camera now seamlessly transitions between default and aiming modes,
working in tandem with strafe movement for precise targeting.
2026-01-07 00:38:43 +05:00
Nikolay Petrov 74996e5e4b feat(camera): add dynamic camera system with multiple behavior modes
- Add TengriCameraConfig data asset for camera parameter configuration
  * Support FreeLook (3D) and SideScroller (2.5D) behavior modes
  * Configurable dead zone system for 2.5D gameplay
  * Smooth transition parameters between configs
  * Camera lag settings for cinematic feel
- Add TengriCameraComponent for runtime camera management
  * Post-physics tick to prevent visual jitter with interpolation
  * Dead zone logic: camera only moves when player exits bounds
  * Smooth config transitions using interpolation
  * Debug visualization for dead zone boundaries
- Use interpolated render position from movement component
- Support dynamic config switching via Blueprint (e.g. camera volumes)

Camera system designed for seamless transitions between 3D exploration
and 2.5D platforming sections with configurable dead zones.
2026-01-07 00:33:52 +05:00
Nikolay Petrov 14d3696805 feat(movement): improve air control and ground snapping behavior
- Add directional air control modifier to prevent instant braking mid-air
  * Reduce control effectiveness by 50% when reversing direction (Dot < 0)
  * Allows side-to-side adjustments while maintaining forward momentum
- Remove input requirement for velocity projection on ground snap
  * Project velocity onto slope even without player input
  * Preserves momentum when landing on slopes
- Add KINDA_SMALL_NUMBER checks to prevent division by zero
- Add GetRenderLocation() Blueprint accessor for VFX positioning
- Clean up comments: translate Russian text to English

This makes air movement feel more realistic (less like flying) while
improving slope handling consistency.
2026-01-06 21:42:31 +05:00
Nikolay Petrov abe8f565b6 refactor(collision): improve wall slide behavior for jumping vs grounded movement
- Remove bShowDebug parameter from PerformSweep and ResolveMovement
- Fix wall slide calculation to distinguish jumping from grounded movement
  * Allow upward wall slide during jumps (RemainingDelta.Z > 0)
  * Force horizontal movement only when grounded (RemainingDelta.Z <= 0)
- Add RemainingDelta scaling by Hit.Time for accurate collision response
- Clean up comments: remove Russian text, reduce verbosity
2026-01-06 21:33:10 +05:00
Nikolay Petrov 8744cb759b feat(interaction): implement pickup, aim and throw mechanics
- Implement Context-Based Input system:
  - Added `IMC_ItemHeld` mapping context.
  - Added logic to switch contexts when picking up/dropping items.
  - Added `Throw` (LMB/R2) and `Aim` (RMB/L2) input actions.

- Refactor Interaction Logic:
  - `Interact`: Now handles picking up items or gently dropping them if held.
  - `OnThrowInput`: Implemented physics-based throw towards camera aim point (center of screen raycast).
  - Added character rotation to face the throw target instantly.

- Update Physics & Movement:
  - Added `bStrafing` mode to `TengriMovementComponent` to allow rotation towards camera view.
  - Updated `TengriPickupActor` to use `bVelChange` for impulses (ignoring mass for consistent throw arc).
  - Tuned throw force and added vertical arc bias.

- Fixes:
  - Resolved rotation logic in MovementComponent to support Aiming state.
2025-12-27 21:55:31 +05:00
Nikolay Petrov c54c9fd6ae feat(movement): implement jump system and air physics (Phases 13-14)
Implemented a responsive, deterministic jump system with "game feel" enhancements and advanced air physics.

Changes:
- **Jump Logic**: Added variable jump height (hold/release control).
- **Game Feel**: Implemented Coyote Time (jump after leaving ledge) and Jump Buffering (early input registration).
- **Air Physics**: Added non-linear gravity (FallingGravityScale) for snappy jumps and Terminal Velocity clamping.
- **Landing**: Added OnLanded delegate with heavy/light landing detection based on impact velocity.
- **Config**: Added auto-calculation logic in PostEditChangeProperty to derive Gravity and JumpVelocity from desired JumpHeight and TimeToApex.
- **Debug**: Added on-screen debug messages for Velocity Z and movement state.
- **Fix**: Moved delegate declaration to global scope to fix blueprint visibility issues.

Relates to: Phase 13, Phase 14
2025-12-26 01:45:13 +05:00
Nikolay Petrov b83388e74e feat(movement): Implement fixed timestep physics with interpolation (Stage 12)
BREAKING CHANGE: Movement now runs on deterministic 120Hz physics
- Physics and render states separated
- Visual interpolation for smoothness
- Deterministic physics independent of FPS

Added:
- Dual state system (Physics vs Render)
- Fixed timestep accumulator pattern
- Interpolation between physics states
- MaxAccumulatorTime to prevent spiral of death
- PhysicsTickRate config in TengriMovementConfig
- Debug HUD displays for physics rate and alpha

Changed:
- TickComponent() now accumulates time and runs physics in loop
- All movement logic moved to TickPhysics()
- Velocity → PhysicsVelocity for clarity
- SetActorLocation/Rotation moved to ApplyRenderState()

Performance:
- Added ~0.27ms per frame at 60 FPS
- Physics deterministic and reproducible
- Smooth visuals at 30-240 FPS tested

Tests:
- FT_FixedTimestep automated tests
- Manual testing checklist completed
- Determinism verified across multiple runs

Documentation:
- TDD.md updated with fixed timestep section
- Stage12_DecisionLog.md created
- Inline comments for all new methods

Refs: Roadmap.md Stage 12
2025-12-24 20:46:43 +05:00
Nikolay Petrov 963e7a34dc rewrite movement to c++ 2025-12-24 19:34:13 +05:00