Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [game-state]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
31 views

How to generate reliable labels for game state using Python and Pygame

I've been looking into making a small game where you would walk around and do puzzles (perhaps do some combat if I can get the basic framework going). So far, Googling for general game patterns used ...
user avatar
1 vote
2 answers
153 views

Disable input and score count in pause menu?

I need some sort of an if statement, which allows me to disable any input and increment score while I'm in the pause menu. The problem is that I don't really understand this kind of pausing code, I'm &...
user avatar
0 votes
1 answer
67 views

Networked game with physics and client side prediction and server reconsiliation causes lag

I'm trying to make a multiplayer platformer game. I can almost get client side prediction and server reconsiliation to work, but there is one issue that I just can't wrap my head around. Lets say that ...
user avatar
0 votes
0 answers
34 views

effect and ability activation in state system?

First time that i am making a text based card game, the main code here is starting to feel a bit clunky.This is a turn-based/phase based system where an effect/ability activates in a specific state/...
user avatar
1 vote
1 answer
112 views

How do I guarantee that important one-time events in my UDP network protocol get received?

I'm creating an online arena game server (moba) that players can play together. 2v2 or 3v3. The game is similar to Battlerite. I chose client/server architecture with deterministic server that tells ...
user avatar
  • 113
0 votes
0 answers
24 views

Multiplayer client has two GameStates

I'm having struggle with GameState. My custom GameState is child of Game State Base. GameMode (child of Game Mode Base) is updating some variables in my GameState. But my clients have two separate ...
user avatar
  • 101
0 votes
0 answers
82 views

How do I store card game states in a NodeJS app hosted on Heroku?

I have a turn based card game node app, and in development env I store all game states in memory (1 object per "game" in a big parent object) since these objects are constantly changing and ...
user avatar
  • 1
0 votes
1 answer
170 views

How to pass data between game states?

Lately I've been using game state stack implementation from a book SFML Game Development and I've stumbled upon a problem with passing data between states. In this implementation State constructors ...
user avatar
  • 57
0 votes
1 answer
216 views

Play and Pause State

Problem i want to implement a pause state and with a simple conditional inside the update of PlayState is very very simple. However i think that the pause has to be another state in the StateMachine ...
user avatar
0 votes
1 answer
130 views

How to deal with race conditions on a game server between network and physics update loops?

