Connected Games Blog – Week 2: Implementing Roguelike Foundations

Project Pivot: Transitioning to Roguelike Mechanics

This week, our team shifted focus to a roguelike game design where players battle monsters, collect loot, and face a final boss. While this change required rapid adaptation, I prioritized building core systems to support scalability and networked gameplay. Below is my progress on foundational health mechanics and player feedback systems.

Player Health System

To enable combat and progression, I developed a networked Health script. This system synchronizes health values across all players, updates a UI health bar in real time, and handles damage events. The script also includes a Downed() method to track player defeat, which will later trigger respawn or game-over logic.

Above is the core implementation of the Health script:

Health Manager for Scalability

To support multiple players and ensure synchronized UI across clients, I created the HPManager class. This system dynamically spawns health bars for each player, positions them cleanly on-screen, and updates them when damage is taken. The manager uses Fusion’s networking to maintain consistency between all clients.

Above is the core implementation of the HPManager script:

Design Thinking

Why These Systems Matter:

  1. Networked Health Synchronization: Ensures all players see the same game state, critical for cooperative play.
  2. Scalable UI Management: The HPManager automatically adapts to new players joining, essential for a roguelike that may feature temporary allies or revived teammates.
  3. Modular Damage Handling: The dealDamageRPC method can be extended for future mechanics like armor, healing, or status effects.

Technical Decisions:

  • Used Fusion’s [Networked] attribute to minimize latency in health updates.
  • Implemented an RPC (dealDamageRPC) to decouple damage calculation (server-side) from visual feedback (client-side).
  • Designed the HPManager as a singleton to simplify global access while avoiding redundant instances.

Reflection and Next Steps

Progress This Week:

  • Established baseline systems for player survivability and team coordination.
  • Validated UI scalability for 2–4 players (see Image 2).
  • Prepared infrastructure for future mechanics like debuffs or team-based power-ups.

Upcoming Tasks:

  1. Gun Mechanics: Implement networked weapon systems with projectile spawning and ammo management.
  2. Enemy AI Prototyping: Create basic enemy movement and attack patterns.
  3. Loot System: Design a framework for item drops and stat upgrades.

Challenges to Address:

Balancing immediate visual feedback with server-authoritative logic.

Ensuring health bar positioning remains consistent across different screen resolutions.

Optimizing network traffic as the number of interactable objects grows.

References

Next week: A deep dive into weapon systems and early enemy AI!

Leave a comment

Design a site like this with WordPress.com
Get started