Skip to main content

Questions tagged [state]

Generally used in correlation with a state machine.

Filter by
Sorted by
Tagged with
1 vote
3 answers
275 views

I have managed to create a state machine for my game core, like on turn start, on turn end, and another one. Now lets talk about effect/status. For generic effects such boosting stats for certain ...
Cryptoboink's user avatar
0 votes
0 answers
32 views

I'm working on a third person platformer. The player controller uses a hierarchical state machine taken from this video : https://www.youtube.com/watch?v=OtUKsjPWzO8 Using Unity 6.0. Currently, it's ...
ssnssnss's user avatar
0 votes
0 answers
29 views

I finished following the "setting up character movement" gameplay tutorial and everything works, except for the jump animation, which does not play when jumping. I determined that the issue ...
TechnicalVoid's user avatar
0 votes
0 answers
54 views

I'm writing a game from scratch in C++, using the book Game Coding Complete as a guide. The engine in the book has an event manager which is used to communicate between the game's systems, such as ...
Vitamin C Plus Plus's user avatar
1 vote
1 answer
105 views

I have a base class for Abilities. This is a point and click game, therefore I have Click, Hold and Drag subclasses. What I need to do is remind myself to set the player's AI state to Ability when it ...
Thisisstackoverflow's user avatar
0 votes
3 answers
189 views

In the usual Update() of a state (let's call it Attack for simplicity) of an object state manager ...
Alex's user avatar
  • 103
1 vote
1 answer
1k views

I've been trying to understand how best to approach carrying state over between scenes, and how to save/load game state. I've built an isolated project to focus on building out this approach. You can ...
Samuel Slade's user avatar
0 votes
1 answer
47 views

My aim is to create events within my various states that will broadcast to other GameObjects when to take certain actions and to send certain data without needing to reference each GameObject. I have ...
ssnssnss's user avatar
1 vote
1 answer
153 views

I have a few string arrays for which I can cycle what the current active element is (of which there can only be one at a time) using the number keys. Something like the item inventory in Half-Life. I ...
ssnssnss's user avatar
0 votes
1 answer
161 views

I am creating a Yugioh java game with MVC. I was wondering wich is the better way to manage game states with MVC? I tought maybe I can use State Pattern in Model section with DrawPhase, ...
Zetsu_Zetsu's user avatar
0 votes
0 answers
55 views

I'm new to game dev and I'm learning about quadtrees for planet rendering. I'm curious on how do I separate player state with quadtrees. For example I have a ship A that's getting close to a planet, ...
Memory1's user avatar
0 votes
0 answers
781 views

So, I'm working on a FSM that ticks on every frame. The inner workings can be simplified to this: The user (me) creates the States: ...
YoshGJ's user avatar
  • 535
2 votes
1 answer
3k views

I'd like events/actions (e.g. pressing a button, defeating a mini-boss, etc.) in one area of the game to affect things (e.g. unlock/open door, enable boss spawn) in other areas that are distinct/...
Cloudy's user avatar
  • 1,154
0 votes
0 answers
238 views

After learning Dialog, I've discovered representing game logic using the logic programming paradigm is a lot of fun; the composability and non-locality makes it feel like some kind of superior ECS. ...
smallobsession's user avatar
0 votes
1 answer
608 views

I'm trying to make a multiplayer platformer game. I can almost get client side prediction and server reconsiliation to work, but there is one issue that I just can't wrap my head around. Lets say that ...
Per Henrik Jakobsson's user avatar
0 votes
1 answer
838 views

Currently I am evaluating how to refactor my core game logic since I tried to design most of it in pure ECS but isn't really completely feasible the way I intended it. My game at its core is a turn-...
Christian Ivicevic's user avatar
1 vote
0 answers
133 views

Background I was able to convert simple statemachines like this... Into a BT looking like this (Notation describtion)... ...
genaray's user avatar
  • 517
0 votes
0 answers
176 views

I'm developing a FPS game and I'm considering polling at a high frequency on a separate thread. This decouples the game loop and reading input. I get sub-frame samples and can process those samples ...
Jesse Lactin's user avatar
0 votes
1 answer
868 views

first of all, this is my code, I'm prototyping a state machine using Unity Animator (First Time) and I'm stuck coding a simple burst of speed. ...
Venay's user avatar
  • 207
0 votes
1 answer
116 views

I'm trying to implement a state pattern - having skated by with enums forever - and have hit a bit of a wall when it comes to it's implementation in my game. It's a grid based strategy game with an ...
Robert Lee's user avatar
0 votes
0 answers
1k views

I have an Animator on this gameObject. The Animator hits one state when some parameters are true, it can transition to this state from any state. The parameters are fine because i can see in the ...
Josh Bailey's user avatar
1 vote
0 answers
168 views

I have this (typical) base class: ...
Battyhal's user avatar
1 vote
1 answer
121 views

I am working on a 2D action platformer and I am currently implementing an upwards slash. For a normal horizontal slash, the player must press the attack button. For an upwards slash, the player must ...
DyingIsFun's user avatar
  • 1,337
0 votes
1 answer
77 views

I am following a tutorial called Complete C# Unity Developer 2D: Learn to Code Making Games. In one section we create a text-based game, where we display a canvas with some UI elements to the user. ...
Starnes Student's user avatar
2 votes
4 answers
4k views

I am working on a 2D side-scrolling action platformer. I am currently working on the state logic for my enemies. These are humanoid enemies that walk on the ground They currently have idle, patrol, ...
DyingIsFun's user avatar
  • 1,337
0 votes
3 answers
5k views

I have a state machine that controls my enemy AI. Each AI has a target which may be a Player, an obstacle, a shell, or even a Vector2 position. I'm trying to abstract my "target" member, and my ...
retrovius's user avatar
  • 117
0 votes
3 answers
1k views

I am new to Game Development and Unity. I have written a component for Jumping and Running, CharacterJumpAbility.cs and ...
Vasile Alexandru Peşte's user avatar
0 votes
1 answer
72 views

I'm trying to figure out how to accurately capture the state of the web app by a URL, similar to something like https://jsfiddle.net/, where they create ...
Lance Pollard's user avatar
1 vote
0 answers
51 views

In doing HTML/DOM work, you are working with concrete nodes which you can visibly touch and have a defined shape and boundary. What I'm wondering though is like with a cloud like structure, or like a ...
Lance Pollard's user avatar
0 votes
2 answers
3k views

I am considering to implement AI using ECS which actually contradicts working with naive FSMs. My current idea is to have multiple components which represent the particular state an Entity that has a <...
Christian Ivicevic's user avatar
0 votes
0 answers
125 views

I'm developing a card game in JavaScript in a functional programming style and I'm unsure what is the best way to implement the flow of player actions that require other player actions for their ...
Thiatt's user avatar
  • 101
1 vote
2 answers
2k views

I saw an example of code using HSM for user input, but to me it seems that Pushdown Automata would be a better fit. I'm confused. If I'm right, then after Hierarchical State Machine exits a ...
Philosophical Ragdoll's user avatar
0 votes
0 answers
264 views

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 ...
Rivasa's user avatar
  • 333
1 vote
1 answer
912 views

I currently have the following base class which I inherit from for my player states (e.g. Idle, Walking, Jumping). ...
Alex Tennant's user avatar
1 vote
1 answer
200 views

Battles in my game run fully automatically and return a combat log afterwards. My main game loop looks like this: ...
Iavra's user avatar
  • 23
2 votes
0 answers
2k views

I've been creating an interactive fiction game in javascript that uses an entity component system as described here. The problem I've encountered is in developing the AI system for the game. Ideally, ...
pigasus's user avatar
  • 21
0 votes
1 answer
158 views

This question sounds quite specific, but I mean in general, how do you manage something like a card game when it comes to decks (one for player1, one for player2, ...) and placed cards focused on ...
nitwhiz's user avatar
  • 47
2 votes
1 answer
1k views

I'm in the process of redesigning some of my state management code (there are several features I've grown to dislike in practice..) which was based on this tutorial and others. The issue I'm having ...
aslg's user avatar
  • 342
