| Author |
Message |
 |
|
|
 |
|
Advert
|
Forum adverts like this one are shown to any user who is not logged in. Join us by filling out a tiny 3 field form and you will get your own, free, dakka user account which gives a good range of benefits to you:
- No adverts like this in the forums anymore.
- Times and dates in your local timezone.
- Full tracking of what you have read so you can skip to your first unread post, easily see what has changed since you last logged in, and easily see what is new at a glance.
- Email notifications for threads you want to watch closely.
- Being a part of the oldest wargaming community on the net.
If you are already a member then feel free to login now. |
|
 |
![[Post New]](/s/i/i.gif) 2015/10/12 21:14:55
Subject: AoS AI Scripting
|
 |
Arch Magos w/ 4 Meg of RAM
|
Hey everyone,
I think Age of Sigmar has untapped potential with its elegant Keyword system. I have been trying to design a simple AI (that is rules to automate movement of enemies) using the Keyword system.
The challenge is making it as simple as possible but covering all eventualities.
The use for an AI would be to allow players to team up and battle "the system". Or for you to play alone if you so wished.
Here is what I have come up with so far:
------------------
There are two types of AI: Offensive and Defensive
All units with the keyword PRIEST or WIZARD use Defensive AI
All units with the keyword HERO but without the keywords PRIEST or WIZARD use Offensive AI
All units with the keyword WAR MACHINE or CREW use Defensive AI
All other units use Defensive AI if they have a ranged attack available to the majority of models in the unit and Offensive AI if they do not.
Offensive AI
- Units must move towards the closest enemy unit in the movement phase.
- If they finish their move further than 12" away from an enemy they must run.
- Any Offensive units with ranged attacks (such as HEROES) must make a ranged attack to the closest enemy unit if they did not run.
- If they are within 12" of an enemy unit they must attempt to charge that unit.
- Offensive units must always pile-in, even if it breaks coherency.
Defensive AI
- Units must remain stationary if the majority of models have ranged attacks within range of an enemy unit.
- If the majority of models do not have ranged attacks within range of an enemy unit, the unit must move towards the closest enemy unit in the movement phase.
- If they finish their move and the majority of models still do not have ranged attacks within range of an enemy unit, they unit must run.
- Defensive units will never charge and defensive units will never pile-in.
Wizards
- Units with the keyword WIZARD follow the same rules but use the range of their spells rather than a ranged attack.
- WIZARDS will always attempt to cast one randomly selected spell (roll a D3) and cast it either on the closest enemy unit or the closest friendly unit. If a spell cannot be cast because there is no eligible target, randomly select another spell.
- If there are no eligible targets for any of WIZARD's spells, the WIZARD must attempt to cast Mystic Shield upon himself.
- Wizards must try and dispel any spells cast by the enemy within 18"
Priests
- PRIESTS must remain stationary if all abilities are within range of a friendly unit.
- If all abilities are not within range, they must move towards the closest friendly unit in the movement phase.
- If they finish their move and all abilities are still not within range, they unit must run.
- PRIESTS will never charge and will never pile-in.
War Machines and Crew
- War Machines and Crew must remain stationary if the War Machine has a ranged attack with range.
- If the War Machine does not have a ranged attack within range, both the War Machine and Crew must move towards the closest enemy unit in the movement phase.
- If they finish their move and the War Machine still does not have ranged attack within range, the War Machine and Crew must run.
- War Machines and Crew will never charge and will never pile-in.
-----------------------
So what do you think?
Are there any units that would behave weirdly under these rules?
What about any loopholes in the rules in general, or parts that are unclear?
Let me know if you are interested in helping polish up this AI system. :-)
|
Bye bye Dakkadakka, happy hobbying! I really enjoyed my time on here. Opinions were always my own :-) |
|
|
 |
 |
![[Post New]](/s/i/i.gif) 2015/10/13 15:22:04
Subject: AoS AI Scripting
|
 |
Tough Treekin
|
Seems pretty good.
I think the crucial bit for anything like this is handling deployment in a realistic manner - had you given any thought to it?
|
|
|
 |
 |
![[Post New]](/s/i/i.gif) 2015/10/14 06:47:01
Subject: AoS AI Scripting
|
 |
Powerful Spawning Champion
|
Question: Do the wizard rules mean that wizards who do have ranged attacks can never use them?
|
|
|
 |
 |
![[Post New]](/s/i/i.gif) 2015/10/14 09:23:50
Subject: AoS AI Scripting
|
 |
Fresh-Faced New User
|
What about khornepriests like the slaughterpriest who enjoy combat?
Also its a very nice idea. I will test it in practice this afternoon,
|
|
|
 |
 |
![[Post New]](/s/i/i.gif) 2015/10/14 10:22:32
Subject: AoS AI Scripting
|
 |
