35 Commits

Author SHA1 Message Date
math-pixel 988c8305bc update remove naming step 2026-05-14 11:58:43 +02:00
math-pixel 5ee52ec752 feat: video intro 2026-05-14 11:50:40 +02:00
math-pixel 3ece1d76de feat: video player 2026-05-14 11:35:03 +02:00
math-pixel 3222d2ed3d update: position intro 2026-05-14 11:16:58 +02:00
math-pixel 41c38a35b2 feat/net shader 2026-05-14 10:34:36 +02:00
math-pixel 6399a2f89f feat: add net shader 2026-05-13 17:07:12 +02:00
math-pixel f5d3d080c8 update bike 2026-05-13 14:05:25 +02:00
math-pixel cac66ebaee Merge branch 'develop' into feat/intro 2026-05-13 11:14:25 +02:00
math-pixel c155d847e9 Merge branch 'develop' into feat/intro 2026-05-13 11:11:28 +02:00
Tom Boullay 7785a6c9d7 fix: clean formatting issues
🔍 Lint / 🪄 Check lint (push) Has been cancelled
🔍 Lint / 🎨 Check format (push) Has been cancelled
🔍 Lint / 🔎 Typecheck (push) Has been cancelled
📊 Quality / 🔒 Security Audit (push) Has been cancelled
📊 Quality / 📋 Dependency Freshness (push) Has been cancelled
📊 Quality / 📦 Bundle Size (push) Has been cancelled
🔍 Lint / 🏗 Build (push) Has been cancelled
2026-05-13 11:03:18 +02:00
Tom Boullay 48f8de5ea5 fix: register mission flow docs route 2026-05-13 11:03:17 +02:00
Tom Boullay 73fc9ec677 fix: add temporary lite map reducer 2026-05-13 11:03:17 +02:00
Tom Boullay 90cd4d40cc fix: update sky model loading 2026-05-13 11:03:16 +02:00
Tom Boullay 5c68e4cd79 update: models and map data 2026-05-13 11:03:14 +02:00
math-pixel f567540f22 fix: step issue 2026-05-13 10:00:19 +02:00
math-pixel 688302d985 wip 2026-05-13 09:05:45 +02:00
math-pixel f9d7c3f00e update: loading waiting 2026-05-12 21:47:54 +02:00
math-pixel 28c6ef199f feat: sequencing 2026-05-12 21:44:43 +02:00
math-pixel ff79448ce8 update : cinematic trigger 2026-05-12 17:07:53 +02:00
Tom Boullay 2b3ccaf67d Merge branch 'develop' of https://git.fabrik.mathieu-chavanel.fr/math-pixel/La-Fabrik into develop
🔍 Lint / 🪄 Check lint (push) Has been cancelled
🔍 Lint / 🎨 Check format (push) Has been cancelled
🔍 Lint / 🔎 Typecheck (push) Has been cancelled
🔍 Lint / 🏗 Build (push) Has been cancelled
📊 Quality / 🔒 Security Audit (push) Has been cancelled
📊 Quality / 📋 Dependency Freshness (push) Has been cancelled
📊 Quality / 📦 Bundle Size (push) Has been cancelled
2026-05-12 16:59:30 +02:00
Tom Boullay 122af7bd9a update: add new models 2026-05-12 16:58:58 +02:00
math-pixel ae34dc38ed Merge pull request 'Feat/mission-12' (#3) from feat/mission-2 into develop
🔍 Lint / 🪄 Check lint (push) Has been cancelled
🔍 Lint / 🎨 Check format (push) Has been cancelled
🔍 Lint / 🔎 Typecheck (push) Has been cancelled
🔍 Lint / 🏗 Build (push) Has been cancelled
📊 Quality / 🔒 Security Audit (push) Has been cancelled
📊 Quality / 📋 Dependency Freshness (push) Has been cancelled
📊 Quality / 📦 Bundle Size (push) Has been cancelled
Reviewed-on: #3
2026-05-12 14:52:53 +00:00
math-pixel 1cecead474 Merge branch 'develop' into feat/mission-2
📊 Quality / 🔒 Security Audit (pull_request) Has been cancelled
📊 Quality / 📋 Dependency Freshness (pull_request) Has been cancelled
📊 Quality / 📦 Bundle Size (pull_request) Has been cancelled
🔍 Lint / 🪄 Check lint (pull_request) Has been cancelled
🔍 Lint / 🎨 Check format (pull_request) Has been cancelled
🔍 Lint / 🔎 Typecheck (pull_request) Has been cancelled
🔍 Lint / 🏗 Build (pull_request) Has been cancelled
2026-05-12 14:52:17 +00:00
math-pixel ceffedf684 fix : lint
🔍 Lint / 🪄 Check lint (pull_request) Has been cancelled
🔍 Lint / 🎨 Check format (pull_request) Has been cancelled
🔍 Lint / 🔎 Typecheck (pull_request) Has been cancelled
🔍 Lint / 🏗 Build (pull_request) Has been cancelled
📊 Quality / 🔒 Security Audit (pull_request) Has been cancelled
📊 Quality / 📋 Dependency Freshness (pull_request) Has been cancelled
📊 Quality / 📦 Bundle Size (pull_request) Has been cancelled
2026-05-12 16:51:35 +02:00
Tom Boullay 43b64172ea Create weekly-branch-promotions.yml
🔍 Lint / 🪄 Check lint (push) Has been cancelled
🔍 Lint / 🎨 Check format (push) Has been cancelled
🔍 Lint / 🔎 Typecheck (push) Has been cancelled
🔍 Lint / 🏗 Build (push) Has been cancelled
📊 Quality / 🔒 Security Audit (push) Has been cancelled
📊 Quality / 📋 Dependency Freshness (push) Has been cancelled
📊 Quality / 📦 Bundle Size (push) Has been cancelled
2026-05-12 16:41:46 +02:00
math-pixel 700c088c48 fix : audio and data issues
🔍 Lint / 🪄 Check lint (pull_request) Has been cancelled
🔍 Lint / 🎨 Check format (pull_request) Has been cancelled
🔍 Lint / 🔎 Typecheck (pull_request) Has been cancelled
🔍 Lint / 🏗 Build (pull_request) Has been cancelled
📊 Quality / 🔒 Security Audit (pull_request) Has been cancelled
📊 Quality / 📋 Dependency Freshness (pull_request) Has been cancelled
📊 Quality / 📦 Bundle Size (pull_request) Has been cancelled
2026-05-12 14:29:38 +02:00
math-pixel 490f9627cc merge mission & intro 2026-05-12 14:03:53 +02:00
math-pixel 8d197ba26b PR: refactor state game 2026-05-12 13:47:05 +02:00
math-pixel eab552a09b PR: refactor name 2026-05-12 13:42:23 +02:00
Tom Boullay 2c3f0db65b refactor: move mission flow state into game store
🔍 Lint / 🪄 Check lint (pull_request) Has been cancelled
🔍 Lint / 🎨 Check format (pull_request) Has been cancelled
🔍 Lint / 🔎 Typecheck (pull_request) Has been cancelled
🔍 Lint / 🏗 Build (pull_request) Has been cancelled
📊 Quality / 🔒 Security Audit (pull_request) Has been cancelled
📊 Quality / 📋 Dependency Freshness (pull_request) Has been cancelled
📊 Quality / 📦 Bundle Size (pull_request) Has been cancelled
2026-05-11 18:02:00 +02:00
Tom Boullay 91ebea8d99 Merge remote-tracking branch 'origin/develop' into feat/mission-2
# Conflicts:
#	package-lock.json
#	package.json
#	src/App.tsx
#	src/components/three/interaction/CentralObject.tsx
#	src/components/three/interaction/VillageoisHelperObject.tsx
#	src/managers/GameStepManager.ts
#	src/stateManager/AudioManager.ts
#	src/world/World.tsx
#	src/world/player/PlayerController.tsx
2026-05-11 17:46:42 +02:00
math-pixel f7b968abe7 wip mission 2 2026-05-11 16:46:22 +02:00
math-pixel 32d644b09d feat-intro 2026-05-11 11:13:36 +02:00
math-pixel 1b7813a5bb update flow 2026-05-11 11:03:01 +02:00
math-pixel 41f7b2ad19 update step 2026-05-11 10:28:39 +02:00
277 changed files with 36788 additions and 3303 deletions
@@ -0,0 +1,69 @@
name: 🔁 Weekly Branch Promotions
on:
schedule:
- cron: "0 6 * * 1"
workflow_dispatch:
permissions:
contents: read
pull-requests: write
concurrency:
group: weekly-branch-promotions
cancel-in-progress: false
jobs:
open-promotion-pr:
name: Open ${{ matrix.head }} → ${{ matrix.base }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- head: develop
base: design
title: "chore: merge develop into design"
- head: design
base: main
title: "chore: merge design into main"
steps:
- name: ⬇️ Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: 🔁 Open promotion PR
env:
GH_TOKEN: ${{ github.token }}
BASE_BRANCH: ${{ matrix.base }}
HEAD_BRANCH: ${{ matrix.head }}
PR_TITLE: ${{ matrix.title }}
run: |
set -euo pipefail
git fetch origin "$BASE_BRANCH" "$HEAD_BRANCH"
if git merge-base --is-ancestor "origin/$HEAD_BRANCH" "origin/$BASE_BRANCH"; then
echo "No promotion needed: $BASE_BRANCH already contains $HEAD_BRANCH."
exit 0
fi
existing_pr="$(gh pr list \
--state open \
--base "$BASE_BRANCH" \
--head "$GITHUB_REPOSITORY_OWNER:$HEAD_BRANCH" \
--json number \
--jq '.[0].number // empty')"
if [ -n "$existing_pr" ]; then
echo "Promotion PR already open: #$existing_pr."
exit 0
fi
gh pr create \
--base "$BASE_BRANCH" \
--head "$HEAD_BRANCH" \
--title "$PR_TITLE" \
--body "Automated weekly promotion PR from \`$HEAD_BRANCH\` to \`$BASE_BRANCH\`."
+187
View File
@@ -0,0 +1,187 @@
# Game Flow - La Fabrik
## Étapes du jeu
```
intro → start-intro → naming → bienvenue → star-move → mission2 → searching_problem → preparation → outOfFabrik
```
---
## Détail des étapes
### 1. `intro` (initial)
- État initial au chargement du jeu
- Aucune action, juste une étape de départ
- Transition automatique vers `start-intro`
### 2. `start-intro`
- **Déclenchement** : Auto-transition depuis `intro` quand la scène est chargée
- **Action** : Joue l'audio d'intro (`intro`)
- **Attente** : Attend que l'audio se termine
- **Transition** : Vers `naming` quand l'audio se termine
### 3. `naming`
- **Déclenchement** : Quand l'audio d'intro se termine
- **Action** : Affiche un input pour demander le prénom du joueur
- **Attente** : L'utilisateur entre son prénom et valide
- **Transition** : Vers `bienvenue` quand l'utilisateur valide
### 4. `bienvenue`
- **Déclenchement** : Quand l'utilisateur valide son prénom
- **Actions** :
- Affiche "Bienvenue {prénom} !" à l'écran
- Joue l'audio de bienvenue
- **Attente** : Attend que l'audio se termine
- **Transition** : Vers `star-move` quand l'audio se termine
### 5. `star-move`
- **Déclenchement** : Quand l'audio de bienvenue se termine
- **Action** : Active le mouvement du joueur (`setCanMove(true)`)
- **État** : Le joueur peut maintenant se déplacer librement
- **Zone** : La détection de zone devient active (ZoneDetection)
### 6. `mission2`
- **Déclenchement** : Quand le joueur entre dans la zone `fabrikExit` (position: `[-5, 25, -15]`)
- **Actions** :
- Stocke `activityCity: false` dans le store Zustand
- Joue l'audio `alertCentral`
- **État** : Les objets avec hook `useActivityCity()` détectent le changement et jouent leurs animations
- **Attente** : Le joueur atteint la zone de trigger pour `searching_problem`
### 7. `searching_problem`
- **Déclenchement** : Quand le joueur entre dans la zone `searchingProblemZone` (position: `[-5, 25, -30]`)
- **Actions** :
- Joue l'audio `searchingProblem`
- Affiche l'objet "central" (position: `[1, 15, -45]`)
- **Attente** : Le joueur interagit avec l'objet "central"
### 8. `preparation`
- **Déclenchement** : Quand le joueur interagit avec l'objet "central"
- **Actions** :
- Bloque le mouvement (`setCanMove(false)`)
- Cache l'objet "central"
### 9. `outOfFabrik`
- **Déclenchement** : (non implémenté pour le moment)
- **Action** : Transition vers l'étape finale
---
## Fichiers clés
| Fichier | Rôle |
| --------------------------------------- | --------------------------------------------------------- |
| `src/stores/gameStore.ts` | Store Zustand pour l'état global du jeu |
| `src/stateManager/GameStepManager.ts` | Synchronise avec le store Zustand |
| `src/components/game/GameFlow.tsx` | Gère les transitions automatiques et la lecture audio |
| `src/components/ui/IntroUI.tsx` | Affiche l'input pour le prénom et le message de bienvenue |
| `src/components/zone/ZoneDetection.tsx` | Détecte quand le joueur entre dans une zone |
| `src/components/3d/CentralObject.tsx` | Objet interactif "central" pour la mission 2 |
| `src/data/audioConfig.ts` | Chemins des fichiers audio |
| `src/data/zones.ts` | Configuration des zones de transition |
| `src/hooks/useActivityCity.ts` | Hook pour détecter le changement d'activité de la ville |
---
## Configuration audio
```typescript
// src/data/audioConfig.ts
export const AUDIO_PATHS = {
intro: "/sounds/fa.mp3",
bienvenue: "/sounds/fa.mp3",
alertCentral: "/sounds/fa.mp3",
searchingProblem: "/sounds/fa.mp3",
};
```
---
## Configuration des zones
```typescript
// src/data/zones.ts
export const ZONES: Zone[] = [
{
id: "fabrikExit",
position: [-5, 25, -15],
radius: 10,
height: 20,
targetStep: "mission2",
},
{
id: "searchingProblemZone",
position: [-5, 25, -30],
radius: 10,
height: 20,
targetStep: "searching_problem",
},
];
```
---
## Store Zustand
```typescript
// src/stores/gameStore.ts
interface GameState {
step: GameStep;
activityCity: boolean;
playerName: string;
canMove: boolean;
setStep: (step: GameStep) => void;
setActivityCity: (value: boolean) => void;
setPlayerName: (name: string) => void;
setCanMove: (canMove: boolean) => void;
}
```
---
## Hooks personnalisés
### useActivityCity
Permet aux objets 3D de réagir au changement d'activité de la ville :
```typescript
import { useActivityCity } from "@/hooks/useActivityCity";
function MyAnimatedObject() {
const activityCity = useActivityCity(); // true par défaut, false en mission2
// L'animation se déclenche quand activityCity change à false
// Utiliser useEffect pour réagir au changement
}
```
---
## Debug
En mode debug (`?debug` dans l'URL), on peut voir :
- **Game Step** : L'étape actuelle dans le panneau lil-gui
- **Player Position** : Position X, Y, Z du joueur en temps réel
- **Zone Visualization** : Anneaux visuels au sol pour les zones + cylindres transparents
---
## Notes techniques
- Le mouvement du joueur est bloqué tant que `canMove` est `false`
- Le store Zustand (`useGameStore`) est la source principale de vérité
- `GameStepManager` synchronise automatiquement avec le store Zustand lors des transitions
- Les transitions via les zones utilisent `GameStepManager.transitionTo()` qui met à jour le store
- L'audio utilise un callback `onEnded` pour déclencher les transitions automatiques
+187
View File
@@ -0,0 +1,187 @@
# Game Flow - La Fabrik
## Étapes du jeu
```
intro → start-intro → naming → bienvenue → star-move → mission2 → searching_problem → preparation → outOfFabrik
```
---
## Détail des étapes
### 1. `intro` (initial)
- État initial au chargement du jeu
- Aucune action, juste une étape de départ
- Transition automatique vers `start-intro`
### 2. `start-intro`
- **Déclenchement** : Auto-transition depuis `intro` quand la scène est chargée
- **Action** : Joue l'audio d'intro (`intro`)
- **Attente** : Attend que l'audio se termine
- **Transition** : Vers `naming` quand l'audio se termine
### 3. `naming`
- **Déclenchement** : Quand l'audio d'intro se termine
- **Action** : Affiche un input pour demander le prénom du joueur
- **Attente** : L'utilisateur entre son prénom et valide
- **Transition** : Vers `bienvenue` quand l'utilisateur valide
### 4. `bienvenue`
- **Déclenchement** : Quand l'utilisateur valide son prénom
- **Actions** :
- Affiche "Bienvenue {prénom} !" à l'écran
- Joue l'audio de bienvenue
- **Attente** : Attend que l'audio se termine
- **Transition** : Vers `star-move` quand l'audio se termine
### 5. `star-move`
- **Déclenchement** : Quand l'audio de bienvenue se termine
- **Action** : Active le mouvement du joueur (`setCanMove(true)`)
- **État** : Le joueur peut maintenant se déplacer librement
- **Zone** : La détection de zone devient active (ZoneDetection)
### 6. `mission2`
- **Déclenchement** : Quand le joueur entre dans la zone `fabrikExit` (position: `[-5, 25, -15]`)
- **Actions** :
- Stocke `activityCity: false` dans le store Zustand
- Joue l'audio `alertCentral`
- **État** : Les objets avec hook `useActivityCity()` détectent le changement et jouent leurs animations
- **Attente** : Le joueur atteint la zone de trigger pour `searching_problem`
### 7. `searching_problem`
- **Déclenchement** : Quand le joueur entre dans la zone `searchingProblemZone` (position: `[-5, 25, -30]`)
- **Actions** :
- Joue l'audio `searchingProblem`
- Affiche l'objet "central" (position: `[1, 15, -45]`)
- **Attente** : Le joueur interagit avec l'objet "central"
### 8. `preparation`
- **Déclenchement** : Quand le joueur interagit avec l'objet "central"
- **Actions** :
- Bloque le mouvement (`setCanMove(false)`)
- Cache l'objet "central"
### 9. `outOfFabrik`
- **Déclenchement** : (non implémenté pour le moment)
- **Action** : Transition vers l'étape finale
---
## Fichiers clés
| Fichier | Rôle |
| --------------------------------------- | --------------------------------------------------------- |
| `src/stores/gameStore.ts` | Store Zustand pour l'état global du jeu |
| `src/stateManager/GameStepManager.ts` | Synchronise avec le store Zustand |
| `src/components/game/GameFlow.tsx` | Gère les transitions automatiques et la lecture audio |
| `src/components/ui/IntroUI.tsx` | Affiche l'input pour le prénom et le message de bienvenue |
| `src/components/zone/ZoneDetection.tsx` | Détecte quand le joueur entre dans une zone |
| `src/components/3d/CentralObject.tsx` | Objet interactif "central" pour la mission 2 |
| `src/data/audioConfig.ts` | Chemins des fichiers audio |
| `src/data/zones.ts` | Configuration des zones de transition |
| `src/hooks/useActivityCity.ts` | Hook pour détecter le changement d'activité de la ville |
---
## Configuration audio
```typescript
// src/data/audioConfig.ts
export const AUDIO_PATHS = {
intro: "/sounds/fa.mp3",
bienvenue: "/sounds/fa.mp3",
alertCentral: "/sounds/fa.mp3",
searchingProblem: "/sounds/fa.mp3",
};
```
---
## Configuration des zones
```typescript
// src/data/zones.ts
export const ZONES: Zone[] = [
{
id: "fabrikExit",
position: [-5, 25, -15],
radius: 10,
height: 20,
targetStep: "mission2",
},
{
id: "searchingProblemZone",
position: [-5, 25, -30],
radius: 10,
height: 20,
targetStep: "searching_problem",
},
];
```
---
## Store Zustand
```typescript
// src/stores/gameStore.ts
interface GameState {
step: GameStep;
activityCity: boolean;
playerName: string;
canMove: boolean;
setStep: (step: GameStep) => void;
setActivityCity: (value: boolean) => void;
setPlayerName: (name: string) => void;
setCanMove: (canMove: boolean) => void;
}
```
---
## Hooks personnalisés
### useActivityCity
Permet aux objets 3D de réagir au changement d'activité de la ville :
```typescript
import { useActivityCity } from "@/hooks/useActivityCity";
function MyAnimatedObject() {
const activityCity = useActivityCity(); // true par défaut, false en mission2
// L'animation se déclenche quand activityCity change à false
// Utiliser useEffect pour réagir au changement
}
```
---
## Debug
En mode debug (`?debug` dans l'URL), on peut voir :
- **Game Step** : L'étape actuelle dans le panneau lil-gui
- **Player Position** : Position X, Y, Z du joueur en temps réel
- **Zone Visualization** : Anneaux visuels au sol pour les zones + cylindres transparents
---
## Notes techniques
- Le mouvement du joueur est bloqué tant que `canMove` est `false`
- Le store Zustand (`useGameStore`) est la source principale de vérité
- `GameStepManager` synchronise automatiquement avec le store Zustand lors des transitions
- Les transitions via les zones utilisent `GameStepManager.transitionTo()` qui met à jour le store
- L'audio utilise un callback `onEnded` pour déclencher les transitions automatiques
+226
View File
@@ -0,0 +1,226 @@
# Game States & Substates
Documentation technique pour le testing et debugging du flow de jeu.
## Vue d'ensemble
```
intro ──► bike ──► pylone ──► ferme ──► outro
```
---
## Main States
| State | Description |
| -------- | ------------------------------------------------------------------ |
| `intro` | Séquence d'introduction (cinématique, naming, premier déplacement) |
| `bike` | Mission de réparation du vélo |
| `pylone` | Quête du pylone (alert → searching → helped → manipulation) |
| `ferme` | Mission de réparation de la ferme |
| `outro` | Fin du jeu |
---
## Intro (GameStep)
```
┌─────────────────────────────────────────────────────────────┐
│ intro.currentStep │
└─────────────────────────────────────────────────────────────┘
intro ──► sequence_video ──► naming ──► start-move ──► bike
```
### Étapes
| Step | Trigger | Action | Passage vers |
| ---------------- | -------- | ---------------------------------------------- | ------------------------------------------------ |
| `intro` | Initial | État initial | Auto → `sequence_video` quand `sceneReady: true` |
| `sequence_video` | GameFlow | Déclenche la cinématique dans `GameCinematics` | Fin cinématique → `naming` |
| `naming` | IntroUI | Affiche l'input pour le prénom | Submit → `start-move` |
| `start-move` | GameFlow | Active le mouvement (`canMove: true`) | Via zone "fabrikExit" → `bike` |
### Transition vers bike
- **Trigger**: Zone `fabrikExit` dans `zones.ts`
- **Action**: `advanceGameState()` dans `ZoneDetection.tsx`
- **Résultat**: `mainState: "bike"`, `intro.hasCompleted: true`
---
## Bike (MissionStep)
```
┌─────────────────────────────────────────────────────────────┐
│ bike.currentStep (MissionStep) │
└─────────────────────────────────────────────────────────────┘
locked ──► waiting ──► inspected ──► fragmented ──► scanning ──► repairing ──► reassembling ──► done
```
### Transition vers pylone
- **Trigger**: `bike.currentStep: "done"`
- **Action**: `completeBikeState()` dans useGameStore
- **Résultat**: `mainState: "pylone"`, `pylone.currentStep: "locked"`
---
## Pylone (PyloneStep)
```
┌─────────────────────────────────────────────────────────────┐
│ pylone.currentStep (PyloneStep) │
└─────────────────────────────────────────────────────────────┘
locked (bypass) ──► alert ──► searching ──► helped ──► manipulation ──► outro
```
### Étapes
| Step | Trigger | Action | Passage vers |
| -------------- | ---------------------------------- | ---------------------------------- | --------------------------------------------------------- |
| `locked` | Initial (après bike) | État initial | **Bypass automatique**`alert` via `advanceGameState()` |
| `alert` | `advanceGameState()` | Affiche l'alerte (à implémenter) | Via `advanceGameState()` |
| `searching` | `advanceGameState()` | Déclenché par zone "searchingZone" | Via `advanceGameState()` |
| `helped` | Interaction avec `NPCHelper` | Dialogue avec le villageois | Via interaction 3D |
| `manipulation` | Interaction avec `PyloneDestroyed` | Interaction avec l'objet central | Via `advanceGameState()``outro` |
### Bypass automatique
```typescript
// useGameStore.ts - advancePyloneStep()
if (state.pylone.currentStep === "locked") {
return { pylone: { ...state.pylone, currentStep: "alert" } };
}
```
### Transition vers outro
- **Trigger**: `pylone.currentStep: "manipulation"` + `advanceGameState()`
- **Action**: `advancePyloneStep()` détecte fin de la séquence
- **Résultat**: `mainState: "outro"`
---
## Ferme (MissionStep)
```
┌─────────────────────────────────────────────────────────────┐
│ ferme.currentStep (MissionStep) │
└─────────────────────────────────────────────────────────────┘
locked ──► waiting ──► inspected ──► fragmented ──► scanning ──► repairing ──► reassembling ──► done
```
### Transition vers outro
- **Trigger**: `ferme.currentStep: "done"`
- **Action**: `completeFermeState()` dans useGameStore
- **Résultat**: `mainState: "outro"`, `ferme.irrigationFixed: true`
---
## Outro
```
┌─────────────────────────────────────────────────────────────┐
│ outro.hasStarted │
└─────────────────────────────────────────────────────────────┘
waiting ──► started
```
---
## Debug Panel
Le debug panel permet de tester toutes les transitions :
### Utilisation
1. Ouvrir le jeu en mode debug (`Debug: true` dans `Debug.ts`)
2. Le panneau "Game State" apparaît en bas à gauche
3. **Main state**: Sélectionner le state principal
4. **Sub state**: Sélectionner le sub-state
5. **Previous/Next step**: Avancer ou reculer d'un step
6. **Reset**: Remettre à l'état initial
### Raccourcis clavier
| Action | Clavier |
| ------- | ------------------ |
| Avancer | Debug panel button |
| Reculer | Debug panel button |
| Reset | Debug panel button |
---
## Comment tester chaque section
### Tester l'intro
1. Vérifier que `sceneReady: false` au démarrage
2. Attendre que le loader termine (`sceneReady: true`)
3. Vérifier `intro.currentStep: "intro"` → auto vers `sequence_video`
4. Si cinématique fonctionne : `sequence_video``naming`
5. Entrer un prénom : `naming``start-move`
6. Vérifier `canMove: true` après `start-move`
7. Entrer dans la zone `fabrikExit``mainState: "bike"`
### Tester bike
1. Via debug panel, avancer jusqu'à `done`
2. Vérifier `mainState: "pylone"`
### Tester pylone
1. Via debug panel, avancer (bypass `locked``alert`)
2. Vérifier `pylone.currentStep: "alert"`
3. Avancer : `alert``searching``helped``manipulation`
4. Après `manipulation`, vérifier `mainState: "outro"`
### Tester ferme
1. Via debug panel, avancer dans bike jusqu'à `done`
2. Vérifier `mainState: "pylone"``ferme` (après pylone)
3. Avancer jusqu'à `done`
4. Vérifier `mainState: "outro"`
---
## Fichiers clés
| Fichier | Rôle |
| ------------------------------------------------- | ------------------------------------- |
| `src/managers/stores/useGameStore.ts` | Store Zustand avec toutes les actions |
| `src/types/game.ts` | Définition de `GameStep` |
| `src/types/gameplay/pylone.ts` | Définition de `PyloneStep` |
| `src/types/gameplay/repairMission.ts` | Définition de `MissionStep` |
| `src/components/game/GameFlow.tsx` | Logique de transition de l'intro |
| `src/components/zone/ZoneDetection.tsx` | Déclenchement des zones |
| `src/components/ui/debug/GameStateDebugPanel.tsx` | Outil de debug |
---
## État initial
```typescript
{
mainState: "intro",
isCinematicPlaying: false,
sceneReady: false,
missionFlow: {
activityCity: true,
canMove: false,
dialogMessage: null,
playerName: "",
},
intro: { currentStep: "intro", dialogueAudio: null, hasCompleted: false, isBikeUnlocked: false },
bike: { currentStep: "locked", dialogueAudio: null, isRepaired: false },
pylone: { currentStep: "locked", dialogueAudio: null, isPowered: false },
ferme: { currentStep: "locked", dialogueAudio: null, irrigationFixed: false },
outro: { dialogueAudio: null, hasStarted: false },
}
```
+79
View File
@@ -0,0 +1,79 @@
# Mission Flow
This document describes the mission intro and mission 2 prototype flow after it was merged into the current architecture.
## Source Of Truth
Mission flow state lives in the global game store:
```txt
src/managers/stores/useGameStore.ts
```
The store owns the `missionFlow` slice:
```ts
missionFlow: {
step: GameStep;
activityCity: boolean;
playerName: string;
canMove: boolean;
dialogMessage: string | null;
}
```
This keeps global gameplay state in Zustand instead of splitting it across a separate mission store or a gameplay manager.
## Managers Boundary
Managers stay responsible for local runtime services:
- `AudioManager` owns audio elements, audio pools, music playback, category volume, and stereo pan.
- `InteractionManager` owns transient focused/nearby/held interaction handles.
Mission progression is not owned by a manager. Components update the store through explicit actions such as `setFlowStep`, `setCanMove`, `showDialog`, and `hideDialog`.
## Runtime Components
- `src/components/game/GameFlow.tsx` reacts to `missionFlow.step` and triggers one-off side effects such as intro audio and movement unlocks.
- `src/components/zone/ZoneDetection.tsx` reads the camera position and moves the flow to a target step when the player enters a configured zone.
- `src/components/three/interaction/CentralObject.tsx` and `VillageoisHelperObject.tsx` expose temporary interactive mission objects.
- `src/pages/page.tsx` mounts mission HTML overlays: `IntroUI`, `BienvenueDisplay`, and `DialogMessage`.
- `src/world/player/PlayerController.tsx` reads `missionFlow.canMove` as an additional movement lock.
## Step Sequence
The prototype currently uses these steps:
```ts
"intro" |
"start-intro" |
"naming" |
"bienvenue" |
"star-move" |
"mission2" |
"searching" |
"helped" |
"manipulation" |
"outOfFabrik";
```
These steps are mission-flow prototype states. They do not replace `mainState` or the repair mission step machine used by `RepairGame`.
## Zone Configuration
Zone triggers live in:
```txt
src/data/zones.ts
```
Each zone has an id, position, radius, height, and `targetStep`. `ZoneDetection` marks a zone as triggered after the first activation so the same zone does not replay its transition every frame.
## Rules
- Keep mission flow state in `useGameStore.missionFlow`.
- Do not reintroduce `GameStepManager` for global state transitions.
- Do not create a second Zustand store for mission flow unless the state becomes independent from game progression.
- Keep side effects such as audio playback in components or service managers, but keep the state transition itself in the store.
- Keep per-frame values such as camera position and zone distance checks out of Zustand.
+15
View File
@@ -1,6 +1,21 @@
{
"version": 1,
"cinematics": [
{
"id": "intro_sequence",
"trigger": "intro_sequence",
"cameraKeyframes": [
{ "time": 0, "position": [8, 5, 12], "target": [0, 2, 0] },
{ "time": 8, "position": [12, 4, -6], "target": [10, 1.4, -8] },
{ "time": 16, "position": [5, 6, -15], "target": [0, 3, -20] },
{ "time": 24, "position": [0, 8, -30], "target": [0, 0, -40] }
],
"dialogueCues": [
{ "time": 0, "dialogueId": "intro_welcome" },
{ "time": 8, "dialogueId": "intro_explanation" },
{ "time": 16, "dialogueId": "intro_mission" }
]
},
{
"id": "intro_overview",
"timecode": 0,
+33542 -3099
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More