@woosh/meep-engine 2.138.19 → 2.139.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/src/core/collection/PairUint32Map.d.ts +100 -0
- package/src/core/collection/PairUint32Map.d.ts.map +1 -0
- package/src/core/collection/PairUint32Map.js +321 -0
- package/src/core/collection/Uint32Map.d.ts +119 -0
- package/src/core/collection/Uint32Map.d.ts.map +1 -0
- package/src/core/collection/Uint32Map.js +345 -0
- package/src/core/collection/array/array_shuffle.d.ts +10 -3
- package/src/core/collection/array/array_shuffle.d.ts.map +1 -1
- package/src/core/collection/array/array_shuffle.js +27 -22
- package/src/core/collection/heap/FibonacciHeap.d.ts +195 -0
- package/src/core/collection/heap/FibonacciHeap.d.ts.map +1 -0
- package/src/core/collection/heap/FibonacciHeap.js +586 -0
- package/src/core/collection/heap/Uint32Heap.js +1 -1
- package/src/core/collection/heap/Uint32Heap4.d.ts +169 -0
- package/src/core/collection/heap/Uint32Heap4.d.ts.map +1 -0
- package/src/core/collection/heap/Uint32Heap4.js +490 -0
- package/src/core/geom/3d/line/line3_closest_points_segment_segment.d.ts +27 -0
- package/src/core/geom/3d/line/line3_closest_points_segment_segment.d.ts.map +1 -0
- package/src/core/geom/3d/line/line3_closest_points_segment_segment.js +88 -0
- package/src/core/geom/3d/shape/BoxShape3D.d.ts +61 -0
- package/src/core/geom/3d/shape/BoxShape3D.d.ts.map +1 -0
- package/src/core/geom/3d/shape/BoxShape3D.js +158 -0
- package/src/core/geom/3d/shape/CapsuleShape3D.d.ts +11 -0
- package/src/core/geom/3d/shape/CapsuleShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/CapsuleShape3D.js +12 -0
- package/src/core/geom/3d/shape/UnitCubeShape3D.d.ts +37 -9
- package/src/core/geom/3d/shape/UnitCubeShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/UnitCubeShape3D.js +45 -98
- package/src/core/geom/3d/shape/UnitSphereShape3D.d.ts +10 -0
- package/src/core/geom/3d/shape/UnitSphereShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/UnitSphereShape3D.js +11 -0
- package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.d.ts +61 -0
- package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.d.ts.map +1 -0
- package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.js +148 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedral_mesh_from_surface.d.ts +39 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedral_mesh_from_surface.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedral_mesh_from_surface.js +147 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedron_quality.d.ts +15 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedron_quality.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedron_quality.js +22 -0
- package/src/core/geom/3d/tetrahedra/prototype_tetrahedrize_mesh.d.ts +2 -0
- package/src/core/geom/3d/tetrahedra/prototype_tetrahedrize_mesh.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/prototype_tetrahedrize_mesh.js +673 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_carve_outside_surface.d.ts +26 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_carve_outside_surface.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_carve_outside_surface.js +222 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_find_tets_around_edge.d.ts +34 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_find_tets_around_edge.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_find_tets_around_edge.js +146 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_23.d.ts +36 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_23.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_23.js +232 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_32.d.ts +33 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_32.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_32.js +255 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.d.ts +68 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.js +365 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.d.ts +31 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.js +112 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.d.ts +22 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.js +55 -0
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_quality.d.ts +32 -0
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_quality.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_quality.js +66 -0
- package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.d.ts +22 -0
- package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.js +49 -0
- package/src/core/geom/3d/topology/struct/binary/BinaryTopology.d.ts +134 -0
- package/src/core/geom/3d/topology/struct/binary/BinaryTopology.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/BinaryTopology.js +276 -3
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.d.ts +17 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.js +135 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compact.d.ts +14 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compact.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compact.js +177 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_face_decouple.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_face_decouple.js +20 -4
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_simplify.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_simplify.js +5 -3
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_create.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_create.js +9 -0
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_get_or_create.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_get_or_create.js +21 -45
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill.js +7 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill_parallels.d.ts +8 -6
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill_parallels.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill_parallels.js +8 -6
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_kill_short_edges.d.ts +22 -0
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_kill_short_edges.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_kill_short_edges.js +73 -0
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_replace.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_replace.js +51 -1
- package/src/core/geom/3d/topology/struct/binary/query/bt_edge_get.d.ts +10 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_edge_get.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_edge_get.js +42 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_sample_interior_grid_points.d.ts +28 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_sample_interior_grid_points.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_sample_interior_grid_points.js +227 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_walk_boundary_loops.d.ts +13 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_walk_boundary_loops.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_walk_boundary_loops.js +108 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_query_edge_is_boundary.d.ts +11 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_query_edge_is_boundary.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_query_edge_is_boundary.js +20 -0
- package/src/core/geom/3d/triangle/triangle_mesh_compute_signed_volume.d.ts +20 -0
- package/src/core/geom/3d/triangle/triangle_mesh_compute_signed_volume.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/triangle_mesh_compute_signed_volume.js +38 -0
- package/src/core/graph/csr/CSRGraph.d.ts +168 -0
- package/src/core/graph/csr/CSRGraph.d.ts.map +1 -0
- package/src/core/graph/csr/CSRGraph.js +319 -0
- package/src/core/graph/metis/cluster_mesh_metis.d.ts +12 -0
- package/src/core/graph/metis/cluster_mesh_metis.d.ts.map +1 -1
- package/src/core/graph/metis/cluster_mesh_metis.js +12 -0
- package/src/core/graph/metis/metis.d.ts +19 -0
- package/src/core/graph/metis/metis.d.ts.map +1 -1
- package/src/core/graph/metis/metis.js +20 -0
- package/src/core/graph/metis/metis_cluster_bs.d.ts +11 -0
- package/src/core/graph/metis/metis_cluster_bs.d.ts.map +1 -1
- package/src/core/graph/metis/metis_cluster_bs.js +11 -0
- package/src/core/graph/metis/metis_options.d.ts +17 -2
- package/src/core/graph/metis/metis_options.d.ts.map +1 -1
- package/src/core/graph/metis/metis_options.js +17 -2
- package/src/core/graph/metis/native/MetisGraph.d.ts +144 -0
- package/src/core/graph/metis/native/MetisGraph.d.ts.map +1 -0
- package/src/core/graph/metis/native/MetisGraph.js +212 -0
- package/src/core/graph/metis/native/bisection/BisectionScratch.d.ts +72 -0
- package/src/core/graph/metis/native/bisection/BisectionScratch.d.ts.map +1 -0
- package/src/core/graph/metis/native/bisection/BisectionScratch.js +101 -0
- package/src/core/graph/metis/native/bisection/bisect_graph.d.ts +37 -0
- package/src/core/graph/metis/native/bisection/bisect_graph.d.ts.map +1 -0
- package/src/core/graph/metis/native/bisection/bisect_graph.js +100 -0
- package/src/core/graph/metis/native/bisection/compute_2way_params.d.ts +15 -0
- package/src/core/graph/metis/native/bisection/compute_2way_params.d.ts.map +1 -0
- package/src/core/graph/metis/native/bisection/compute_2way_params.js +84 -0
- package/src/core/graph/metis/native/bisection/fm_2way.d.ts +30 -0
- package/src/core/graph/metis/native/bisection/fm_2way.d.ts.map +1 -0
- package/src/core/graph/metis/native/bisection/fm_2way.js +290 -0
- package/src/core/graph/metis/native/bisection/grow_bisection.d.ts +23 -0
- package/src/core/graph/metis/native/bisection/grow_bisection.d.ts.map +1 -0
- package/src/core/graph/metis/native/bisection/grow_bisection.js +137 -0
- package/src/core/graph/metis/native/bisection/split_graph_two_way.d.ts +28 -0
- package/src/core/graph/metis/native/bisection/split_graph_two_way.d.ts.map +1 -0
- package/src/core/graph/metis/native/bisection/split_graph_two_way.js +119 -0
- package/src/core/graph/metis/native/coarsen/coarsen_graph.d.ts +20 -0
- package/src/core/graph/metis/native/coarsen/coarsen_graph.d.ts.map +1 -0
- package/src/core/graph/metis/native/coarsen/coarsen_graph.js +94 -0
- package/src/core/graph/metis/native/coarsen/create_coarse_graph.d.ts +24 -0
- package/src/core/graph/metis/native/coarsen/create_coarse_graph.d.ts.map +1 -0
- package/src/core/graph/metis/native/coarsen/create_coarse_graph.js +158 -0
- package/src/core/graph/metis/native/coarsen/match_shem.d.ts +41 -0
- package/src/core/graph/metis/native/coarsen/match_shem.d.ts.map +1 -0
- package/src/core/graph/metis/native/coarsen/match_shem.js +175 -0
- package/src/core/graph/metis/native/initial/initial_kway_bfs.d.ts +24 -0
- package/src/core/graph/metis/native/initial/initial_kway_bfs.d.ts.map +1 -0
- package/src/core/graph/metis/native/initial/initial_kway_bfs.js +122 -0
- package/src/core/graph/metis/native/initial/initial_kway_recursive_bisection.d.ts +29 -0
- package/src/core/graph/metis/native/initial/initial_kway_recursive_bisection.d.ts.map +1 -0
- package/src/core/graph/metis/native/initial/initial_kway_recursive_bisection.js +170 -0
- package/src/core/graph/metis/native/metis_partition_kway.d.ts +41 -0
- package/src/core/graph/metis/native/metis_partition_kway.d.ts.map +1 -0
- package/src/core/graph/metis/native/metis_partition_kway.js +126 -0
- package/src/core/graph/metis/native/refine/IndexedFloatMaxHeap.d.ts +62 -0
- package/src/core/graph/metis/native/refine/IndexedFloatMaxHeap.d.ts.map +1 -0
- package/src/core/graph/metis/native/refine/IndexedFloatMaxHeap.js +261 -0
- package/src/core/graph/metis/native/refine/RefinementScratch.d.ts +45 -0
- package/src/core/graph/metis/native/refine/RefinementScratch.d.ts.map +1 -0
- package/src/core/graph/metis/native/refine/RefinementScratch.js +53 -0
- package/src/core/graph/metis/native/refine/compute_kway_params.d.ts +18 -0
- package/src/core/graph/metis/native/refine/compute_kway_params.d.ts.map +1 -0
- package/src/core/graph/metis/native/refine/compute_kway_params.js +138 -0
- package/src/core/graph/metis/native/refine/fm_kway.d.ts +63 -0
- package/src/core/graph/metis/native/refine/fm_kway.d.ts.map +1 -0
- package/src/core/graph/metis/native/refine/fm_kway.js +462 -0
- package/src/core/graph/metis/native/refine/project_kway.d.ts +22 -0
- package/src/core/graph/metis/native/refine/project_kway.d.ts.map +1 -0
- package/src/core/graph/metis/native/refine/project_kway.js +43 -0
- package/src/core/graph/metis/native/refine/refine_kway.d.ts +34 -0
- package/src/core/graph/metis/native/refine/refine_kway.d.ts.map +1 -0
- package/src/core/graph/metis/native/refine/refine_kway.js +43 -0
- package/src/core/math/linalg/eigen/matrix_householder_in_place.d.ts +2 -2
- package/src/core/math/linalg/eigen/matrix_householder_in_place.js +2 -2
- package/src/core/math/linalg/eigen/matrix_qr_in_place.d.ts +6 -4
- package/src/core/math/linalg/eigen/matrix_qr_in_place.d.ts.map +1 -1
- package/src/core/math/linalg/eigen/matrix_qr_in_place.js +69 -23
- package/src/engine/EngineHarness.d.ts +3 -1
- package/src/engine/EngineHarness.d.ts.map +1 -1
- package/src/engine/EngineHarness.js +6 -4
- package/src/engine/control/first-person/DESIGN.md +30 -6
- package/src/engine/control/first-person/DESIGN_EXTENSIONS.md +563 -0
- package/src/engine/control/first-person/FirstPersonPlayerController.d.ts +102 -9
- package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerController.js +38 -3
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts +533 -4
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.js +315 -6
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts +220 -22
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.js +858 -241
- package/src/engine/control/first-person/TODO.md +127 -0
- package/src/engine/control/first-person/abilities/Ability.d.ts +101 -0
- package/src/engine/control/first-person/abilities/Ability.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/Ability.js +119 -0
- package/src/engine/control/first-person/abilities/AbilitySet.d.ts +86 -0
- package/src/engine/control/first-person/abilities/AbilitySet.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/AbilitySet.js +185 -0
- package/src/engine/control/first-person/abilities/LedgeGrab.d.ts +62 -0
- package/src/engine/control/first-person/abilities/LedgeGrab.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/LedgeGrab.js +199 -0
- package/src/engine/control/first-person/abilities/Mantle.d.ts +45 -0
- package/src/engine/control/first-person/abilities/Mantle.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/Mantle.js +188 -0
- package/src/engine/control/first-person/abilities/Slide.d.ts +33 -0
- package/src/engine/control/first-person/abilities/Slide.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/Slide.js +158 -0
- package/src/engine/control/first-person/abilities/WallJump.d.ts +45 -0
- package/src/engine/control/first-person/abilities/WallJump.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/WallJump.js +131 -0
- package/src/engine/control/first-person/abilities/WallRun.d.ts +44 -0
- package/src/engine/control/first-person/abilities/WallRun.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/WallRun.js +180 -0
- package/src/engine/control/first-person/composer/EyeOffsetStack.d.ts +49 -0
- package/src/engine/control/first-person/composer/EyeOffsetStack.d.ts.map +1 -0
- package/src/engine/control/first-person/composer/EyeOffsetStack.js +60 -0
- package/src/engine/control/first-person/mastery/BreathRhythmEvaluator.d.ts +100 -0
- package/src/engine/control/first-person/mastery/BreathRhythmEvaluator.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/BreathRhythmEvaluator.js +133 -0
- package/src/engine/control/first-person/mastery/DecisionPoint.d.ts +10 -0
- package/src/engine/control/first-person/mastery/DecisionPoint.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/DecisionPoint.js +30 -0
- package/src/engine/control/first-person/mastery/FootAsymmetryTurnEvaluator.d.ts +61 -0
- package/src/engine/control/first-person/mastery/FootAsymmetryTurnEvaluator.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/FootAsymmetryTurnEvaluator.js +109 -0
- package/src/engine/control/first-person/mastery/MasteryEvaluator.d.ts +40 -0
- package/src/engine/control/first-person/mastery/MasteryEvaluator.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/MasteryEvaluator.js +45 -0
- package/src/engine/control/first-person/mastery/MasteryScore.d.ts +68 -0
- package/src/engine/control/first-person/mastery/MasteryScore.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/MasteryScore.js +100 -0
- package/src/engine/control/first-person/mastery/MasterySet.d.ts +60 -0
- package/src/engine/control/first-person/mastery/MasterySet.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/MasterySet.js +86 -0
- package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.d.ts +58 -0
- package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.js +83 -0
- package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.d.ts +69 -0
- package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.js +109 -0
- package/src/engine/control/first-person/math/Spring.d.ts +56 -0
- package/src/engine/control/first-person/math/Spring.d.ts.map +1 -0
- package/src/engine/control/first-person/math/Spring.js +71 -0
- package/src/engine/control/first-person/math/computeLRCBreathRate.d.ts +26 -0
- package/src/engine/control/first-person/math/computeLRCBreathRate.d.ts.map +1 -0
- package/src/engine/control/first-person/math/computeLRCBreathRate.js +41 -0
- package/src/engine/control/first-person/math/computeMassRatios.d.ts +35 -0
- package/src/engine/control/first-person/math/computeMassRatios.d.ts.map +1 -0
- package/src/engine/control/first-person/math/computeMassRatios.js +44 -0
- package/src/engine/control/first-person/pose/FirstPersonPose.d.ts +31 -1
- package/src/engine/control/first-person/pose/FirstPersonPose.d.ts.map +1 -1
- package/src/engine/control/first-person/pose/FirstPersonPose.js +49 -3
- package/src/engine/control/first-person/pose/FirstPersonPosture.d.ts +7 -0
- package/src/engine/control/first-person/pose/FirstPersonPosture.d.ts.map +1 -0
- package/src/engine/control/first-person/pose/FirstPersonPosture.js +27 -0
- package/src/engine/control/first-person/prototype_first_person_controller.js +550 -119
- package/src/engine/control/first-person/sensors/FirstPersonSensors.d.ts +58 -0
- package/src/engine/control/first-person/sensors/FirstPersonSensors.d.ts.map +1 -0
- package/src/engine/control/first-person/sensors/FirstPersonSensors.js +77 -0
- package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.d.ts +80 -0
- package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.d.ts.map +1 -0
- package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.js +196 -0
- package/src/engine/control/first-person/test/buildTestPlayer.d.ts +20 -0
- package/src/engine/control/first-person/test/buildTestPlayer.d.ts.map +1 -0
- package/src/engine/control/first-person/test/buildTestPlayer.js +28 -0
- package/src/engine/ecs/EntityManager.d.ts +2 -2
- package/src/engine/ecs/EntityManager.d.ts.map +1 -1
- package/src/engine/ecs/EntityManager.js +13 -8
- package/src/engine/ecs/System.d.ts.map +1 -1
- package/src/engine/ecs/System.js +2 -2
- package/src/engine/graphics/camera/testClippingPlaneComputation.js +0 -2
- package/src/engine/graphics/ecs/light/Light.d.ts.map +1 -1
- package/src/engine/graphics/ecs/light/Light.js +27 -0
- package/src/engine/graphics/ecs/light/LightSystem.js +1 -1
- package/src/engine/graphics/ecs/path/PathDisplaySystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/testPathDisplaySystem.js +0 -2
- package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +0 -2
- package/src/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +0 -2
- package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +0 -2
- package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +0 -2
- package/src/engine/navigation/grid/find_path_on_grid_astar.d.ts.map +1 -1
- package/src/engine/navigation/grid/find_path_on_grid_astar.js +11 -2
- package/src/engine/navigation/mesh/bt_mesh_face_find_path.d.ts.map +1 -1
- package/src/engine/navigation/mesh/bt_mesh_face_find_path.js +11 -1
- package/src/engine/physics/PLAN.md +236 -0
- package/src/engine/physics/body/BodyStorage.d.ts +187 -0
- package/src/engine/physics/body/BodyStorage.d.ts.map +1 -0
- package/src/engine/physics/body/BodyStorage.js +427 -0
- package/src/engine/physics/broadphase/PairList.d.ts +62 -0
- package/src/engine/physics/broadphase/PairList.d.ts.map +1 -0
- package/src/engine/physics/broadphase/PairList.js +97 -0
- package/src/engine/physics/broadphase/aabb_transform_oriented.d.ts +30 -0
- package/src/engine/physics/broadphase/aabb_transform_oriented.d.ts.map +1 -0
- package/src/engine/physics/broadphase/aabb_transform_oriented.js +93 -0
- package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts +16 -0
- package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts.map +1 -0
- package/src/engine/physics/broadphase/compute_fat_world_aabb.js +61 -0
- package/src/engine/physics/broadphase/generate_pairs.d.ts +38 -0
- package/src/engine/physics/broadphase/generate_pairs.d.ts.map +1 -0
- package/src/engine/physics/broadphase/generate_pairs.js +101 -0
- package/src/engine/physics/contact/ManifoldStore.d.ts +226 -0
- package/src/engine/physics/contact/ManifoldStore.d.ts.map +1 -0
- package/src/engine/physics/contact/ManifoldStore.js +499 -0
- package/src/engine/physics/ecs/BodyKind.d.ts +23 -0
- package/src/engine/physics/ecs/BodyKind.d.ts.map +1 -0
- package/src/engine/physics/ecs/BodyKind.js +24 -0
- package/src/engine/physics/ecs/Collider.d.ts +98 -0
- package/src/engine/physics/ecs/Collider.d.ts.map +1 -0
- package/src/engine/physics/ecs/Collider.js +136 -0
- package/src/engine/physics/ecs/ColliderFlags.d.ts +14 -0
- package/src/engine/physics/ecs/ColliderFlags.d.ts.map +1 -0
- package/src/engine/physics/ecs/ColliderFlags.js +15 -0
- package/src/engine/physics/ecs/ColliderObserverSystem.d.ts +58 -0
- package/src/engine/physics/ecs/ColliderObserverSystem.d.ts.map +1 -0
- package/src/engine/physics/ecs/ColliderObserverSystem.js +103 -0
- package/src/engine/physics/ecs/ColliderSerializationAdapter.d.ts +25 -0
- package/src/engine/physics/ecs/ColliderSerializationAdapter.d.ts.map +1 -0
- package/src/engine/physics/ecs/ColliderSerializationAdapter.js +37 -0
- package/src/engine/physics/ecs/PhysicsEvents.d.ts +15 -0
- package/src/engine/physics/ecs/PhysicsEvents.d.ts.map +1 -0
- package/src/engine/physics/ecs/PhysicsEvents.js +16 -0
- package/src/engine/physics/ecs/PhysicsSystem.d.ts +520 -0
- package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -0
- package/src/engine/physics/ecs/PhysicsSystem.js +1159 -0
- package/src/engine/physics/ecs/RigidBody.d.ts +197 -0
- package/src/engine/physics/ecs/RigidBody.d.ts.map +1 -0
- package/src/engine/physics/ecs/RigidBody.js +240 -0
- package/src/engine/physics/ecs/RigidBodyFlags.d.ts +21 -0
- package/src/engine/physics/ecs/RigidBodyFlags.d.ts.map +1 -0
- package/src/engine/physics/ecs/RigidBodyFlags.js +22 -0
- package/src/engine/physics/ecs/RigidBodySerializationAdapter.d.ts +28 -0
- package/src/engine/physics/ecs/RigidBodySerializationAdapter.d.ts.map +1 -0
- package/src/engine/physics/ecs/RigidBodySerializationAdapter.js +81 -0
- package/src/engine/physics/ecs/SleepState.d.ts +11 -0
- package/src/engine/physics/ecs/SleepState.d.ts.map +1 -0
- package/src/engine/physics/ecs/SleepState.js +12 -0
- package/src/engine/physics/events/ContactEventBuffer.d.ts +46 -0
- package/src/engine/physics/events/ContactEventBuffer.d.ts.map +1 -0
- package/src/engine/physics/events/ContactEventBuffer.js +83 -0
- package/src/engine/physics/events/diff_manifolds.d.ts +25 -0
- package/src/engine/physics/events/diff_manifolds.d.ts.map +1 -0
- package/src/engine/physics/events/diff_manifolds.js +50 -0
- package/src/engine/physics/fluid/FluidField.d.ts +294 -16
- package/src/engine/physics/fluid/FluidField.d.ts.map +1 -1
- package/src/engine/physics/fluid/FluidField.js +510 -66
- package/src/engine/physics/fluid/FluidSimulator.d.ts +188 -5
- package/src/engine/physics/fluid/FluidSimulator.d.ts.map +1 -1
- package/src/engine/physics/fluid/FluidSimulator.js +455 -95
- package/src/engine/physics/fluid/SliceVisualiser.d.ts +29 -6
- package/src/engine/physics/fluid/SliceVisualiser.d.ts.map +1 -1
- package/src/engine/physics/fluid/SliceVisualiser.js +190 -165
- package/src/engine/physics/fluid/ecs/FluidComponent.d.ts +154 -0
- package/src/engine/physics/fluid/ecs/FluidComponent.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/FluidComponent.js +238 -0
- package/src/engine/physics/fluid/ecs/FluidEffectorsComponent.d.ts +45 -0
- package/src/engine/physics/fluid/ecs/FluidEffectorsComponent.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/FluidEffectorsComponent.js +89 -0
- package/src/engine/physics/fluid/ecs/FluidSystem.d.ts +107 -0
- package/src/engine/physics/fluid/ecs/FluidSystem.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/FluidSystem.js +278 -0
- package/src/engine/physics/fluid/effector/AbstractFluidEffector.d.ts +62 -1
- package/src/engine/physics/fluid/effector/AbstractFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/AbstractFluidEffector.js +81 -6
- package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts +17 -4
- package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/GlobalFluidEffector.js +105 -12
- package/src/engine/physics/fluid/effector/ImpulseFluidEffector.d.ts +43 -0
- package/src/engine/physics/fluid/effector/ImpulseFluidEffector.d.ts.map +1 -0
- package/src/engine/physics/fluid/effector/ImpulseFluidEffector.js +210 -0
- package/src/engine/physics/fluid/effector/WakeFluidEffector.d.ts +62 -1
- package/src/engine/physics/fluid/effector/WakeFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/WakeFluidEffector.js +302 -8
- package/src/engine/physics/fluid/prototype.js +102 -91
- package/src/engine/physics/fluid/solver/optimal_sor_omega.d.ts +33 -0
- package/src/engine/physics/fluid/solver/optimal_sor_omega.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/optimal_sor_omega.js +41 -0
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.d.ts +20 -5
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.d.ts.map +1 -1
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.js +60 -38
- package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.d.ts +25 -4
- package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.d.ts.map +1 -1
- package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.js +93 -73
- package/src/engine/physics/fluid/solver/v3_grid_apply_scalar_advection.d.ts +23 -0
- package/src/engine/physics/fluid/solver/v3_grid_apply_scalar_advection.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_apply_scalar_advection.js +60 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_divergence.d.ts +23 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_divergence.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_divergence.js +68 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.d.ts +30 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.js +66 -0
- package/src/engine/physics/fluid/solver/v3_grid_patch_edges_uniform.d.ts +26 -0
- package/src/engine/physics/fluid/solver/v3_grid_patch_edges_uniform.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_patch_edges_uniform.js +113 -0
- package/src/engine/physics/fluid/solver/v3_grid_shift_in_place.d.ts +30 -0
- package/src/engine/physics/fluid/solver/v3_grid_shift_in_place.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_shift_in_place.js +107 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.d.ts +49 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.js +126 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.d.ts +93 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.js +424 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_unmasked_legacy.d.ts +20 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_unmasked_legacy.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_unmasked_legacy.js +83 -0
- package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.d.ts +26 -0
- package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.js +70 -0
- package/src/engine/physics/gjk/expanding_polytope_algorithm.d.ts.map +1 -1
- package/src/engine/physics/gjk/expanding_polytope_algorithm.js +8 -10
- package/src/engine/physics/inertia/world_inverse_inertia.d.ts +29 -0
- package/src/engine/physics/inertia/world_inverse_inertia.d.ts.map +1 -0
- package/src/engine/physics/inertia/world_inverse_inertia.js +79 -0
- package/src/engine/physics/integration/integrate_position.d.ts +16 -0
- package/src/engine/physics/integration/integrate_position.d.ts.map +1 -0
- package/src/engine/physics/integration/integrate_position.js +48 -0
- package/src/engine/physics/integration/integrate_velocity.d.ts +25 -0
- package/src/engine/physics/integration/integrate_velocity.d.ts.map +1 -0
- package/src/engine/physics/integration/integrate_velocity.js +79 -0
- package/src/engine/physics/integration/quat_integrate.d.ts +27 -0
- package/src/engine/physics/integration/quat_integrate.d.ts.map +1 -0
- package/src/engine/physics/integration/quat_integrate.js +62 -0
- package/src/engine/physics/island/IslandBuilder.d.ts +167 -0
- package/src/engine/physics/island/IslandBuilder.d.ts.map +1 -0
- package/src/engine/physics/island/IslandBuilder.js +411 -0
- package/src/engine/physics/island/union_find.d.ts +51 -0
- package/src/engine/physics/island/union_find.d.ts.map +1 -0
- package/src/engine/physics/island/union_find.js +76 -0
- package/src/engine/physics/narrowphase/PosedShape.d.ts +59 -0
- package/src/engine/physics/narrowphase/PosedShape.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/PosedShape.js +110 -0
- package/src/engine/physics/narrowphase/box_box_manifold.d.ts +32 -0
- package/src/engine/physics/narrowphase/box_box_manifold.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/box_box_manifold.js +543 -0
- package/src/engine/physics/narrowphase/capsule_contacts.d.ts +122 -0
- package/src/engine/physics/narrowphase/capsule_contacts.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/capsule_contacts.js +508 -0
- package/src/engine/physics/narrowphase/narrowphase_step.d.ts +11 -0
- package/src/engine/physics/narrowphase/narrowphase_step.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/narrowphase_step.js +382 -0
- package/src/engine/physics/narrowphase/sphere_box_contact.d.ts +38 -0
- package/src/engine/physics/narrowphase/sphere_box_contact.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/sphere_box_contact.js +130 -0
- package/src/engine/physics/narrowphase/sphere_sphere_contact.d.ts +26 -0
- package/src/engine/physics/narrowphase/sphere_sphere_contact.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/sphere_sphere_contact.js +51 -0
- package/src/engine/physics/queries/PhysicsSurfacePoint.d.ts +83 -0
- package/src/engine/physics/queries/PhysicsSurfacePoint.d.ts.map +1 -0
- package/src/engine/physics/queries/PhysicsSurfacePoint.js +100 -0
- package/src/engine/physics/queries/raycast.d.ts +20 -0
- package/src/engine/physics/queries/raycast.d.ts.map +1 -0
- package/src/engine/physics/queries/raycast.js +249 -0
- package/src/engine/physics/solver/friction_cone.d.ts +16 -0
- package/src/engine/physics/solver/friction_cone.d.ts.map +1 -0
- package/src/engine/physics/solver/friction_cone.js +37 -0
- package/src/engine/physics/solver/solve_contacts.d.ts +36 -0
- package/src/engine/physics/solver/solve_contacts.d.ts.map +1 -0
- package/src/engine/physics/solver/solve_contacts.js +598 -0
- package/src/core/geom/3d/topology/struct/binary/io/edge/OrderedEdge.d.ts +0 -34
- package/src/core/geom/3d/topology/struct/binary/io/edge/OrderedEdge.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/OrderedEdge.js +0 -66
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_calc_edges.d.ts +0 -2
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_calc_edges.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_calc_edges.js +0 -54
- package/src/core/geom/3d/topology/struct/binary/io/edge/get_or_create_edge_map.d.ts +0 -2
- package/src/core/geom/3d/topology/struct/binary/io/edge/get_or_create_edge_map.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/get_or_create_edge_map.js +0 -26
- package/src/engine/ecs/components/Motion.d.ts +0 -21
- package/src/engine/ecs/components/Motion.d.ts.map +0 -1
- package/src/engine/ecs/components/Motion.js +0 -27
- package/src/engine/ecs/components/MotionSerializationAdapter.d.ts +0 -20
- package/src/engine/ecs/components/MotionSerializationAdapter.d.ts.map +0 -1
- package/src/engine/ecs/components/MotionSerializationAdapter.js +0 -26
- package/src/engine/ecs/systems/MotionSystem.d.ts +0 -9
- package/src/engine/ecs/systems/MotionSystem.d.ts.map +0 -1
- package/src/engine/ecs/systems/MotionSystem.js +0 -29
- package/src/engine/physics/fluid/Fluid.d.ts +0 -26
- package/src/engine/physics/fluid/Fluid.d.ts.map +0 -1
- package/src/engine/physics/fluid/Fluid.js +0 -221
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_reverse.d.ts +0 -7
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_reverse.d.ts.map +0 -1
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_reverse.js +0 -8
|
@@ -0,0 +1,563 @@
|
|
|
1
|
+
# FirstPersonPlayerController — Extension Plan
|
|
2
|
+
|
|
3
|
+
> Status: **In progress** — core movement vocabulary + 4 mastery evaluators landed. Slide, Mantle, WallRun, WallJump, and LedgeGrab abilities are implemented; StrideTimingJump, FootAsymmetryTurn, BreathRhythm (multi-decision-point), and SlideInitiationTiming evaluators ship registered in the prototype.
|
|
4
|
+
> Sibling to: [DESIGN.md](./DESIGN.md) (base controller).
|
|
5
|
+
> Scope of this doc: movement vocabulary (wall run, wall jump, mantle, vault, ledge grab, slide) + a hidden mastery layer (gait-timed bonuses, foot-asymmetric modifiers, curve-driven response).
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Vision
|
|
10
|
+
|
|
11
|
+
Two pillars, layered:
|
|
12
|
+
|
|
13
|
+
**Pillar A — Movement vocabulary.** The controller graduates from "athlete with juice" to "free-runner". Walls, ledges, and surfaces become traversable surfaces. The base movement still works for everyone — these extensions are *additive*, never required.
|
|
14
|
+
|
|
15
|
+
**Pillar B — Hidden mastery.** Behind the visible mechanics, a layer of *temporally-aware* modifiers rewards understanding gait phase, foot-side, momentum, and chained timing. A casual player presses jump and gets a jump. A skilled player presses jump *at right-foot push-off, mid-stride, leaning into the turn* and gets ~12% more height. They cover more ground over a long traversal. Compounded across a parkour run, the gap is meaningful.
|
|
16
|
+
|
|
17
|
+
**Core design rule:** **symmetric in behaviour, asymmetric in magnitude.** The same curve drives both bonuses and penalties — peak timing rewards, anti-peak timing punishes — but the penalty side is *smaller* than the bonus side (typical +12% peak / −5% trough). This makes mastery genuinely valuable while making mis-timed inputs feel "slightly off" rather than punitively bad. A flat per-evaluator multiplier (`flatBoost`) lets designers tune overall magnitude without re-authoring curves.
|
|
18
|
+
|
|
19
|
+
The reasoning: pure-additive bonuses produce odd outcomes (good-timing-or-baseline, no concept of "mistimed"). Symmetric responses are honest — your inputs land somewhere on a continuous response curve, with peaks and troughs.
|
|
20
|
+
|
|
21
|
+
**Subtlety rule:** typical mastery bonus is +3 to +15%; matching penalty is −2 to −5%. Never enough to be obvious in a single instance. Compounds across chains.
|
|
22
|
+
|
|
23
|
+
**No glitch-mastery rule.** Bunny-hopping, tap-strafing, and similar exploits arise from *unintended* interactions between systems (or, charitably, from gaps designers chose to leave). We don't want those. Every mastery effect in our system is **physically motivated** — stride timing, foot-side asymmetry, breath rhythm, momentum carry, contact angles. If a "discovery" can't be explained as a real-body effect, it's a bug, not a feature.
|
|
24
|
+
|
|
25
|
+
Inspiration for *layered depth*: Apex Legends, Mirror's Edge, Titanfall 2. Inspiration for *grounded-in-body*: Inman/Perry gait research, sports biomechanics. Inspiration for *what NOT to do*: Quake bunny-hop (depth from glitches, not from physics).
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 2. Architectural extensions
|
|
30
|
+
|
|
31
|
+
### 2.1 Layered model (revised)
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
L0 Intent external (input/AI)
|
|
35
|
+
L1 Locomotion base movement (unchanged from DESIGN.md)
|
|
36
|
+
L1.5 Mastery hooks NEW — observe locomotion, compute timing-based bonuses
|
|
37
|
+
L1.6 Ability override NEW — wall run / mantle / slide can override L1 entirely
|
|
38
|
+
L2 Pose state unchanged
|
|
39
|
+
L3 Camera unchanged (abilities push to EyeOffsetStack)
|
|
40
|
+
L4 Events unchanged + new ability-specific signals
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
L1.5 and L1.6 are the new layers. L1.5 runs *during* normal L1 (it modifies coefficients used by L1's math). L1.6 *replaces* L1's body integration when an ability is active.
|
|
44
|
+
|
|
45
|
+
### 2.2 The Ability framework
|
|
46
|
+
|
|
47
|
+
An ability is a behaviour module that:
|
|
48
|
+
- Polls per fixed update for activation
|
|
49
|
+
- Once active, runs its own `tick(dt)` to override locomotion / vertical integration
|
|
50
|
+
- Resolves its own exit conditions (timer, contact, intent, etc.)
|
|
51
|
+
- Releases control back to base locomotion on exit
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
class Ability {
|
|
55
|
+
/** Priority for activation. Higher wins ties when multiple can fire. */
|
|
56
|
+
priority = 0;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @param {FirstPersonPlayerController} controller
|
|
60
|
+
* @param {PerEntityRuntime} runtime
|
|
61
|
+
* @param {Object} sensors See § 2.4
|
|
62
|
+
* @returns {boolean} true if this ability wants to take control now
|
|
63
|
+
*/
|
|
64
|
+
canActivate(controller, runtime, sensors) { return false; }
|
|
65
|
+
|
|
66
|
+
/** Called once when this ability acquires control. */
|
|
67
|
+
onActivate(controller, runtime) {}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Runs each fixed step while active. Owns the body's motion during
|
|
71
|
+
* this window — writes to runtime.velocity*, bodyTransform.position
|
|
72
|
+
* directly. Returns true to stay active, false to release.
|
|
73
|
+
*/
|
|
74
|
+
tick(controller, runtime, dt) { return false; }
|
|
75
|
+
|
|
76
|
+
/** Called once when releasing control (either by tick returning false
|
|
77
|
+
* or by being preempted by a higher-priority ability). */
|
|
78
|
+
onDeactivate(controller, runtime) {}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Activation policy** — at most one ability is active at a time. Each fixed update:
|
|
83
|
+
1. If an active ability exists, its `tick()` runs first. If it returns `false`, fall through to step 2 in the SAME tick.
|
|
84
|
+
2. Poll all abilities by descending priority. First that says `canActivate` becomes active, with `onActivate` called immediately.
|
|
85
|
+
3. If no ability activates, base L1 locomotion runs.
|
|
86
|
+
|
|
87
|
+
**Preemption** — an active ability can be preempted by a higher-priority one that wants in (e.g., mid-slide, hit a vaultable obstacle → mantle takes over). The current ability's `onDeactivate` fires before the new one's `onActivate`.
|
|
88
|
+
|
|
89
|
+
**Ability set is config-driven** — a controller has an array of `Ability` instances. Removing wall-running from a particular game/mode is just leaving that ability out of the array. No code changes.
|
|
90
|
+
|
|
91
|
+
### 2.3 Sensors
|
|
92
|
+
|
|
93
|
+
Multiple abilities share spatial queries. Wall run, wall jump, and ledge grab all need to know "is there a wall to my left/right". Mantle and vault need "is there an obstacle in front of me, and how tall is it". Building one shared "sensor bundle" beats each ability re-raycasting.
|
|
94
|
+
|
|
95
|
+
```js
|
|
96
|
+
class FirstPersonSensors {
|
|
97
|
+
/** {hit: bool, distance: number, normal: Vec3, surfaceTag: string?} */
|
|
98
|
+
wallLeft = null;
|
|
99
|
+
wallRight = null;
|
|
100
|
+
wallFront = null;
|
|
101
|
+
|
|
102
|
+
/** Forward-and-up probe: information about a vaultable obstacle ahead.
|
|
103
|
+
* Includes the surface top altitude relative to the player's feet. */
|
|
104
|
+
obstacleAhead = null;
|
|
105
|
+
|
|
106
|
+
/** Ledge detection: result of "forward hits, but a step-up to a low
|
|
107
|
+
* ceiling, then nothing forward" — i.e., a grabbable ledge edge. */
|
|
108
|
+
ledgeAhead = null;
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
The sensors update once per fixed step (in their own subsystem, runs before the ability poll). Cost: a small constant number of raycasts per player. Cache the results on `runtime.sensors`.
|
|
113
|
+
|
|
114
|
+
Sensors use the engine's existing physics raycast facility (or, for the prototype-without-physics, a simple AABB world model).
|
|
115
|
+
|
|
116
|
+
### 2.4 The Mastery layer
|
|
117
|
+
|
|
118
|
+
A *mastery evaluator* observes controller state and returns a multiplier for a specific decision point. Decision points include:
|
|
119
|
+
|
|
120
|
+
- Jump impulse magnitude (event: jump-fire)
|
|
121
|
+
- Ground acceleration (every fixed step on ground)
|
|
122
|
+
- Slide initiation velocity preservation (event: slide-start)
|
|
123
|
+
- Wall-jump impulse (event: wall-jump-fire)
|
|
124
|
+
- Mantle exit speed (event: mantle-end)
|
|
125
|
+
- Wall-run gravity factor (each fixed step while wall-running)
|
|
126
|
+
|
|
127
|
+
```js
|
|
128
|
+
class MasteryEvaluator {
|
|
129
|
+
/**
|
|
130
|
+
* @param {number} decisionPoint one of the DecisionPoint enum values
|
|
131
|
+
* @param {FirstPersonPlayerController} controller
|
|
132
|
+
* @param {PerEntityRuntime} runtime
|
|
133
|
+
* @returns {number} multiplier; 1.0 = no opinion, >1 = bonus, <1 = penalty
|
|
134
|
+
*/
|
|
135
|
+
evaluate(decisionPoint, controller, runtime) { return 1.0; }
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Each decision point queries every registered evaluator and composes *multiplicatively*:
|
|
140
|
+
```
|
|
141
|
+
finalMultiplier = evaluators.reduce((acc, e) => acc * e.evaluate(point, c, r), 1.0)
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**Symmetric response.** Evaluators can return values both above and below 1.0 — the same curve drives bonus and penalty regions. Default convention: curve `y` range is `[1 - penaltyMag, 1 + bonusMag]` where typically `bonusMag ≈ 2.5 × penaltyMag`. Behaviour is symmetric (a curve evaluation at every decision point); magnitude is asymmetric (the bonus side is bigger than the penalty side). Mis-timing feels "slightly off", peak timing feels good.
|
|
145
|
+
|
|
146
|
+
**Flat multiplier per evaluator.** Each evaluator has a `flatBoost: number` (default 1.0) that scales its entire output. Lets designers tune overall magnitude without re-authoring the curve. `final = pow(curveValue, flatBoostExponent)` — exponentiation rather than multiplication preserves the curve's range bracketing around 1.0.
|
|
147
|
+
|
|
148
|
+
**Composition is multiplicative**, not additive, so evaluator contributions are independent. A 1.10× and a 1.05× compose to 1.155×. A 0.95× (penalty) and a 1.10× (bonus) compose to 1.045× — penalty partially offset by bonus. This is what gives the system its "honest" feel: mistiming costs something even when other parts went well.
|
|
149
|
+
|
|
150
|
+
### 2.5 Mastery score (developer-facing telemetry)
|
|
151
|
+
|
|
152
|
+
The system maintains a per-controller *mastery score* — a normalized exponential moving average of all evaluator outputs over time:
|
|
153
|
+
|
|
154
|
+
```js
|
|
155
|
+
class MasteryScore {
|
|
156
|
+
/** EMA of (multiplier − 1.0). Positive = trending bonus, negative = trending penalty. */
|
|
157
|
+
aggregate = 0;
|
|
158
|
+
/** EMA per decision point. Keyed by DecisionPoint. */
|
|
159
|
+
byPoint = new Map();
|
|
160
|
+
/** EMA half-life (seconds). */
|
|
161
|
+
halfLife = 8.0;
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Every time any evaluator fires, the score updates. The game/HUD can read these values to drive whatever feedback it wants (a subtle UI hint, post-match summary, leaderboard score, achievement triggers, training-mode coaching, etc.). The controller itself doesn't *use* the score — it's a side-channel for downstream systems.
|
|
166
|
+
|
|
167
|
+
This satisfies the "subtle but discoverable" requirement without putting mastery-feedback directly on the camera. The dev/game decides what to surface.
|
|
168
|
+
|
|
169
|
+
### 2.6 Curve-driven response
|
|
170
|
+
|
|
171
|
+
Every mastery evaluator's input→output mapping is an `AnimationCurve` (engine's `engine/animation/curve/AnimationCurve.js` — exists and has `.evaluate(t)`). Curves are *symmetric around 1.0*: above 1.0 in peak-timing regions, below 1.0 in worst-timing regions.
|
|
172
|
+
|
|
173
|
+
```js
|
|
174
|
+
class StrideTimingJumpEvaluator extends MasteryEvaluator {
|
|
175
|
+
/** Curve: stride phase [0..1) → multiplier ∈ [1-pen, 1+bonus] */
|
|
176
|
+
curve = null;
|
|
177
|
+
/** Exponent applied to (curve - 1) for overall magnitude tuning. */
|
|
178
|
+
flatBoost = 1.0;
|
|
179
|
+
|
|
180
|
+
evaluate(decisionPoint, controller, runtime) {
|
|
181
|
+
if (decisionPoint !== DecisionPoint.JumpImpulse) return 1.0;
|
|
182
|
+
const raw = this.curve.evaluate(controller.state.stridePhase);
|
|
183
|
+
// Preserve symmetry around 1.0 while scaling magnitude:
|
|
184
|
+
// signed deviation × flatBoost, then add back to 1.0.
|
|
185
|
+
return 1.0 + (raw - 1.0) * this.flatBoost;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Designers author the curve in the engine's existing curve editor. The curve shape encodes the *response profile*:
|
|
191
|
+
- Wide bell centred at peak → forgiving window
|
|
192
|
+
- Sharp spike + sharp trough → precise timing, big magnitude swing
|
|
193
|
+
- Asymmetric (steeper one side) → easier in one direction than the other
|
|
194
|
+
|
|
195
|
+
The curve's `x` range is decision-specific:
|
|
196
|
+
- Stride-timed jump: `x` = stride phase ∈ [0, 1)
|
|
197
|
+
- Slide-on-impact: `x` = time-since-footfall ∈ [0, 0.3] (seconds)
|
|
198
|
+
- Wall run takeoff: `x` = time-on-wall ∈ [0, 2.5]
|
|
199
|
+
- Breath-rhythm action: `x` = breath phase ∈ [0, 1) — peak at exhale (0.75), trough at inhale (0.25)
|
|
200
|
+
- Wall-jump angle: `x` = dot(velocity, wall.normal) ∈ [0, 1]
|
|
201
|
+
|
|
202
|
+
Default curves ship with the system. Designers can override any of them. Default curves are unit-tested for "bonus at peak, penalty at trough" behaviour patterns (not specific magnitudes — those are tunable).
|
|
203
|
+
|
|
204
|
+
### 2.7 File layout
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
control/first-person/
|
|
208
|
+
DESIGN.md (base — existing)
|
|
209
|
+
DESIGN_EXTENSIONS.md (this file)
|
|
210
|
+
FirstPersonPlayerController.js (existing — extended to hold ability state)
|
|
211
|
+
FirstPersonPlayerControllerConfig.js (existing — extended)
|
|
212
|
+
FirstPersonPlayerControllerSystem.js (existing — orchestrates abilities)
|
|
213
|
+
|
|
214
|
+
abilities/
|
|
215
|
+
Ability.js (interface/base)
|
|
216
|
+
AbilitySet.js (the activation/preemption logic)
|
|
217
|
+
Slide.js
|
|
218
|
+
Mantle.js
|
|
219
|
+
WallRun.js
|
|
220
|
+
WallJump.js
|
|
221
|
+
LedgeGrab.js
|
|
222
|
+
|
|
223
|
+
sensors/
|
|
224
|
+
FirstPersonSensors.js (struct)
|
|
225
|
+
FirstPersonSensorsSystem.js (populates the struct each tick)
|
|
226
|
+
|
|
227
|
+
mastery/
|
|
228
|
+
MasteryEvaluator.js (base)
|
|
229
|
+
DecisionPoint.js (enum)
|
|
230
|
+
StrideTimingJumpEvaluator.js
|
|
231
|
+
FootAsymmetryTurnEvaluator.js
|
|
232
|
+
SlideInitiationTimingEvaluator.js
|
|
233
|
+
WallRunTakeoffTimingEvaluator.js
|
|
234
|
+
|
|
235
|
+
math/ (existing)
|
|
236
|
+
pose/ (existing)
|
|
237
|
+
composer/ (existing)
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## 3. Movement abilities — detail
|
|
243
|
+
|
|
244
|
+
For each ability: **activation**, **behaviour**, **exit**, **events**, **mastery hooks**, **risks**.
|
|
245
|
+
|
|
246
|
+
### 3.1 Slide (run → slide)
|
|
247
|
+
|
|
248
|
+
The simplest ability — pure locomotion override, no spatial sensing needed.
|
|
249
|
+
|
|
250
|
+
**Activation** — `intent.crouch` rising edge AND `state.speed > slideMinSpeed` AND `state.grounded`. So you can only initiate slide while moving fast.
|
|
251
|
+
|
|
252
|
+
**Behaviour** — replaces standard L1.b/c/d. Velocity is preserved (no decel during slide) with very low friction. `state.eyeHeight` springs to `body.crouchHeight` (same as crouch). Forward intent has *reduced* steering, lateral intent has slightly more (you can carve the slide). Vertical impact spring kicks once on slide-start for the visual "thud".
|
|
253
|
+
|
|
254
|
+
**Exit** — speed drops below `slideEndSpeed`, OR intent.crouch released, OR intent.jump (slide-jump → preserves horizontal speed, gives normal vertical impulse), OR collision with wall.
|
|
255
|
+
|
|
256
|
+
**Signals** — `onSlideStart{entrySpeed}`, `onSlideEnd{reason, exitSpeed}`, `onSlideJump` (special: fires both onSlideEnd AND onJumpStart).
|
|
257
|
+
|
|
258
|
+
**Mastery hooks:**
|
|
259
|
+
- `slideInitiationVelocityCurve`: input = time-since-last-footfall. Sliding *right at footfall* preserves more entry speed (you're pushing off the foot into the slide). Wide window centred around 0–80ms post-footfall.
|
|
260
|
+
- `slideJumpTimingCurve`: jumping out of slide near a footfall gives a boost to the jump's horizontal carry.
|
|
261
|
+
|
|
262
|
+
**Config additions:**
|
|
263
|
+
```js
|
|
264
|
+
slide = {
|
|
265
|
+
minEntrySpeed: 5.0, // m/s — gates activation
|
|
266
|
+
endSpeed: 2.0, // m/s — auto-exit threshold
|
|
267
|
+
friction: 3.0, // m/s² deceleration while sliding
|
|
268
|
+
steerForwardFactor: 0.3, // intent.move.y has 30% steering authority
|
|
269
|
+
steerLateralFactor: 1.4, // intent.move.x has 140% (carving)
|
|
270
|
+
eyeHeight: 0.55, // even lower than crouch
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### 3.2 Mantle / Vault
|
|
275
|
+
|
|
276
|
+
Auto-triggered surface clearing. Distinguishes by obstacle height: low → vault (over and continue); medium → mantle (climb onto and stop on top).
|
|
277
|
+
|
|
278
|
+
**Activation** — `sensors.obstacleAhead.hit` AND obstacle top is reachable (within `mantleMaxHeight`) AND forward intent is non-zero. Vault if the obstacle has *space behind it* (sensor detects a deeper forward probe past the obstacle); mantle if not.
|
|
279
|
+
|
|
280
|
+
**Behaviour** — scripted Bezier curve through the motion: up + slight slow-down + over/onto. The body's position is on a *path*, not under integration, during the mantle window. Duration is fixed (configurable per height) — typically 0.4–0.8s. Camera dips down on the ascent (looking at hands/wall), then back to level.
|
|
281
|
+
|
|
282
|
+
**Exit** — when the scripted path completes. The player re-acquires control with their previous (preserved) velocity for vault, zeroed for mantle.
|
|
283
|
+
|
|
284
|
+
**Signals** — `onMantleStart{obstacleHeight, kind:"mantle"|"vault"}`, `onMantleEnd{kind}`.
|
|
285
|
+
|
|
286
|
+
**Mastery hooks:**
|
|
287
|
+
- `mantleApproachTimingCurve`: input = approach angle (radians off-perpendicular). Hitting a vault dead-perpendicular gives the cleanest, fastest vault. Approaching at a slight angle (≤20°) maintains some momentum carry; beyond that, the vault is slower or aborted.
|
|
288
|
+
- `vaultCarrySpeedCurve`: input = pre-vault horizontal speed. Sprinting into a vault carries *more* exit speed than walking into one. The curve is super-linear at the top — sprinting gives a slight EXTRA speed boost on exit, like you're using the vault as a momentum gate.
|
|
289
|
+
|
|
290
|
+
**Risks** — the scripted path overrides player input briefly. Need careful design so it doesn't feel like control loss. Mitigation: paths are SHORT (<0.5s), and the player can cancel by reverse-intent during the first 25% of the window (drop off the obstacle).
|
|
291
|
+
|
|
292
|
+
### 3.3 Wall run
|
|
293
|
+
|
|
294
|
+
Run along a vertical surface for a brief window.
|
|
295
|
+
|
|
296
|
+
**Activation** — `!state.grounded` AND `(sensors.wallLeft.hit OR sensors.wallRight.hit)` with normal roughly perpendicular to body forward AND `state.speed > walkSpeed` AND `state.airborneTime > 0.1` (so you can't trigger off a jump's initial frames — you have to be IN the air, not transitioning).
|
|
297
|
+
|
|
298
|
+
**Behaviour** — gravity is reduced to `wallRunGravity` (typically ~30% of normal fall). Velocity is preserved along the wall's tangent. Body yaw is forced to align with the wall (player can adjust, but yaw is steered toward the wall direction). Camera rolls toward the wall (~10–15°).
|
|
299
|
+
|
|
300
|
+
**Exit** — wall ends (sensor lose contact), OR `state.airborneTime - wallRunStartedAt > wallRunMaxDuration` (timer expires; ~2s default), OR jump pressed (chains to wall-jump), OR move-away intent strong enough.
|
|
301
|
+
|
|
302
|
+
**Signals** — `onWallRunStart{side:"L"|"R"}`, `onWallRunEnd{reason}`.
|
|
303
|
+
|
|
304
|
+
**Mastery hooks:**
|
|
305
|
+
- `wallRunEntryTimingCurve`: input = time-since-takeoff. Wall-running just after a jump (within ~0.3s) is "clean" and starts at full speed. Wall-running mid-fall costs some speed. Curve has a peak at ~0.1s post-takeoff.
|
|
306
|
+
- `wallRunTakeoffTimingCurve`: input = time-on-wall. The wall-jump exit is more powerful if you trigger it within the first second (you have leg energy left to push off). Bell curve peaking at ~0.4s.
|
|
307
|
+
|
|
308
|
+
**Risks** — the camera roll is a known motion-sickness trigger. Provide `wallRunCameraRoll: number` config with default 0.6 (=60% of "full" tilt) and gate it on `cfg.lean.enabled` so the motion-sickness toggle covers it.
|
|
309
|
+
|
|
310
|
+
### 3.4 Wall jump
|
|
311
|
+
|
|
312
|
+
Impulse off a wall — chains naturally from wall run, also fires from near-wall airborne (a brief window where you're close to a wall but not yet running).
|
|
313
|
+
|
|
314
|
+
**Activation** — `intent.jump` rising edge AND `!state.grounded` AND `(sensors.wallLeft.hit OR sensors.wallRight.hit)` with normal pointing away from body forward AND wall is roughly vertical. Higher priority than base jump (so an in-air jump press near a wall produces wall-jump, not nothing).
|
|
315
|
+
|
|
316
|
+
**Behaviour** — instantaneous impulse: `wallJumpImpulse` magnitude along (wall.normal + worldUp * `wallJumpUpFactor`). Resets `state.isVariableJumpCut` and `runtime.midJump = true` so subsequent gravity treats it as a fresh jump.
|
|
317
|
+
|
|
318
|
+
**Exit** — instantaneous (it's an impulse, not a sustained state). Returns control to base airborne integration.
|
|
319
|
+
|
|
320
|
+
**Signals** — `onWallJump{wallNormal, impulse}`.
|
|
321
|
+
|
|
322
|
+
**Mastery hooks:**
|
|
323
|
+
- `wallJumpEntryAngleCurve`: input = dot(incoming velocity, wall.normal) — how directly the player is *flying into* the wall. Cleanly into-wall (high dot) → bigger off-wall impulse (you have more inbound momentum to flip). Glancing → smaller. Models "you push off harder when you've committed harder".
|
|
324
|
+
- `wallJumpRhythmCurve`: input = breathPhase. *Yes, breath phase.* Wall-jumping at exhalation gives a small boost. Subtle but a player who learns it gets a long-traversal advantage. The kind of detail Tony Hawk speedrunners would obsess over.
|
|
325
|
+
|
|
326
|
+
### 3.5 Ledge grab
|
|
327
|
+
|
|
328
|
+
Snap to and hang from a ledge edge during a fall (or after an aborted mantle).
|
|
329
|
+
|
|
330
|
+
**Activation** — `sensors.ledgeAhead.hit` AND `runtime.velocityY <= 0` (descending) AND `state.airborneTime > 0.3` (not just leaving ground) AND forward intent (you have to be aiming at the ledge).
|
|
331
|
+
|
|
332
|
+
**Behaviour** — body position snaps to ledge-hang position. Vertical velocity zeroed; horizontal motion limited to side-shuffling along the ledge edge. Eye position adjusts to "looking up over the ledge". Stamina/exertion gradually depletes (climbing fatigue).
|
|
333
|
+
|
|
334
|
+
**Exit** — jump pressed (mantle up), OR crouch/back-intent (drop), OR exertion saturates (slip — soft fall), OR `sensors.ledgeAhead` loses contact (shuffled off the edge).
|
|
335
|
+
|
|
336
|
+
**Signals** — `onLedgeGrab{ledgeHeight}`, `onLedgeRelease{reason}`.
|
|
337
|
+
|
|
338
|
+
**Mastery hooks:**
|
|
339
|
+
- `ledgeCatchTimingCurve`: input = vertical-velocity at catch. Catching at low-velocity (gentle descent) is forgiving. Catching at high-velocity (a desperate save) is harder, but if successful, the next mantle-up from this position is *faster* (you've used momentum to your advantage). Curve has TWO regions: the "forgiveness zone" at low Vy where everything is easy, and a "skill zone" at high Vy where mantle-up speed scales with how aggressive the catch was.
|
|
340
|
+
- `ledgeMantleTimingCurve`: input = breath phase at mantle-up press. Same Tony-Hawk-detail level.
|
|
341
|
+
|
|
342
|
+
---
|
|
343
|
+
|
|
344
|
+
## 4. Hidden mastery — worked examples
|
|
345
|
+
|
|
346
|
+
### 4.1 Stride-timed jump
|
|
347
|
+
|
|
348
|
+
**Player input:** `intent.jump` rising edge.
|
|
349
|
+
**Mastery query:** `StrideTimingJumpEvaluator` at `DecisionPoint.JumpImpulse`.
|
|
350
|
+
**Inputs read:** `state.stridePhase`, `runtime.standingFoot`.
|
|
351
|
+
**Curve:** authored such that mid-stance (`stridePhase ≈ 0.25` for R-foot, `≈ 0.75` for L-foot) gives 1.10–1.12×; mid-swing gives 1.00×.
|
|
352
|
+
**Effect:** jump impulse multiplied by the result. A 1.8m jump becomes a 1.95m jump at peak timing.
|
|
353
|
+
**Player-visible:** the jump just goes higher. No UI, no sound cue.
|
|
354
|
+
|
|
355
|
+
### 4.2 Foot-asymmetric turn momentum
|
|
356
|
+
|
|
357
|
+
**Player input:** sustained yaw turn (`intent.look.x` non-zero) while running.
|
|
358
|
+
**Mastery query:** `FootAsymmetryTurnEvaluator` at `DecisionPoint.GroundAccel`.
|
|
359
|
+
**Inputs read:** `runtime.standingFoot`, sign of yaw rate.
|
|
360
|
+
**Effect:** turning rightward (negative yawDelta in our convention) while LEFT foot is standing gives slight extra ground acceleration (the right leg is in swing, can push you toward the turn).
|
|
361
|
+
**Magnitude:** ~5% accel boost. Composed over a long sprint-turn the player covers more ground.
|
|
362
|
+
**Player-visible:** the run feels "smoother" in one direction than the other. Most players never notice why.
|
|
363
|
+
|
|
364
|
+
> The "handedness asymmetry" knob is a `cfg.mastery.dominantFoot: "R"` setting. By convention right-dominant gets ~3% additional bonus to its asymmetric advantage. Off by default in serious modes; on in arcadey ones.
|
|
365
|
+
|
|
366
|
+
### 4.3 Slide initiation timing
|
|
367
|
+
|
|
368
|
+
**Player input:** `intent.crouch` rising edge during sprint.
|
|
369
|
+
**Mastery query:** `SlideInitiationTimingEvaluator` at `DecisionPoint.SlideEntryVelocity`.
|
|
370
|
+
**Inputs read:** time since last footfall (the controller stores this as `runtime.timeSinceFootfall`, which is new — would be added in this extension).
|
|
371
|
+
**Curve:** peaks at ~80ms after a footfall (you've just pushed off, body has full forward momentum). Falls off in both directions.
|
|
372
|
+
**Effect:** slide-entry velocity preserved at 100% at the peak, ~85% at the trough.
|
|
373
|
+
**Player-visible:** sliding "feels good" when timed right. Players naturally trend toward the good timing.
|
|
374
|
+
|
|
375
|
+
### 4.4 Breath-rhythm reward
|
|
376
|
+
|
|
377
|
+
**Player input:** any decision-point event (jump, slide-start, wall-jump, mantle-start).
|
|
378
|
+
**Mastery query:** `BreathRhythmEvaluator` — registered against *multiple* decision points.
|
|
379
|
+
**Inputs read:** `state.breathPhase`.
|
|
380
|
+
**Curve:** symmetric bell with peak at 0.75 (exhale), trough at 0.25 (inhale). At exhale: +3%. At inhale: −1%. Asymmetric magnitude per the design rule.
|
|
381
|
+
**Effect:** every decisive action benefits slightly from being timed to exhale. Physically motivated — divers, weightlifters, and martial artists all exhale during exertion. Inhaling mid-effort marginally degrades performance.
|
|
382
|
+
**Player-visible:** outcomes are slightly inconsistent until the player intuits the pattern.
|
|
383
|
+
|
|
384
|
+
A linked variant: `BreathRhythmSpeedBonusEvaluator` against `DecisionPoint.GroundAccel` — same curve over breath phase, slight (~1–2%) speed bonus during the exhale half of the cycle. Players running with breath rhythm covered slightly more ground.
|
|
385
|
+
|
|
386
|
+
> **Note on intensity.** Breath-rhythm bonuses are the smallest in the system by design. They reward acute body awareness without dominating. If a player is *aware* of breath sync, they get a barely-noticeable advantage; if not, they pay a barely-noticeable cost. This is the floor of the mastery layer.
|
|
387
|
+
|
|
388
|
+
### 4.5 Wall-run launch chain (compounded mastery)
|
|
389
|
+
|
|
390
|
+
A player wall-runs along a wall, then wall-jumps off it. Multiple evaluators chain:
|
|
391
|
+
|
|
392
|
+
| Stage | Evaluator | Skilled-timing | Mis-timing |
|
|
393
|
+
|---|---|---|---|
|
|
394
|
+
| Approach jump | StrideTimingJumpEvaluator | +12% impulse | −4% impulse |
|
|
395
|
+
| Approach jump | BreathRhythmEvaluator (jump) | +3% | −1% |
|
|
396
|
+
| Wall-run entry | WallRunEntryTimingEvaluator | +5% speed | −2% speed |
|
|
397
|
+
| Wall-run takeoff | WallRunTakeoffTimingEvaluator | +8% impulse | −3% impulse |
|
|
398
|
+
| Wall jump angle | WallJumpEntryAngleEvaluator | +6% impulse | −2% impulse |
|
|
399
|
+
|
|
400
|
+
**Skilled outcome (multiplicative):** 1.12 × 1.03 × 1.05 × 1.08 × 1.06 ≈ **1.39×**.
|
|
401
|
+
**Mis-timed outcome (multiplicative):** 0.96 × 0.99 × 0.98 × 0.97 × 0.98 ≈ **0.89×**.
|
|
402
|
+
**Casual outcome (all near curve midpoint, all close to 1.0):** ≈ 1.00×.
|
|
403
|
+
|
|
404
|
+
Note: the asymmetric magnitude means mis-timing produces ~11% loss while peak timing produces ~39% gain. The spread is genuine. Across a 30-second parkour route the gap accumulates into a genuinely different traversal speed — and the "mastery score" EMA will reflect it for game UI.
|
|
405
|
+
|
|
406
|
+
*That* is what mastery looks like — invisible per-interaction, dominant in aggregate.
|
|
407
|
+
|
|
408
|
+
---
|
|
409
|
+
|
|
410
|
+
## 5. Implementation roadmap
|
|
411
|
+
|
|
412
|
+
Each phase delivers usable value and is testable independently.
|
|
413
|
+
|
|
414
|
+
**Phase 1 — Mastery scaffold (~1 day)**
|
|
415
|
+
|
|
416
|
+
`DecisionPoint` enum, `MasteryEvaluator` base, `MasterySet` (registers + composes multiplicatively), `MasteryScore` (EMA tracker). No evaluators yet. The decision-point query path exists and returns 1.0 by default. Plumbing only — no observable behaviour change.
|
|
417
|
+
|
|
418
|
+
Test: composition is multiplicative; score EMA tracks correctly; default-returning-1.0 leaves baseline intact.
|
|
419
|
+
|
|
420
|
+
**Phase 2 — Ability framework (~1.5 days)**
|
|
421
|
+
|
|
422
|
+
`Ability` base, `AbilitySet` with the hybrid preempt-or-queue logic. No abilities yet. Active ability slot exists on runtime; base locomotion is the fallback. Higher-priority new request checks `current.canInterrupt()`; if no → queued, re-tries each tick.
|
|
423
|
+
|
|
424
|
+
Test: zero abilities = unchanged behaviour; mock ability of higher priority preempts when interruptible, queues when not; queued ability fires the moment current ability releases.
|
|
425
|
+
|
|
426
|
+
**Phase 3 — Sensor system (~1 day)**
|
|
427
|
+
|
|
428
|
+
`FirstPersonSensors` struct + `FirstPersonSensorsSystem` that populates it each fixed step. Raycasts against:
|
|
429
|
+
- `Terrain.raycastFirstSync` for terrain hits
|
|
430
|
+
- `ShadedGeometrySystem.raycast` for static geometry (BVH-backed; cheap)
|
|
431
|
+
|
|
432
|
+
Initial sensors: `wallLeft`, `wallRight`, `wallFront`, `obstacleAhead`, `ledgeAhead`. NPCs without ability needs use a stub sensor (zero rays).
|
|
433
|
+
|
|
434
|
+
Test: with mocked geometry, sensor populates expected hit info; with no geometry, sensor reports null.
|
|
435
|
+
|
|
436
|
+
**Phase 4 — Wire mastery into base controller (~0.5 day)**
|
|
437
|
+
|
|
438
|
+
Apply mastery composition at the existing jump-impulse fire site as proof-of-concept. Default behaviour: no evaluators registered → 1.0 multiplier → no change. With a single test evaluator returning 1.1 → jump v0 is 10% higher.
|
|
439
|
+
|
|
440
|
+
Test: jump impulse v0 = base × `MasterySet.evaluate(JumpImpulse)`; default = base; with evaluator = scaled.
|
|
441
|
+
|
|
442
|
+
**Phase 5 — First evaluator: StrideTimingJumpEvaluator (~1 day)**
|
|
443
|
+
|
|
444
|
+
The canonical evaluator. Symmetric curve over stride phase. Default curve ships peaks at midstance phases (≈0.25 and 0.75), troughs at footfall transitions (≈0, 0.5). Optional foot-asymmetry: dominant foot's peak is slightly higher.
|
|
445
|
+
|
|
446
|
+
Test: jump fired at peak stride phase produces > base impulse; at trough produces < base; at midpoint ≈ base.
|
|
447
|
+
|
|
448
|
+
**Phase 6 — Slide ability (~1 day)**
|
|
449
|
+
|
|
450
|
+
Simplest ability. No sensors needed. Validates the framework. Includes a "non-interruptible window" at the start (matches user's spec — slide can't be preempted in its first ~0.15s).
|
|
451
|
+
|
|
452
|
+
Test: slide initiates from sprint+crouch; non-interruptible window blocks preemption; exits on speed loss; slide-jump preserves momentum.
|
|
453
|
+
|
|
454
|
+
**Phase 7 — Mantle / Vault (~3 days)**
|
|
455
|
+
|
|
456
|
+
Needs `obstacleAhead` sensor + scripted Bezier-path body integration. Path-driven motion is the new pattern; design carefully so the ECS contract stays clean (body position is *written* during the path, not *integrated*).
|
|
457
|
+
|
|
458
|
+
Test: low obstacle → vaults; tall obstacle → mantles; uncrossable obstacle → no activation.
|
|
459
|
+
|
|
460
|
+
**Phase 8 — Wall run + wall jump (~3 days)**
|
|
461
|
+
|
|
462
|
+
Needs lateral wall sensors. Wall jump is a simple impulse; can fire either from wall-run state or from "near-wall airborne" state. Camera roll goes through the existing `leanSpring` (not a separate effect — consistent with the unification work).
|
|
463
|
+
|
|
464
|
+
Test: wall-detected + airborne + speed → wall run; jump-during-wall-run produces wall-jump; timer expires correctly; queued ability requests after wall-run release fire correctly.
|
|
465
|
+
|
|
466
|
+
**Phase 9 — Ledge grab (~2 days)**
|
|
467
|
+
|
|
468
|
+
Needs `ledgeAhead` sensor (forward + up + over-edge probe). Exertion as a depletion mechanic plugs into the existing exertion system. Mantle-up reuses the mantle ability machinery (priority-preempts ledge-grab when triggered).
|
|
469
|
+
|
|
470
|
+
Test: ledge caught from descent; exertion depletes while hanging; release on exit conditions; mantle-up from ledge transitions cleanly.
|
|
471
|
+
|
|
472
|
+
**Phase 10 — Additional evaluators (~2 days)**
|
|
473
|
+
|
|
474
|
+
`FootAsymmetryTurnEvaluator` (ground accel), `BreathRhythmEvaluator` (multi-point), `SlideInitiationTimingEvaluator`, `WallRunEntryTimingEvaluator`, `WallRunTakeoffTimingEvaluator`, `WallJumpEntryAngleEvaluator`. All ship with default curves.
|
|
475
|
+
|
|
476
|
+
Test: each evaluator's curve produces > base at peak, < base at trough, with documented magnitudes.
|
|
477
|
+
|
|
478
|
+
**Phase 11 — Iterate on curves (~ongoing)**
|
|
479
|
+
|
|
480
|
+
The framework is done; the *feel* is iterated by tuning curves through play. Mastery score EMA is the in-game diagnostic.
|
|
481
|
+
|
|
482
|
+
Total estimate: ~2.5 weeks of focused work to ship all movement abilities + the foundational evaluators.
|
|
483
|
+
|
|
484
|
+
---
|
|
485
|
+
|
|
486
|
+
## 6. Risks and open questions
|
|
487
|
+
|
|
488
|
+
**Determinism & netcode.** Resolved: the controller is deterministic in `fixedUpdate`, networking is tick-synchronized with rollback, and all intent is delivered through networked actions. Mastery curves sampled per fixed step are pure functions of state, so they replay identically. No mastery-specific networking work needed.
|
|
489
|
+
|
|
490
|
+
**Ability composition.** Resolved via the hybrid preempt+queue model:
|
|
491
|
+
- Higher-priority new request → check `current.canInterrupt()`. If yes → preempt now. If no → queue, re-try every tick until current releases.
|
|
492
|
+
- Lower-priority new request → queue.
|
|
493
|
+
- Priorities (default): slide=10, mantle=30, ledge=40, wall-run=50, wall-jump=60. Wall-jump highest because it's the most player-input-driven (responding to a press) and should fire reliably mid-air.
|
|
494
|
+
|
|
495
|
+
**The "uninterruptible window" problem.** Resolved by exposing it. Each ability has its own definition of "can interrupt" — slide includes a non-interruptible startup window; mantle is non-interruptible mid-path; wall-jump is instantaneous so never has the issue. The framework supports this naturally via the `canInterrupt()` hook.
|
|
496
|
+
|
|
497
|
+
**Mastery layer testability.** Resolved by default-curves contract: each shipped evaluator's default curve is unit-tested for the *behaviour pattern* — output > baseline near peak, output < baseline at trough, output ≈ baseline at midpoint. Not specific magnitudes — those are tunable.
|
|
498
|
+
|
|
499
|
+
**Sensor cost.** Resolved: meep has a fast BVH; ~100 rays/tick are comfortable, ~1000/frame at 60Hz is fine. We can fire what we need without micro-optimizing. The sensor abstraction still helps because it dedupes queries across abilities (mantle and ledge-grab both need a forward+up probe — compute once, share).
|
|
500
|
+
|
|
501
|
+
**Raycast targets (interim).** Until the dedicated physics layer arrives, raycast against:
|
|
502
|
+
- `Terrain.raycastFirstSync(result, ox, oy, oz, dx, dy, dz)` for terrain
|
|
503
|
+
- `ShadedGeometrySystem.raycast(...)` for static geometry (BVH-backed)
|
|
504
|
+
Filter both through a small union helper that returns the nearest hit across both sources.
|
|
505
|
+
|
|
506
|
+
**AnimationCurve.evaluate() perf.** ~100ns per evaluation for typical mastery curves (~5 keys). Per-tick: ~20 evaluator queries × 100ns ≈ 2μs. Negligible.
|
|
507
|
+
|
|
508
|
+
**Curve authoring.** The engine has an editor at `engine/animation/curve/view/`. Our curves are plain `AnimationCurve` instances — they slot in directly. No tooling work expected.
|
|
509
|
+
|
|
510
|
+
**Glitch-mastery (anti-bunny-hop).** Active design constraint: every mastery effect must be **physically motivated**. Stride timing → real gait dynamics. Foot asymmetry → real handedness asymmetry. Breath rhythm → real exhalation-during-exertion. Wall-jump angle → real momentum redirection. If a "discovery" can't be explained as a real-body effect, it's a bug to remove, not a feature to keep.
|
|
511
|
+
|
|
512
|
+
The acid test: "could a sports biomechanist endorse this as a real effect, in principle?" If no → cut it.
|
|
513
|
+
|
|
514
|
+
**Visual feedback for mastery.** Resolved per the user's instruction: we do NOT have a dedicated "mastery visual tell". Instead, mastery effects feed back through *existing dynamics*. A bigger jump impulse goes through the existing jump system → existing anticipation dip → existing landing dip → existing camera kick. The visual response naturally scales because it's downstream of the same physics. We don't add mastery-aware hooks to the camera — the camera reads what's there. This satisfies "actions should have consequences" without coupling.
|
|
515
|
+
|
|
516
|
+
**Mastery score for game feedback.** Resolved per the user's instruction: `MasteryScore` is an EMA tracking each evaluator's contribution per decision point, plus an aggregate. Exposed via `controller.mastery.score`. The controller doesn't *use* the score — downstream systems (HUD, post-match summary, training mode, etc.) read it and decide what (if anything) to surface.
|
|
517
|
+
|
|
518
|
+
**Wall-run camera roll.** Same as base `lean.enabled` — accessibility toggle covers it.
|
|
519
|
+
|
|
520
|
+
---
|
|
521
|
+
|
|
522
|
+
## 7. Testing strategy
|
|
523
|
+
|
|
524
|
+
**Sensor stubs.** Tests pre-populate `sensors.wallLeft` etc., then run ability ticks. Validates ability logic without a physics dependency.
|
|
525
|
+
|
|
526
|
+
**Ability state transitions.** For each ability: not-active → active → not-active under the documented activation/exit conditions. Pin against regressions.
|
|
527
|
+
|
|
528
|
+
**Preemption.** A high-priority ability fires while a low-priority one is active → preempt happens, deactivate hooks fire in order. Test mid-tick preemption explicitly (it's the common edge case).
|
|
529
|
+
|
|
530
|
+
**Mastery composition.** Two evaluators registered, both returning 1.1, on the same decision point → final multiplier 1.21 (not 1.2). Three at 1.05 → 1.158. Confirms multiplicative reduction.
|
|
531
|
+
|
|
532
|
+
**Mastery determinism.** Two identical controller instances, identical intent sequences → identical state trajectories. Curve sampling is by definition deterministic, but the test catches accidents (random number leaks, non-deterministic Map iteration order if it ever happens).
|
|
533
|
+
|
|
534
|
+
**Mastery curves.** For each shipped evaluator, a "sanity test" verifies the curve produces ≥ 1.0 everywhere (no penalties), peaks within the documented window, and falls off symmetrically (where applicable). Doesn't test exact magnitudes — those are tunable.
|
|
535
|
+
|
|
536
|
+
**Roundtrip serialization with curves.** Config that contains an AnimationCurve must round-trip through toJSON/fromJSON cleanly. The existing curve module has its own JSON path; verify it composes with our config.
|
|
537
|
+
|
|
538
|
+
---
|
|
539
|
+
|
|
540
|
+
## 8. Out of scope (for now)
|
|
541
|
+
|
|
542
|
+
These come later if they prove needed; flagging so they don't sneak in:
|
|
543
|
+
|
|
544
|
+
- **Climbing** (vertical surfaces, not just ledges). Big mechanic; deserves its own design pass.
|
|
545
|
+
- **Swimming.** Whole separate locomotion mode.
|
|
546
|
+
- **Vehicles / mounts.** Different controller entirely.
|
|
547
|
+
- **Crouch-jump** (small extra height from crouch-and-jump combo). Tempting and easy, but adds a "competitive timing" expectation that interferes with the mastery layer's subtlety. Defer.
|
|
548
|
+
- **Combat animations / weapon interactions.** Controlled by other systems that read pose channels; controller doesn't need to know.
|
|
549
|
+
- **Hard-coded keybindings for any of the new abilities.** Per existing design, abilities are activated by *intent* — input wiring is external.
|
|
550
|
+
|
|
551
|
+
---
|
|
552
|
+
|
|
553
|
+
## 9. Sources
|
|
554
|
+
|
|
555
|
+
For the curated subset relevant to this extension:
|
|
556
|
+
|
|
557
|
+
- [Mirror's Edge Catalyst — Keeping the camera in your face — DICE / Söderholm](https://ctrl500.com/developers-corner/mirrors-edge-catalyst-keeping-the-camera-in-your-face/) (camera while wall-running)
|
|
558
|
+
- Titanfall 2 wall-running references (multiple GDC talks; specific implementation differs but principle is shared)
|
|
559
|
+
- Apex Legends movement tech analysis (community-documented bunny-hop, wall-bounce, tap-strafe) — illustrates the "hidden mastery" pattern in a shipped product
|
|
560
|
+
- Quake III physics (the canonical "compounding subtle bonuses" reference — air-strafing, bunny-hop)
|
|
561
|
+
- [Spring-It-On — Daniel Holden](https://theorangeduck.com/page/spring-roll-call) (for the spring-driven path interpolations used in mantle)
|
|
562
|
+
|
|
563
|
+
All compound on top of what the base controller already does — the extension is genuinely *layered*, not a rewrite.
|