top of page

Harbor Rush

“Harbor Rush” is a mobile naval combat game combining top-down shooting gameplay with resource management and real-time combat strategy systems.


Players dynamically collect and manage colored combat energy during battle to activate powerful character abilities, creating moment-to-moment decision making layered on top of fast-paced combat encounters.

The gameplay emphasizes combat adaptation, skill synergy, and progression-driven encounter pacing designed for mobile gameplay sessions.

image.png
image.png
image.png

Hierarchical Projectile Pattern System:

Complex projectile gameplay can quickly become difficult to scale if every weapon pattern is implemented as a hardcoded firing script. To support more flexible combat design, I designed and implemented a data-driven Bullet Pattern System where projectile behaviors can be authored as reusable pattern definitions instead of one-off code logic.

The core idea is that a weapon does not directly spawn a fixed set of bullets. Instead, it references a BulletPattern, and each pattern contains multiple leaves that define local offsets, directions, movement behavior, speed, lifetime, and spawn timing. A leaf can either spawn a real projectile or reference another BulletPattern, allowing complex projectile formations to be built through hierarchical composition.

Data-Driven Pattern Architecture

Each BulletPattern is authored through data, allowing designers to define projectile layouts without changing gameplay code. A pattern can describe simple attacks such as dual parallel bullets, but it can also describe more advanced behaviors such as delayed shots, nested projectile groups, detached bullets, or reusable sub-patterns.

This design makes projectile behavior more scalable because new weapons can be created by combining existing pattern blocks. Instead of writing a new script for every weapon, the system composes patterns from data: position offsets, firing directions, movement phases, lifetime, speed, prefab references, and optional nested groups.

QQ_1779353883868.png

Hierarchical Runtime Pipeline

The most important part of the system is that a BulletPattern can contain another BulletPattern. This creates a hierarchy where a projectile group can behave as a parent object while its child bullets inherit local-space positioning and movement.

For complex patterns, the system spawns a lightweight “group ghost” entity that acts as the transform anchor for child bullets. The group can move as a whole, while children preserve their relative local offsets and directions. For simple patterns, the system supports a headerless mode that skips the group entity and directly spawns leaf bullets, avoiding unnecessary runtime overhead.

QQ_1779353929843.png

Transform and Movement Integration

Projectile hierarchy is built on top of the simulation transform system. Parent-child relationships are managed through transform hierarchy components, with dirty propagation and depth-sorted world transform updates. This allows nested bullet groups to move consistently without each bullet needing custom parent-following logic.

Movement is also decoupled from pattern spawning. The pattern system only defines what should be spawned and how it should be arranged, while the movement system processes movement components such as linear movement, hold movement, acceleration, and auto-rotation. This keeps projectile composition, transform hierarchy, and movement simulation separated into clean runtime layers.

QQ_1779353964100.png

Technical Design Highlights

  • Data-driven projectile pattern authoring

  • Hierarchical bullet pattern composition

  • BulletPattern can recursively contain sub-patterns

  • Headerless optimization for simple projectile layouts

  • Ghost group entities for parent-space pattern control

  • Local offset / local direction converted into world-space spawning

  • Delayed leaf spawning through scheduled events

  • Transform hierarchy integration for parent-child movement

  • Movement logic decoupled from spawn logic

  • Supports future complex projectile patterns without rewriting weapon code

Gameplay Timing Desynchronization:

In many gameplay systems, projectiles are spawned immediately when gameplay conditions are met, which often causes visual timing mismatches between gameplay logic and character animation. To solve this problem, I implemented an animation-driven combat pipeline where the simulation layer determines whether an attack should happen, while the animation system determines when the attack is actually executed.

The system keeps gameplay authority inside the simulation layer while synchronizing projectile spawning to exact animation frames through Unity animation events. This allows attack timing, muzzle flashes, recoil, hit reactions, and projectile spawning to remain visually synchronized without tightly coupling gameplay logic to Unity presentation code.

Simulation-Authoritative Combat Flow

The simulation layer fully owns combat validation, including cooldowns, targeting, attack speed, ammo checks, special weapon state, and firing eligibility.

When gameplay conditions are satisfied, the WeaponSystem does not immediately spawn projectiles. Instead, it triggers the presentation-layer attack animation and enters a deferred fire state. The actual projectile spawn only occurs when the animation reaches a FireProjectile event frame.

This architecture keeps gameplay deterministic while allowing animations to control exact combat timing.

QQ_1779394083438.png

Animation-Synchronized Projectile Spawning

Projectile spawning is synchronized through Unity animation events routed back into the simulation layer through deferred simulation events.

QQ_1779394122861.png

This solves a common gameplay problem where gameplay logic and presentation timing drift apart. Instead of spawning projectiles immediately during gameplay update, projectile creation becomes synchronized to the exact visual firing frame.

The system also dynamically adjusts animation playback speed based on gameplay attack speed and cooldown timing, ensuring that animation pacing remains synchronized with gameplay fire rate.

Runtime Decoupling

The system cleanly separates:

  • gameplay validation

  • animation presentation

  • projectile spawning

  • projectile composition

into independent runtime layers.

  • The simulation layer decides whether combat actions are valid

  • The Animator controls presentation timing

  • The attack dispatcher handles spawning

  • The BulletPattern system controls projectile structure

This architecture allows gameplay systems, animation systems, and projectile systems to scale independently without tightly coupling combat logic to Unity-specific presentation code.

Technical Design Highlights

  • Data-driven projectile pattern authoring

  • Hierarchical bullet pattern composition

  • BulletPattern can recursively contain sub-patterns

  • Headerless optimization for simple projectile layouts

  • Ghost group entities for parent-space pattern control

  • Local offset / local direction converted into world-space spawning

  • Delayed leaf spawning through scheduled events

  • Transform hierarchy integration for parent-child movement

  • Movement logic decoupled from spawn logic

  • Supports future complex projectile patterns without rewriting weapon code

bottom of page