In my turn-based game there are various characters and objects on a map. While each player has a main character they control, they may also control some “minions” as the game progresses. The way characters move or attack is by the player clicking on the character and then clicking on the target square or object. Each player also has a hand of cards and playing cards will also affect characters and objects on the screen.
My question, as an Unreal noob, is whether I should stick with everything (objects, walls, characters, etc.) being just derived form the Actor class or is there significant benefit in making the characters derive from Pawn. Having everything inherit from Actor will make my class structure simpler since I have some base classes from which ideally both objects and characters would be derived. If I have to make characters derive from Pawn and object derive from Actor then I will either have to duplicate some functionality or just make my class structure derive from ActorComponent and attach them to Actors or Pawns instead having my class derive directly from them.
So to summarize my question. Will I lose significant functionality (that I will have to then add myself) if I don’t use Pawns at all and have everything just derive from Actor?
Unreal Engine structure is a bit particular about that and to be honest doesn’t have strategy games in mind.
The only addition pawn has on top of an actor is the ability to be possessed by a controller. Actor without a controller though has a hard time using behavior trees (if you go in that direction)
The other problem is what @Auran131 pointed out: Although all actors can have components some components rely on the actor being a pawn. (Like PawnMovementCompinent)
Thanks a lot for your feedback. On the flip side, if I make everything a Pawn (including walls, stationary objects, items) would that result in a significant performance hit, or should it be ok for game like mind where there’s never a lot of movement or animation happening at the same time?
There will be a performance hit but I doubt it will be significant. The memory footprint will increase but I have no idea how much. I guess it all depends on how many objects are we talking bout.
What I do know is that it is not a good idea. You should always strive to use the most basic class that satisfies your needs. Even if the overhead is small it is still unnecessary.