6
votes
Accepted
How to avoid lots of booleans
Oldschool RPGs with lots of these switch/lock-and-key style steps but a strictly linear progression would often implement this as a "Quest Stage" integer or enumeration.
Let's imagine a linear ...
4
votes
Accepted
Data Structures for Game State
This is sort of open ended, but I would generally recommend that you have a list of open quests, separate from your other state.
When something interesting happens, you generate an event that ...
3
votes
Unity Save System - is there a better way?
Unity does not have a build-in system for saving and loading gamestates, so there is no standard solution for this. Which means that there are as many approaches to gamestate serialization as there ...
3
votes
How can I synchronize state in my Asteroids game with many networked players?
Is it possible to save the game's current state to disk?
If yes (hint, the answer is always yes) then you have a means by which you can synchronize players. Even if it is horribly inefficient. But ...
2
votes
Accepted
Let both clients know of complete game-state in turn-based game?
This is not safe.
As soon as you let client know something, consider the player knows it too. Even if the information is hidden from players view in GUI, it can be more or less easily extracted from ...
2
votes
Accepted
How do I guarantee that important one-time events in my UDP network protocol get received?
One approach I've seen is to include in each packet an ID of the last update you received from this client/server, or a bitmask of which packets you've received in a sliding window.
When forming an ...
1
vote
Accepted
The state that is synced when a window is broken in a FPS game
I will go over the how state synchronization works, and later will go over your particular cases.
But before that, let me tell you that you do not need to implement all that I say here. If you have a ...
1
vote
Accepted
Disable input and score count in pause menu?
The problem is that I don't really understand this kind of pausing code, I'm "used to" the regular boolean one.
You can grab your boolean using your GameState:
...
1
vote
Disable input and score count in pause menu?
So because I can't see how your StateMachine is running, I've made up a simple example that hopefully demonstrates what the purpose of the Statemachine is in the first place.
In your scenario ...
1
vote
Networked game with physics and client side prediction and server reconsiliation causes lag
Keep track of unconfirmed inputs (basically an array of the actual state of player's control buttons in each frame) on the client.
Upon receiving the game state from the server, put the player back ...
1
vote
Accepted
How to pass data between game states?
StateStack can route 1 parameter to the state's constructor. Notice how states are registered in Application::registerStates.
...
1
vote
Accepted
How to deal with race conditions on a game server between network and physics update loops?
One option is to copy the state to a buffer after each simulation step. This operation is typically not that time consuming when compared to performing the step per se. The network thread then ...
1
vote
Accepted
Game states and events
I don't have the luxury to write a full answer, unfortunately, but here it is, at a glance. Note that there seems to be some fundamental architecture differences between what we have and what you have,...
1
vote
Accepted
If online games use permalinks
There are generally two ways to refer through the URL to a specific state
The state itself is stored in the URL. The State will be serialized and then encoded to a string of valid URL-Characters. ...
1
vote
Accepted
How to protect save game data when saving game over the network?
Use HTTPS
Sign and/or encrypt the data with a key included in the app. This won’t stop somebody from modifying the app, but it will stop casual MITM attacks using a proxy server.
If you want to get ...
1
vote
Accepted
Overlaying Menus with a State Machine
One solution to this problem is by executing EACH state on the state machine, or having speicfic states (or transition states) that are defined to execute one before another. A typical implementation ...
1
vote
Accepted
Problem with transitioning to previous state(State Stack)
Do you remember these cartoons where the goofy character saw the branch of the tree, but realized too late that he was on the wrong side of the cut?
That's what you seem to be doing here.
...
1
vote
Issues with events changing game state
I think the difficulty here is that, because you have bits of non-state code (the objectives system in this case) interfering with normal operation of the state machine, the state machine will get ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
game-state × 72c++ × 13
architecture × 11
networking × 10
multiplayer × 10
state × 10
c# × 8
unity × 6
client-server × 6
synchronization × 5
java × 3
android × 3
input × 3
events × 3
savegame × 3
libgdx × 2
software-engineering × 2
game-loop × 2
pygame × 2
optimization × 2
entity-system × 2
sfml × 2
mmo × 2
rpg × 2
c × 2