2026 · work
MetaForest Unity ClientUnity · Photon · Agora
A Unity 6 remake of the client, run side by side on PC and mobile in the same room
Context
A live metaverse counseling client in Unity. Voice runs on Agora, room sync on Photon, source control on Plastic SCM.
Voice outages: the symptom was not the cause
- Symptom: Voice cut out for 30 seconds, six times in 31 minutes.
- First suspect: Agora. But the logs showed that on every momentary Photon disconnect (PlayerTtl=0),
OnPlayerLeftRoomcalledLeaveChannelimmediately. A one-second blip was amplified into a 30-second outage. - Fix: Not a different disconnect source but a debounce: a 45-second grace on the leave decision, keeping the channel if the player returns. Compiled and verified; device verification precedes the merge.
Agora cost: occupancy gating
The voice channel now stays open only with two or more people, removing charges for rooms where someone sat alone. The duplicate-session issue turned out to be a backend webhook race, not the client, and was fixed there.
Also
- A transcript-summary feature that was unused but still riding along in builds was removed.
- Speaker indicators froze with five or more participants because Agora reports only the top three speakers. Fixed.
Security, cleaned up on the same branch
Security items left in the client were cleaned up on one branch. Secrets that rode along verbatim in diagnostic logs are now masked rather than silenced, so the diagnostics that root-caused the August outage stay available. The paths that let secrets ship inside build output were removed, with a server-side path left for re-enabling. Dead code that would have pointed a production build at the wrong place if revived was deleted.
The individual items are not written up here, because they still connect to app versions installed on users’ devices.
Unity 6 remake (Nov 2025 –)
Moving five years of code into a new repository meant a lot of code to read, so I put AI agents on the repetitive parts: reading the old code, clearing unused features, swapping libraries. Results were checked with builds and on real devices, and the remade client shipped to production.
A new repository for the Unity 6 client. My check-ins by month: November Photon swap, OpenCV/Dlib removed for MediaPipe face tracking, animal characters. December lighting rebuilds for eight counseling scenes, SKT plugin removal, the 3.1.6 production release. January Sentry, webview, a MediaPipe upgrade, the start of Android 16 KB page-alignment work, urgent optimization with Cursor. February quick-counsel deep links, automatic Photon region selection, Android video-chat audio fix. March 16 KB alignment solved, face zoom, an NPOT-to-POT converter. April Unity 6000.3.10 → 3.12, voice moved fully to Agora, chat UI rework. May the 3.3.3 hotfix and voice filters. June occupancy gating, speakerphone routing, auto-reconnect. Debounce details: the grace period went from 15 s to 45 s after measuring outages of 29–38 s per event, which decomposed into time away plus 5–8 s of voice rejoin.