Generally used in correlation with a state machine.
37
votes
10answers
6k views
Game State 'Stack'?
I was thinking about how to implement game states into my game. The main things I want for it are:
Semi-transparent top states-being able to see through a pause menu to the game behind
Something ...
26
votes
10answers
3k views
Alternative to Game State System?
As far as I can tell, most games have some sort of "game state system" which switches between the different game states; these might be things like "Intro", "MainMenu", "CharacterSelect", "Loading", ...
20
votes
5answers
1k views
Reasons to disable game save during combat (e.g. Mass Effect 2)
So I've been playing Mass Effect 2 (PC) and one of the things I've noticed is that you can only save your game when you're not engaged in combat. As soon as the first enemy shows up on your radar, ...
13
votes
3answers
3k views
Finite state machine in C++
So, I've read a lot about using FSMs to do game state management, things like what an FSM is, and using a stack or set of states for building one. I've gone through all that. But I'm stuck at writing ...
12
votes
2answers
589 views
Design of a turn-based game where actions have side-effects
I am writing a computer version of the game Dominion. It is a turn-based card game where action cards, treasure cards, and victory point cards are accumulated into a player's personal deck. I have the ...
10
votes
2answers
1k views
Data-driven animation states
EDIT: To clarify what exactly my question is: is this a good way to handle animations / animation state in a game engine with the eye on content creation / management? What are the flaws in doing it ...
9
votes
3answers
2k views
Game state management techniques?
First off, I'm not referring to scene management; I'm defining game state loosely as any sort of state in a game which has implications about whether or not user input should be enabled, or if certain ...
9
votes
2answers
525 views
Good practices in screen states management?
I wonder what are the best ways to organize different screens in a game?
I am thinking of it like this:
Inheriting a base State class, and overriding update and render methods, to handle the current ...
9
votes
1answer
4k views
Behaviour tree code example?
http://altdevblogaday.org/2011/02/24/introduction-to-behavior-trees/
Obviously the most interesting article I found on this website. What do you think about it ?
It lacks some code example, don't ...
8
votes
5answers
3k views
game state saving/loading?
what is the most used method or algorithm for saving game state (profiles), databases text files how there encryption goes and things related.
I have seen Caesar IV used mySQL.
any suggestions.
8
votes
2answers
239 views
Is there a design flaw when an entity's state doesn't fully utilize enter(), execute() and exit()?
I'm following Mat Buckland's Programming Game AI by Example, and I find that I don't always have use for enter(), execute() and exit() on an entity's state. For example, in an RPG, a weapon may have ...
8
votes
3answers
918 views
Is there a pattern for writing a turn-based server communicating with n clients over sockets?
I'm working on a generic game server that manages games for an arbitrary number of TCP socket-networked clients playing a game. I have a 'design' hacked together with duct-tape that is working, but ...
8
votes
2answers
919 views
Game state and input handling in component-based entity systems
My question is:
How can I handle game states in my entity system, without resorting to keeping a stack of game state objects around?
So the design of my entity system means that when an entity needs ...
7
votes
2answers
3k views
How to structure a simple game server for a multiplayer game?
I would like to create a simple multiplayer game server for a simple game:
The game is supposed to be similar to Command & Conquer, you have a few tanks and a few soldiers. You can select one ...
7
votes
6answers
2k views
Storing game state at exit on the iPhone with Objective-C
How would you store your game state at exit for an iPhone game written in Objective-C?
7
votes
4answers
476 views
Simultaneous game states
I think I understand the basic idea behind a Finite State Machine-based game loop. But I'm trying to write a little game in which the same object can simultaneously be in multiple, independent states. ...
7
votes
1answer
467 views
How to represent a game character in code?
In a previous game I wrote I had a game character class. This class tracked the location, velocity, and a set of states. Except the states were tied very close to the animation. Each state would have ...
6
votes
1answer
340 views
What should “own” the battle state in combat between the player and NPCs?
I have a Map, a Tile, NPCs and the Player. When a player enters a tile in the map, a moveTo event is fired, which calls for any NPCs associated with that tile to be "activated". Those NPCs may be ...
6
votes
3answers
910 views
How should the actual game interface with the menu system
I'm using the Game State Management (GSM) concept in my prototype and I like it very much. One of the screen has a "Game" embeded in it, where all the "good stuff" happens. The menu launching the game ...
6
votes
2answers
392 views
State changes in entities or components
I'm having some trouble figuring how to deal with state management in my entities.
I don't have trouble with Game state management, like pause and menus, since these are not handled as an entity ...
6
votes
3answers
315 views
Common ways to keep up with character state in a 2D game?
I am currently developing a 2D Blockdude clone for learning purposes and am wondering about storing character state in the game. For example, the character can be facing either right or left. What are ...
6
votes
1answer
673 views
What methods should save/load a game state
There are a lot of articles about how to save a state of a game and they are pretty good. But I have one conceptual misunderstanding where should I save the state?
My game has number of screens and ...
6
votes
2answers
826 views
How should I structure my turn based engine to allow flexibility for players/AI and observation?
I've just started making a Turn Based Strategy engine in GameMaker's GML language... And I was cruising along nicely until it came time to handle the turn cycle, and determining who is controlling ...
5
votes
3answers
472 views
For games that time stamp a saved game (think Half-Life), is the entire game state really being saved every time?
It seems to me if that were the case that your directory of saved binaries or serialized objects could get massive real quick. Is there some sort of strategy being employed on top of the State pattern ...
5
votes
2answers
522 views
Integrating an AI state machine with actions that take more than 1 tick
Background: I'm having a problem conceptualising something which seems to be pretty fundamental. We have, what I believe to be, a traditional 'game loop', which runs at 60 fps and iterates through ...
5
votes
5answers
508 views
C++: Game State Logic other than switch statement?
Executive summary
Are there any good tutorials on Game State FSMs, particularly OOP/OOD-based and not switch-statement-based?
Summary
Is there a practical process for creating a game state engine ...
5
votes
3answers
624 views
How to update entity states and animations in a component-based game
I'm trying to design a component-based entity system for learning purposes (and later use on some games) and I'm having some troubles when it comes to updating entity states.
I don't want to have an ...
5
votes
1answer
193 views
Design to handle logic within a state
I am designing a new game and I am trying out the entity-component design where entities are comprised of groups of components holding a bunch of attributes. I also have a stack of 'game states' and ...
4
votes
3answers
1k views
GameState management hierarchical FSM vs stack based FSM
I'm reading a bit on Finite State Machines to handle game states (or screens). I would like to build a rather decent FSM that can handle multiple screens.
e.g. while the game is running I want to be ...
4
votes
2answers
2k views
finite state machine used in mario like platform game
I don't understand how to use a finite state machine with the entity controlled by the player.
For example I have a Mario style game (2d platform). I can jump, run, walk, take damage, swim, etc. So ...
4
votes
2answers
274 views
Game state management: the buck doesn't stop “here” soon enough
I realize there are already many Q&As on this site about GameState/GameScreen management, state machines, state stacks, etc. This question is meant as a follow-up:
Suppose hypothetically I ...
4
votes
1answer
2k views
State Machines: State Object versus sequential check: what are the pro/cons?
I dont know much about finite state machine in AI or other game behaviors in game, except this quick tutorial with a Miner: http://www.ai-junkie.com/architecture/state_driven/tut_state1.html which is ...
4
votes
3answers
754 views
Deal with mini states in game
Hi :)
I want to ask what is the best way to deal with "mini-states" in game? For example I making game like Simcity, i can build buildings, roads, rails, or I can change something in economy.
I am ...
4
votes
1answer
81 views
Game State and Configuration via Events
Often "singletons" are problematic for testing, so with my next game I'm trying my best to avoid them. But there is bunch of data (configuration or game state information) that different parts of my ...
4
votes
2answers
2k views
How to structure game states in an entity/component-based system
I'm making a game designed with the entity-component paradigm that uses systems to communicate between components as explained here. I've reached the point in my development that I need to add game ...
4
votes
1answer
312 views
A few questions about entity states
This is the first time I'm trying to make a 2D game, so I'm having quite a few difficulties in getting things right. Right now I'm trying to figure out exactly how the entity state machine should ...
4
votes
1answer
142 views
Deferred contexts and inheriting state from the immediate context
I took my first stab at using deferred contexts in DirectX 11 today. Basically, I created my deferred context using CreateDeferredContext() and then drew a simple triangle strip with it.
Early on in ...
3
votes
3answers
462 views
How can state changes be batched while adhering to opaque-front-to-back/alpha-blended-back-to-front?
This is a question I've never been able to find the answer to. Batching objects with similar states is a major performance gain when rendering many objects. However, I've been learned various rules ...
3
votes
1answer
234 views
Change the tilemap shown on stage in Flixel
I am building a simple platformer using Flixel, beginning with the source code from Flixel creator's EZPlatformer . I would like to adjust the level's tilemap when the player sprite enters/overlaps ...
3
votes
3answers
217 views
Avoiding bouncing between states in an FSM
Suppose you have a simple state machine for a game character with two states:
StandingIdle
Walking
In the update logic for the StandingIdle state you have (pseudo code):
if input received
...
3
votes
1answer
1k views
Handling game states for Android
Currently developing a game for Android. I went through a tutorial to get sprites, loop, etc. up and running, and it all works fine. The way it is currently set up is that Main creates a canvas, the ...
3
votes
2answers
484 views
Android: how do I switch between game scenes in a game? Any tutorials?
I am trying to create a simple game using the Android SDK without using AndEngine (or any other game engine). I have plenty of experience designing games from the past, but I'm having lots of trouble ...
2
votes
2answers
602 views
States, actions logic am I doing it right?
Currently I have the follow states:
Need To Run
Run
Need To Walk
Walk
Need To Fight
Fight
Am I misunderstanding it and mixig possible actions with states ?
I mean, to me Need To Run would either ...
2
votes
2answers
275 views
How do you handle animations that are for transitioning between states?
How does one usually handle animations that are for going between a game object's states? For example, imagine a very simple game in which a character can only crouch or stand normally. Currently, I ...
2
votes
2answers
790 views
Game State Management using Lua
I want to be able to (only) define game states using Lua script, but I'm not sure how I should do it. Here's what I have in mind currently:
For each state, I will create a .lua file that contains a ...
2
votes
1answer
49 views
extrapolating object state based on updates
I have a networked multi-user collaborative application. To maintain a consistent virtual world, I send updates for objects from a master peer to a guest peer. The update state contains
x,y,z ...
1
vote
4answers
234 views
Knowing state of game in real time
I'm trying to code a tic tac toe game in java and I need help figuring out how to efficiently and without freezing the program check if someone won the game.
I'm only in the design stages now, I ...
1
vote
3answers
1k views
Game state sharing data
A game is a set of Game States.
Each Game State contains game objects, may be list, may be scene graph or any other data structure.
We can use Game States as Game Locations, too.
How do you share ...
1
vote
5answers
2k views
How to pause and resume a game in XNA using the same key?
I'm attempting to implement a really simple game state system, this is my first game - trying to make a Tetris clone. I'd consider myself a novice programmer at best. I've been testing it out by ...
1
vote
2answers
152 views
persistence of objects between game states
What are the possible ways of sharing different objects between game states and how do other engines implement such system?
Lets say a game has a couple of states (a menu state and a game state for ...
