Ability System Component for a RPG multiplayer game?

Hello there,

I followed the exellent Create a multiplayer RPG with Unreal Engine’s Gameplay Ability System (GAS) with Stephen Ulibarri on Udemy. On this lecon, he creates a single controlled Character game, with multiplayer functionality. The PlayerState is the Owner of the AbilitySystemComponent, and the Controlled Pawn is the AvatarActor.

On my case, I want to create for example, a Baldur’s Gate like game. GameplayAbilty and AttributeSet are everywhere. So, for this game, I can control multiple Pawns, right?

How and when the Ability System Component is initialize for my Pawns/Heros?

  • Do I need a PlayerState, owner of the ASC too (init on PossessedBy and OnRep_PlayerState)?
  • Is the ASC is living on the Pawn (init on PossessedBy and AcknowledgePossession)?
  • Or the ASC is like an AI-Controlled Character (init a BeginPlay)?

I hope it is clear enought.

Thanks,

i havent used GAS but I imagine it would have to be on the pawn

In this case you should possess some abstract pawn that consist only of camera. Then you should implement custom system of units selection and forwarding inputs from your controller to currently selected units. You don’t possess them directly, but they will still receive the forwarded inputs.

Generally you may read RTS (real time strategy) guides for other approaches

How and when the Ability System Component is initialize for my Pawns/Heros?

At the level that makes most sense for your goals. It makes little sense to store ASC on anything player-related, since the PlayerController\PlayerState exists only in single instance for the given player.
So going the level lower, the pawn itself is a good place for it: each pawn will have its own ASC in this case. The owner may be set to player controller, while the avatar is pawn itself.
But you can’t init it on OnPossess\PossessedBy, since you’ll never possess player characters (btw, implementation of AI may vary, including possession). As for BeginPlay… in your case it should work unless i’m missing something, worth a try.