Introduction
This week, I focused on developing a server-authoritative XP system to support our game’s progression mechanics. The system includes:
- A networked XP counter with scaling level thresholds
- A global UI slider visible to all players
- Foundation for future stat-selection mechanics
I ensured this system aligns with our core gameplay loop of combat → rewards → character growth.
Design Rationale
The system was designed to:
- Maintain Performance: Uses Photon Fusion’s [Networked] properties for efficiency.
- Sync Across All Players: Server-managed values prevent cheating or desynchronization.
- Scale with Progression: Level-up thresholds increase by 100 XP per level.
- Support Future Features: Built to integrate with unassigned stat upgrades (design placeholder).
Implementation
1. Server-Managed XP Slider (Client-Side UI)
Key Features:
- Automatic reference to the networked XP_System
- Real-time UI updates via Update()
- TextMeshPro for crisp text rendering
2. Networked XP Logic (Server-Authoritative)
Key Features:
- Network-safe value modification (StateAuthority only)
- Event-driven XP allocation via onEnemyKilled
- Linear threshold scaling for predictable progression
Collaborative Challenges
Provided test build with debug XP gain shortcuts
UI Synchronization:
- Initial client-side slider jitter resolved with Networked properties
Event System Refinement:
- Created custom onEnemyKilled event to avoid GameObject searches
- Worked with combat programmer to standardize XP values per enemy type
Design Coordination:
- Documented API for future stat-selection UI integration
Reflection
What Worked Well
- Networked properties simplified state synchronization
- Linear XP scaling provided clear progression pacing
- Decoupled UI system allows easy art replacement
Areas for Improvement
- Level-up events lack visual/audio feedback (placeholder only)
- Current UI doesn’t show “XP to next level” numerically
Next Steps
Player Feedback:
- Add particle effects on XP gain (collaborate with VFX team)
- Implement “level up” sound
Stat Selection System:
- Develop upgrade menu interface
- Create [Networked] stat modifiers (attack speed, health, etc.)
References
- Photon Engine. (2025). Fusion 2 Introduction. Retrieved May 2, 2025, from https://doc.photonengine.com/fusion/current/fusion-intro
- Unity Technologies. (2025). Unity Engine. Retrieved May 2, 2025, from https://unity.com/products/unity-engine
- ShareX. (2025). Free and Open Source Screenshot Tool for Windows. Retrieved May 2, 2025, from https://getsharex.com
- Imgur. (2025). Online Image Sharing and Hosting Service. Retrieved May 2, 2025, from https://imgur.com
