GameMode vs GameState
So I'm setting up a GameMode and GameState for my project. After reading online a lot about the differences between the two, I've downloaded the shooter game to get an idea as well.
So I want to see if I had the correct idea... in super laymen terms.
GameMode seems to be the referee, while GameState is kinda of like the assistant ref, just keeping an eye one the clock, who's on what team, what the score is as a whole (PlayerState keeps track of individual scores), and possibly where those players might be on the field if we care about that sort of thing, but mostly TEAM stats - not individual state.
If I hit a player, I don't tell GameState. I tell GameMode and it will decide whether I really hit the player or not. Also, no variables, whether public, private, or protected, should ever changed within GameMode, as those are the rules that are to be set and maintained through the match. If I want rules to change in the middle of a match, whether it's a major or minor change, should I make a separate GameMode and just swap the GameMode?
Thanks in advance!
asked Oct 24 '14 at 07:31 AM in C++ Programming
They Are Very Different In Multiplayer Game
Game Mode = Only Exists on the server, and controls how players login to the match, and how player units are spawned. You can stop a player from joining a multiplayer game here, or know when a player has left. And again this actor only ever exists on the server.
Game State = Ideal for managing all aspects of a replicated world, such as world time, world object positions not owned by a player, AOE damage zones, neutral replicated gameplay elements of any kind.
This actor exists for client and server and allows for each client to know stuff about the world.
Again a great example is World time where you want the client to know what what the session / turn / current mission time is as propogated to each client from server calculations that are done in Game State class on the server, and replicated to each client using a replicated Time variable.
The bulk of actual game-time related stuff in multiplayer game has to be done in Game State if it is anything you want clients to know about locally :)
answered Oct 26 '14 at 06:14 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here