Abilities
Network Abilities Module
Server-authoritative networking solution for the DaimahouGames Abilities system.
Overview
This module provides complete network synchronization for the Abilities system, including:
Ability Casting - Server-validated ability execution
Cooldowns - Server-authoritative cooldown tracking (prevents manipulation)
Projectiles - Server-spawned with client-side visual representation
Impacts - Server-calculated AOE with synchronized hit detection
Ability Learning - Server-validated ability slot management
Security Modes
This module offers two security levels:
Option A: Interception-Based (Default)
No third-party code modification required
Intercepts ability requests and validates on server
Good protection against casual cheaters
⚠️ Determined cheaters could bypass via reflection
Option C: Full Server Authority (Optional Patch)
Requires applying a patch to DaimahouGames Abilities
Hooks directly into Caster.Cast() at the source
Clients cannot bypass validation by calling methods directly
✅ Maximum security - true server authority
To enable Option C, use the menu:
Architecture
File Structure
Quick Start
Where To Add Components
Add exactly one
NetworkAbilitiesControllerto a shared bootstrap/manager GameObject in scene.Do not add
NetworkAbilitiesControllerper player character.The Setup Wizard
Scene Objectsstep can create/reuse the shared controller whenEnsure NetworkAbilitiesControlleris enabled.NetworkAbilitiesManageris a static API/service (NetworkAbilitiesManager.cs), not aMonoBehaviourcomponent. Do not add it to a GameObject.
NetworkAbilitiesManager Role
NetworkAbilitiesManager is the transport-facing facade for Abilities. It owns:
Message type IDs (
MessageTypes) used by your transport router.Asset registries (
Ability,Projectile,Impact) for hash-to-asset resolution.Pawn ↔ network-id tracking (
RegisterPawn,UnregisterPawn).Incoming packet routing (
RouteIncomingMessage(...)) intoNetworkAbilitiesController.Convenience gameplay API (
RequestCast,RequestLearn, cooldown queries, server spawn helpers).
Typical lifecycle:
Call
NetworkAbilitiesManager.Initialize(...)once when your network session starts.Register ability/projectile/impact assets used by this session.
Register pawns on spawn and unregister on despawn.
Forward received Abilities packets to
RouteIncomingMessage(...).Call
NetworkAbilitiesManager.Clear()on session shutdown.
1. Initialize Manager & Registries
2. Controller Setup
3. Using the System
Message Types
Reserved message type IDs: 230-259
230
AbilityCastRequest
Client → Server
231
AbilityCastResponse
Server → Client
232
AbilityCastBroadcast
Server → All
233
AbilityEffectBroadcast
Server → All
234
CastCancelRequest
Client → Server
235
ProjectileSpawnBroadcast
Server → All
236
ProjectileEventBroadcast
Server → All
238
ImpactSpawnBroadcast
Server → All
239
ImpactHitBroadcast
Server → All
240
CooldownRequest
Client → Server
241
CooldownResponse
Server → Client
242
CooldownBroadcast
Server → All
243
AbilityLearnRequest
Client → Server
244
AbilityLearnResponse
Server → Client
245
AbilityLearnBroadcast
Server → All
246
AbilityStateRequest
Client → Server
247
AbilityStateResponse
Server → Client
Server Validation
The server validates:
Caster exists and has the Caster feature
Ability is known (in one of the caster's slots)
Cooldown check (server-tracked, not client)
Requirements met (via RuntimeAbility.CanUse)
Range validation (with grace for latency)
Cast queue (prevents ability spam)
Integration with Ability Effects
For projectile and impact effects in networked games, use the server spawn methods:
Statistics & Debugging
Inspector Settings
The NetworkAbilitiesController exposes these settings:
Cast Settings
Allow Client Prediction - Show cast effects before server response
Max Cast Queue Size - Prevent ability spam (default: 2)
Range Validation Grace - Extra range for latency (default: 0.5m)
Cooldown Settings
Cooldown Buffer - Server adds this to prevent edge-case exploits
Projectile Settings
Max Projectiles Per Character - Limit for performance
Cleanup Interval - How often to clean stale projectiles
Impact Settings
Max Concurrent Impacts - Global limit for AOE impacts
Best Practices
Register all abilities during network initialization
Use server spawn methods for projectiles/impacts in networked games
Don't modify cooldowns locally - server is authoritative
Check IsOnCooldown before showing UI elements
Handle rejection gracefully - show feedback to player
Clean up on disconnect - call
NetworkAbilitiesManager.Clear()
Server Authority Patch System
Applying the Patch
Open Unity
Go to
Game Creator > Networking Layer > Patches > Abilities > Patch (Server Authority)Read the confirmation dialog and click "Apply Patch"
Wait for Unity to recompile
What the Patch Does
The patch modifies Caster.cs to add:
Static validation hooks (
NetworkCastValidator,NetworkLearnValidator,NetworkUnLearnValidator)Completion callbacks (
NetworkCastCompleted)Direct execution methods (
LearnDirect,UnLearnDirect) for server-side use
Checking Patch Status
Removing the Patch
This restores the original files from the backup created during patching.
Using Patched Mode
When the patch is applied, add NetworkAbilitiesPatchHooks to enable the hooks:
Compatibility Notes
Backups are created before patching
Safe to update DaimahouGames Abilities (unpatch first, update, re-patch)
Patch version is tracked to detect incompatibilities
Works alongside the interception-based system as a security enhancement
Compatibility
Works with existing Ability definitions (no modifications needed)
Integrates with existing Caster feature
Supports all activator types (Single, Channeled)
Compatible with targeting system
Works alongside other network modules (Stats, Inventory, etc.)
Last updated
