Wiki source code of Player State Machine (Test)

Version 34.2 by Alexandros Mloukie on 2025/12/11 02:42

Show last authors
1 = Table of Contents =
2
3 {{toc/}}
4
5 ----
6
7 = 0 - Introduction =
8
9 This document outlines the Finite State Machine infrastructure inherent to the Player Character. It contains and defines:
10
11 * Player States & Overarching Architecture
12 * State Transitions
13 * State Actions
14
15 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.
16
17 == 0.1 - Disclaimer ==
18
19 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.
20
21 == 0.2 - Terminology ==
22
23 (% class="table-bordered" style="margin-right:auto" %)
24 (% class="active" %)|=(% style="width: 200px;" %)Term|=(% style="width: 1237px;" %)Meaning
25 |(% style="width:200px" %)PC|(% style="width:1237px" %)Player Character
26 |(% style="width:200px" %)(((
27 FSM
28 )))|(% style="width:1237px" %)Finite State Machine
29
30 ----
31
32 = 1 - Core Concepts =
33
34 There are 4 key concepts inherent to the FSM
35
36 (% class="table-bordered" %)
37 (% class="active" %)|=(% style="width: 203px;" %)Concept|=(% style="width: 1234px;" %)Definition
38 |(% style="width:203px" %)State|(% style="width:1234px" %)(((
39 The different, distinct, and self-contained conditions the PC can be in. The PC can only be in **one** state at any given moment.
40 )))
41 |(% style="width:203px" %)Action|(% style="width:1234px" %)(((
42 Describes the different actions, mechanics, and elements the player can engage with.Multiple States can have access to the same Actions.
43
44 Some Actions will Transition from the current State to a new one.
45
46 Actions can induce Statuses on the player.{{wikimacrocontent/}}
47 )))
48 |(% style="width:203px" %)Status|(% style="width:1234px" %)(((
49 Describes an external effect (e.g. buff/debuff) that affects the player (e.g. Blindness, Crippled)
50
51 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).
52
53 Statuses can prevent or allow the player's Transitions to another State.
54 )))
55 |(% 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.
56
57 ----
58
59 = 2 - Player States =
60
61 (% class="table-bordered" %)
62 (% class="active" %)|=State|=Description
63 |{{box}}Idle{{/box}}|Default player State. Allows for most of the movement and combat actions the player can partake in.
64 |{{box}}Controlled Fall{{/box}}|The player is mid-air, but maintains control over the PC.
65 |{{box}}Freefall{{/box}}|(((
66 The player is mid-air, but has lost control over the PC.
67 )))
68 |{{box}}Skating{{/box}}|The player is skating on top of a rail.
69 |{{box}}Rock Climbing{{/box}}|The player is clung onto a climbable rock surface.
70 |{{box}}Rope Climbing{{/box}}|The player is currently on a climbable rope.
71 |{{box}}Grappling{{/box}}|The player is currently utilizing a Grapple Hook tool.
72 |{{box}}Mounted{{/box}}|The player is mounting a vehicle/ridable mob.
73
74 ----
75
76 = 3 - Actions =
77
78 == 3.1 - Traversal Actions ==
79
80 {{warning}}
81 For details on any of the following actions please refer to: Traversal - Technical Design
82 {{/warning}}
83
84 {{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}}
85
86 == 3.2 - Combat Actions ==
87
88 {{warning}}
89 For details on any of the following actions please refer to: Combat System - Technical Design
90 {{/warning}}
91
92 {{error}}Attack{{/error}} {{error}}Block{{/error}} {{error}}Parry{{/error}} {{error}}Dodge{{/error}} {{error}}Use Off-Hand{{/error}}
93
94 == 3.3 - Interaction Actions ==
95
96 {{warning}}
97 For details on any of the following actions please refer to: Crafting System - Technical Design
98 {{/warning}}
99
100 {{success}}Interact{{/success}} {{success}}Construct{{/success}}
101
102 ----
103
104 = 4 - Statuses =
105
106 == 4.1 - Status List ==
107
108 (% class="table-bordered" %)
109 (% class="active" %)|=Status|=Blocks the following Actions
110 |{{box}}Blinded{{/box}}|{{info}}Skate{{/info}} {{info}}Grapple{{/info}} {{error}}Attack{{/error}} {{error}}Parry{{/error}} {{success}}Interact{{/success}} {{success}}Construct{{/success}}
111 |{{box}}Crippled{{/box}}|{{info}}Sprint{{/info}} {{info}}Jump{{/info}} {{info}}Skate{{/info}} {{info}}Rock Climb{{/info}} {{error}}Dodge{{/error}}
112 |{{box}}Crouching{{/box}}|{{info}}Sprint{{/info}} {{error}}Dodge{{/error}}
113 |{{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}}
114 |{{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}}
115
116 == 4.2 - Action Induced Statuses ==
117
118 (% class="table-bordered" %)
119 (% class="active" %)|=(% style="width: 127px;" %)Action|=(% style="width: 1036px;" %)Applies the following Status
120 |(% style="width:127px" %){{info}}Sprint{{/info}}|(% style="width:1036px" %){{box}}Sprinting{{/box}}
121 |(% style="width:127px" %){{info}}Crouch{{/info}}|(% style="width:1036px" %){{box}}Crouching{{/box}}
122 |(% style="width:127px" %){{error}}Attack{{/error}}|(% style="width:1036px" %){{box}}Attacking{{/box}}
123
124 ----
125
126 = 5 - Transitions =
127
128 == 5.1 - High-Level Transition Diagram ==
129
130