Player state machine #3

Closed
opened 2025-11-26 18:03:34 +00:00 by Sara · 3 comments
Owner
  • Class separate from primary player body
  • Capable of controlling animations using travel
  • Capable of controlling movement
  • Can be locked/unlocked based on energy available
- [x] Class separate from primary player body - [x] Capable of controlling animations using `travel` - [x] Capable of controlling movement - [x] Can be locked/unlocked based on energy available
Sara added this to the Iteration 0 project 2025-11-26 18:03:34 +00:00
Author
Owner

Approaches

Function state machine

  • Single function per state, if an enter/exit function is needed, it's a state that immediately moves to the process state, or to the next state.
  • Requires configuring either all in one place, or function-local.
# Approaches ## Function state machine - Single function per state, if an enter/exit function is needed, it's a state that immediately moves to the process state, or to the next state. - Requires configuring either all in one place, or function-local.
Author
Owner

C++ Class State Machine

  • One object to represent all of enter, exit, process, physics process, setup, etc

  • Allows configuring states separate from body

  • very code-dependent, configuration and setup all has to happen in the code. Also difficult to debug as such

# C++ Class State Machine - One object to represent all of enter, exit, process, physics process, setup, etc - Allows configuring states separate from body - very code-dependent, configuration and setup all has to happen in the code. Also difficult to debug as such
Author
Owner

Node State Machine

  • Enter, exit, process and physics process, as well as setup and input functions are all included from the get-go

  • States configured in the editor, separate from the body/machine

  • Makes switching states slightly difficult, as all objects are ticking at once unless told otherwise (opposite of a usual state machine).

  • Makes stacked state machine very easy

# Node State Machine - Enter, exit, process and physics process, as well as setup and input functions are all included from the get-go - States configured in the editor, separate from the body/machine - Makes switching states slightly difficult, as all objects are ticking at once unless told otherwise (opposite of a usual state machine). - Makes stacked state machine very easy
Sara closed this issue 2025-12-01 14:23:54 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Sara/break-utopia#3
No description provided.