A Gameplay Ability System (GAS) is a framework/toolkit to create any game mechanic.
A GAS is like a collection of gears to build any kind of ability.
It uses Attributes, Tags, Effects and Modifiers to model any imaginable interaction.
You can build MMO/Action RPG abilities, crazy roguelike upgrades/effects, soulslike poise/stamina/dodge/animation synced systems and immersive sim objects and elemental interactions.
GASify is inspired by Unreal’s Gameplay Ability System.
A spell ability that lasts 10s and heals your target every 2s for 20% of your total Mana.
A passive that increases your CriticalChance by 5% of your MaxHealth but reduces your Armor by 30% your CriticalChance.
A buff that increases your AttackSpeed by 10% of your missing Health for 5s every time you receive damage.
A fireball spell that sets objects on fire, causes instant 120% of your MaxDamage as fire damage and 50% your MinDamage as burning damage over 60s.
A water spell that stops any fire effect and converts any remaining damage over time into healing.
A projectile ability that disables any Healing effect on a given target, reduces his Armor by 10% of your total Mana, and makes anyone in a 10m radius get poisoned for 50s.
A mind control spell that allows a player to take control of another character (We use a calculation to put your custom code to change camera/control input)
You can combine and stack effects, attributes and tags to create any crazy mechanic!
Abilities can also represent a wide array of ingame actions, and are not limited to powers or spells that players explicitly use. Hit reactions, object interaction, animations, vfx/sfx cues are also easily handled.
Networking/Multiplayer.
Mirror integration with ability Prediction and Replication!
VERY performant.
Nothing runs on Update().
Handles up to 200k ability activations per second.
Easy workflow.
Setup abilities/effects workflow via code or editor (SriptableObjects).
Overview:
Ability System Component: Main component to put on any entity. Holds the entity’s attributes, abilities that can be used, and Gameplay Effects/Tags currently applied to it.
Modifiers: Change the value of attributes (Add, Multiply, Override). Modifiers come in 4 flavors: Simple (a constant value), Scalable (Scales it’s output by a function e.g. Curve), AttributeBased (Uses another attribute to compute the modifier output) and SetByCaller (Set by some external data)
Gameplay Tags: Can be used to categorize effects/abilities or define states. e.g. Element.Fire, Stats.Buff.Stun or State.Movement.Sprinting
Gameplay Effect: Apply a set of modifiers and Calculations to an AbilitySystemComponent (asc). These effects can have different durations: Instant, Duration, Infinite and Periodic.
Calculations: Adds the capability to create any custom behavior/effect. Needs custom code. Executed with the GameplayEffect that has it attached.
Gameplay Ability: Abilities with cost, cooldown, activation/blockage tags. Included: Instant, Passive, Toggle, Ability Tasks (Abilities that are async and need to wait for external events, like animation triggers). Melee and projectile ability example included. Any other custom, non general ability can be created by extending this class.
Gameplay Cues: Play sounds, particle effects, animations by just adding a tag to the effect/ability and the prefab on CueLibrary.
One of the main advantages of Unreals GAS system was how easy it was to network sync. Is this built with similar ideology in mind? Would love to try syncing this with something like FishNet
Absolutely! It is designed with multiplayer in mind. A Mirror integration is on the roadmap, so its gonna have it out of the box soon™.
If you want another networking or dont want to wait, it’s actually super simple to synchronize:
Everything has handles you can subscribe to (e.g. OnGameplayEffectApplied, or OnGameplayTagsChanged) you can just synchronize the data when these happens.
Quick patch incoming:
v1.0.1
-fixes crashes on 2022.3+ when auto-refreshing attributes/tags happens when also loading new scene.
-additional attributeLibrary dictionary syncing without auto-refresh
Incoming features for v1.1.0:
-TriggerAbility, a generic ability that is automatically triggered when tags are applied. Supports triggering for any multitude of cases, on application of Instant Effect, on application or removal of Duration/Infinite effect and any combination in between.
-Initial Mirror integration supporting basic server authoritative synchronization.
I can’t seem to build. It can’t seem to find your ReadOnly attribute as its tagged to compile in Editor only. Are there other scripts that should be in the editor folder?
Hi guys, I’ve been working on a integration with Mirror.
Here is a little progress video, showcasing:
Replication: Abilities are automatically replicated across clients.
Prediction: Abilities fire immediately on client, even with latency, then are validated on server and replicated to clients.
Performance: In the video, each Unity instance has 100 networked enemies. Each Ability activation produces one projectile targeting each enemy (100 projectiles). We can have thousands of projectiles with very low performance impact. We can also have dozens of thousands of active abilities with minimal performance impact.