So, im working on a game and im not really familliar with unreal, im learning quite everything, days after days, working on my project.
From what i read, PlayerState class are class that are present on both the server and clients. So i was wondering what was hapenning when you were calling a method of a PlayerState Child class.
In my case, i think about building my game so all my players have a PlayerState child class that contain a “Champion” class, which is a custom abstract class.
Here’s that abstract class :
#pragma once
#include "MyPlayerState.h"
#include "CoreMinimal.h"
/**
*
*/
class MYPROJECT4_API MyChampions
{
public:
MyChampions();
~MyChampions();
virtual void Spell_1() = 0;
virtual void Spell_2() = 0;
virtual void Spell_3() = 0;
virtual void Spell_4() = 0;
virtual void UltimateSpell() = 0;
virtual void BasicSpell() = 0;
protected:
//Identity
std::string m_ChampionName;
std::string m_ChampionClass;
//Sustain
int m_ChampionHealthPoints;
int m_ChampionTemporaryHealthPoints;
int m_ChampionShieldPoints;
int m_ChampionTemporaryShieldPoints;
int m_ChampionSourcePoints;
int m_ChampionTemporarySourcePoints;
int m_ChampionArmorDivFactor;
int m_ChampionArmorSubFactor;
//Spells
int m_FocusRate;
int m_Spell_1_Steps;
int m_Spell_2_Steps;
int m_Spell_3_Steps;
int m_Spell_4_Steps;
int m_Ultimate_Steps;
int m_BasicSpell;
};
So if ever i do PlayerState.Champion.Spell_1() for exemple, and that methods modify a specific value of a selected PlayerState, will that modify that call the method on the server, so modify the value on the server, and then replicate it on the clients? with other words, is that organization network friendly?
Also another question, not about unreal itself but network in games in general. I don’t know if the client should just send its inputs to the server, and then the server to do stuffs considering those inputs, or if the client should ask to call some function following some input and then the server indeed call those functions or not.
Tho i might just be missing some unreal features that actually dont needs me to think about those stuffs, cause yeah i know really not a lot about it, so don’t hesitate to guide me into the right way!