Generally used in correlation with a state machine.

learn more… | top users | synonyms (1)

1
vote
0answers
25 views

Game logic implemented using TPL / async / await, and performance of it

I'm working on a game, and as a typical game (here using Monogame) it uses frame based approach, where all logic happens in Update() method called every frame. As a consequence, any sequential logic ...
0
votes
2answers
59 views

How to handle global Data within a state machine setup? (C#)

I am currently building a turn-based framework (Unity,C#) I was tired of my former tight-coupled systems and opted for a state machine this time, basically all components subscribe to the state-Enter ...
0
votes
1answer
34 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 loaded additively (such as the ...
0
votes
0answers
92 views

How to make a PROPER main menu (or any other UI windows/modals) in Unity?

So, I'm currently learning both about Unity for the first time as well as the 'new' 2D UI system, but I'm having a hard time figuring out how to make windows, modals/dialogs, main menus etc. which are ...
1
vote
1answer
74 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 ...
1
vote
1answer
70 views

What exactly is a 'set of states'?

Whilst looking into game-oriented applications of programming patterns I discovered a question on this site which suggests that a 'set of states' is superior to a 'stack of states' but does not ...
0
votes
1answer
52 views

Code vs. Configuration in Unity [closed]

I know a thing or two about Unity at this point, but I've still lots of subjective, best practice questions, Such as: How do you decide what values are obtained via Start/Awake initialization, and ...
1
vote
1answer
123 views

Why does my Unity animator state “finish” before the visible motion does?

Example: Screenshot of the TopAppearing motion - boost the alpha of the sprite from 0 to 1 for total of 2 seconds. Screenshot after TopAppearing state has been finished Screenshot of the ...
1
vote
0answers
47 views

State machines and map transitions

I've implemented a [basic] FSM in my game and it currently does its job very well. Recently I have come across a "problem" that I need to show a "Loading map. Please wait..." screen for as long the ...
2
votes
1answer
149 views

Architecture for game character movements with user input and a finite state machine

I have a JavaScript canvas game setup using Phaser framework. When I first made my character able to run, jump, and crouch, I used lots of if/else conditions and ended up with an ugly, buggy mess. I ...
0
votes
1answer
51 views

Changing the duration of motion state transitions in Animator Controller

Anyone around who is experienced with Unity animation states and the Animation Controller? I wonder is it possible in Unity to change the duration of time it takes between motion transitions in the ...
0
votes
2answers
217 views

Fixing enemy behavior state machine in Unity

I'm working on a state machine for my game's NPC. The only thing I can't to get work properly is the hit sequence. The hits register. What I would like to happen is for the attack sequence (animation)...
1
vote
1answer
69 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 ...
0
votes
0answers
72 views

State Machine help

I'm using a state machine for my enemy's AI. I've not worked with state machines before & followed Unity's live training on State Machines. I added a HitState to handle animation sequences. The ...
1
vote
3answers
80 views

How to architect input code to utilise state machine?

I have an InputController which currently handles all user input, so it looks at button states and updates entity intentions according to some simple rules. I'm looking to add a new state to the game ...
3
votes
1answer
30 views

Animations won't transfer states until entire animation is completed

I am following the survival shooter tutorial and am using Unity 5. I just completed this video (linked) and I tested played it to see my animations worked but it seems like it will only transition ...
0
votes
1answer
289 views

How to create a state based traffic signal?

I want to create a traffic light for a Unity3D game. I will model it in blender. What is the best way to control this light in a unity scene? One way I could think of is to change texture of say ...
1
vote
0answers
110 views

Pausing game with State machine and handling jumps

I am adding pause functionality to my upcoming racing game.The players can jump in it. Time.timeScale = 0 is obvious solution to pause game.I am avoiding this solution as users can do in app ...
2
votes
1answer
48 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 ...
0
votes
1answer
128 views

Legacy GUI - run OnGUI only once

I remember something about onGui being able to be run multiple times per frame, and I also seem to recall that you can check 'which state' the onGUI is being run in, so that you can do all of the ...
1
vote
1answer
221 views

Best way to handle movement input?

I'm currently developing a RPG movement system in c++, and tried to use the State Pattern/State machine for this, but AFAIK I would have to check each movement key in every state.(right?) Is there a ...
0
votes
2answers
187 views

State Machine class vs function pointers [closed]

What do you guys recommend to use? A State Machine with function pointers or classes? Or, in which case one would be better than the other one? At work we use the state machine with function ...
1
vote
0answers
304 views

In Phaser, how should I be managing state? [closed]

I'm quite new to Phaser and JavaScript really confused about state management. Phaser has lots of documentation and info on the net, but everyone seems to be doing it a different way. An example: ...
1
vote
1answer
87 views

State system and animation of derived classes

I'm trying to get some kind of state system for my game objects. I have a base Actor class that is derived by classes like Policeman, Informant or Brawler. Each of those classes describes different ...
2
votes
1answer
343 views

How should a Unity object control it's state?

I've been using Unity's component based design, and the biggest problem I've faced is how to control an object's( not component's ) state. The problem is, some components must act differently based ...
1
vote
1answer
495 views

Animation-based Collision Boxes

Background I'm currently working on a top-down 2D game, roughly similar to something like Zelda for the SNES. Certain game entities such as the player or a typical enemy will consist of multiple ...
1
vote
1answer
387 views

how to store game state for a multiplayer board game eg. poker

First Approach: Store the state in database and play with database queries. Could a database handle the load, as poker is quite fast paced, and I have to query/update database for each player move. ...
1
vote
0answers
66 views

How to apply physics when you have sub frame state changes?

I'm currently calculating my physics every 1/100th of a second and using a state machine to manage the current state of the player. In my main loop I'm checking user input and transitioning the state ...
0
votes
1answer
407 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. ...
0
votes
3answers
177 views

Proper way for Player object to communicate with Map object?

I'm writing my first game (in javascript / node over websockets) and am running into a bit of chicken and egg problem, and am afraid how I'm doing it right now won't scale once the game gets more ...
1
vote
2answers
151 views

Should character actions be considered states?

So I've been on a team that has been working on a game for quite a few months now and we're hitting some really nasty bloat problems with our character actions. Question in bold. Accompanying ...
1
vote
3answers
188 views

Modeling player mechanics with a finite state machine

I have three states standing walking jumping When I press D standing transitions to walking. The velocity will be set to a defined value and the player moves. When I release D walking transitions ...
2
votes
1answer
2k 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 ...
0
votes
0answers
269 views

Maintaining State in Mud Engine

I am currently working on a Mud Engine and have started implementing my state engine. One of the things that has me troubled is maintaining different states at once. For instance, lets say that the ...
0
votes
1answer
728 views

Change players state and controls in-game

I'm using Unity 3D Let's say the player is an ice cube. You control it like a normal player. On press of a button, ice transforms (with animation) into water. You control it completely different than ...
3
votes
1answer
221 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 ...
0
votes
2answers
217 views

Synchronizing mob states in online multiplayer game

I'm developing an exploration-based platform game in which from the start there were plans about including local multiplayer support, but recently I've been considering an online multiplayer mode, ...
1
vote
1answer
229 views

How do I change rasterizer state properly?

To set the rasterizer state I have to ID3D11Device::CreateRasterizerState() and then ID3D11DeviceContext::RSSetState. And then I should ID3D11RasterizerState::Release() it, right? How about when I ...
1
vote
1answer
68 views

What is the correct way to seperate (react) view from state?

I would like to know the correct implementation to declare game logic and view logic: I see 3 ways of implementing this: 1.Storing (eg writing preprocessing to store the change to a property) ...
0
votes
1answer
117 views

Entity's FSM and exposing internals of the entity

I'm trying to implement FSM according to Programming Game AI by Example, it is a pretty standard and straightforward FSM that goes like similarly to this (some stuff omitted and translated from C++ to ...
0
votes
1answer
2k views

How to manage input state in Unity3D?

In Unity3D how do I manage input among many components, especially in relation to "blocking" input messages to certain components? To make my question clear, an example: Component 1: Input Manager ...
8
votes
4answers
268 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. ...
0
votes
1answer
143 views

How to handle Gameflow and Progression

Iam building my own 2D Engine and i try to handle the Progression of my Character. For Example when the Player got an special Item an Door opens or when he talks with someone and got an Item the ...
0
votes
1answer
132 views

watching for changes in object state

I'd like to know what others do to watch for changes in object states while the game is running. Say you have an object and that object has a timer. The timer completes. What is the best way to know ...
2
votes
1answer
115 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, ...
3
votes
1answer
2k 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
334 views

Rendering structure [closed]

my question is "What is the best way to structure rendering code". Is it better to make a class with a render function that iterates through all game objects based on there name or type and have no ...
4
votes
1answer
176 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 ...
6
votes
4answers
689 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. ...
5
votes
1answer
296 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 '...