Melee
GC2 Melee Network Integration
Server-authoritative melee combat networking for Game Creator 2.
Overview
This module provides network-aware melee combat for GC2, enabling server-authoritative hit validation with lag compensation. It integrates seamlessly with the base GC2 Network Integration and requires it as a dependency.
Requirements
Game Creator 2 Core
Game Creator 2 Melee Module
GC2 Network Integration (base module)
A configured transport adapter (NGO/FishNet/Mirror/custom)
Installation
Import the GC2 Network Integration base module
Import this GC2 Melee Network module
The module will auto-detect GC2 Melee via the
GC2_MELEEdefine symbol
Architecture
Network Flow
Components
NetworkMeleeManager

Global singleton that coordinates all melee networking.
Setup:
Add to a persistent GameObject in your scene
Connect the network delegates to your transport:
NetworkMeleeController

Per-character component that handles melee hit interception.
Setup:
Add to any Character that uses melee combat
Ensure NetworkCharacter is also present
Set
Combat Mode = Disabledon NetworkCharacter (melee handles combat separately)
Properties:
Optimistic Effects: Show hit effects before server confirmationLog Hits: Debug logging for hit detection
ConditionNetworkMeleeHit (Visual Scripting)
A GC2 Condition that intercepts hits in the Skill's "Can Hit" conditions.
Usage:
Open your Melee Skill asset
Find the "Can Hit" conditions section
Add the "Network Melee Hit" condition
This condition:
Returns
trueon server (server processes hits directly)Returns
true/falseon client based on optimistic settingAlways returns
falseon remote clients (they receive broadcasts)
Setup Guide
Step 1: Scene Setup
Add
NetworkMeleeManagerto your scene (on NetworkManager or persistent object)Configure the network delegates (see above)
Step 2: Character Setup
For each networked character with melee combat:
Add
NetworkCharactercomponentSet Combat Mode = Disabled (important!)
Add
NetworkMeleeControllercomponentConfigure optimistic effects preference
Step 3: Skill Setup
For each Melee Skill that should use network hit validation:
Open the Skill ScriptableObject
In "Can Hit" conditions, add Network Melee Hit condition
This intercepts the hit and routes through server
Step 4: Network Transport
Connect the manager to your transport adapter. Optional NGO example: This sample follows NGO 2.10 unified RPC API ([Rpc], RpcParams, RpcTarget).
Data Types
NetworkMeleeHitRequest (~30 bytes)
Sent from client to server when a hit is detected.
RequestId
ushort
Unique ID for response matching
ClientTimestamp
float
When hit was detected
AttackerNetworkId
uint
Attacker's network ID
TargetNetworkId
uint
Target's network ID
HitPoint
Vector3
World position of hit
StrikeDirection
Vector3
Direction of strike
SkillHash
int
Hash of skill being used
WeaponHash
int
Hash of weapon being used
ComboNodeId
int
Current combo position
AttackPhase
byte
Current attack phase
NetworkMeleeHitResponse (~8 bytes)
Server response to hit request.
RequestId
ushort
Matching request ID
Validated
bool
Whether hit was valid
RejectionReason
byte
Why hit was rejected
Damage
float
Calculated damage
PoiseBroken
bool
Whether poise broke
NetworkMeleeHitBroadcast (~24 bytes)
Broadcast to all clients when hit is confirmed.
AttackerNetworkId
uint
Who attacked
TargetNetworkId
uint
Who was hit
HitPoint
Vector3
Where to show effects
StrikeDirection
Vector3
Direction for effects
SkillHash
int
For looking up effects
BlockResult
byte
Block/parry result
PoiseBroken
bool
For reaction animation
Rejection Reasons
None
No rejection (hit valid)
TargetNotFound
Target doesn't exist on server
AttackerNotFound
Attacker doesn't exist on server
OutOfRange
Hit position too far from target
InvalidPhase
Not in strike phase
TargetInvincible
Target has invincibility
TargetDodged
Target was dodging
SkillMismatch
Skill doesn't match expected
WeaponMismatch
Weapon doesn't match expected
AlreadyHit
Target already hit this strike
TimestampTooOld
Hit too far in the past
CheatSuspected
Suspicious hit pattern
Advanced: Custom Validation
Override validation by extending NetworkMeleeController:
Optimistic vs Confirmed Effects
Optimistic Effects (Recommended for action games):
Hit effects play immediately on local client
If server rejects, effects already played (minor visual inconsistency)
Better game feel, responsive combat
Confirmed Effects (For competitive/esports):
Wait for server confirmation before effects
Adds ~RTT/2 latency to visual feedback
100% accurate to server state
Configure per-character via NetworkMeleeController.OptimisticEffects.
Troubleshooting
Hits not being intercepted
Check
ConditionNetworkMeleeHitis in skill's "Can Hit" conditionsVerify
NetworkMeleeControlleris on the attacker characterCheck network role is initialized correctly
All hits rejected
Check
NetworkMeleeManageris in scene and initializedVerify
GetCharacterByNetworkIdFuncis set correctlyCheck timestamps aren't too old (increase
MaxRewindTime)
Effects not playing
For local client: Check optimistic effects setting
For remote clients: Verify broadcast is being received
Check skill effects are configured in GC2 Skill asset
Version History
1.0.0: Initial release
Server-authoritative hit validation
Lag compensation support
GC2 Visual Scripting integration
Optimistic/confirmed effects modes
Last updated