0 votes
1 answer
184 views

Question: What is the best data structure for GameObjects that have different states and thus different visuals? The situation is: I'm creating a game for mobiles (written in Kotlin, no Engine used)....
Tobias Reich's user avatar
0 votes
1 answer
94 views

I have some questions regarding the XXSetShader and what happens after, for instance I would like to know if when XXSetShader is called the subsequent calls would be bound to that particular shader, ...
Richard Harrow's user avatar
0 votes
0 answers
56 views

I have a grid like map with entities that can perform turn-based actions like moving or growing strength. When I have a task that requires a certain strength, I want to find the entities required to ...
Sven's user avatar
  • 387
0 votes
1 answer
287 views

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 ...
ApheX's user avatar
  • 135
1 vote
1 answer
142 views

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 ...
Nikolai97's user avatar
  • 121
0 votes
1 answer
2k views

When I start my game I get null-references in my OnStateExit of objects that are initialized in the OnStateEntered. After this it goes smooth, so it only occurs at startup before any conditions for ...
bbnkttp's user avatar
  • 101
1 vote
1 answer
175 views

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

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. ...
ronscript's user avatar
  • 501
2 votes
0 answers
2k views

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 ...
Arek's user avatar
  • 181
1 vote
2 answers
2k views

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 ...
user avatar
1 vote
1 answer
1k views

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 ...
artganify's user avatar
  • 469
5 votes
3 answers
3k views

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 ...
artganify's user avatar
  • 469