16 Commits

Author SHA1 Message Date
32becc12f9 feat: free-roam mode + fix multiplayer sync + remote player polish
Backend (ArenaRoom.js):
- Strip race state machine (lobby/countdown/playing/round/qualify). Persistent
  "playing" phase, no rounds, no checkpoints. Free-roam multi.
- Spawn lowered to y=1.5 (was 5) + MIN_DIST raised to 5 (was 3) to avoid
  ejecting overlapping players at connect.
- Schema kept intact (handshake-safe); deprecated fields default-valued.
- npm run schema:gen wired (anti-drift codegen).

Unity client:
- C# schema generated by schema-codegen into RolldSchema namespace
  (Generated/GameState.cs, Generated/Player.cs). NetworkSchema.cs removed —
  handshake no longer scans global namespace.
- NetworkManager: typed Room<GameState>, callbacks rebound, seeds players
  already in room on join.
- RemotePlayerController:
  * Post-spawn 1.5s grace window (BumpReady) — local PlayerController.HandleBump
    ignores remotes during grace.
  * Solid SphereCollider disabled during grace, re-enabled afterwards — fixes
    the kinematic-vs-dynamic eject when a new client spawns inside someone.
  * NPCBall prefab material switched from invisible-in-URP Default-Material to
    BallShader.shadergraph.
  * TrailRenderer added, tinted with player's chosen color.
  * Name label distance-scales (1x-8x) so pseudos remain readable far away.
- GameHUD: OnGUI emptied — race UI (rounds, mode, timer, playersAlive) gone.
- GameCanvas.jsx: BUILD_PREFIX/VERSION bumped for cache-bust.

