Closed Z-Puyu closed 3 days ago
Framework: Utility AI YouTube lecture.
The agent comes with a set of possible goals, for example:
The agent observes the current game world and capture its environment.
The agent starts to analyse the environment. During this process, it has some considerations which will assign an importance score to each goal based on the environment's parameters.
Then, the goals are passed to a planner to plan out the moves.
Agent
: the AI.
Goal
: a set of desired environment parameters that the agent wishes to achieve with its actions.
Environment
: keeps an internal dictionary of game world parameters.
Parameter
: a string-integer pair to describe a certain aspect of the current game world's state.
Consideration
: captures a curve to map a parameter value to its importance for each of the goals.
Framework: Goal-Oriented Action Planning YouTube tutorial.
The planner receives a list of goals sorted based on their importance.
For each goal, the planner tries to search among all possible moves that can be taken to influence the current environment.
A move will map an environment to a different one.
During combat, the planner will make a move first, and predict what the opponent will react with another move.
Once an environment that matches the desired one of the goal, a plan will be constructed using the past moves.
A prudence level can be pre-defined or configured for each different agent to determine how deep its planner will search before returning all valid plans.
If no perfect plan can be found, those which are the closest to the desired environment will be returned as "good enough" plans.
The planner will use the goal's importance and the "goodness" of the plan to evaluate each plan.
All plans are then passed to the decision maker.
Planner
: use BFS to search for all plans.
Move
: an IAction<Environment, Environment>
to influence an environment. Each move should have a cost and an expected gain.
Plan
: contains a stack of moves. Each plan should have a cost and an expected gain.
The decision maker receives a list of plans sorted based on their scores.
If there is an ongoing plan currently, this plan will be re-evaluated and put back to the collection.
One plan is picked based on the plan's score and the decision-making mode.
The decision-making modes:
Logical
: consider all plans which are better than half of all the choices and select one based on weighted probability.
Deterministic
: randomly select one plan among those with the highest score.
Stochastic
: randomly select one plan among all plans.
Sabotage
: choose a worst plan.
At each turn, the next move of the current plan will be executed.
DecisionMaker
: a component to make the decisions.Implemented the "observing" stage.
Implemented the "planning" and "decision-making" stages.
We might need someone with more experience in this to optimise the AI... :( For now, this simple framework without opponent predication should be good enough.
Explore GOAP AI mechanics.
Build a GOAP system and integrate with the current state machine.
Test the system using the current combat logic.