Generally used in correlation with a state machine.

learn more… | top users | synonyms (1)

41
votes
10answers
10k 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 ...
28
votes
10answers
4k 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", ...
19
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, ...
18
votes
1answer
7k 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 ...
15
votes
3answers
4k 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 ...
13
votes
2answers
1k 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 ...
13
votes
3answers
5k 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 ...
13
votes
2answers
2k 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 ...
11
votes
2answers
4k 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 ...
10
votes
5answers
5k 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.
10
votes
2answers
661 views

Good practices in screen states management? [duplicate]

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 ...
10
votes
3answers
2k 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 ...
9
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?
8
votes
2answers
266 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
4answers
202 views

Sending state diffs (deltas) and unreliable connections

We're building a realtime multiplayer game, in which each player is responsible for reporting its state on every iteration of the game loop. The state updates are broadcasted using unreliable UDP. ...
8
votes
2answers
4k 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 ...
8
votes
2answers
837 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 ...
7
votes
4answers
596 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
515 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 ...
7
votes
3answers
2k 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 ...
7
votes
2answers
3k 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 ...
7
votes
2answers
1k 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 ...
6
votes
1answer
382 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
957 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
3answers
395 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
843 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 ...
5
votes
3answers
509 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
3answers
2k 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 ...
5
votes
2answers
683 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
1answer
3k 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 ...
5
votes
5answers
608 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
1answer
271 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
2answers
3k 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
417 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
3answers
970 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
147 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
1answer
343 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
2answers
545 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 ...
4
votes
2answers
907 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 ...
3
votes
3answers
578 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
2answers
720 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 ...
3
votes
1answer
613 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
1answer
64 views

Does calling VSSetShader() twice with the same shader have a performance penalty?

Let's say I render 2 objects that are using the same shader (and the same ID3D11VertexShader object). When I call VSSetShader() to set the shader for the 1st object DirectX has to change previous ...
3
votes
3answers
277 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
2k 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 ...
2
votes
2answers
321 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
1answer
126 views

(Phaser) Preload Future States in Create?

I'm a first time user of Phaser, been trying to make a simple point and click type game. I'm trying to keep things very modular, so I'm defining a list of levels (states) in a JSON, and then every ...
2
votes
1answer
497 views

Fuzzy State Logic or Finite State Machine for AI

My question is regarding the use of fuzzy state logic and finite state machine with AI. What I would like to know is what the key benefits are for both and also some examples of situations where you ...
2
votes
2answers
1k 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
107 views

Using an FSM, how do you clean up state related attributes that may be used from several states?

I'm making a game that plays a bit like Diablo, but you can harvest resources like in an RTS. I have the following states in my FSM: IdleState, ApproachingTargetCoordinateState, ...