Welcome Guest [Log In] [Register]
Add Reply
The Artificial Intelligence
Topic Started: Friday 24-02-2012, 06:26 (146 Views)
Legatus
Administrator
Here's a bit of insight into how the artificial intelligence might work. It's a bit brute-force and flawed, but it's a start.

1. Sort the list of controlled units.
*More durable units are moved to the top of the list.
*Healers are moved to the bottom of the list.

2. Select the first unit on the list and do the following.

3. Scan for unit within attack/healing/buffing range. Add every enemy within range to a list.
*Also scan for potential area of effect spots near the enemies and add them to another list.

4. For each unit/AoE spot in the list, simulate the effects of every ability available.

5. Execute the ability with the best results on the best target.
*When selecting the spot to attack from, move as far from allies and enemies as possible. If this goes well, emergent flanking behavior might result. If not... the AI ranks just scatter and the units become easy targets. This is something that needs to be tested and pondered.

6. If there are units remaining in the list of controlled units, go back to step 2.

7. Finished.


I'm already pondering alternate, more complex solutions, like ones based on squads and formations, but before we get there we'll have this.
Edited by Legatus, Friday 24-02-2012, 06:50.
Offline Profile Quote Post Goto Top
 
molater
Member Avatar
Apples
How about we have two IF-THEN statements for healers; one before other units move and one after the other units move.

The first would check to see if any unit in their range is below a certain percentage of health (like OHKO range). If they are, then heal them. If not, then they will be passed over until the second IF-THEN statement.

The second would do the same check except they would heal the one with the lowest percentage of health.

This way, the AI can afford to have a more aggressive style and not just suicide against the player's wall of spears.
Offline Profile Quote Post Goto Top
 
Legatus
Administrator
That is actually a very good idea. I should incorporate something like that somehow.
Offline Profile Quote Post Goto Top
 
Legatus
Administrator
Had a short chat with molater which was mostly about a topic not directly related to this project, so it did not get posted in the logs, but it did lead him to asking me about the AI in the game. Here is summarized what basically my latest idea for the AI is.

The AI is divided into three hierarchical layers:
  • Command AI: Manages the big picture; divides the available forces into squads and assigns missions to the squads. The decisions are based on priorities set when the map is made.
  • Squad AI: Carries out the mission given to it by the Command AI. It gives roles to the squad members.
  • Unit AI: Handles the actual unit movement and actions, based on the role given to it by the Squad AI.


The AI is not supposed to be a competitive player-killer, but it is supposed to make it look like the enemies act with some sort of coordination rather than blindly charging on. If I manage to develop it to its full potential, the Command AI would possess such tricks such as holding chokepoints, performing tactical withdrawals and pincer strikes.
Edited by Legatus, Tuesday 24-04-2012, 00:26.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Coding · Next Topic »
Add Reply

Themed by tiptopolive of IFSZ.