Nick Crosgrove Profile picture
Jun 15 25 tweets 5 min read Twitter logo Read on Twitter
It's my Birthday, so I'll post a little knowledge sharing with regards to how I've been using the excellent Gameplay Ability System in #UnrealEngine for the past two years.

Here's 24 Tips about using GAS. I tried for 34 (My age), but New Twitter Sucks. Image
1. Wrap the core classes in a C++ Wrapper inside your own codebase.

Even if they're just stubs, having the base C++ class you use for your blueprints later within your own code will speed up the process significantly and reduce your refactoring burden later.
2. Create a Base Blueprint Archetype for all Abilities.

This is where you'll build the first pass for common logic within your Abilities. At some point, you will need to migrate this to C++, and having it one place will save you a headache later.
3. "Throw Basketball"

It's really tempting to go deep and crazy as you get started, but stick to building a common set of basic abilities you can use to learn the system.

Nothing more complicated then "Throw Basketball"
4. "Play Basketball"

Once you have a core set of abilities, try building an Ability that plays off other abilities.
IE: If an enemy is casting a Spell, create a Counterspell that causes the spell to misfire when used.

This kind of systemic interaction will teach you loads!
5. Embrace Gameplay Tags

GameplayTags are utterly revolutionary when it comes to their applications for Gameplay in Unreal, and you should be using them if you aren't.

Tags can be attached to Abilities, Effects, Etc to give them additional context for your systems to react to.
6. Pipeline Inputs to your Abilities

Having access to Inputs inside your abilities will make a lot of things much easier to do.

It's a subject for another thread, but reducing inputs down to Gameplay Tags and sending those to your Ability System is POWERFUL.
7. Don't Build Core Movement Inside the Ability System.

GAS Is powerful, and Every Tutorial encourages you to make Jump as an Ability. Don't. Keep a hard separation between core movement, and GAS.

GAS should influence the attributes of your movement system, but not drive it.
8. Pipeline your Damage.

Wrap the concept of Damage inside a Struct, and pass that reference thru a pipeline to allow other systems to react to it, change it, etc. I recommend a Queue System personally, queue the messages and then handle them one-by-one.
9. Basic AI/Player Parity in Abilities

When it comes to basic actions, Player and AI Abilities should be identical. This will also make it much easier to test! You can simply add the Ability to your Player Pawn and use it to test the edge cases.
10. Bosses Break All the Rules

Sometimes Bosses are weird! If they need to break any rules to look or feel good, let them. Maybe you're just gonna have a boss be a bunch of Sequencer Animations. Do it. Go nuts. Don't force them into a GAS Shape if they don't want to fit.
11. Add a GameState Ability Component

Add an Ability Component to your GameState, modifiers to the Game State can be "Abilities" that get run on this Component. This is one of those weird patterns that, once you grok it, will unlock amazing results!
12. Understand GAS Limitations

GAS Has some pitfalls. So far, I (and others) have not succeeded in getting GAS to Reinflate during Save/Load. Saving Abilities in the middle of execution seems to be difficult. So know this going in.

If I ever find a solve, I'll share.
13. Avoid Ticking Behaviours!

Ticking is a performance Nightmare in games, try and avoid falling back on Ticking when making complex abilities, try and use Tasks wherever possible. Event-Driven is going to be your friend!
14. Build GAS Friendly AnimBP

Build your AnimBP to support more complex GAS interactions, like, one-ability-per-arm, separate Upper Body from Lower Body, and react to the Tags on GameplayEffects. A little work here goes a LONG way!
15. Avoid Casting to Non-C++ Classes

Fun Fact: Casting drags references to the Blueprint being cast to into the blueprint doing the casting. This is a major cause of Memory Bloating.

Take advantage of Soft Object Pointers, and use Interfaces to define Optional Behaviours.
16. Define Damage Types and Executions

Having a dedicated Damage Type Class for things like, "Fire Dmg", "Shock Dmg", etc. and defining the DamageExecution that type should use will let you be very flexible in how damage is dealt in your system, and massively reuse logic.
17. Create Ability Sets

Having Abilities defined as a Data Asset that can be quickly added to an Ability System Component can unify the logic to add Abilities.

Having these on Equipment, Consumables, etc. And just Applying/Removing them as needed becomes a snap.
18. Pipeline Animation Notifies / States

Setting up a system for receiving Animation Notifies and Animation States inside your abilities can open up a whole world of inter-operability, and reduce the Timing Complexity for creating new, complex actions ingame.
19. Abilities should Score Themselves

If you're having an AI generate a heuristic when determining what ability to use, move the calculation of that inside the Ability CDO so you can define that for each ability.

IE: Healing a target will score very differently from Damage.
20. Expose Blueprint Functionality to Gameplay Effects

The basic UGameplayEffect has no BP Functionality. This makes it of limited use to your combat designers, it's trivial to override the base virtual functions and add your own, you should do so.
21. Build Complimentary, Independant Systems

Build Systems that can work hand-in-hand with GAS, but also be used elsewhere. Good examples of this would be a Subsystem that handles Floating Damage Text, which can be used by GAS, but also Elsewhere as needed.
22. Avoid Assuming Pawns or Characters

Use interfaces to define behavior, and avoid assuming everything you might use an Ability against is a Character or Pawn. If you want something to be Damagable, have an IDamagableInterface, or a DamageRecieverComponent that is found instead
23. Attach Floats to Tags

"Weighted Tags" is one of my favorite catch-all solutions to a massive range of challenges.

It's an FGameplayTag, and a Float. That's it.

Need to Score an Ability based on State of Character?
Pick a Weighted Random Resulting Tag?
Add related Values?
24. Try not to Direct-Set Attributes

It's really tempting sometimes to take a shortcut, but try and always use GameplayEffects to set Attributes. It safely exposes an awesome set of tools, and makes it much easier to track down the source of Attribute Changes later on.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Nick Crosgrove

Nick Crosgrove Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(