-
Notifications
You must be signed in to change notification settings - Fork 1
/
about.txt
134 lines (97 loc) · 3.55 KB
/
about.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
Wannta create fsm for defold, so. It should be like playmaker for Unity (technically)
So:
+ All available commands should be described with single line
+ On enter state should run all commands, attached to them
+ Transitions should not have callbacks, just switching states
+ FSM should have variables and ability to control from external space (like, entity health)
+ Ability to move data to JSON? What part of data can be described as data?
Is it possible to fnd online visual editor for states at least? With JSON export
+ FSM should be described as easy as possible
+ Some actions can be triggered in any time. So here is should be ability to bind/unbind stuff.
+ State joined - bind conditions (event, value cond., trigger?), State leaved - unbind it
+ Some actions can be run once, per frame (translate?). per second
+ FSM we will use: https://github.com/unindented/lua-fsm/blob/master/src/fsm.lua
Think about Eva integration, since we have already a lot of ready API
Think about Tiled integrations
Think about Eva Events instead FSM, it can be more useful (if it will be as part of Eva module)
FSM shoulbe be possible to use as script, gui_script and lua module
Script and gui_script have additional commands to control entity
+ Split commands in separate namespaces, like adam.gui/go/timer/operators?
What actions can be?
Animations:
any go/gui animate for any param (fire another event at end)
play flipbook/spine
animation control (pause/slow/fast)
Sys:
Quit/Reboot? (See eva.game)
Timer:
only delay?
Operators:
check or do something with any variables
vmath stuff
math stuff
Arrays:
check or do something with array variable
Entities:
spawn something
delete something
Other:
msg post
sound play
print
debug traceback?
Camera:
how we can work with camera?
Physics:
We should have triggers for entities?
Add forces? Idk, never used physics before
GUI:
almost all gui ref? what it can be more useful?
Network? - I rarely use HTTP, so not by me
How it can be used? for example bossfight start?
we should describe one state with several actions
Somehow we trigger FSM from "initial state" to "prepare for battle" state
PrepareForBattle Event:
- adam.sound.play("battle_start")
- adam.camera.center_to("go_id", 2)
- adam.animation.play_flipbook_self("battle_start", "on_next_prepare")
// on_next_prepate will transition to other FSM state
PrepareForBattleLamp1 Event:
- adam.animation.play_flipbook("firelamp1")
- adam.sound.play("firelight")
- adam.time.delay(1, "on_lamp_next")
PrepareForBattleLamp2 Event:
- adam.animation.play_flipbook("firelamp2")
- adam.sound.play("firelight")
- adam.time.delay(1, "on_lamp_next")
PrepareForBattleLamp3 Event:
- adam.animation.play_flipbook("firelamp3")
- adam.sound.play("firelight")
- adam.time.delay(1, "start_battle")
StartBattle Event:
- adam.sound.play("battle")
- adam.msg.post("path-gui?", "appear_boss_gui", "params?")
- adam.event("idle")
IdleBoss Event:
- adam.animation.play_flipbook_self("idle")
- adam.timer.delay(0.5, "make_action")
BossChooseAction Event:
- adam.operation.random(1, 3, "rndvalue")
- adam.math.eq("rndvalue", 1, "action_1")
- adam.math.eq("rndvalue", 2, "action_2")
- adam.math.eq("rndvalue", 3, "action_3")
BossAction1 Event:
- adam.animation.play_flipbook("attack1")
- adam.go.spawn("spike1", "pos1?")
-- etc, spawn spikes with delay
How I should it describe in code?
How I should debug this?
fsm.events.BossChooseAction:bind(adam.*)
fsm.events.BossChooseAction:bind(adam.*)
fsm.events.BossChooseAction:bind(adam.*)
or
fsm.events.BossChooseAction(
adam.*,
adam.*,
adam.*
)