Frontend WebGL build (pretty_build): final build with all the above.
2026-05-20 12:25:48 +02:00
ec05fb8ddd build: WebGL last_build 20260518 + fix NetworkManager MapSchema iteration
- New WebGL build (data +6MB, wasm +92KB) with all bug fixes
- Fix MapSchema foreach: iterate via .Keys with explicit casts
- Fix sbyte->int cast for playersAlive Listen callback
- Updated Tutorial.unity scene

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 08:58:37 +02:00
a4792759e6 fix: CameraOrbitKeyboard + playersAlive HUD
- CameraOrbitKeyboard: clic droit = unlock, clic gauche = re-lock (coherent avec PlayerController)
- CameraOrbitKeyboard: bloque les inputs quand ChatUI est ouvert
- CameraOrbitKeyboard: OnEnable ne verrouille plus la souris si un panel UI est ouvert
- NetworkManager: alimente GameHUD.SetPlayersAlive via Listen(playersAlive)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 08:25:25 +02:00
e2fa2ba8a9 fix: chat input isolation, mouse lock, multi spawn
- PlayerController: block WASD/jump callbacks when ChatUI is open
- PlayerController: clic droit = unlock souris, clic gauche = re-lock (n'est plus un toggle)
- PlayerController: ajoute ResetInputs() appelé à l'ouverture du chat
- ChatUI: appelle ResetInputs() quand le panel s'ouvre pour éviter les touches collées
- NetworkManager: seed les joueurs déjà présents dans la room à la connexion
  (les OnAdd Colyseus peuvent être manqués si l'état est décodé avant l'enregistrement des callbacks)
- NetworkManager: garde anti-doublon dans OnPlayerAdd
- NetworkManager: fallback sphere si remotePlayerPrefab est null

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 08:22:40 +02:00
aa27725c4e feat: nouveau build WebGL last_build + fixes stats et schema Colyseus
- Unity build last_build remplace build_mai
- NetworkSchema.cs: correction types sbyte pour int8 (fix OverflowException Colyseus)
- StatsTracker: envoi periodique toutes les 30s, plus de dependance aux round events
- StatsTracker: cooldown client 6s pour respecter le rate-limit serveur
- StatsPage: correction row.value au lieu de row[activeTab]
- StatsPage: suppression onglet Courses (racesPlayed)
- Backend index.js: logging POST /stats/update
- Scene Tutorial: mise a jour, suppression assets obsoletes (TutorialInfo, physicMaterials)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 00:12:14 +02:00
391c000a73 feat: systeme de lobby avec liste de rooms
Backend:
- GET /rooms via matchMaker.query() pour lister les salles actives
- ArenaRoom: setMetadata avec nom de salle (Salle #<id6>)

NetworkManager:
- FetchRooms() / OnRoomsRefreshed event (UnityWebRequest GET /rooms)
- JoinByRoomId(), CreateRoom() en plus de JoinArena()
- Refactoring: PrepareJoin/FinishJoin/HandleJoinError pour eviter duplication

LobbyUI:
- Redesign: panel 620x520 avec setup perso (gauche) + liste rooms (droite)
- Bouton Rejoindre par salle, Creer une salle, Rejoindre n importe
- Pseudo pre-rempli depuis PlayerPrefs
- Refresh automatique toutes les 4s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 22:14:27 +02:00
385b4f690e fix: stats jamais envoyees - OnDisconnected avant Cleanup + cache du nom joueur
NetworkManager: inverser ordre OnDisconnected/Cleanup pour que les listeners
aient encore acces a LocalPlayerName au moment du callback.

StatsTracker: mettre en cache le nom a la connexion comme fallback supplementaire.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 21:55:01 +02:00
7327f073d8 fix: remapper F1/F2/F3 -> backtick/Tab/T pour compatibilite WebGL navigateur
- DebugNetworkUI: F1 -> backtick (`)
- KeyBindingUI: F2 -> Tab
- ChatUI: F3 -> T (ouvrir seulement), Escape pour fermer

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 20:53:07 +02:00
b993c6b3e6 fix: chat PlayerName fallback + nouveau build WebGL 20260517b
- ChatUI: PlayerName utilise PlayerPrefs comme fallback si non connecte
- NetworkManager: sauvegarde le nom dans PlayerPrefs a la connexion
- GameCanvas: version build bump -> 20260517b (cache bust)
- Nouveaux fichiers build_mai (data + wasm mis a jour)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 20:21:00 +02:00
5c98f1638a feat: stats + chat + frontend pages (Stats, Chat, NavBar)
Backend:
- StatsManager.js: JSON persistence, leaderboard, rate-limit 1/5s
- ChatManager.js: 200-msg buffer, JSON persistence
- index.js: routes GET/POST /stats, /chat/history, /chat/send (Zod validation)
- ArenaRoom.js: chat handler broadcasts to room + persists via ChatManager

Unity:
- StatsTracker.cs: distance, maxSpeed, jumps, bumps, checkpoints, raceTime tracking
- ChatUI.cs: F3 toggle, bottom-right panel, polling 3s, unread badge
- NetworkManager.cs: SendChatMessage() + OnMessage<ChatUI.ChatMessage>(chat)
- CheckpointSystem.cs: RegisterCheckpoint/Finish hooks
- PlayerController.cs: RegisterJump/Bump hooks, physics rebalance, billboard fix
- GameHUD.cs: LocalRaceTimer, SetTotalRounds, OnRoundStart signature fix
- GameManager.cs: spectator cam reconnect fix

Frontend:
- NavBar.jsx: fixed top nav, Accueil/Stats/Chat/Jouer
- App.jsx: page state (home/play/stats/chat) + NavBar
- StatsPage.jsx: 6-tab leaderboard, auto-refresh 30s
- ChatPage.jsx: polling 3s, localStorage name, Enter to send

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 18:33:06 +02:00
526d30c569 Fix physique boule (moins de drag) + billboard name tags vers caméra
- turnDamping 7→1.5, idleDrag 3→0.2 : comportement boule plus naturel
- Fix billboard : LookRotation inversé (texte faisant face à la caméra, pas dos)
  s'applique aux labels local (PlayerController) et remote (RemotePlayerController)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 16:47:13 +02:00
4743c307a6 Supprime les mini-jeux (survival/teams), corrige tous les bugs identifiés
- Supprime DeathZone.cs, ZoneCapture.cs, ArenaZoneBuilder.cs
- ArenaRoom.js : mode race uniquement, fix _checkRoundEndCondition, fix _getActiveCount
- GameState.js : supprime team (Player) et deathZoneY/teamScoreRed/teamScoreBlue (GameState)
- NetworkSchema.cs : aligne sur le nouveau schéma serveur (supprime team, indices corrigés)
- NetworkManager.cs : supprime OnDeathZoneYChanged/SendDeathZoneHit/SendInZone, OnRoundStart passe totalRounds
- GameManager.cs : subscriptions OnEnable→Start/OnDestroy, fix Lobby (player visible si connecté), HandleRoundStart(totalRounds)
- GameHUD.cs : supprime blocs survival/teams, ajoute SetTotalRounds, supprime dead code
- PlayerController.cs : cache Rigidbody, fix OnCollisionStay gel (supprime else), SetSpawnPosition
- CheckpointSystem.cs : flash le prochain checkpoint actif, supprime FinishFlash vide
- LobbyUI.cs : CancelInvoke sur connexion, appelle SetSpawnPosition

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 16:28:37 +02:00
456d876847 Fix: NetworkSchema — supprimer userId fantome, corriger ordre isReady
userId [Type(0)] inexistant cote serveur decalait tous les champs d un
cran : x recevait y, y recevait z, positions et rotations toutes fausses.
isReady etait en [Type(23)] alors que le serveur l envoie en index 20.
Les deux bugs cassaient toute la synchronisation reseau multi.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 15:21:06 +02:00
a022d59917 fix: URL serveur wss://game.rolld.kerboul.me (rolld.io:2567 inaccessible)
rolld.io pointe sur CloudFront sans exposer le port 2567.
Le game server Coolify est accessible via game.rolld.kerboul.me (Traefik).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 11:58:35 +02:00
1e37e44143 feat: backend state machine, Unity URL prod, simplify GameSetup 2026-05-15 09:16:01 +02:00
c322793b0d feat: add Unity project (Assets, ProjectSettings) 2026-05-15 09:13:39 +02:00