Download

Simple question about GameMode vs GameState

Hello.

For now, I only know that the GameMode exists on the server and the GameState is replicated to all the clients.
If my FPS has a Deathmatch and a TeamDeathmatch mode… are these GameModes or GameStates?

Deathmatch has some properties like MaxKills, MatchTime
TeamDeathmatch has BlueTeamScore, RedTeamScore, MaxScore, MatchTime

Starting from these, how would I set up these ones?

Every player HAS TO KNOW the properties of the Deathmatch, for example the maximum ammount of kills to be achieved before the match ends.

And… so? Where should I put those variables?
In the DeathmatchGameMode class or in the DeathmatchGameState class?
In the TeamDeathmatchGameMode class or in the TeamDeathmatch**GameState **class?

In this example I gave you, I don’t understand the difference between the two.

Clarafications are needed!

You are also welcome to put variables in Game Instance :slight_smile:

I would actually suggest to download and look at the ShooterGame example from the Learn Tab. Also, Generic Shooter from @Allar (Marketplace) would be quite beneficial for you as well.

You’ve probably already done this but:

Game framework docs: https://docs.unrealengine.com/latest/INT/Gameplay/Framework/index.html
Game framework stream: https://www.youtube.com/watch?v=0LG4hiisflg

I suggest you go ahead and read the docs and watch the stream and many, if not all, your questions will be answered. (Also, go ahead and buy Allar’s Marketplace item as a learning tool)

I’ve just finished watching the Video you linked.

Unfortunately, he speaks about GameMode and GameState a little and basically he said all things I already knew.
Also that was completely a Single Player game and most of my questions weren’t answered.
**
That’d be nice to know the difference between the two in a Multiplayer game.**

Unfortunately I see very few videos about Multiplayer, even on the Unreal Engine official youtube channel.

And in the ShooterGame there are some things I don’t understand.

There are 2 Game Modes: ShooterGame_FreeForAll and ShooterGame_TeamDeathmatch
This leads me to think I’ve to create one GameMode class for each Game Mode i’m going to implement.

Alright but on the other hand, the GameState is one and I don’t understand what it exactly does and what’s its role in a Multiplayer game.

choose.png

I only see member functions, but I don’t quite understand by who are called.

This thread is pertinent for me, too. I would really appreciate to read a clear technical explanation/definition of the difference and the practical uses between those two.

Look at what the data the functions are using .

gameMODE should be used for all the rules, victory conditions , of the match eg max number of players, how many kills to win the game, how long are the matches etc

gameSTATE should be used for anything relating to the actual game in progress.

Eg players names, team name number, number of kills , match time etc

Bear in mind sometime they may share similar variables