Ross Przybylski
Administrator
Posts: 1051
D20Studios, LLC
|
« on: September 25, 2010, 07:59:54 PM MT » |
|
Dear Hero Mages Fans,
What a productive week for Hero Mages development! For those who weren't already aware, I took a week vacation specifically to dedicate myself to the development of Hero Mage's upcoming computer based player feature. Up until now, the prototype AI was functionally on a purely random tactical basis- using the list of its available actions and seeking out legal targets in random order. While this worked surprisingly effective due to the tactical intelligence abilities of individual unit actions, it resulted in odd behavior where the AI was conflicted in the use of its resources. For example, a Warrior might move towards an enemy to attack, and then, on the next command, sprint back to base to protect another unit.
What my AI was lacking was a decision making tree for organizing and processing its available choices. And so, I created one. For those interested, check out the attached JPEG and follow along- I’ve kept the jargon in layman’s terms. Each box on the flow chart represents an AI project with its own decision making process and tasks to carry out. A summary of these projects follows below. Questions and feedback are welcome!
Protect Mage This project examines potential threats of the mage and weighs the risk of exposing it to the enemy to cast spells. Depending on how the mage might be used during the turn, the AI take measures to protect it. Such measures might include strong protective buffs (Shield), sprinting back to safety at the end of turn after casting, etc.
Scry for Cards This project is assigned whenever the AI is looking for a particular kind of action but fails to find it in its current arsenal. The AI will add any scrying actions (Transmute, Scribe) such to find the cards it needs for the task it’s trying to perform.
Heal Units When the initial question “Do any of our units need healing?” is asked, the AI is also checking to see if any units are disrupted or defeated. Healing actions are thus considering actual healing actions plus restorative actions and revive. Available healing actions are sorted by priority based on the type of healing needed (group healing, single unit, etc.) and then assigned to the AI’s command cycle. Since healing spells have built-in intelligence to know when it’s wise to actually use them (for example, don’t waste a group heal on a single unit with only 1 damage) we ensure that only the most efficient healing actions are used and the rest are conserved.
Summon Creatures I have prioritized summoning creatures over direct engagement with the idea that it is best practice to bolster our forces with units over direct assault as this increases our threat in the long term and also reduces threats from the enemies (as creatures will often draw enemy fire away from heroes). This project works by adding all available creature actions to the action command cycle, prioritizing by a combination of inherent creature value and greatest threat to enemy calculations.
Energize The AI creates a command cycle to use any actions that would generate additional mana (Mana Surge, Meditate) so that we have the greatest supply of resources to work with in preparing our assault on the enemy. I have purposively ordered this process after Summon Creatures under the notion that I believe it is best to use surplus mana for direct engagement actions vs. reinforcing the team with additional units which could potentially clog up the AI’s assault on the enemy.
Cleanse The cleanse project is where the AI uses actions to remove enemy effects that are potentially giving them an advantage so we can accurately assess targeting priority in the next phase. Currently, the only action that falls in this category is Dispel Magic, but I’ve labeled the project type as Cleanse to keep it open for future actions that may have similar purposes.
Engage Enemies If the AI has been assigned this project it means that it has engage actions available to use this turn and it has deemed that the benefit of using these actions outweighs the potential risks of retaliation.
Engage actions are actions used directly against units to damage or disrupt them (attacks and disruptive actions) and offensive buff spells that contribute damage to attacks we can make in the current turn. These actions are prioritized by the best threat to cost ratio and are added to the AI’s action command cycle one at a time until the AI determines it has no further resources left. After all engage actions our resources allow have been assigned, the chosen actions are sorted by their proper use-order (ensuring such things as buffs are used before attacking and stuns are performed last) and carried out. After this cycle is complete, the AI will attempt to engage again (as new actions may be available such as Warrior’s second attack or Barbarian’s frenzy attack).
Retreat and Recover This project is triggered when the AI either lacks enough engage actions for an assault or has determined that an assault is not worth the risk given the health of its units. In either case, there are two primary goals here- take defensive positions to avoid enemy retaliation and gather more cards. If our hand is already full of spells, discard our lowest priority card for each surplus mana we have that would bring our hand back to full.
Manipulate Enemy While manipulation has many potential uses in the game of Hero Mages (particularly in FFA games), the AI will be using it to expedite its ability to engage the enemy in the current turn. A prime example would be the inability to attack a unit because it’s short of movement range. We’d start by adding a single manipulation spell (prioritized by a fixed order) such as Mind Control and use this action only if it would bring the enemy in range to attack.
Rush the Enemy The AI is assigned this project when it has determined its strength greatly overwhelms the enemy. Rather than take its time to move cautiously through cover, the AI chooses to take the shortest path towards the enemy allowing sprint moves and opting for spaces adjacent and surrounding enemy units so as to trap and finish them off before they can escape or recover.
Support and Advance The goal of this project is to advance closer to the enemy in a cautious fashion, choosing spaces closer to the enemy with the least possible threat. We can also use support actions here to prepare us for engagement next turn, such as Bloom, Armor of Aegis, and Archon’s Might – but the caveat is to not allow movement when calculating targeting for these actions. We want to reserve movement and sprint for positioning (as this is more important here). So, first we run a cycle of support actions from current location. Then, we initiate an action cycle allowing sprint based on each unit’s primary action (for most units, this is attack range, but for mages, this is line of sight). This should put each unit in the safest, closest position. Finally, we run another cycle of support actions (again, disabling movement) in the event that new positions opened up opportunities to use these actions.
Cast Bonus Spell This project is used to catch any additional spells the AI could have used that slipped through the cracks of the initial process flow.
Use Bonus Action This project is used to catch any bonus actions that the AI could have used that slipped through the cracks of the initial process flow.
Use Reserve Actions This project is used to perform any actions the AI has reserved resources to perform at the end of its turn. Reserve actions will typically be generated in the Protect Mage project (ensuring we save enough movement to sprint back into cover, cast imprison, etc.).
|