For strategies and tactics, your AI probably needs to make some rational decisions to make it more intelligent. There are many ways to do this, the easiest way is to write down a few rules of the conditions of action for your tanks and implement them as a finite state machine. FSMs are easy to implement and easy to debug, but it gets tedious later when you want to revise the rules of the conditions or add / remove any conditions. You can also use agent utilities - AI checks the operability of each potential target (for example, hire, retreat, reload / refuel, take cover, repair, etc.) Based on current statistics (ammunition, health, number of enemies and locations) periodically and then selects the most preferred target. This takes more time to implement than FSM, but it is more flexible in the sense that you do not need to change the flow of decisions when you need to add or remove behavior. This makes AI look like it follows a general rule, but is not always predictable. The agent utility is also more difficult to debug and control, because you do not have strict rules for the conditions for tracking how you do with FSM when your AI goes crazy. Another popular method is the behavior tree. Sequences of actions are implemented as a tree structure. This requires more code to write up, but usually gives you a better balance between control and flexibility than the FSM and service agent. These decision-making processes are not mutually exclusive - you can use any method for top-level strategies and another method for low-level tactics.
No matter which decision-making process you choose, you need some input to feed your AI. You can use the influence AI card to determine where on the battlefield is considered hostile and where it is considered safe. The influence map is distributed between the team, so it can also help in group tactics. When your AI involves multiple enemies, it is important to choose the right target. If your AIs choose a target that most people don’t own, the player will feel that the AI is “stupid,” even when sometimes the chosen target is actually the best. You can perform remote verification on enemy units and filter / prioritize the target using the line of sight, the current range of weapons, the level of threat, etc. Some tests are more expensive than others (eye testing is usually one of the worst offenders), so if you have a lot of enemy units within range, you want to run those slower tests last.
Study the steering behavior for tank movement. It covers a lot of vehicle driving behavior, but chasing and dodging are the ones you need the most. Also look at A * to find a way if your tanks must navigate difficult terrain. There are other good solutions that give you the shortest / fastest way, but in the game the shortest / fastest way is not always the best way. If your shortest path is open, but too close to the enemy’s line, you want to give your tank a heuristic to take another route. You can easily customize your path with A *.
What you need to see: finite state machine, utility-based agent, behavior tree, steering behavior, search algorithm *, navigation waypoints or navigation grid, influence map.
Rick juang
source share