Unreal Engine's Pawn/Actor/Possession design pattern

DavidC

Active member
I don't know if you're aware of this design pattern, but I wanted to bring it to your attention because I have frequently heard it is superior to the "normal" design pattern in Unity, and that you can incorporate it's concepts into Unity. The way it works is relatively simple to explain.

Actors are any object that has the ability to act or be interacted with. So this would include a mineable rock, but exclude a static mesh rock.

A pawn is an actor a player could control. Like how a player can move a chess pawn.

Possession is when a player takes control of a pawn.

So a practical example is, imagine the Deathmatch Kit. Two players are playing. One of them is disconnected. The player (the possessed pawn) becomes a regular pawn which can then be taken control of by AI. That player rejoins a couple minutes later, the pawn is possessed again. This is a seamless transition which simply disables the AI and sets this player to be "possessing."

Another example would be "Eyes of the Beast" ability in some games like Warcraft, or a literal ghostly possession type ability. The player loses control of their current pawn, and takes control of the animal companion pawn. When it ends, it reverts.

The separation of player controls/camera and related functions into it's own object, from pawns is the key takeaway, here. You essentially create a new degree of modularity which has a number of benefits.

I don't expect that this is something you would immediately switch to or anything. But it is an interesting design pattern, and something for you to keep in mind during your continual developments.

Thank you for your hard work!
 
Top