03_Shields — Shields Overview¶
Goal¶
Teach how different shield providers modify incoming damage and how they interact through the real HealthSystem pipeline.
What This Scene Demonstrates¶
Amount + tags → DamageContext → shield provider(s) → HealthSystem result.
This scene focuses entirely on shields as part of the damage pipeline. The panel switches between real shield providers, configures them through public APIs, and sends hits through HealthSystem to observe actual behaviour.
PreviewDamage shows the authoritative preview. ApplyDamage shows the real runtime result.
What To Look For¶
- Setup: The panel binds a victim with
HealthSystemand optional attacker context. - Shield Type: Switching between None, Capacity, Rechargeable, Reduction, Overheal, and Chain changes the active provider.
- Config: Each shield exposes its real runtime configuration (capacity, regen, reduction, decay, etc.).
- Preview: Shows the engine’s expected result after shields.
- Breakdown: A teaching aid showing approximate absorption per shield (when available).
- Apply: Sends real hits through
HealthSystem.ApplyDamageand reports actual results. - Bypass: True/bypass hits skip the shield layer entirely via
DamageContext.BypassShields.
Mental model: incoming hit → shield provider decides outcome → remaining damage reaches HealthSystem.
Sample Scope¶
This scene covers:
-
Shield providers:
-
CapacityShield RechargeableShieldReductionShieldOverhealShieldShieldChain- Switching active shield providers at runtime
- Configuring shields through public APIs
- Shield absorption, reduction, recharge, and decay
- Chaining multiple shields and processing order
- Comparing normal hits vs bypass (true) hits
- Real preview and apply behaviour through
HealthSystem
This scene does NOT cover:
- Full combat rule flow (armor, affinity, crit, etc.)
- Death handling as the primary focus
- Networking implementation
- Production gameplay setup patterns
- Custom shield implementations beyond the built-ins
This panel rebuilds shield components for deterministic teaching. That behaviour is demo-only.
Authority Note¶
This scene may include a permissive sample authority setup where mutations are allowed locally for demonstration purposes.
Networking Reminder¶
No networking is included; integration is the developer’s responsibility.
How To Use¶
-
Enter Play Mode.
-
Open the Setup tab.
-
Confirm:
-
Victim is assigned and has
HealthSystem -
Attacker is optional
-
Set:
-
Amount
-
Tags (Melee / Ranged)
-
Open Shield Type tab.
-
Select a shield:
-
None (baseline)
- Capacity
- Rechargeable
- Reduction
- Overheal
-
Chain
-
Open Config tab.
-
Adjust values based on shield type:
-
Capacity: max, flat, percent
- Recharge: max, delay, regen/sec
- Reduction: flat, percent
- Overheal: max temp, decay, pause
-
Chain: enable/disable shield layers, rebuild
-
Use shield-specific actions:
-
Recharge Full
- Add Overheal
- Clear / Top Up
- Rebuild chain
-
Refresh order
-
Open Preview / Apply tab.
-
Observe:
-
Preview After Shields (authoritative)
-
Breakdown (approximate, when available)
-
Click:
-
Apply Hit (normal shield path)
-
Apply True (Bypass) (skips shields)
-
Compare results:
-
Shield absorption
- Remaining damage
- Final applied value
Failure Behaviour¶
-
Missing Victim
-
Meaning: No target for shield or damage flow
-
Fix: Assign a GameObject with
HealthSystem -
Missing HealthSystem
-
Meaning: Shield pipeline cannot run
-
Fix: Add
HealthSystemto the victim -
Zero Damage
-
Meaning: Hit is rejected or does nothing
-
Fix: Set Amount above 0
-
No Tags Selected
-
Meaning: Untagged hits still work, but tag-based rules may not contribute
-
Fix: Enable Melee or Ranged if needed
-
No Shield Active
-
Meaning: Damage goes directly to health
-
Fix: Select a shield type
-
Missing CapacityShield / Rechargeable / etc.
-
Meaning: Selected shield type is not present
-
Fix: Switch type in Play Mode to attach demo shield
-
Capacity Depleted
-
Meaning: Shield can no longer absorb damage
-
Fix: Recharge or increase capacity
-
Apply Requires Play Mode
-
Meaning: Cannot mutate runtime state
-
Fix: Enter Play Mode
-
Target Is Dead
-
Meaning:
ApplyDamagerejects the hit -
Fix: Revive or reset victim
-
AbsorbedByShield
-
Meaning: Shield fully absorbed damage
-
Fix: Increase Amount, reduce shield, or use bypass
-
Bypass Still Absorbed
-
Meaning: Custom behaviour overrides bypass
-
Fix: Inspect shield or rule implementation
-
ZeroOrNegativeAmount
-
Meaning: Shield/reduction removed all damage
- Fix: Increase Amount or reduce shield strength
Behind The Scenes¶
HealthSystem— applies and previews damageDamageContext— carries attacker, victim, amount, tags, and bypass flagDamageContext.BypassShields— skips shield providersIShield— abstraction for shield providersIShieldPreview— optional preview interface for breakdownCapacityShield— finite absorb pool with reductionRechargeableShield— regenerating capacity shieldReductionShield— always-on flat + percent reductionOverhealShield— temporary HP with decayShieldChain— ordered processing of multiple shieldsHealthSystem.SetShield(IShield)— assigns active providerHealthSystem.PreviewDamage(in ctx, includeShields:true)— authoritative previewHealthSystem.ApplyDamage(in ctx)— authoritative runtime result
The panel rebuilds shield components using public APIs. No internals or reflection are used.
Key Takeaway¶
Shields are not a single mechanic — they are interchangeable providers in the damage pipeline.
Each shield decides how damage is absorbed, reduced, or passed through, while HealthSystem remains the single source of truth for the final result.