Tagged Questions

Generally used in correlation with a state machine.

learn more… | top users | synonyms (1)

1
vote
0answers
361 views

In a state machine, is it a good idea to separate states and transitions? [closed]

I have implemented a small state machine in this way (in pseudo code): class Input {} class KeyInput inherits Input { public : enum { Key_A, Key_B, ..., } } class GUIInput inherits Input { ...
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 ...
0
votes
1answer
2k views

Is Goal-Oriented Action Planning (GOAP) a valid replacement for state machines outside the realm of AI?

I just learned about Goal-Oriented Action Planning (sources below) as used in AI programming. I'm making a state machine for a player-controlled character and was wondering if it can be replaced by a ...
6
votes
3answers
404 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
862 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 ...
3
votes
3answers
281 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 ...
0
votes
3answers
120 views

Keeping per-client data, when using singleton-based states

In my game, I deal with a lot of units. Every unit implements a state machine, and changes states quite often. As a result, I'd like to keep my states as singletons, since I want to avoid the creation ...
1
vote
3answers
165 views

Changing game object type: reinstantiating the object, or switching an object state

I work on a strategy game, where the player occasionally has to transform ordinary citizens into the so called "leaders". Leaders are temporary units, which the player can control directly, in order ...
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 ...
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 ...
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 ...
1
vote
2answers
391 views

How granular should entity states be?

I'm writing a component-based entity system and one of the components is the entity's state, which dictates how it reacts to game events. In case anyone has experience with implementing states, how ...
6
votes
3answers
963 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 ...
5
votes
2answers
699 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 ...
2
votes
2answers
325 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 ...
14
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 ...
-1
votes
3answers
2k views

C++ GameState management

I have been attempting to make a game engine in C++ and have come across the dilemma of game state management. I have done a lot of research and found numerous ways of accomplishing from game engine ...
18
votes
1answer
8k 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 ...
4
votes
1answer
347 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 ...
5
votes
3answers
511 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 ...
6
votes
1answer
389 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 ...
3
votes
2answers
738 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 ...
1
vote
1answer
151 views

Followed the XNA GameStateManagement sln, but my doesn't work. What am I doing wrong?

If someone has the time I wanted to know if you would be willing to check out my solution file here: http://elvis.rowan.edu/~majeko02/AwesomeShip.zip I followed the XNA GameStateManagement on AppHub, ...
3
votes
3answers
583 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 ...
11
votes
2answers
678 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 ...
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 ...
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, ...
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 ...
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 ...
0
votes
1answer
277 views

Distinction between constant and changeable game objects in save/load game?

Do you distinguish constant and changeable game objects when you save/load game? If yes, how do you do it? If not to save constant objects (for example, mountains and trees), we optimize memory usage ...
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 ...
7
votes
1answer
519 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 ...
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 ...
4
votes
3answers
994 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 ...
11
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.
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", ...
42
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 ...
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 ...
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?