Wiki source code of Player State Machine (Test)

Version 17.1 by Alexandros Mloukie on 2025/12/11 01:56

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}}|
64 (% style="background-color:blue" %)
65 |{{box}}Controlled Fall{{/box}}|
66 |{{box}}Idle{{/box}}|
67 |{{box}}Idle{{/box}}|
68 |{{box}}Idle{{/box}}|
69 |{{box}}Idle{{/box}}|
70 |{{box}}Idle{{/box}}|
71 |{{box}}Idle{{/box}}|