Tough Treekin
|
I'd suggest adding TOTEM to the defensive AI by default - people like their standards close to the frontline, but not actually in it...
If you remove references to PRIEST outside of their specific rules then they'll be covered under the general catch-all of ranged/melee=defensive/offensive, which 'fixes' Slaughterpriests and Warrior Priests (Remove the 4th PRIEST specific rule as well).
toasteroven wrote:Question: Do the wizard rules mean that wizards who do have ranged attacks can never use them?
To my reading they can - their spells control their positioning, but there's nothing in either the defensive or wizard subsets that prevent them shooting.
|
|
|
 |
 |
![[Post New]](/s/i/i.gif) 2015/10/14 11:11:38
Subject: AoS AI Scripting
|
 |
Powerful Spawning Champion
|
Yes, I think you're right. I was forgetting that a wizard who casts a spell can still shoot in the shooting round.
This has potential.
|
|
|
 |
 |
![[Post New]](/s/i/i.gif) 2015/10/14 14:31:54
Subject: AoS AI Scripting
|
 |
Arch Magos w/ 4 Meg of RAM
|
I have since found lots of loop holes in my original script.
For example, units like trolls end up being Defensive. So that's not good. Also warmachines like Steam tanks end up being defensive.
I have created a much more water tight version which I will post up later. It doesn't take into account combat orientated priests however, which we can work on together perhaps!
I'll post up the amended version a little later :-)
|
Bye bye Dakkadakka, happy hobbying! I really enjoyed my time on here. Opinions were always my own :-) |
|
|
 |
 |
![[Post New]](/s/i/i.gif) 2015/10/14 17:46:34
Subject: Re:AoS AI Scripting
|
 |
Arch Magos w/ 4 Meg of RAM
|
Amended version:
AI
There are two types of AI: Offensive AI and Defensive AI
Before the game begins it is important establish which AI will govern a unit. This is determined by the KEYWORDS found on the unit's warscroll and other factors. The unit's AI remains fixed for the entire game.
Offensive AI
- All units with the keyword MONSTER (regardless of any other keyword they have)
- All units with the keyword HERO except for those with the keyword PRIEST or WIZARD
- All units with the keyword WAR MACHINE without a corresponding CREW
- All units without the keyword HERO or WAR MACHINE where the majority of models have 4 or more wounds
- All other units where the majority of models do not have a missile weapon
Defensive AI
- All units with the keyword PRIEST or WIZARD except for those with the keyword MONSTER
- All units with the keyword WAR MACHINE that have a corresponding CREW
- All other units where the majority of models have a missile weapon
Offensive AI
All units with Offensive AI use the following rules:
Hero Phase
- All units must activate all possible abilities and spells (Including command abilities if the unit is the general) towards the closest eligible target.
- Eligible targets include the closest enemy unit for some abilities and spells, and the closest friendly unit for other abilities and spells.
- If there is no friendly unit within range for an appropriate ability or spell (for example Mystic Shield), the unit must cast the ability upon itself (if possible).
- When there is a choice between different abilities, spells or effects, randomly select using a dice roll. (For example Wizards cannot cast more spells than the maximum listed on their warscroll and so the spell cast must be randomly selected from those available.)
Movement Phase
- All units must move their full movement value towards the closest enemy unit.
- Once the move has been completed check to see if either a.) the majority of models have a missile weapon within range of the enemy, or b.) a model in the unit is within 12" of the enemy. If neither of the above are true the unit must run towards the closest enemy unit.
Shooting Phase
- All units with missile weapons must attack the closest enemy unit if they are in range and providing they did not run.
Combat Phase
- All units with a model within 12" of an enemy unit must attempt to charge in the combat phase, providing they did not run.
- All offensive units must pile-in unless it breaks coherency.
Defensive AI
All units with Defensive AI use the following rules with the exception of those with the PRIEST, WIZARD, WAR MACHINE or CREW keywords which have individual movement rules (see below).
Hero Phase
- All units must activate all possible abilities and spells (Including command abilities if the unit is the general) towards the closest eligible target.
- Eligible targets include the closest enemy unit for some abilities and spells, and the closest friendly unit for other abilities and spells.
- If there is no friendly unit within range for an appropriate ability or spell (for example Mystic Shield), the unit must cast the ability upon itself (if possible).
- When there is a choice between different abilities, spells or effects, randomly select using a dice roll. (For example Wizards cannot cast more spells than the maximum listed on their warscroll and so the spell cast must be randomly selected from those available.)
Movement Phase
- Units must remain stationary if the majority of models have missile weapons within range of an enemy unit.
- If the majority of models do not have a missile weapon within range of an enemy unit, the unit must move towards the closest enemy unit.
- If they finish their move and the majority of models still do not have a missile weapon within range of an enemy unit, the unit must run towards the closest enemy unit.
Shooting Phase
- All units with missile weapons must attack the closest enemy unit if they are in range and providing they did not run.
Combat Phase
- Units will never attempt to charge the enemy and will never pile-in during combat.
Unique Defensive AI
Wizards
Wizards follow the standard rules for Defensive AI except for the movement phase:
Movement Phase
- Wizards must remain stationary if they are within 18" of an enemy unit.
- If the wizard is not within 18" of an enemy unit, the wizard must move towards the closest enemy unit.
- If they finish their move and are still not within 18" of an enemy unit, the Wizard must run towards the closest enemy unit.
Priest
Priests follow the standard rules for Defensive AI except for the movement phase:
Movement Phase
- Priests must remain stationary if all abilities are within range of a friendly unit.
- If all abilities are not within range, they must move towards the closest friendly unit in the movement phase.
- If they finish their move and all abilities are still not within range, they unit must run towards the closest friendly unit.
War Machines & Crew
War Machines & Crew follow the standard rules for Defensive AI except for the movement phase
Movement Phase
- War Machines & Crew must remain stationary if the War Machine has a missile weapon within range of an enemy unit.
- If the War Machine does not have a missile weapon within range of an enemy unit, both the War Machine and Crew must move together towards the closest enemy unit.
- If they finish their move and the War Machine still does not have a missile weapon within range of an enemy unit, both the War Machine and Crew must run together towards the closest enemy unit.
|
|
This message was edited 2 times. Last update was at 2015/10/14 19:13:26
Bye bye Dakkadakka, happy hobbying! I really enjoyed my time on here. Opinions were always my own :-) |
|
|
 |
 |
