3.9 KiB
Main Feature
This document explains the current repair-game prototype in La-Fabrik.
What It Does
The main feature is a repair interaction sandbox mounted in the debug physics scene. It lets the player approach a repair case, open it, and interact with module slots that can show selectable models and exploded-model states.
The current user flow is:
- Open the app with
?debug. - Switch the scene to
Physicsin the debug panel. - Move close to the repair case.
- Press the interaction key when prompted.
- Watch the case open or close with sound feedback.
- Interact with repair module slots to cycle/select repair models.
The production repair flow is now being moved toward reusable mission data for bike, pylone, and ferme. This lets the same future RepairGame component read one mission config instead of duplicating per-mission setup.
Why It Matters
This feature validates the core repair fantasy before a full mission system exists. It tests whether repair objects, physical proximity, model selection, audio feedback, and exploded model visualization can work together in the 3D scene.
Current Behavior
The repair case reacts to player proximity. When the player is close enough, it floats upward and rotates gently to signal interactivity. When the player moves away, it returns to its resting transform.
Interacting with the case toggles its open state. The lid animation is handled with GSAP because it is a discrete interaction animation, not a continuous per-frame loop.
Repair module slots are configured from static gameplay data. They render selectable repair models and can use exploded model visualization to show parts separated from their original positions.
Key Files
src/world/debug/TestMap.tsxmounts the repair-game prototype in the debug physics scene.src/components/three/gameplay/RepairGameZone.tsxcomposes the repair-game zone.src/components/three/gameplay/RepairCaseObject.tsxconnects the repair case to trigger interaction and audio.src/components/three/gameplay/RepairCaseModel.tsxrenders and animates the case model.src/components/three/gameplay/RepairModuleSlot.tsxrenders repair slots and model selection behavior.src/components/three/models/ExplodableModel.tsxrenders selectable models with split/exploded visualization.src/data/gameplay/repairCaseConfig.tsstores repair case model, sound, and animation constants.src/data/gameplay/repairGameConfig.tsstores repair zone and slot positions.src/data/gameplay/repairGameModelCatalog.tsstores selectable repair models.src/data/gameplay/repairMissions.tsstores reusable repair mission config forbike,pylone, andferme.src/managers/stores/useGameStore.tsstores mission progression state and generic mission step helpers.
Debug Requirements
The repair-game prototype currently requires:
- the app opened with
?debug - the debug scene set to
Physics - model assets available under
public/models/ - sound assets available under
public/sounds/
Frontend command:
npm run dev
Debug URL:
http://localhost:5173/?debug
Related Hand Tracking
Hand tracking is a separate debug interaction layer. It can move grabbable physics objects with webcam input, but it is not yet integrated into the repair-game mission flow.
For hand tracking, run the Python backend separately:
source backend/.venv/bin/activate
python -m backend.main
Current Limitations
- It is mounted only in the debug physics scene.
- The production
RepairGamecomponent is not mounted in the main game scene yet. - Mission progression exists in Zustand, but the full repair mission flow is still being integrated.
- There is no central
GameManagerin this branch. - Hand tracking is available as debug interaction input, not as final repair gameplay.
- The repair-game content is configured statically in
src/data/gameplay/.