Gamestate & gamemode 4-26

Question about game mode and game state.

I read heaps of article on it and think I get the difference for the most part but have a question about the replication.

In my multiplayer farm game I have plant growth that does a bit of calculations , only the answer of the answer of the calculation is used for players, let’s say there is a delta time ticker in game mode that cause growth to happen, once the plant can be harvested I just need to replicate the boolean value.

Can I do the following; do all the math in game mode, and then just update gamestate with the right boolean to replicate it to clients?

(Why?) I think that running less code in game state makes replication more efficient since I don’t want to replicate things I don’t need i.e. thus I put that in game mode. Is that needed or should I not care, i.e. keep it simple and put everything in game state in case I need it later?

Thanks in advance

The correct method is to calculate everything important in GameMode (this is server only) and set the variables in the GameState which are replicated to the clients. This also prevents cheating in multiplayer.

In short: Yes