I am new to game networking. In various articles on the internet, I found that there are usually two loops on the server: one for physics updates and the other for sending snapshots to the client (...
user avatar
0 votes
1 answer
61 views

How to disable pause() in game_loop() once game_over() function is called?

How can I disable pause() in game_loop() once game_over() function is called? game loop ...
user avatar
1 vote
0 answers
100 views

Unique_ptr game state vs shared_ptr game state

I have this (typical) base class: ...
user avatar
0 votes
1 answer
196 views

Game states and events

I'm writting a game in C++ and I'm struggling with getting events and game states work together. By game states I mean something like this ...
user avatar
  • 3
0 votes
1 answer
47 views

If online games use permalinks

I'm trying to figure out how to accurately capture the state of the web app by a URL, similar to something like https://jsfiddle.net/, where they create ...
user avatar
  • 177
1 vote
1 answer
92 views

How to protect save game data when saving game over the network?

Newbie question please - I am working on my own RPG, using Unreal Engine 4 and C++. Regarding data formats - I figured I would just make HTTP Post requests to store the data as JSON in AWS's ...
user avatar
  • 113
2 votes
1 answer
444 views

Overlaying Menus with a State Machine

I'm working on developing a game with C++, SDL, and OpenGL. I created the engine from scratch, and implemented my own state machine to handle menus and general gameplay. Each State gets pushed into a ...
user avatar
  • 23
2 votes
2 answers
412 views

How to avoid lots of booleans

This was probably asked somewhere but I can't google anything for some reason. So I'm making a puzzle game as a result I have lots of booleans which affect the game only once and become redundant. As ...
user avatar
0 votes
2 answers
225 views

How ID's work in FPS games

I am wondering how games generate IDs/GUIDs for their entities (along these lines), and which entities specifically get them. To narrow the scope of the question down, I am just focusing on FPS games ...
user avatar
  • 177
0 votes
1 answer
331 views

The state that is synced when a window is broken in a FPS game

In order to better understand how state syncing works in games, I wanted to pose a specific example. Say you are in a FPS game with multiple players and someone breaks a window in some building. ...
user avatar
  • 177
1 vote
1 answer
143 views

How can I synchronize state in my Asteroids game with many networked players?

Wondering how state synchronization works in games with lots of players like MMOs. It seems like a hard problem to solve and I am not aware if there are standard solutions. Specifically, synchronizing ...
user avatar
  • 177
0 votes
1 answer
90 views

Let both clients know of complete game-state in turn-based game?

I'm writing a simple turn-based game for mobile, just to test the waters and I'm having doubts about the approach. Each player has 5 cards on hand. I want for both players to be able to replay ...
user avatar
  • 103
3 votes
1 answer
2k views

Multiplayer client-server architecture sending input

I've got a 2D java game with an infinite generating world with a player and other entities. I wish to make this game multiplayer and have done my research. I read this article multiple times and is ...
user avatar
  • 135
0 votes
0 answers
340 views

How can I deal with different states in a multiplayer game?

I'm currently just making a concept for a MMORPG-like (much less massive) game, in which the player can do all the usual stuff (farming, talk to NPCs, accept quests, kill monsters etc.). An important ...
user avatar
1 vote
1 answer
450 views

Problem with transitioning to previous state(State Stack)

I am using a state stack as the mechanism to transition through states in my game. Currently moving to a new state works correctly, but when I want to go back to a previous state(removing top state) ...
user avatar
4 votes
3 answers
622 views

Issues with events changing game state

I am currently experimenting with creating a turn based game using Unity and am trying to come up with a sensible architecture for structuring my game systems. So far I have decided to base ...
user avatar
  • 564
5 votes
3 answers
741 views

How do I handle Game Screens in LibGDX?

In my game the main screen is the playscreen. But because I want to draw the menu and the gameover screen on top of the playscreen, I don't create separate screens for them. But if I want to replay, I ...
user avatar
1 vote
1 answer
668 views

Data Structures for Game State

I'm writing my first game. It's an adventure-RPG in the style of Starflight. I'm thinking about how to represent game state. There are three obvious parts of game state: dialog, combat, and story/...
user avatar
0 votes
1 answer
237 views

Where to put SFML Window in GameStateManager

I have a Pong game using SFML organized after this tutorial. This is the UML diagram from the tutorial. Now I am not sure where I should put my SFML RenderWindow variable (and other things that ...
user avatar
2 votes
1 answer
236 views

4-player arena game networking model : dedicated servers? [closed]

So my question is not technically limited to 4-player games, but there has been a lot of games on steam lately (brawlhalla, duck game etc) that seem to be quite popular lately. My question is, are ...
user avatar
  • 1,417
1 vote
1 answer
988 views

InvalidOperationException when peeking from a stack within custom editor

I've got a simple state machine for handling game states which works using GameObjects that I enable/disable in order to switch the states. Since some states can be ...
user avatar
  • 459
2 votes
1 answer
2k views

Game states & passing data between scenes

I'm not entirely sure if I'm doing this right, but I always considered the scene system in Unity as some sort of state management (rather than e.g. a level system) which allows to group the contents (...
user avatar
  • 459
0 votes
1 answer
79 views

Ideas for refactoring regarding simple state management in entities and level

I'm actually developing a very simple 3D game, Arkanoid/Breakout style, with very simple mechanics, and it's progressing while I learn the game dev domain own concepts and techniques (My background is ...
user avatar
  • 155
1 vote
1 answer
423 views

Managing game states (states flow, controlling the state machine...)

I am currently struggling really bad to make the game states management. Before we dig into the problem, I must point out that I do know about state machines, I do have both implemented (states and ...
user avatar
  • 183
-1 votes
1 answer
72 views

Game State being skipped

One of my game states is being skipped (pressing space goes straight to the 'GameScreen' game state skipping the 'CharSelect' state). All help is appreciated. ...
user avatar
2 votes
1 answer
176 views

How to propagate component updates? (Changing components at runtime)

Whenever an entity is being added to an entity controller (which is essentially just a bag of entities), I scan through it's components to figure out if I need to register additional entity processors ...
user avatar
  • 459
1 vote
3 answers
5k views

libGDX best way to do Game States

I'm making a JRPG in libGDX, and I'm working with Screens. I have a main Screen called GameScreen, a screen for battles called BattleScreen and I want to make a screen for managing party members and ...
user avatar
3 votes
1 answer
123 views

Can USB device be aware of in-game death?

I intend to design a peripheral that changes state (in this case, LED color) in response to software state (ideally, player death in-game). I have adequate experience in manufacturing design, but not ...
user avatar
  • 139
1 vote
1 answer
121 views

States within a GameState?

I ended up coming up with having states within game states. For example: States splash menu tracks garage loading play What bothers me is that I now have states within the play state to handle it ...
user avatar
2 votes
3 answers
1k views

How do I correctly make character sprite direction match player inputs?

In my top down game I can move the character around and the character will even face the direction he is moving. However, there is some weird behavior I'm having: when you hold down one direction and ...
user avatar
  • 249
3 votes
1 answer
914 views

SpriteKit Game State Management

I've created a SpriteKit Mac OS X app and I am using a simple finite state machine to manage the game states. I've seen some solutions, especially for C++ games, where a GameState class and a ...
user avatar
  • 147
2 votes
1 answer
98 views

Game State query -- Are Game states and Game Phases the same thing?

I am currently writing a simple board game app. I have written some basic states which are more to do with global state of the game. Currently they are just enums, they don't really do anything nor ...
user avatar
0 votes
2 answers
1k views

Storing a block world

I've gotten a basic Minecraft clone working (thanks to gamedev.stackexchange's help! ^_^), but know I have no idea how to save the file. Minecraft itself uses a naive list of block ids as far as I ...
user avatar
  • 257
1 vote
2 answers
290 views

Client Tells Server What Gamestate Data to Send Back

I'm just stepping into the world of MMORPGs and how they function, so assume I know very little. in a game, a client doesn't see everything that the server does. For example, the client can't see ...
user avatar
3 votes
1 answer
646 views

Is there a pattern for handling multiple game states?

I'm experimenting with writing a multiplayer game, almost from scratch (I'm using C++, OpenGL, ENet, and platform-specific APIs) with a client/server networking model where the server is authoritative....
user avatar
13 votes
2 answers
3k views

How would a game-state snapshot system be implemented for networked real-time games?

I want to create a simple client-server real-time multiplayer game as a project for my networking class. I've read a lot about real-time multiplayer network models and I understand the relationships ...
user avatar
1 vote
3 answers
111 views

c - Starting an user defined function after the current one ends

The game I am creating displays a menu before starting, the user may select to start the game, or do some stuff. When the user selects an option, I need to call another function which actually does ...
user avatar
1 vote
1 answer
1k views

Slick2d - state change problem

In my slick-based game, I have 4 states - introState, gameState, pauseState and menuState. From the gameState, I want player to go to either menuState or pauseState. To do that, I did this in ...
user avatar
3 votes
1 answer
117 views

Informing objects within a particular state of the world state

Following the State pattern, every state in my game is a derived object that reflects a particular segment of the game (MenuState, PlayingState, GameOverState, etc.) Each of those state objects holds ...
user avatar
1 vote
1 answer
4k views

How to prevent a circular dependency between an entity and its state? [closed]

I've read this question, and I think it has some good answers and discussion, but it appears to focus primarily on rendering. I have a different problem in the management of a game entity's state. ...
user avatar
4 votes
1 answer
2k views

How to structure complex global game state?

Assume you're working on an RPG like Fallout and you have all sorts of flags and variables tracking the state of the world. Stuff like: Talked to NPC X Opened chest Y Completed quest 1 Visited some ...
user avatar
  • 3,554