Student: Yiwei Yu
Course: Game Data Analysis
Unity Project: Data_Visualization_proj/
- Open Unity project:
Delivery 3/Data_Visualization_proj/ - Wait for Unity to compile scripts
- Open the Analytics Dashboard:
Window > Game Analytics > Visualization Dashboard - Click "Test Connection" to verify backend connectivity
- Open
ExampleScene.unity(already configured) - Press Play
- Play for 2-5 minutes (explore, die, collect items)
- Data automatically exports to MySQL in real-time
- Exit Play mode
- In Analytics Dashboard, select a session from dropdown
- Click "Load Session"
- Choose a preset (e.g., "Death Hotspots")
- Switch to Scene View to see visualizations
This project implements a complete analytics pipeline for Unity's 3D Game Kit Lite:
Data Pipeline: Unity Runtime → PHP Backend → MySQL Database → Unity Editor Visualization
-
Database: UPC Server (
citmalumnes.upc.es) -
Schema:
yiweiy -
Tables: 5 normalized tables with
delivery3_prefixdelivery3_sessions- Gameplay sessionsdelivery3_player_positions- Movement tracking (2 Hz sampling)delivery3_death_events- Player/enemy deathsdelivery3_pickup_events- Item collectiondelivery3_combat_events- Damage tracking
-
PHP Endpoints: Hosted at
https://citmalumnes.upc.es/~yiweiy/delivery3_backend/receive_analytics.php- Real-time data ingestionget_sessions.php- Session list retrievalget_session_data.php- Full session data export
Interactive Scene View Overlays:
- Heatmap - 3D grid-based density visualization (blue = low, red = high)
- Movement Paths - Player trajectory with direction arrows
- Death Markers - Red/orange pillars showing death locations with labels
- Pickup Markers - Green cubes for item collection events
- Combat Markers - Yellow rings for damage events
Customization Controls:
- Grid size adjustment (0.5m - 10m)
- Time range filtering (analyze specific gameplay segments)
- Event type toggles (deaths, pickups, combat)
- Color palette customization
- Layer visibility controls
Presentation Presets:
- Death Hotspots - Difficulty spike analysis
- Exploration Patterns - Movement heatmap + paths
- Combat Analysis - Combat + death correlation
- First 2 Minutes - Onboarding effectiveness
- Complete Overview - All layers enabled
Keyboard Shortcuts:
H- Toggle HeatmapP- Toggle PathsD- Toggle DeathsK- Toggle PickupsC- Toggle CombatA- Apply/Refresh VisualizationX- Clear AllR- Reset Time Range
Non-Intrusive Design: Zero modifications to 3D Game Kit source code. Analytics collected via event subscription pattern.
Real-Time Export: Position samples batched (20 at a time) and sent asynchronously during gameplay. Fire-and-forget pattern ensures no performance impact.
Scalable Architecture: Normalized MySQL schema with foreign keys, indexes, and CASCADE DELETE. Tested with 1000+ position samples per session.
Editor Integration: Custom EditorWindow, SceneView hooks, persistent settings via ScriptableObject, coroutine-based async HTTP requests.
Delivery 3/
├── Data_Visualization_proj/ # Unity project (OPEN THIS)
│ └── Assets/Analytics/ # Custom analytics system
├── Backend/ # PHP scripts (uploaded to UPC)
│ ├── config.php
│ ├── receive_analytics.php
│ ├── get_sessions.php
│ └── get_session_data.php
├── Database/
│ └── schema_upc.sql # Database schema
└── README.md # This file
"Connection Failed" Error:
- Verify PHP files uploaded to UPC server
- Check
config.phphas correct credentials (schema:yiweiy) - Test endpoint:
https://citmalumnes.upc.es/~yiweiy/delivery3_backend/test_connection.php
Visualizations Not Appearing:
- Ensure you're in Scene View (not Game View)
- Click "Apply Visualization" button
- Check session has data (positions count > 0)
- Verify time range filter includes data
No Sessions in Dropdown:
- Generate demo data by playing the game
- Click "Refresh Sessions" button
- Check MySQL tables have data:
SELECT * FROM delivery3_sessions;