-
Notifications
You must be signed in to change notification settings - Fork 3
Ember Conflict Bot System
Note that the Bot System is far from completed, here is what we currently have and some information about the design and future implementations.
Representing a fake player, it's identical to real player except the commands are issued by the bot running inside battle server.
Each bot will have a brain, it can be either a different kind, or can be customised with different parameters.
Each brain is a combination of plans (explained below), in bot config you can not change what plan to be included in the brain, but you can adjust the parameters of each plan.
The design is for easier creation of specific brain for different senarios, we probably will end up with many diffrent brain if we needed, currently there is no easy way to pick up brain based on players status (except in zone level or in scenario level), in the future we may add more advance logic to pickup a "right" brain for the user.
This is responsible for deploy new squads when resource been available.
This is responsible for commanding a single squad, based on plans attached to this squad.
Each squad of the bot are controlled via different plans, at a given moment, exact one plan is activated, the current plan will decide the behaviour of the squad.
Each plan might have up to 5 states, e.g. ChasePlan have 2 states, the first one is when there is enemy in attack range, the second one is when no enemy in attack range.
You need to know the id of each state to customize them, detail information can be found under each plan's section.
For each state of plan, a number is associated, it's used for the system to choose which plan to choose to execute after current one expired. When a squad need a new plan, it will ask each plan to update their states, then use random value to choose from all of the plans, the weight here basically means how likely a plan will be choosen comparinig to others.
Bot AI related settings live under Bots/*.json, here is a quick example.
"bot": {
"brain": "simple",
"plans": {
"chase": {
"weight_0": 100,
"weight_1": 100,
"weight_2": 100,
"weight_3": 100,
"weight_4": 100,
"min_duration": 5,
"max_duration": 10,
"min_delay": 1,
"max_delay": 5,
"force_odds": 0.1,
"target_odds": 0.1
}
}
}
Note that both brain type and plan types are lowercase.
For each plan exist in the brain, these are all available parameters can be overrided in config
- weight_0 ~ weight_5: weight value for state 0 to 5, default value is 100
- min_duration, max_duration: minimal/maximum duration of the plan once it's been choosen, the actualy duration will be a random value between them. the value is in seconds.
- min_delay, max_delay: minimal/maximum delay between each execution of the plan, the actualy delay will be a random value between them. the value is in seconds.
- force_odds: the propability of a path being force movement, value should between 0 to 1.
- target_odds: the propability of a path being target movement, value should between 0 to 1.
Note about the duration and delay: each plan is in active state, but it won't keep running, it will schedule itself based on the delay here, the reason is that the only way we interact with the system is via creating new path or stop, so the number of operation is actually very low, though the added path will keep being effective just as pathed created by users.
Only plans that create path will use the force_odds, and target_odds might not apply to all movements.
"bot": {
"brain": "empty",
}
It's actually empty, it still have DeployCommander though, so deployment will be still there. This is mainly for test, I usually give one player empty, then I can command it's squads in battle server.
"bot": {
"brain": "simple",
}
Includes following plans:
- ChasePlan
- StandPlan
- PoCPlan
Here only list the states information, the common parameters are common for all type of plans.
The values in the samples are the default values, if the default value is not the same with the common one, will be listed here as well.
"bot": {
"plans": {
"chase": {
"weight_0": 100,
"weight_1": 20,
}
}
}
- 0: when there is enemy in attack range.
- 1: there is no enemy in attack range.
When active, it will chase the closest visible enemy,
"bot": {
"plans": {
"stand": {
"weight_0": 100,
"weight_1": 20,
"min_duration": 2.0,
}
}
}
- 0: when there is enemy in attack range.
- 1: there is no enemy in attack range.
Nothing
"bot": {
"plans": {
"poc": {
"weight_0": 0,
"weight_1": 60,
"weight_2": 500,
"weight_3": 250,
}
}
}
- 0: there is no PoC need to be taken by this squad, all been captured by the team (probably won't happen anyway.)
- 1: this squad is not moving towards any PoC, and no teams is winning with PoC at the moment.
- 2: this squad is not moving towards any PoC, and all PoCs are either already taken by enemy, or in the progress, i.e. losing.
- 3: this squad is on a PoC, and all PoCs are either already taken by us, or in the progress, i.e. winning.
If already on an PoC, will keep there, if not, will move toward the closest PoC.