Currently i’m making turn-based combat system, but i have encountered a problem.
My game is designed to be played against AI. Both players(controllers) receive 4 pawns. I want to store player data somewhere, but I cannot store it in pawn, because pawns share same data in team. I can’t store data in controller, because AI Controller and Player Controller doesn’t share same parent, so i would have to duplicate everything. Also AI doesn’t have player state. There are no data holders that i can use seperately?
Some other options:
Instance - Bad to use if i want multiplayer in future.
GameMode - Bad to use if i want multiplayer in future.
Database actor object - Lots of casting and have to make logic for data retrieval
I know that they are replicated, but AI Controller does not have PlayerState. Only players have PlayerState. GameState is replicated and i can use it to store some information, but i need to store same kind of information on both controllers (not pawns)
I managed to get PlayerState for AI, so i don’t have to duplicate most of my player related data between playercontroller and ai controller. I’m not sure if this is best solution, but it fit me best so i can add multiplayer in future.