Download

Who is best to do possess?

Hello Everybody!

I have a turn driven (2-4 “players”) physics based game I am putting together as I learn the engine. So far things have been going great. I have a working Player Controller, and Player Pawn that it drives. There is a Referee actor that spawns into the world at the start of the game that the game pieces and player pawns report to in response to their in game actions (overlaps, movement, etc.). The Referee will handle the game logic (this may get moved to the Game Mode in the future if it fits the engine architecture better but it works well for the prototype phase.)

I hope to make this a multiplayer networked game once I get the local version working. For the local version I have one Player Controller that takes turns possessing the two (or more) Player Pawns. There is no split screen, the view switches to the active pawn’s camera. The referee holds a list of the players and determines who the current player will be when a turn starts. I just tore it apart but previously the player controller got passed the next player to posses. I am leaning toward having the player pawn hold a reference to the controller (anticipating multiple controllers) and when the player pawn is activated by the referee it will use that reference to call the possess actions.

My question is, which object is best suited to call the depossess, possess functions: the Player Pawn, the Player Controller, or the Referee (or something else)? Are there any gotchas to watch out for when it comes to swapping controlled pawns using one controller?

EDIT: so maybe this is too open ended of a question to answer?