Staredit Network > Forums > SC1 UMS Theory and Ideas > Topic: AI Ability Requirements
AI Ability Requirements
May 22 2011, 6:25 pm
By: Heinermann  

May 22 2011, 6:25 pm Heinermann Post #1

SDE, BWAPI owner, hacker.

Definitions

Region
A region is a group of tiles(usually under 100 tiles). Regions are used internally for pathfinding, AI, and some other things.
[attach=7802]

Box-pixel Radius
Not a true radius. Instead just takes the X +- value, and Y +- value, making it square or boxed like a location with equal dimensions. This greatly increases performance of the application.

Unit Behaviours

Air Units (In General)
  • Always move and patrol to the exact center of a region as depicted in the above screenshot.

Unit Abilities
Notes: All abilities follow normal requirement procedures, doesn't target invincible units, etc.
Hero units do not use abilities except for Cloak.
Just because a unit is excluded from a primary target does not mean it isn't included in cluster calculations.


Spider Mines
  • Hits 3 randomizers; one for region, one for X, one for Y. Places a mine within a 256x256 box-pixel radius of an "owned" region's center. The best way to make the AI "own" a region is to run an AI script at the location and place a buildings owned by the computer player in the region.

Recharge Shields
  • The shield battery must have at least 50 energy.
  • The target unit must have at most 40 shield points remaining.
  • The target must not be engaged with an enemy.
  • Follows some additional unknown rules.

Yamato Gun
  • If idle, the target range is the entire map. Otherwise when provoked it will choose a target within a 512x512 box-pixel radius.
  • Does not target Interceptors, Spider Mines, Scarabs, Zerg Eggs, or workers harvesting gas.
  • Does not target heroes.
  • Target must be a unit that has a HP+Shields total between 200 and 450.
  • Exceptions are buildings that have a weapon (turret), and a loaded bunker.

Plague
  • If idle, the target range is a 4096 box-pixel radius, otherwise it is a 288 box-pixel radius.
  • Does not target Interceptors, Spider Mines, Scarabs, or workers harvesting gas.
  • Does not target units that have already been plagued.
  • Does not target heroes.
  • Enemy unit cluster must have at least 250 HP total, and this value must be greater than 2 times the HP+Shields total of allies in the cluster.

Dark Swarm
  • If idle, the target range is a 2048 box-pixel radius in campaign scripts or 1024 box-pixel radius in normal scripts. Otherwise it will be a 288 box-pixel radius when provoked.
  • Does not target Interceptors, Spider Mines, Scarabs, or workers harvesting gas.
  • Generally targets almost any unit (either that or unknown?).
  • If the target is an air unit, it will cast swarm over the air unit's target.
  • Occurs only if plague fails.

Parasite
  • 1/256 chance of casting when running a campaign script, otherwise it will only cast it if it has full energy.
  • 2048 box-pixel radius when idle. 288 box-pixel radius when provoked.
  • Does not target Interceptors, Spider Mines, Scarabs, or workers harvesting gas.
  • In a campaign script it only casts when the unit does not have parasite by anyone, otherwise it will cast if the unit doesn't have parasite by itself. (For example if another player parasited the unit, in a campaign the computer won't parasite the unit a second time for itself, but in a non-campaign script it will).
  • In a non-campaign script, the unit must either be a clean detector(no blind,stasis,maelstrom,lockdown), be a transport, be a spellcaster(not hallucinations), be a worker, or have at least 300 HP+Shields.

Spawn Broodling
  • In a campaign script has a 255/256 chance of casting. Otherwise it will only cast if it has less than maximum energy or parasite requirements fail.
  • 2048 box-pixel radius when idle. 288 box-pixel radius when provoked.
  • Does not target Interceptors, Spider Mines, Scarabs, or workers harvesting gas.
  • Does not target heroes.
  • Target must either have 100 HP+Shields, be a worker, siege tank, medic, or a ghost that is currently nuking.
  • Exception to previous point when unit is provoked.

Ensnare
  • Only casts if both parasite and spawn broodling requirements fail.
  • Always casts in a campaign script, otherwise it must have full energy.
  • If idle, the target range is a 2048 box-pixel radius in campaign scripts or 1024 box-pixel radius in normal scripts. Otherwise it will be a 288 box-pixel radius when provoked.
  • Does not target Interceptors, Spider Mines, Scarabs, or workers harvesting gas.
  • Does not target units already ensnared.
  • Enemy unit cluster must have at least 250 HP+Shields total, and this value must be greater than 2 times the HP+Shields total of allies in the cluster.
  • Will be cast as an exception in response to its own units being attacked by a cloaked unit.

