Lecture 9 Flashcards
What is decision making?
The ability of a character to decide what to do
What is the difference between internal knowledge and external knowledge for a decision maker?
Internal: Character’s internal state (health, goals, etc.)
External: Information from the game environment (position of other entities, level layout etc.)
What is the output of a decision maker?
An action request
What is the difference between external changes and internal changes?
External: movement, animations
Internal: Beliefs, change in goals
What is a decision tree made up of?
Nodes
How does a decision tree work?
Each node has boolean condition and two children
Start at root node and proceed down tree making choices until a leaf node is encountered
Leaf node contains action
Can the same action be in multiple leaves?
Yes
Decisions can be ______________ to reflect AND or OR clauses
Put into series
What is the difference between binary and n-ary trees?
Binary: two children
N-ary: n children
N-ary marginally more efficient but less easily optimised.
When is a tree balanced?
If there are approximately the same number of leaves on each branch
What is the benefit of having a balanced tree
Guarantees that selecting an action will be performed in O(log2(n)) time
Unbalanced can be as bad as O(n)
When writing a decision tree, the most commonly used checks should be placed
a) close to the rood
b) close to the leaves
a) close to the root
How can a directed acyclic graph be produced?
What do you need to be careful of?
Allow certain nodes to be accessed by multiple branches
Don’t create infinite loops
What elements does an FSM have?
Finite set of states - wif FSM is in same state it will keep performing same action
Initial state
Finite set of transitions between states - triggered by internal or external events
What is a hierarchical state machine?
FSM that groups states belonging to the same context in a higher level state
How do transitions work in HFSMs?
Transitions within highlevel states work normally
Transitions between high level states are triggered from any state in the origin
How do starting states work with HFSMs?
Starting high level state
Starting state within each high level state, used when transitioning in
What are the advantages of behaviour trees?
Can do many things - path finding, planning etc.
Modular, scalable
Easy to develop - GUIs help with creation and manipulation
Can be combined into subtrees for more complex decisions
What is a task?
An activity that, given some CPU time, returns a value
What 3 elements does a basic behaviour tree consist of?
Conditions
Actions
Composites (collection of child tasks)
Where do conditions and actions sit in the tree?
leaf nodes
What 2 composite tasks are there?
Selector - returns success as soon as one child bejaviour succeeds (OR)
Sequence - returns success only if all child behaviours succeed
What symbols are used for selectors and sequences?
Selector: Question mark
Sequence: Arrow
What is partial ordering and why is it used?
Some random order mixed into some strict order
If not used behaviour can quickly become boring