Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

game mode - game state relation


im having a bit of trouble understanding the correct relation between game mode and game state.

I know that game mode should set the rules and keep track on player, and is only exposed to the server, while game state replicates to clients and should hold information about the current state of the game.

So if i set up a simple deathmatch game, where a player needs to kill 30 enemies to win, what would be the distribution in the blueprints?

To my understanding , the method of "Player has died" should be in the game mode, which when called by the server -

1) tells the game state to add a score to the killing player (in its player state) and check the winning condition (kills=30).

the value of 30 will be in the game mode.

2) queue the killed player for respawn (respawn time is in game mode)

Is this correct?

Thank you.

Product Version: UE 4.20
more ▼

asked Aug 31 '18 at 12:10 PM in Blueprint Scripting

avatar image

17 1 5 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

In my understanding GameMode is more of a "connection manager" than anything else. Yes it holds some rules but they are mostly needed to initialize the game like how many players can connect at once, are they on teams, which pawns do they use. In the end it is also responsible for initializing the next GameMode when the goal of the game is reached.

GameState is more of a data storage and communication manager. Since it has access to all clients and they have access to it it is very easy to use it so store leader boards, timers, and it manages all PlayerStates.

Be sure to check eXi's Multiplayer Network Compendium.

What should and should not go in a specific class is a bit murky especially for low priority things. Your approach is perfectly valid but you can realize it in many other ways which will present it's own problems and benefits.

Here is an example: Score is can be kept in the PlayerController and PlayerState could compile a scoreboard table and re-spawn the players. It is not a perfect approach but it is valid too.

more ▼

answered Aug 31 '18 at 01:32 PM

avatar image

1.3k 6 5 9

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question