Stasis Field
  • If idle, the target range is a 2048 box-pixel radius in campaign scripts or 1024 box-pixel radius in normal scripts. Otherwise it will be a 288 box-pixel radius when provoked.
  • Does not target Interceptors, Spider Mines, Scarabs, or workers harvesting gas.
  • Only targets units owned by players 1-8.
  • Enemy unit cluster must have at least 250 HP+Shields total, and this value must be greater than 2 times the HP+Shields total of allies in the cluster.

Recall
  • Has several "unknown" requirements. (Needs research)
  • Only casts if Stasis Field requirements fail.
  • Target range is the entire map.
  • Target unit must be targetting another unit.
  • Target unit must be either Carrier, Gantrithor, Reaver, or Warbringer. (No other units are targetted)
  • Target's shields must be at most 10.

Psionic Storm
  • If idle, the target range is a 2048 box-pixel radius in campaign scripts or 1024 box-pixel radius in normal scripts. Otherwise it will be a 288 box-pixel radius when provoked.
  • Does not target Interceptors, Spider Mines, Scarabs, or workers harvesting gas.
  • Enemy unit cluster must have at least 250 HP+Shields total unless the unit was provoked, and this value must be greater than 2 times the HP+Shields total of allies in the cluster.

Hallucination
  • Must have maximum energy.
  • Only casts if Psionic Storm requirements fail.
  • Only casts when idle.
  • Targets units within a 1024 box-pixel radius.
  • Only hallucinates Carriers, Scouts, Arbiters, and Archons. (No other units are targetted)

Lockdown
  • If idle, the target range is a 2048 box-pixel radius in campaign scripts or 1024 box-pixel radius in normal scripts. Otherwise it will be a 288 box-pixel radius when provoked.
  • Does not target Interceptors, Spider Mines, Scarabs, or workers harvesting gas.
  • Unit must not be frozen with another ability.
  • Targets loaded Shuttles, loaded Dropships, carriers, and reavers.
  • Targets units that are targetting an allied unit.

Cloak
  • All units with cloaking ability will automatically cloak when attacked, including heroes.
  • Cloak is also used only in some very special (unknown/needs research) cases.

EMP Shockwave
  • If idle, the target range is a 2048 box-pixel radius, otherwise it is a 288 box-pixel radius.
  • Will prioritize EMP on shields over EMP on units with energy.
  • Does not target Interceptors, Scarabs, or workers harvesting gas.
  • Enemy unit cluster must have at least 200 Shields OR 200 Energy total.
  • Does not include hallucinations in energy calculations.

Defensive Matrix
  • Only casts if EMP Shockwave requirements fail.
  • If idle, the target range is a 2048 box-pixel radius, otherwise it is a 288 box-pixel radius.
  • Only targets units that have another target, and are not cloaked.
  • Target unit must have at least 100 maximum HP, and have at most 75 HP remaining.
  • Targets allies as well.
  • Must not be matrixed.

Irradiate
  • Only casts if both EMP Shockwave and Defensive Matrix requirements fail.
  • If idle, the target range is a 2048 box-pixel radius, otherwise it is a 288 box-pixel radius.
  • Does not target Interceptors, Spider Mines, Scarabs, Zerg Eggs, Larva, Lurker Eggs, or workers harvesting gas.
  • Must not be irradiated.
  • When a campaign script is run, targets only workers, overlords, and medics when idle. Targets everything when provoked or not running a campaign script.

Disruption Web
  • If idle, the target range is a 4096 box-pixel radius in campaign scripts or 2048 box-pixel radius in normal scripts. Otherwise it will be a 288 box-pixel radius when provoked.
  • Does not target Spider Mines, Scarabs, or workers harvesting gas.
  • Targets turrets, spore colonies, cannons, and loaded bunkers whose first loaded unit is targetting an allied unit. (For example, if you load and SCV first, and then load marines, they will not cast Disruption Web on the bunker)
  • Targets other ground units that can attack and are targetting an allied unit only if they are within a 256 pixel radius.

Restoration
  • Target range is a 1024 box-pixel radius.
  • Target unit's HP+Shields must be greater than 60.
  • Unit must have one of the following status ailments: Ensnare, Plague, Irradiate, Lockdown, Maelstrom, Acid Spores.
  • If an unknown condition is met, then it will check the entire map for units with parasite or maelstrom.

