Hey guys, so I watched this lecture but I can’t figure out the difference between decisions and actions.
In the last twenty minutes, the scanning was chosen to be a decision for the AI not an action. And the Look too was a decision not an action.
Why is that? Why it would differ? Couldn’t the scan be an action?
1 Like
Hi abdo,
so I just also bumped into this tutorial.
The point here is that because of the design Idea to have this “pluggable System”,
you want to have actions that are only happening when your AI is in a certain state.
So when you are in state A you always attack, when you are in state B you always
try to run away for example. This makes it nice and easy on the one hand, but on the
other hand, it forces you to create some system of conditions that decide when you
switch from state A to B.
That’s where decisions come into place. So, for example, I am in state A where I
explore, then when I see some enemy I switch to state B, where I have some other
action to perform, like attack, for example.
So the “when I see some enemy” - code is what you would put into your decision, because
it makes your system change states.
To answer your question, whether scan could be an action. In principle, almost any code could
be in some action as well as in some decision, it would just mostly make no sense in the
state-changing logic that is built here.
Here we only want to put code into decisions that return some boolean, by which we can decide
whether to switch to another state. In an action, on the other hand, you could very well use some
kind of scanning for some subtask if you needed it.
I know it might still be confusing, but try not to think about the specific code but rather the
big picture of how states, decisions and actions work together.