How to organise game data for multiplayer with a player manager?
Hi guys,
I'm a little stuck on this concept right now and just looking for advice how to organise my game data. So I plan to have up to 10 players in a single match all with stats and combat scripts. Below I have a sample. Its from Brackey's RPG series from youtube. But I am trying to implement this system to a multiplayer so ideally I reference the player who is attacking/taking damage from somewhere. So my objectives would be:
Easily access data whenever combat stats are called for the relevant player.
Secure so that data cannot be change (I will need to research this more in the future).
So the solutions as I see it could be but not limited to (any suggestions are welcome):
Organise the stats and combat script into the player manager and try to update it this with any change.
Make a Getter for these scripts from the player.
Make a reference to the player when they interact such as:
Thanks in advance!
public override void Interact(Player1 interacter)
{
base.Interact(interacter);
// Attack the enemy
//Debug.Log(playerManager.player);
playerCombat = playerManager.playerCombat;
if (playerCombat != null)
{
playerCombat.Attack(myStats);
}
}
Hope this thread looks ok, took ages to get formatting ok. Cheers,
Brettus Lettus