Optical Flare
  • Only casts if Restoration requirements fail.
  • Only casts when energy is at max.
  • If idle, the target range is a 1024 box-pixel radius, otherwise it is a 288 box-pixel radius.
  • Does not target Interceptors, Spider Mines, Scarabs, or workers harvesting gas.
  • Does not target units that are blind.
  • The maximum HP+Shields must be greater than 80.
  • Will blind clean detectors(No blind,lockdown,maelstrom,stasis) as an exception.

Healing
  • Will move to heal any organic unit that isn't at full health.
  • Normal auto-heal behaviour applies.

Feedback
  • If idle, the target range is a 2048 box-pixel radius in campaign scripts or 1024 box-pixel radius in normal scripts. Otherwise it will be a 288 box-pixel radius when provoked.
  • Does not feedback heroes or hallucinations.
  • Will feedback only if the target's energy is greater than its HP+Shields.

Mind Control
  • Only casts when Feedback requirements fail.
  • Target acquisition range is a 1024 box-pixel radius.
  • Does not target Interceptors, Spider Mines, Scarabs, or workers harvesting gas.
  • Does not target heroes.
  • Will always mind control the following units: Siege Tank, Science Vessel, Battlecruiser, Medic, Ultralisk, Overlord, Queen, Defiler, Devourer, Dark Archon, Dark Templar, High Templar, Arbiter, Carrier, Reaver, and Lurker.
  • Will mind control units that cost at least as much minerals and as much gas as a Protoss Dark Templar.

Maelstrom
  • Only casts when both Feedback and Mind Control requirements fail.
  • Does not cast when unit has as much energy as both Maelstrom and Mind Control.
  • If idle, the target range is a 2048 box-pixel radius in campaign scripts or 1024 box-pixel radius in normal scripts. Otherwise it will be a 288 box-pixel radius when provoked.
  • Does not target Zerg Larva, Zerg Egg, Lurker Egg, Cocoon, or workers harvesting gas.
  • Does not target units that have been maelstromed.
  • Enemy unit cluster must have at least 250 HP+Shields total unless the unit was provoked, and this value must be greater than 2 times the HP+Shields total of allies in the cluster.
  • Targets loaded Overlords always as an exception.

Scanner Sweep
  • A response to being attacked by cloaked units.
  • Only scans if a unit with a weapon, a bunker, or a worker, is being attacked.


Attachments:
SCScrnShot_052211_115258.gif
Hits: 12 Size: 163.86kb

Post has been edited 5 time(s), last time on May 23 2011, 2:36 am by Heinermann.




May 22 2011, 9:35 pm Lanthanide Post #2



Excellent! Thanks Heinermann!

Haven't had time to read it all yet, but looks very very useful. The link between Plague and Dark Swarm is very good to know.

Does Dark Swarm target enemy units, or allied units? It doesn't make a lot of sense for it to be targeting air units, unless the air unit is an enemy.
Could you investigate Archon Meld and Dark Archon Meld? Under what circumstances are these abilities used? Also Consume, Nuke and Guardian/Lurker morph. I'm guessing these abilities (except maybe Consume) are handled by unit production AI, rather than specific ability AI?

Post has been edited 3 time(s), last time on May 22 2011, 9:48 pm by Lanthanide.



None.

May 22 2011, 9:59 pm Heinermann Post #3

SDE, BWAPI owner, hacker.

Archon Warp, Dark Archon Warp, Lurker Morph, Guardian/Devourer Morph are all handled by production AI.
Dark swarm doesn't target air units, but if the air unit is attacking an allied ground unit, then the swarm goes over the allied unit.

Consume is never used, just like Nydus Canal is never used.




May 22 2011, 10:41 pm Lanthanide Post #4



So the unit-production abilities are handled by production AI; is there any way that that production AI can be operated without a full base - eg without a CC, workers, minerals, gas, and the appropriate tech buildings? Could you run one of the campaign scripts, or something like Area Town, and get the AI to create these units? For example, there are a couple of terran expansion AI scripts that will add nukes to any silos that exist for that player, essentially it's a side-effect of those scripts, but a useful one.

Do all references to "HP + shields" or "HP" refer to the units current HP, unless otherwise stated that it means maximum?

Also you didn't really answer the dark swarm question. Does the spell specifically target ally units in general? It doesn't seem sensible to cast dark swarm on an enemy ultralisk, for example. Maybe that's what "Generally targets almost any unit (either that or unknown?)" means - it is targeting allied units using an unusual function call - maybe allied units that are under attack from a ranged enemy - eg it won't cast it on an allied ultra being attacked by zerglings, but it will cast it on an allied ultra being attacked by marines.

Post has been edited 1 time(s), last time on May 22 2011, 10:46 pm by Lanthanide.



