State
2025/12/27
- Type
- Learning Resource
- Format
- Glossary Article
- Version
- General
- Subject Tags
- Created
- Updated
- 2026/02/16
- 2025/12/27
We call the state of a program a snapshot of all the data loaded in the computer's memory that belongs to the program. It's the sum of all the values assigned to all the variables in the program.
It can also mean a group of variables; for example, the "player's state" is the group of all variables that describe the player's position, health, and so on.
In the context of a Finite State Machine, a state is a specific condition or situation in which a system can be.
Imagine a very simple program with a single variable that never changes its value. The program's state is always a single piece of data, 1.
var initial_value := 1Let's add a line that changes the value of the variable. At the beginning, the state is 1, but after the _ready() function is executed, it becomes 2.
var initial_value := 1
func _ready() -> void:
initial_value = 2In a real program, the state is much more complex. In a Godot game, there may be hundreds or thousands of nodes, each with dozens of properties like their position, rotation, material, and so on.
A snapshot of all those values at a given point in time is the game's state at that time. A part of this could be written to disk; we refer to this as serializable state.
Don't stop here. Step-by-step tutorials are fun but they only take you so far.
Try one of our proven study programs to become an independent Gamedev truly capable of realizing the games you’ve always wanted to make.
Get help from peers and pros on GDQuest's Discord server!
20,000 membersJoin ServerThere are multiple ways you can join our effort to create free and open source gamedev resources that are accessible to everyone!
Sponsor this library by learning gamedev with us onGDSchool
Learn MoreImprove and build on assets or suggest edits onGithub
Contributeshare this page and talk about GDQUest onRedditYoutubeTwitter…