![[Post New]](/s/i/i.gif) 2015/10/14 18:57:50
Subject: AoS AI Scripting
|
 |
Tough Treekin
|
I think it might be a case of looking at every unit and seeing what happens...
|
|
|
 |
 |
![[Post New]](/s/i/i.gif) 2015/10/14 19:06:43
Subject: AoS AI Scripting
|
 |
Arch Magos w/ 4 Meg of RAM
|
I think your totem idea is great and I will definitely make that amendment. Do we have a good way of separating combat priests from support priests?
If the majority of priests are combat orientated maybe we should add them to the Offensive AI?
Yes deployment is going to be super tricky. I also thought we will need an "initiative order" to decide who moves, shoots, fights first etc.
A simple method could be the warscrolls bravery + wound + 2D6 = Your score for the game. That should ensure most big monsters and heroes take priority in actions over the gribbles.
if we could make the system reactive in combat, so units that are in combats where the opponent has not yet been activated take priority over the ones who have, we could have a pretty good system. I'll think on the wording later, but if anyone has any suggestions please fire away.
And any ideas for deployment too, fire away! Once we have those things in place we could run some test battles :-)
|
|
This message was edited 1 time. Last update was at 2015/10/14 19:15:10
Bye bye Dakkadakka, happy hobbying! I really enjoyed my time on here. Opinions were always my own :-) |
|
|
 |
 |
![[Post New]](/s/i/i.gif) 2015/10/15 13:34:32
Subject: Re:AoS AI Scripting
|
 |
Tough Treekin
|
Hmmm...
The principle thing with a system like this is that it needs to be relatively streamlined, so if you get to the point of "unless a Slaughterpriest" in the rules then you need to go back and look at why.
Couple of rough ideas;
Activation Order
Hero phase:
i)General always activates first.
ii)All other Hero Abilities in ascending order of range from enemy models
iii)Spells in descending order of range from enemy models
Where models have more than one ability they can use (for example, Wizards), then if they meet the conditions for more than one ability then randomise which they use.
If a model has both Hero *and* Spell abilities, then that model activates at step two.
Movement & Shooting Phases
Roll a die (toss a coin, whatever). on a 1-3, Defensive Units activate first that phase - on a 4-6, Offensive Units do.
When activating Defensive Units, start with the unit furthest from an enemy model, then onto the next furthest, etc.
When activating Offensive Units, start with the unit closest to an enemy model, then next closest, etc.
Charge Phase
Units charge in descending order of Move value, with units closer to the enemy going before those who are further away.
Combat Phase
Activate units and attack in the following order; If at any stage activation order is not clear, randomise.
i)Units with the HERO keyword ("With me, men!")
ii)Units with the MONSTER keyword ("GRAAAaaraaagh!!")
iii)Units where the closest enemy has the HERO or MONSTER keywords ("KillitkillitKILLIT!")
iv)Units where the closest enemy has not yet activated that phase.
I have a couple of ideas on deployment, but need to translate them into english...
|
|
|
 |
 |
![[Post New]](/s/i/i.gif) 2015/11/12 18:33:47
Subject: Re:AoS AI Scripting
|
 |
Fresh-Faced New User
|
I really LOVE this idea! This enables solo games for practice, testing new units and for lonely nights when no opponents are available
Are anyone still working on this?
|
|
|
 |
 |
![[Post New]](/s/i/i.gif) 2015/11/13 22:01:59
Subject: AoS AI Scripting
|
 |
Regular Dakkanaut
|
Ooh, this is a really cool idea. Will definitely try this out when I have the opportunity!
|
|
|
 |
 |
![[Post New]](/s/i/i.gif) 2016/01/06 15:45:05
Subject: AoS AI Scripting
|
 |
Inspiring Icon Bearer
|
I'm down. When I'm tired of getting stomped by my friend and his army of all named characters, we can team up vs our collections of undead and demons.
|
|
|
|
 |
 |
|
|