None.

May 22 2011, 10:50 pm Heinermann Post #5

SDE, BWAPI owner, hacker.

You would have to research the scripts.

Quote
Do all references to "HP + shields" or "HP" refer to the units current HP, unless otherwise stated that it means maximum?
Yes, its current HP/Shields.

Quote
Also you didn't really answer the dark swarm question. Does the spell specifically target ally units in general?
Not sure, I'd have to look at it again.




May 24 2011, 2:33 am Lanthanide Post #6



What about SCV Repair? Or does that come under production or a separate area of AI control?



None.

May 24 2011, 5:24 am Wormer Post #7



I'm sorry, but this is EPIC.



Some.

May 26 2011, 5:25 pm Heinermann Post #8

SDE, BWAPI owner, hacker.

Quote from Lanthanide
What about SCV Repair? Or does that come under production or a separate area of AI control?
It has its own separate controller.

There are several other conditions aside from the following listed:
Unit Repair (SCV)
  • Must be running a town script. Assumed but not confirmed: should not be running any attack scripts (random suicide, attack, patrol).
  • Obtains target within a 2048 box-pixel radius.
  • Target must be owned by the same player.
  • Does not target workers or buildings.
  • The target's order target must be this SCV (Controlled by another system, the unit to repair basically right clicks on SCV).
  • Unit has a path to the target.
  • Some unknown AI controller requirements.

(Unit must right click (follow) an SCV first)
Unit Repair (Mech Unit)
  • Must not have maximum HP.
  • Must not be plagued.
  • Must not be irradiated.
  • Must not be a worker.
  • Some unknown AI controller requirement.


Post has been edited 1 time(s), last time on May 26 2011, 6:07 pm by Heinermann.




Dec 22 2011, 3:11 am Lanthanide Post #9



Heinermann, could you add the requirements for Stim to be used?

In my testing it appears that Raynor marine and Gui Montag will not use Stim; does the code support this finding?



None.

Dec 28 2011, 5:27 am Heinermann Post #10

SDE, BWAPI owner, hacker.

I won't look but I have a strong belief that it probably supports that finding. Heroes are not controlled by the AI.
The only reason cloak is used is because it checks a function probably called something similar to "Unit::HasCloakingAbility()" (made it up), however it is a small inlined function so it does not actually have a separate piece of code that is being called. The AI stim code does not have this.




Aug 9 2012, 12:57 pm GGmano Post #11

Mr.Pete-Tong

Quote from Lanthanide
Heinermann, could you add the requirements for Stim to be used?

In my testing it appears that Raynor marine and Gui Montag will not use Stim; does the code support this finding?

Yeah jim raynor and gui montag dosent use stim.

@Heinermann is it only idle vultures that can lay mines in region, x and y?

Post has been edited 1 time(s), last time on Aug 9 2012, 1:08 pm by GGmano.



A Legendary Map Maker, Player. Apparently im more than intresting to observe Irl

Ill try do my best in making all youre watchers happy

The maps I made are tweaked into perfection and maximum strategy added

Aug 9 2012, 10:11 pm Kaias Post #12



This list is amazing, though I'd like to see burrow on there.



None.

Aug 9 2012, 10:58 pm Roy Post #13

An artist's depiction of an Extended Unit Death

Burrow seems to just be used automatically by idling units that have it researched, even without an AI script running for the player that owns the unit.




Mar 14 2018, 7:43 am Lanthanide Post #14



From looking at Firegraft, here's some additional useful information about how the unit AI uses these abilities.

The following spells all use the base units Vision as their range, rather than the actual "weapons" range:
  • Mind control
  • Feedback
  • Hallucination
  • Defense Matrix

This is relevant since with EUDs we can edit both weapon range and unit vision.

It seems these spells might be this way due to Optical Flare, eg casting Optical Flare on a CPU Dark Archon is a good way to de-fang it. Strange that's it's only those very few spells though, and it's effectively meaningless for D.Matrix.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:39 am]
Ultraviolet -- no u elky skeleton guy, I'll use em better
[10:50 pm]
Vrael -- Ultraviolet
Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
hey cut it out I'm getting all the minerals
[10:11 pm]
Ultraviolet -- :P
[10:11 pm]
Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
[2024-4-17. : 11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[2024-4-17. : 3:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
[2024-4-17. : 1:53 am]
Vrael -- bet u'll ask for my minerals first and then just send me some lousy vespene gas instead
[2024-4-17. : 1:52 am]
Vrael -- hah do you think I was born yesterday?
Please log in to shout.


Members Online: eksxo