Questions tagged [fsm]

Finite State Machines model game flow, AI behaviour, or other processes using a set of discrete states and transitions between them.

Filter by
Sorted by
Tagged with
0
votes
0answers
15 views

Player controller (Concurrent FSMs + Animation Graph) question

I'm building a little Player Controller for my new 2D game. I have all the basic things setup and now I would like to get into player state management and anim sincronization. My player will be able ...
0
votes
0answers
80 views

Creating state machines to handle multiple aspects of a game?

So first off, I'm not sure if it matters but I am using SFML and C++. I've been wanting to write a game and I've read a lot on FSMs and what they do/make things easier for managing games, etc. What I ...
1
vote
0answers
97 views

C# FSM for multiple NPC types

Okay, so this is going to be a bit of code that I kind of need help with. Foreword The code below describes an implementation of an FSM now since I am using unity this allows me to create assets ...
1
vote
2answers
404 views

Finite State Machine Horizontal Jump

I'm creating a 2D Sidescrolling Action RPG with MonoGame and I am using a finite state machine. A state consists of an animation and some behavior, only one state can be executed at once, however: If ...
1
vote
1answer
100 views

Proper way to load assets with a FSM transition between menus and actual game

So far I am making a game in C++ and SDL, and the way to switch between the different menus and the actual game is via a Finite State Machine, AKA a stack where I put each state (MenuState, GameState.....
0
votes
1answer
3k views

Best way to implement Finite State Machine for player character in Unity?

I'd like to implement the player in my game as an FSM as described in this guide to programming patterns in games. What is the best way to accomplish this? Should I implement each state as a ...
0
votes
1answer
196 views

Problem understanding finite state machine

I want to use the finite state machine for the ennemies AI in my game. I implemented the pattern and it work fine for my first enemy (enemy A): Enemy is in IdleState by default When enemy see the ...
1
vote
0answers
413 views

Create a stack driven coroutine based state machine for Unity

I am working on a game where I am using a coroutine based state machine which is mostly a multi class implementation of this link. I am using it because it allows me to create multi frame sequences. ...
3
votes
0answers
93 views

Design pattern for allowing components to interact with main state machine

I am making a game using Unity in which I have a main game state machine that controls the current game scenario. My question is how do I handle communication between different components of the game ...
1
vote
1answer
63 views

Managing Discrete Character Animation States

I'm creating a 2D game in which each possible direction of movement for the player, (Up, Down, Left, Right), has its own distinct animation, i.e., they aren't rotations of each other. Currently I am ...
0
votes
1answer
661 views

Finite State Machines for Enemies (AI vs. Entity States)

Finite State Machines are a great tool for simplifying a system where an Entity has many states it can be in with different conditions that determine what state to transition to. This works well for ...
7
votes
2answers
184 views

Maintaining/Updating Large Amount of Player States

I am developing a fighting game to practice my skills in Java and I would like to know what would be the best approach for figuring out how to easily expand the amount of states a player can have ...
1
vote
1answer
110 views

What component should hold the character movements in ecs and fsm?

In the below code, there's a FSM for CharacterState that will be handled also in CharacterSystem. The problem was, I don't know ...
0
votes
1answer
240 views

Should I use single state or multiple state of an entity in finite state machine?

In the below code, is the options I've created whether to use single or multiple states for my character or other entity. Still can't decide which one is better inf using state machines. ...
3
votes
1answer
831 views

Handling data logic on libgdx ai state machine or in ashley system?

In this below example, I've combined libgdx ashley and AI state machine. Do you think it's a good idea to handle the logic in state machine or stick on handling the data logic on System? ...
1
vote
0answers
476 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
1answer
97 views

FSM AI design with no accept states

I'm new to game development and design, I've been looking forward to doing FSM AI design as it seems interesting to me, but I have a question that I see no answer for in the internet. I've seen FSM ...
2
votes
0answers
187 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 ...
3
votes
2answers
692 views

Problem with coroutines unity 3d

I cannot understand why the coroutines are not waiting the designated number of seconds before executing the code below it. At the moment, the animation bleeds into the next state. I could get around ...
0
votes
2answers
736 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
1answer
1k views

Finite-state machine with more than one concurrent state

I am using a FSM for the player entity and it is working fine. Currently the entity has one state and only one (e.g. paralyzed). The entity's state process() method is called every turn. It is ...
1
vote
2answers
381 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 ...
5
votes
1answer
2k views

Can a behavior tree represent the same logic as a finite state machine?

So I was just learning about Behaviour trees and I thought they're really cool. So I decided to use them in my games. But what I don't quite understand is: Short: Can everything done in an FSM, be ...
6
votes
2answers
178 views

Must all AI states be able to react to any event?

FSMs implemented with the State design pattern are a common way to design AI agents. I am familiar with the State design pattern and know how to implement it. How is this used in games to design AI ...
0
votes
1answer
327 views

How do I implement following behavior with a state-based AI? [closed]

I'm making a 2D game with two spaceships flying around shooting each other. One spaceship is controlled by the user, the by an AI. I want to use a simple Finite State Machine (FSM) for the AI. I'm ...
1
vote
3answers
555 views

How can I notify my AI systems that a target has died?

I am currently building a game focusing on AI for my university and this is my first time writing such a complex AI system. Naturally, I ran into a little logic problem: In the game, the AI uses a ...
0
votes
1answer
133 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
197 views

How to handle Gameflow and Progression?

I am building my own 2D engine and I try to handle the progression of my character. For example, when the player has a special item an door opens or when he talks with someone and has an item, the ...
2
votes
1answer
144 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, ...
5
votes
1answer
3k 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 ...
4
votes
1answer
197 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
357 views

AI system recommendations for a Hive mind system

Im currently starting to work on a game project where a player will be faced against an enemy which has a hive mind. I was wondering if anyone could recommend an A.I system which I could use as at the ...
6
votes
4answers
1k 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
340 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 '...
1
vote
1answer
203 views

State machine interpreters

I wrote my own state machine tool in C and at this point I'm faced with two choices for specifying state machines. Crafting a little language and writing a interpreter. Writing a compiler for that ...
1
vote
0answers
572 views

State Machine with State per Entity [closed]

I have a generic state machine implementation like this: ...
0
votes
1answer
264 views

Implementing a FSM with ActionScript 2 without using classes?

I have seen several references of A.I. and FSM, but sadly I still can't understand the point of an FSM in AS2.0. Is it a must to create a class for each state? I have a game-project which also it has ...
0
votes
1answer
394 views

Basic AI FSM - Handling state transition

I'm starting to study on how to implement game AI, and it seems to me that a very simple FSM for my Pong demo would be a nice way to start. My vision on implementing this would be to have a basic ...
1
vote
1answer
330 views

Stack based state design for isometric character movement, am I doing it right?

I have been reading around about stack-based FSM, and I found it to be perfect for my game. However, when a character moves, it consequently have to face in some direction (and animation of each ...
5
votes
5answers
2k views

Implementing game state without switch statements everywhere?

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 ...
14
votes
2answers
4k 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 ...
6
votes
3answers
6k 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 ...
23
votes
3answers
8k views

How to wire finite state machine into component-based architecture? [closed]

State machines seem to cause harmful dependencies in component-based architectures. How, specifically, is communication handled between a state machine and the components that carry out state-related ...
7
votes
2answers
980 views

What is a convincing Berserker enemy AI finite state machine for a Roguelike

I'm looking for a way to create a convincing Berserker enemy in a Roguelike I've been creating for some time. You may assume a game like NetHack for this when considering what kinds of actions can be ...
3
votes
3answers
342 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): ...
1
vote
3answers
175 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 ...
6
votes
2answers
1k 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 ...
4
votes
2answers
985 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 ...
6
votes
3answers
7k views

Using components in the XNA Game State Management example?

In the game state management example at the App Hub, they say that if you want to use components in the example you can extend the GameScreen to host other components inside itself. I'm having a ...
7
votes
2answers
6k views

How to transition between states and mix states in a finite state machine?

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 ...