Compare commits
39 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4e6582b543 | |||
| e4ee2d768b | |||
| 5e594c51f7 | |||
| 26ddbebe14 | |||
| 48c2b4f0cd | |||
| cf08062def | |||
| 4f25b33d3b | |||
| 072dec03b4 | |||
| 529c60adae | |||
| 27951d13fd | |||
| cdd919c010 | |||
| cea2856fd0 | |||
| d245d6b460 | |||
| dba7aec6fa | |||
| d376d0ba6b | |||
| 242a3dcd37 | |||
| 225ac828df | |||
| 28f7db172c | |||
| 2063656f29 | |||
| 592cfa405f | |||
| 0a32cd1d21 | |||
| 4516cf4ec6 | |||
| c6f60d1ca7 | |||
| aa35e97cbb | |||
| 57c142c8ef | |||
| 4843bf1d75 | |||
| d02cf29a1d | |||
| 3b4c9c2529 | |||
| fdf03349cf | |||
| 439f9c1dad | |||
| 260bfea716 | |||
| b3a3f3557c | |||
| 621556b38c | |||
| 5c55f2c7f4 | |||
| bb4bccb175 | |||
| ae835e5008 | |||
| 1d3aa1c9f2 | |||
| 23cab2da5e | |||
| 44216f9395 |
@@ -1,59 +1,58 @@
|
||||
name: 🔁 Weekly Branch Promotions
|
||||
name: 🔁 Branch Promotions
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 6 * * 1"
|
||||
- cron: "0 6 * * 1,4" # Lundi et Jeudi à 6h UTC (design → develop)
|
||||
- cron: "0 6 * * 1" # Lundi à 6h UTC (develop → main)
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
promotion:
|
||||
description: "Which promotion to run"
|
||||
required: true
|
||||
type: choice
|
||||
options:
|
||||
- design-to-develop
|
||||
- develop-to-main
|
||||
- both
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
concurrency:
|
||||
group: weekly-branch-promotions
|
||||
group: branch-promotions
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
open-promotion-pr:
|
||||
name: Open ${{ matrix.head }} → ${{ matrix.base }}
|
||||
design-to-develop:
|
||||
name: Open design → develop
|
||||
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"
|
||||
|
||||
if: |
|
||||
(github.event_name == 'schedule') ||
|
||||
(github.event_name == 'workflow_dispatch' && (github.event.inputs.promotion == 'design-to-develop' || github.event.inputs.promotion == 'both'))
|
||||
steps:
|
||||
- name: ⬇️ Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@v4
|
||||
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"
|
||||
git fetch origin develop design
|
||||
|
||||
if git merge-base --is-ancestor "origin/$HEAD_BRANCH" "origin/$BASE_BRANCH"; then
|
||||
echo "No promotion needed: $BASE_BRANCH already contains $HEAD_BRANCH."
|
||||
if git merge-base --is-ancestor origin/design origin/develop; then
|
||||
echo "No promotion needed: develop already contains design."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
existing_pr="$(gh pr list \
|
||||
--state open \
|
||||
--base "$BASE_BRANCH" \
|
||||
--head "$GITHUB_REPOSITORY_OWNER:$HEAD_BRANCH" \
|
||||
--base develop \
|
||||
--head "$GITHUB_REPOSITORY_OWNER:design" \
|
||||
--json number \
|
||||
--jq '.[0].number // empty')"
|
||||
|
||||
@@ -63,7 +62,50 @@ jobs:
|
||||
fi
|
||||
|
||||
gh pr create \
|
||||
--base "$BASE_BRANCH" \
|
||||
--head "$HEAD_BRANCH" \
|
||||
--title "$PR_TITLE" \
|
||||
--body "Automated weekly promotion PR from \`$HEAD_BRANCH\` to \`$BASE_BRANCH\`."
|
||||
--base develop \
|
||||
--head design \
|
||||
--title "chore: merge design into develop" \
|
||||
--body "Automated promotion PR from \`design\` to \`develop\`."
|
||||
|
||||
develop-to-main:
|
||||
name: Open develop → main
|
||||
runs-on: ubuntu-latest
|
||||
if: |
|
||||
(github.event_name == 'schedule' && github.event.schedule == '0 6 * * 1') ||
|
||||
(github.event_name == 'workflow_dispatch' && (github.event.inputs.promotion == 'develop-to-main' || github.event.inputs.promotion == 'both'))
|
||||
steps:
|
||||
- name: ⬇️ Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: 🔁 Open promotion PR
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
git fetch origin main develop
|
||||
|
||||
if git merge-base --is-ancestor origin/develop origin/main; then
|
||||
echo "No promotion needed: main already contains develop."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
existing_pr="$(gh pr list \
|
||||
--state open \
|
||||
--base main \
|
||||
--head "$GITHUB_REPOSITORY_OWNER:develop" \
|
||||
--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 main \
|
||||
--head develop \
|
||||
--title "chore: merge develop into main" \
|
||||
--body "Automated weekly promotion PR from \`develop\` to \`main\`."
|
||||
|
||||
@@ -143,6 +143,7 @@ WS ws://localhost:8000/ws
|
||||
| `docs/technical/hand-tracking.md` | Webcam, backend/browser MediaPipe, glove, and gesture flow |
|
||||
| `docs/technical/zustand.md` | Game, settings, and subtitle stores |
|
||||
| `docs/technical/three-debugging.md` | DevTools workflow for stepping into Three.js internals |
|
||||
| `docs/technical/map-performance.md` | Map draw-call bottlenecks and optimization notes |
|
||||
| `docs/technical/editor.md` | Editor implementation details |
|
||||
| `docs/technical/animation.md` | Animated, explodable, and reusable 3D model components |
|
||||
| `docs/user/features.md` | Implemented feature inventory |
|
||||
|
||||
@@ -1,226 +0,0 @@
|
||||
# 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 },
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,187 @@
|
||||
# Map Performance Notes
|
||||
|
||||
This document tracks the current map-rendering performance pass.
|
||||
|
||||
## Current Runtime Path
|
||||
|
||||
- `public/map.json` is the source of map transforms.
|
||||
- `src/world/GameMap.tsx` renders regular visual map nodes.
|
||||
- `src/world/vegetation/VegetationSystem.tsx` already instances dense vegetation.
|
||||
- `src/world/map-instancing/MapInstancingSystem.tsx` instances selected repeated static map assets.
|
||||
- `src/world/GameMapCollision.tsx` keeps terrain collision separate for the player octree.
|
||||
|
||||
## Draw-Call Bottlenecks Found
|
||||
|
||||
The first performance bottleneck was draw calls. Some assets were exported as many small GLTF primitives even when they used only a few materials.
|
||||
|
||||
| Model | Instances | Meshes / primitives | Notes |
|
||||
| ---------------- | --------: | ------------------: | ---------------------------------------------------------------- |
|
||||
| `generateur` | 3 | 3152 | Worst draw-call offender. Needs asset-side mesh merging. |
|
||||
| `lafabrik` | 4 | 56 | Moderate draw calls, heavy 2048 texture set. |
|
||||
| `ecole` | 1 | 107 | One material but many primitives; should be merged. |
|
||||
| `fermeverticale` | 3 | 1 | Geometry is fine; textures are large for the visible complexity. |
|
||||
|
||||
`generateur` was especially expensive because three visible instances could multiply thousands of primitives into thousands of draw calls. Instancing reduces repeated instance cost, but the source asset still needs a cleaner export.
|
||||
|
||||
## Runtime Merge Pass
|
||||
|
||||
`InstancedMapAsset` now groups source meshes by material and compatible geometry attributes before creating `THREE.InstancedMesh` objects. This reduces the runtime draw groups even when the source GLTF is exported as many small meshes.
|
||||
|
||||
Estimated source primitive count versus runtime merged groups:
|
||||
|
||||
| Model | Source primitives | Runtime merged groups |
|
||||
| ------------ | ----------------: | --------------------: |
|
||||
| `generateur` | 3152 | 8 |
|
||||
| `ecole` | 107 | 2 |
|
||||
| `eolienne` | 118 | 8 |
|
||||
| `lafabrik` | 56 | 14 |
|
||||
|
||||
This is a code-side safety net, not a replacement for clean asset exports. Clean GLB exports with merged meshes and fewer textures remain the preferred long-term path.
|
||||
|
||||
## Current Triangle Bottleneck
|
||||
|
||||
After the runtime merge pass, draw calls can drop dramatically, but FPS can still stay low because the scene now remains triangle-bound. A debug capture after the merge showed roughly:
|
||||
|
||||
```txt
|
||||
138 draw calls
|
||||
~69.6M triangles
|
||||
~10 FPS
|
||||
```
|
||||
|
||||
That means the renderer is no longer mostly blocked by draw-call submission. It is mostly drawing too many visible triangles.
|
||||
|
||||
Estimated triangle contribution from `map.json` instance counts:
|
||||
|
||||
| Model | Instances | Triangles each | Estimated total triangles |
|
||||
| ------------------- | --------: | -------------: | ------------------------: |
|
||||
| `buisson` | 646 | 37 500 | ~24.2M |
|
||||
| `champdesoja` | 1181 | 16 268 | ~19.2M |
|
||||
| `arbre` | 291 | 38 906 | ~11.3M |
|
||||
| `champdeble` | 1307 | 6 260 | ~8.2M |
|
||||
| `champsdetournesol` | 1163 | 3 264 | ~3.8M |
|
||||
| `sapin` | 93 | 23 972 | ~2.2M |
|
||||
|
||||
These vegetation and crop assets account for almost all of the current `~69M` triangle count. By comparison, the previously suspicious static buildings are much smaller in triangle cost:
|
||||
|
||||
| Model | Estimated total triangles |
|
||||
| ---------------- | ------------------------: |
|
||||
| `generateur` | ~123k |
|
||||
| `lafabrik` | ~124k |
|
||||
| `ecole` | ~5k |
|
||||
| `fermeverticale` | ~1k |
|
||||
|
||||
`InstancedMesh` reduces draw calls, but it does not reduce triangle count. If 646 bushes each contain 37 500 triangles, the GPU still has to draw about 24 million bush triangles when those instances are visible.
|
||||
|
||||
## Debug Performance Controls
|
||||
|
||||
The next useful runtime tool is a debug-only performance folder that can isolate model families. This should be mounted only when `?debug` is enabled.
|
||||
|
||||
Proposed controls:
|
||||
|
||||
```txt
|
||||
Performance / Map
|
||||
- vegetation
|
||||
- crops
|
||||
- trees
|
||||
- buildings
|
||||
- landmarks
|
||||
- props
|
||||
- terrain
|
||||
- sky
|
||||
```
|
||||
|
||||
Useful per-model toggles:
|
||||
|
||||
```txt
|
||||
buisson
|
||||
arbre
|
||||
sapin
|
||||
champdeble
|
||||
champdesoja
|
||||
champsdetournesol
|
||||
fermeverticale
|
||||
lafabrik
|
||||
immeuble1
|
||||
eolienne
|
||||
pylone
|
||||
```
|
||||
|
||||
The purpose is diagnostic, not final gameplay behavior. The expected workflow is:
|
||||
|
||||
1. Open `/?debug` with R3F perf enabled.
|
||||
2. Disable one family or model type.
|
||||
3. Watch `triangles`, `calls`, and FPS.
|
||||
4. Identify which model groups need LOD, density reduction, or asset re-export.
|
||||
|
||||
Recommended implementation files:
|
||||
|
||||
```txt
|
||||
src/managers/stores/useMapPerformanceStore.ts
|
||||
src/hooks/debug/useMapPerformanceDebug.ts
|
||||
src/world/vegetation/VegetationSystem.tsx
|
||||
src/world/map-instancing/MapInstancingSystem.tsx
|
||||
src/world/GameMap.tsx
|
||||
```
|
||||
|
||||
The store should stay runtime/debug-only. It should not change persisted production map data.
|
||||
|
||||
## Triangle-Reduction Follow-Up
|
||||
|
||||
Once the expensive model families are isolated, the real triangle fixes are:
|
||||
|
||||
1. Lower-poly vegetation and crop exports.
|
||||
2. LOD variants for trees, bushes, and crop fields.
|
||||
3. Distance-based culling for vegetation/crop instances.
|
||||
4. Chunked instancing so Three.js can frustum-cull groups instead of one huge global `InstancedMesh`.
|
||||
5. Billboard/impostor versions for far vegetation.
|
||||
|
||||
Chunked instancing is especially important. A single `InstancedMesh` containing every bush has one global bounding sphere. If that bounding sphere is visible, Three.js may keep the whole batch visible. Splitting instances into grid chunks allows entire offscreen chunks to be skipped.
|
||||
|
||||
## Current Code-Side Optimization
|
||||
|
||||
Repeated static assets are configured in:
|
||||
|
||||
```txt
|
||||
src/world/map-instancing/mapInstancingConfig.ts
|
||||
```
|
||||
|
||||
Those names are excluded from the regular `GameMap` clone path, then rendered by `MapInstancingSystem` with merged `THREE.InstancedMesh` batches.
|
||||
|
||||
This keeps the existing map authoring format while reducing repeated draw calls for selected assets.
|
||||
|
||||
## Generated R3F Model Path
|
||||
|
||||
Unique static map assets can use explicit R3F components instead of the generic cloned GLTF path. This follows the same intent as `gltfjsx`: expose the model as a React component, then keep control over mesh/material setup in code.
|
||||
|
||||
Current generated map-model entry point:
|
||||
|
||||
```txt
|
||||
src/world/map-generated/GeneratedMapNodeInstance.tsx
|
||||
```
|
||||
|
||||
Current generated model component:
|
||||
|
||||
```txt
|
||||
src/components/three/models/generated/EcoleModel.tsx
|
||||
```
|
||||
|
||||
`ecole` is a safe first candidate because it appears once in `map.json`, has one material, and does not participate in player collision or repair gameplay. Its source GLTF has 107 primitives, so the generated component also merges compatible geometry groups before mounting the meshes.
|
||||
|
||||
This path should be used selectively. It improves control and can remove clone overhead, but it does not reduce source triangle count by itself.
|
||||
|
||||
## Asset-Side Follow-Up
|
||||
|
||||
Design/export should prioritize:
|
||||
|
||||
1. Produce lower-poly `buisson`, `arbre`, `sapin`, and crop assets.
|
||||
2. Add LOD or billboard variants for far vegetation.
|
||||
3. Merge `generateur` meshes from 3152 primitives to a small number of material groups.
|
||||
4. Reduce `lafabrik` texture count and downscale flat/low-detail maps.
|
||||
5. Merge `ecole` primitives because it uses a single material.
|
||||
6. Prefer runtime `.glb` or compressed runtime textures when the pipeline supports it.
|
||||
|
||||
## Safety Rules
|
||||
|
||||
- Do not instance `terrain` for player collision without validating `Octree.fromGraphNode` support.
|
||||
- Do not replace repair-game models with optimized map models unless repair node names are preserved.
|
||||
- Dispose only GPU resources created locally. Do not dispose textures or geometries owned by `useGLTF`'s cache.
|
||||
+1
-1
@@ -7,7 +7,7 @@ import tseslint from "typescript-eslint";
|
||||
import { defineConfig, globalIgnores } from "eslint/config";
|
||||
|
||||
export default defineConfig([
|
||||
globalIgnores(["dist"]),
|
||||
globalIgnores(["dist", "POC-grass"]),
|
||||
{
|
||||
files: ["**/*.{ts,tsx}"],
|
||||
extends: [
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,21 +1,6 @@
|
||||
{
|
||||
"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,
|
||||
|
||||
+40800
-35030
File diff suppressed because it is too large
Load Diff
+35051
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.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user