How anhkhoa-ledinh/protected-m works
Protected M is a glasses-free, head-coupled 3D bug-hunt game, with HCPD also usable as a standalone display engine. Players sign in, select a level and photo, bake depth layers, equip a loadout, then hunt depth-occluded bugs using webcam head tracking and mouse shots. The graph preserves photo processing, tracking/projection, gameplay, UI, shared-album, and online PvP/server capabilities. Relationships are grounded mainly in the README and indexed references; unsampled implementation details are not inferred.
Main entry points: app.py Game orchestrator · tracking_worker.py Tracking worker · depth_worker.py Bake worker · client.py PvP client
Components 29
Application and UI
- Application entry
main.py - Game orchestrator
src/engine/app.py - UI routing
src/ui_album/v3_routes.py - UI flow state
src/ui_album/v3_flow.py
Tracking and display
- Webcam capture
src/camera/capture.py - Tracking worker
src/engine/tracking_worker.py - Head pose solve
src/pose/head_pose.py - Face calibration
src/pose/calibration.py - Pose filtering
src/filters/pipeline.py - Pose distribution
src/engine/pose_bus.py - Webcam preview
src/renderer/webcam_preview.py
Photo and scene content
- Photo input
src/content/image_source.py - Bake worker
src/content/depth_worker.py - Depth estimation
src/content/depth_estimator.py - Layer and fill processing
src/content - Baked scene content
src/content/persistence.py - Shared photo album
src/content/shared_album.py
Gameplay
- Hidden bug placement
src/content/prop_game.py - Match rules and state
src/game/match.py - Level definitions
src/game/levels.py - 3D scene rendering
src/renderer/renderer.py
Accounts and online
- Local accounts
src/account/service.py - Shared account rules
src/shared/account_rules.py - PvP client
src/net/client.py - Network protocol
src/net/protocol.py - Central server
src/server/app.py - Server request handlers
src/server/handlers.py - Server data store
src/server/store.py
Other components
- Player
Connections 31
- Player → Application entry: starts game
- Application entry → Game orchestrator: launches
main.py - Game orchestrator → UI routing: handles UI actions
src/engine/app.py - UI routing → UI flow state: updates screen state
src/ui_album/v3_routes.py - Player → Game orchestrator: chooses photo and acts
- Game orchestrator → Webcam capture: starts capture
src/engine/app.py - Tracking worker → Webcam capture: reads frames
src/engine/tracking_worker.py - Tracking worker → Head pose solve: solves pose
src/engine/tracking_worker.py - Head pose solve → Face calibration: uses scale calibration
src/pose/head_pose.py - Tracking worker → Pose filtering: filters pose
src/engine/tracking_worker.py - Tracking worker → Pose distribution: publishes pose
src/engine/tracking_worker.py - Tracking worker → Webcam preview: provides preview
src/engine/tracking_worker.py - Game orchestrator → Bake worker: starts photo bake
src/engine/app.py - Bake worker → Depth estimation: estimates depth
src/content/depth_worker.py - Bake worker → Layer and fill processing: builds depth layers
src/content/depth_worker.py - Bake worker → Baked scene content: caches baked result
- Game orchestrator → Shared photo album: requests album photos
src/engine/app.py - Shared photo album → Photo input: supplies photo
src/content/shared_album.py - Game orchestrator → Hidden bug placement: creates hidden bugs
src/engine/app.py - Hidden bug placement → Level definitions: uses level settings
src/content/prop_game.py - Game orchestrator → Match rules and state: updates match
src/engine/app.py - Match rules and state → Level definitions: uses level rules
src/game/match.py - Game orchestrator → 3D scene rendering: renders 3D hunt
- Player → Local accounts: signs in
- Local accounts → Shared account rules: applies account rules
src/account/service.py - Game orchestrator → PvP client: uses PvP services
src/engine/app.py - PvP client → Network protocol: encodes messages
src/net/client.py - PvP client → Central server: exchanges requests
- Central server → Server request handlers: dispatches requests
src/server/app.py - Server request handlers → Server data store: reads and writes
src/server/handlers.py - Central server → Network protocol: frames messages
src/server/app.py