Wiki source code of Player State Machine (Test)

Version 37.1 by Alexandros Mloukie on 2025/12/11 03:05

Hide last authors
Alexandros Mloukie 1.1 1 {{toc/}}
2
3 ----
4
5 = 0 - Introduction =
6
7 This document outlines the Finite State Machine infrastructure inherent to the Player Character. It contains and defines:
8
9 * Player States & Overarching Architecture
10 * State Transitions
11 * State Actions
12
13 The player's Finite State machine defines the states and capabilities of the Player Character within the game. Each state is self-contained, and can be transitioned to when certain conditions are met. The state capabilities, transition requirements, and relations to one another are defined within this document.
14
15 == 0.1 - Disclaimer ==
16
17 This document is subject to change as part of the evolving nature of the game's development, and updates will be made accordingly. If anything is not correct or requires further explanation, contact Adam Janus to get further guidance.
18
19 == 0.2 - Terminology ==
20
21 (% class="table-bordered" style="margin-right:auto" %)
22 (% class="active" %)|=(% style="width: 200px;" %)Term|=(% style="width: 1237px;" %)Meaning
23 |(% style="width:200px" %)PC|(% style="width:1237px" %)Player Character
24 |(% style="width:200px" %)(((
25 FSM
26 )))|(% style="width:1237px" %)Finite State Machine
27
28 ----
29
30 = 1 - Core Concepts =
31
32 There are 4 key concepts inherent to the FSM
33
34 (% class="table-bordered" %)
35 (% class="active" %)|=(% style="width: 203px;" %)Concept|=(% style="width: 1234px;" %)Definition
36 |(% style="width:203px" %)State|(% style="width:1234px" %)(((
37 The different, distinct, and self-contained conditions the PC can be in. The PC can only be in **one** state at any given moment.
38 )))
39 |(% style="width:203px" %)Action|(% style="width:1234px" %)(((
40 Describes the different actions, mechanics, and elements the player can engage with.Multiple States can have access to the same Actions.
41
42 Some Actions will Transition from the current State to a new one.
43
44 Actions can induce Statuses on the player.{{wikimacrocontent/}}
45 )))
46 |(% style="width:203px" %)Status|(% style="width:1234px" %)(((
47 Describes an external effect (e.g. buff/debuff) that affects the player (e.g. Blindness, Crippled)
48
49 Statuses can affect the capabilities of the player (e.g. reduce speed), and prevent or allow certain Actions taking place (e.g. no sprinting when Crippled).
50
51 Statuses can prevent or allow the player's Transitions to another State.
52 )))
53 |(% style="width:203px" %)Transition|(% style="width:1234px" %)A Transition refers to the act of moving from one State to another, usually as a result of an Action or Status.
54
55 ----
56
57 = 2 - Player States =
58
59 (% class="table-bordered" %)
60 (% class="active" %)|=State|=Description
Alexandros Mloukie 31.1 61 |{{box}}Idle{{/box}}|Default player State. Allows for most of the movement and combat actions the player can partake in.
62 |{{box}}Controlled Fall{{/box}}|The player is mid-air, but maintains control over the PC.
63 |{{box}}Freefall{{/box}}|(((
64 The player is mid-air, but has lost control over the PC.
65 )))
66 |{{box}}Skating{{/box}}|The player is skating on top of a rail.
67 |{{box}}Rock Climbing{{/box}}|The player is clung onto a climbable rock surface.
68 |{{box}}Rope Climbing{{/box}}|The player is currently on a climbable rope.
69 |{{box}}Grappling{{/box}}|The player is currently utilizing a Grapple Hook tool.
70 |{{box}}Mounted{{/box}}|The player is mounting a vehicle/ridable mob.
71
72 ----
73
74 = 3 - Actions =
75
Alexandros Mloukie 34.1 76 == 3.1 - Traversal Actions ==
Alexandros Mloukie 31.1 77
Alexandros Mloukie 34.1 78 {{warning}}
79 For details on any of the following actions please refer to: Traversal - Technical Design
80 {{/warning}}
81
82 {{info}}Walk{{/info}} {{info}}Sprint{{/info}} {{info}}Crouch{{/info}} {{info}}Jump{{/info}} {{info}}Fall{{/info}} {{info}}Skate{{/info}} {{info}}Rock Climb{{/info}} {{info}}Rope Climb{{/info}} {{info}}Grapple{{/info}}
83
84 == 3.2 - Combat Actions ==
85
86 {{warning}}
87 For details on any of the following actions please refer to: Combat System - Technical Design
88 {{/warning}}
89
90 {{error}}Attack{{/error}} {{error}}Block{{/error}} {{error}}Parry{{/error}} {{error}}Dodge{{/error}} {{error}}Use Off-Hand{{/error}}
91
92 == 3.3 - Interaction Actions ==
93
94 {{warning}}
95 For details on any of the following actions please refer to: Crafting System - Technical Design
96 {{/warning}}
97
98 {{success}}Interact{{/success}} {{success}}Construct{{/success}}
99
Alexandros Mloukie 32.1 100 ----
Alexandros Mloukie 31.1 101
Alexandros Mloukie 32.1 102 = 4 - Statuses =
103
Alexandros Mloukie 34.2 104 == 4.1 - Status List ==
105
106 (% class="table-bordered" %)
107 (% class="active" %)|=Status|=Blocks the following Actions
108 |{{box}}Blinded{{/box}}|{{info}}Skate{{/info}} {{info}}Grapple{{/info}} {{error}}Attack{{/error}} {{error}}Parry{{/error}} {{success}}Interact{{/success}} {{success}}Construct{{/success}}
109 |{{box}}Crippled{{/box}}|{{info}}Sprint{{/info}} {{info}}Jump{{/info}} {{info}}Skate{{/info}} {{info}}Rock Climb{{/info}} {{error}}Dodge{{/error}}
110 |{{box}}Crouching{{/box}}|{{info}}Sprint{{/info}} {{error}}Dodge{{/error}}
111 |{{box}}Sprinting{{/box}}|{{info}}Crouch{{/info}} {{info}}Rock Climb{{/info}} {{info}}Rope Climb{{/info}} {{info}}Grapple{{/info}} {{error}}Attack{{/error}} {{error}}Block{{/error}} {{error}}Parry{{/error}} {{error}}Dodge{{/error}} {{error}}Use Off-Hand{{/error}} {{success}}Interact{{/success}} {{success}}Construct{{/success}}
112 |{{box}}Attacking{{/box}}|{{info}}Sprint{{/info}} {{info}}Rock Climb{{/info}} {{info}}Rope Climb{{/info}} {{info}}Grapple{{/info}} {{error}}Attack{{/error}} {{error}}Block{{/error}} {{error}}Parry{{/error}} {{error}}Dodge{{/error}} {{error}}Use Off-Hand{{/error}} {{success}}Interact{{/success}} {{success}}Construct{{/success}}
113
114 == 4.2 - Action Induced Statuses ==
115
116 (% class="table-bordered" %)
117 (% class="active" %)|=(% style="width: 127px;" %)Action|=(% style="width: 1036px;" %)Applies the following Status
118 |(% style="width:127px" %){{info}}Sprint{{/info}}|(% style="width:1036px" %){{box}}Sprinting{{/box}}
119 |(% style="width:127px" %){{info}}Crouch{{/info}}|(% style="width:1036px" %){{box}}Crouching{{/box}}
120 |(% style="width:127px" %){{error}}Attack{{/error}}|(% style="width:1036px" %){{box}}Attacking{{/box}}
121
122 ----
123
124 = 5 - Transitions =
125
126 == 5.1 - High-Level Transition Diagram ==
127
Alexandros Mloukie 34.3 128 [[image:1765417604690-575.png]]
129
Alexandros Mloukie 35.1 130 == 5.2 - Per-State Transition Tables ==
131
132 === 5.2.1 - {{box}}Idle{{/box}} Transitions ===
133
134 (% class="table-bordered" %)
Alexandros Mloukie 36.1 135 (% class="active" %)|=(% style="width: 324px;" %)Available Actions|=(% style="width: 839px;" %)Transitions to State
136 |(% style="width:324px" %){{info}}Walk{{/info}} {{info}}Sprint{{/info}} {{info}}Crouch{{/info}}|(% style="width:839px" %)-
137 |(% style="width:324px" %){{info}}Jump{{/info}}|(% style="width:839px" %){{box}}Controlled Fall{{/box}}
138 |(% style="width:324px" %){{info}}Fall{{/info}} with Stamina|(% style="width:839px" %){{box}}Controlled Fall{{/box}}
139 |(% style="width:324px" %){{info}}Rock Climb{{/info}}|(% style="width:839px" %){{box}}Rock Climbing{{/box}}
140 |(% style="width:324px" %){{info}}Rope Climb{{/info}}|(% style="width:839px" %){{box}}Rope Climbing{{/box}}
141 |(% style="width:324px" %){{info}}Grapple{{/info}}|(% style="width:839px" %){{box}}Grappling{{/box}}
142 |(% style="width:324px" %){{error}}Attack{{/error}} {{error}}Block{{/error}} {{error}}Parry{{/error}} {{error}}Dodge{{/error}} {{error}}Use Off-Hand{{/error}}|(% style="width:839px" %)-
143 |(% style="width:324px" %){{success}}Interact{{/success}} {{success}}Construct{{/success}} with object or station|(% style="width:839px" %)-
144 |(% style="width:324px" %){{success}}Interact{{/success}} with mount|(% style="width:839px" %){{box}}Mounted{{/box}}
Alexandros Mloukie 35.1 145
146 === 5.2.2 - {{box}}Controlled Fall{{/box}} Transitions ===
147
148 (% class="table-bordered" %)
Alexandros Mloukie 36.1 149 (% class="active" %)|=(% style="width: 324px;" %)Available Actions|=(% style="width: 839px;" %)Transitions to State
150 |(% style="width:324px" %){{info}}Fall{{/info}} land on ground|(% style="width:839px" %){{box}}Idle{{/box}}
151 |(% style="width:324px" %){{info}}Fall{{/info}} land on rail|(% style="width:839px" %){{box}}Skating{{/box}}
152 |(% style="width:324px" %){{info}}Fall{{/info}} out of Stamina or after X seconds|(% style="width:839px" %){{box}}Freefall{{/box}}
153 |(% style="width:324px" %){{info}}Rock Climb{{/info}}|(% style="width:839px" %){{box}}Rock Climbing{{/box}}
154 |(% style="width:324px" %){{info}}Rope Climb{{/info}}|(% style="width:839px" %){{box}}Rope Climbing{{/box}}
155 |(% style="width:324px" %){{info}}Grapple{{/info}}|(% style="width:839px" %){{box}}Grappling{{/box}}
Alexandros Mloukie 35.1 156
157 === 5.2.3 - {{box}}Freefall{{/box}} Transitions ===
158
159 (% class="table-bordered" %)
Alexandros Mloukie 36.1 160 (% class="active" %)|=(% style="width: 324px;" %)Available Actions|=(% style="width: 839px;" %)Transitions to State
161 |(% style="width:324px" %){{info}}Fall{{/info}} land on a solid surface|(% style="width:839px" %){{box}}Idle{{/box}}
Alexandros Mloukie 35.1 162
163 === 5.2.4 - {{box}}Skating{{/box}} Transitions ===
164
165 (% class="table-bordered" %)
Alexandros Mloukie 36.1 166 (% class="active" %)|=(% style="width: 326px;" %)Available Actions|=(% style="width: 837px;" %)Transitions to State
167 |(% style="width:326px" %){{info}}Jump{{/info}}|(% style="width:837px" %){{box}}Controlled Fall{{/box}}
168 |(% style="width:326px" %){{info}}Grapple{{/info}}|(% style="width:837px" %){{box}}Grappling{{/box}}
Alexandros Mloukie 35.1 169
170 === 5.2.5 - {{box}}Rock Climbing{{/box}} Transitions ===
171
172 (% class="table-bordered" %)
Alexandros Mloukie 36.1 173 (% class="active" %)|=(% style="width: 327px;" %)Available Actions|=(% style="width: 836px;" %)Transitions to State
174 |(% style="width:327px" %){{info}}Jump{{/info}}|(% style="width:836px" %){{box}}Controlled Fall{{/box}}
175 |(% style="width:327px" %){{info}}Fall{{/info}} when out of Stamina|(% style="width:836px" %){{box}}Controlled Fall{{/box}} → {{box}}Freefall{{/box}}
176 |(% style="width:327px" %){{info}}Rock Climb{{/info}} end Rock Climb on ground|(% style="width:836px" %){{box}}Idle{{/box}}
177 |(% style="width:327px" %){{info}}Grapple{{/info}}|(% style="width:836px" %){{box}}Grappling{{/box}}
Alexandros Mloukie 35.1 178
179 === 5.2.6 - {{box}}Rope Climbing{{/box}} Transitions ===
180
181 (% class="table-bordered" %)
Alexandros Mloukie 36.1 182 (% class="active" %)|=(% style="width: 327px;" %)Available Actions|=(% style="width: 836px;" %)Transitions to State
183 |(% style="width:327px" %){{info}}Jump{{/info}}|(% style="width:836px" %){{box}}Controlled Fall{{/box}}
184 |(% style="width:327px" %){{info}}Fall{{/info}} when out of Stamina|(% style="width:836px" %){{box}}Controlled Fall{{/box}} → {{box}}Freefall{{/box}}
185 |(% style="width:327px" %){{info}}Rope Climb{{/info}} end Rope Climb on ground|(% style="width:836px" %){{box}}Idle{{/box}}
186 |(% style="width:327px" %){{info}}Grapple{{/info}}|(% style="width:836px" %){{box}}Grappling{{/box}}
Alexandros Mloukie 35.1 187
188 === 5.2.7 - {{box}}Grappling{{/box}} Transitions ===
189
190 (% class="table-bordered" %)
Alexandros Mloukie 36.1 191 (% class="active" %)|=(% style="width: 327px;" %)Available Actions|=(% style="width: 835px;" %)Transitions to State
192 |(% style="width:327px" %){{info}}Jump{{/info}}|(% style="width:835px" %){{box}}Controlled Fall{{/box}}
193 |(% style="width:327px" %){{info}}Fall{{/info}} when out of Stamina|(% style="width:835px" %){{box}}Controlled Fall{{/box}} → {{box}}Freefall{{/box}}
194 |(% style="width:327px" %){{info}}Rock Climb{{/info}}|(% style="width:835px" %){{box}}Rock Climbing{{/box}}
195 |(% style="width:327px" %){{info}}Rope Climb{{/info}}|(% style="width:835px" %){{box}}Rope Climbing{{/box}}
196 |(% style="width:327px" %){{info}}Grapple{{/info}} end Grapple on ground|(% style="width:835px" %){{box}}Idle{{/box}}
Alexandros Mloukie 35.1 197
198 === 5.2.8 - {{box}}Mounted{{/box}} Transitions ===
199
200 (% class="table-bordered" %)
Alexandros Mloukie 36.1 201 (% class="active" %)|=(% style="width: 329px;" %)Available Actions|=(% style="width: 833px;" %)Transitions to State
202 |(% style="width:329px" %){{info}}Walk{{/info}}|(% style="width:833px" %)-
203 |(% style="width:329px" %){{success}}Interact{{/success}} to dismount|(% style="width:833px" %){{box}}Idle{{/box}}