TaranokAI v1.71 (P) Updated: 1/6/13

Help - Resources - AI Scripting - Grafting - Plugins - Modding Projects
User avatar
Taranok
Posts: 256
Joined: Tue Sep 07, 2010 9:41 pm

TaranokAI v1.71 (P) Updated: 1/6/13

Postby Taranok » Fri Jan 13, 2012 9:25 am

Taranok AI P v1.71
Download
Open, Right Click and use "Save Page As"

Download to BWAILauncher/packages/Entropy/Protoss
or
BWAILauncher/packages/AIvsAI/Protoss

Things I need to change:
more variation in builds!!

Change log:
[spoiler]v1.0
first non beta public release!
v1.02
does build some anti air
built a bit more like for AI vs Human
does train units during attacks (I think)
v1.03
attacks a year earlier
adds gateways with more money
dragoons are now in attack groups
faster upgrades
v1.04
changed some stuff, might be hard to tell differences
v1.1
completely rewritten!
42x better than old versions.
v1.11
increased priority of workers at expansion
earlier 2nd attack
v1.12
1st attack is better (i'm not actually sure how)
2nd attack is faster
fixed stalling with some upgrades
adds gateways as it adds expos
v1.13
added psionic storm
added late game arbiters
slightly more dts
v1.13b
slightly better timings
v1.14
fixed crashing in late game
may get dark archons
v1.2
gets natural expansion quicker
uses attack_prepare, attack_do and everything
actually techs during its second attack
v1.21
removed 3rd attack
added one more gate to gateloop
v1.23
builds more probes
some better timings on buildings so hopefully in plays smoother
v1.3
better transition from 2nd attack
v1.31
defends a bit better after first attack, while getting natural set up
v1.4
earlier 2nd attack (with same force)
builds more dark archons against defilers, queens, battlecruisers, templars, etc.
makes decisions whether to attack or not
better macro
prioritizes building units more than before
v1.42
gets range earlier to guarantee that it finishes before first major attack (an issue on short rush distances)
hopefully improved grouping of attacks slightly
v1.43
fixed dumb mistakes
v1.46
fixed some freezing and bad code that occurs after 3rd is built
v1.5
doesn't die to a bio rush every single time by a Terran AI /smile.gif' class='bbc_emoticon' alt=':)' />
better macro
vs Terran it will get the armor upgrade first instead of weapons[/size]
v1.6
changed expansion timing during late game
higher getoldpeon value (this helps build probes)
reduced frequency of a lot of different enemyowns_jump checks
gets 6-8th gates later when it has money
v1.61
added back the 4th cannon to natural, helps save P from T AIs.
v1.7
uses rush command to evaluate oppenents strength during 2nd attack
optimized beginning by 1 second! :D
lower limit on dragoons[/spoiler][spoiler]v1.71
uses panic command
got rid of send_suicide(0)
better macro[/spoiler]

Recommended maps:
Tau Cross, Jade, Byzantium, Destination

Any feedback is welcome!

Thanks to:
Myk - for some help with scripting
A_Wing + JH24 - testing and some scripting


Bragging rights:
essentially the best P AivsAI ever! 13-1 versus Terran! PvZ is pretty good too.
Last edited by psychowico on Mon Dec 31, 2012 3:11 am, edited 8 times in total.
User avatar
JH24
Posts: 323
Joined: Sat Mar 14, 2009 6:25 pm

Postby JH24 » Sat Jan 14, 2012 2:19 pm

I played two games with your AI today. I had a lot of fun, both replays are uploaded at the bottom of this post.



The first replay is on Spring Thaw. A 1 (Zerg) vs. 2 (Protoss - Taranok AI)game. I lost this game, I'm really impressed how heavy the attacks are this AI executes, I especiially liked how the AI's kept up the pressure after that. Never allowing me to rebuild.





The second replay is on Tau Cross. Also 1 a vs. 2 game. I won this game but I have to say the layout of the map helped me a lot. I buried lurkers at the choke point near the natural and both AI's weren't able to break it. It wasa very intense game, but I did notice that the AI's didn't get any upgrades. Also, the brown AI seemed to lock up later in the game.



===



After the first expansion was build I noticed that the AI's started building several gateways. It slowed down the production of zealots and at this point the AI wouldn't be able to fully make use of these gateways. If possible, try to add a resource loop for them. This way the AI will only build them if it has the resources, and if it does, it will also be able to use them.



For example like this:



--gateway expand--



wait(1)

resources_jump(900, 0, build gate 5 and 6)

wait(360)



goto(gateway expand)





--build gate 5 and 6--



wait(1)

build(5, gateway, 70)

wait_buildstart(5, gateway)

build(6, gateway, 70)

wait_build(6, gateway)





--gateway expand 2--



wait(1)

resources_jump(1300, 0, build gate 7 and 8)

wait(360)



goto(gateway expand 2)





--build gate 7 and 8--



wait(1)

build(7, gateway, 70)

wait_buildstart(7, gateway)

build(8, gateway, 70)

wait_build(8, gateway)

wait(1)



stop()






Anyway, you've done a great job. It is definitely a very strong AI when it starts attacking, when you've improved the early game this definitely will be an AI to fear. /smile.gif' class='bbc_emoticon' alt=':)' />



As for anti-air/detection in the main base early game. This is a loop I use in my scripts for early anti-air and detection:





Detection:



--PMCx 0010--

wait(240)



wait_build(1, forge)

wait(50)



enemyowns_jump(spire, PMCx 0037)

enemyowns_jump(starport, PMCx 0037)

enemyowns_jump(stargate, PMCx 0037)

enemyowns_jump(ghost, PMCx 0037)

enemyowns_jump(dark_templar, PMCx 0037)

enemyowns_jump(lurker, PMCx 0037)

wait(240)



goto(PMCx 0010)





--PMCx 0037--

wait(1)



wait_build(1, forge)

wait(50)



creep(4)

build(1, photon_cannon, 80)

wait_build(1, photon_cannon)

wait(1)



build(2, photon_cannon, 80)

wait_build(2, photon_cannon)

wait(1)



build(3, photon_cannon, 80)

wait_build(3, photon_cannon)

wait(1)



stop()




Early anti-air:



--PMCx 0006--

wait(240)



enemyowns_jump(stargate, PMCx 0044)

enemyowns_jump(spire, PMCx 0044)

enemyowns_jump(starport, PMCx 0044)

wait(240)



goto(PMCx 0006)





--PMCx 0044--

wait(10)



player_need(1, assimilator)

wait(1)



player_need(1, cybernetics_core)

wait(1)



defenseuse_gg(2, dragoon)

defenseuse_ga(2, dragoon)

defenseuse_ag(4, dragoon)

defenseuse_aa(4, dragoon)

wait(24)



train(1, dragoon)

train(2, dragoon)

train(3, dragoon)

train(4, dragoon)

stop()




EDIT: I just saw that you have low values for time in between your research upgrades. This could slow down your AI a lot depending on the circumstances. Also, it would be better if you gave the AI 3 Forges at once instead of only one.



If it's okay I've slightly rewritten your research loop as an example:





--PMCx 0009--

wait(24)

wait_build(3, Protoss Forge)

wait(24)



upgrade(1, Protoss Ground Weapons, 30)

upgrade(1, Protoss Plasma Shields, 30)

upgrade(1, Protoss Armor, 30)

wait(4100)



wait_build(1, Protoss Templar Archives)

wait_build(3, Protoss Forge)

wait(24)



upgrade(2, Protoss Ground Weapons, 30)

upgrade(2, Protoss Armor, 30)

upgrade(2, Protoss Plasma Shields, 30)

wait(4670)



wait_build(1, Protoss Templar Archives)

wait_build(3, Protoss Forge)

wait(24)



upgrade(3, Protoss Ground Weapons, 30)

upgrade(3, Protoss Plasma Shields, 30)

upgrade(3, Protoss Armor, 30)

wait(24)

stop()






The timings I've used are from this website: http://www.teamliquid.net/forum/viewmes ... c_id=84768



If you multiply the numbers with 24, you'll get the time the AI needs to upgrade or tech something. If you add 100 or 200 to it you'll be pretty safe and giving the AI enough time to do its job. (For example - Maelstrom: 62,5 x 24 = 1500 + 100/200 = 1600/1700 in-game seconds) If the AI gets not enough time it tends to slow down and do nothing for awhile.
User avatar
Taranok
Posts: 256
Joined: Tue Sep 07, 2010 9:41 pm

Postby Taranok » Sat Jan 14, 2012 8:09 pm

Thanks for feedback and replays.

Upgrades: Hmmmm.... I'm not really sure why neither of them get upgrades, whenever I played them tehy would always start upgrades at about the 14 minute mark.

The numbers I was guessing at but I just noticed those were really bad guesses.

Anti Air:
Dragoons or cannons? I think Dragoons are better, but then the AI would be vulnerable to any counter attack. Maybe both?
Can you try some games on Byzantium or Colloseum?
I'm really excited so work in some changes. I'll try to not upload 100000 versions, even though I really like to.
Last edited by psychowico on Mon Dec 31, 2012 3:17 am, edited 1 time in total.
User avatar
JH24
Posts: 323
Joined: Sat Mar 14, 2009 6:25 pm

Postby JH24 » Sat Jan 14, 2012 11:28 pm

[quote name='Taranok' date='14 January 2012 - 12:09 PM' timestamp='1326571741' post='10600']

Thanks for feedback and replays.



Upgrades: Hmmmm.... I'm not really sure why neither of them get upgrades, whenever I played them tehy would always start upgrades at about the 14 minute mark.



The numbers I was guessing at but I just noticed those were really bad guesses.



Anti Air:

Dragoons or cannons? I think Dragoons are better, but then the AI would be vulnerable to any counter attack. Maybe both?



Can you try some games on Byzantium or Colloseum?



I'm really excited so work in some changes. I'll try to not upload 100000 versions, even though I really like to.

[/quote]





I wouldn't worry too much about the upgrades just yet. Sometimes it depends on the map the AI plays on as well. I'll play the next games on Byzantium and Colloseum very soon and see how the upgrades go. I'll also change the research times in your script to see if it makes a difference.



As for anti-air, I prefer to use dragoons for quick anti-air and cannons for detection, but both together will definitely work. (For example 2/3 dragoons and 2/3 photon cannons) The only problem is that resources in the beginning are a bit limited, and the AI might not always have enough money available to build both.





I'm very glad you're excited about this. I look forward to see more updates. /smile.gif' class='bbc_emoticon' alt=':)' />
User avatar
JH24
Posts: 323
Joined: Sat Mar 14, 2009 6:25 pm

Postby JH24 » Sun Jan 15, 2012 8:22 am

Sorry for the double reply, but I wanted to upload a new replay.





This replay is on Byzantium and is a 1vs1. (I wanted to see if the AI would act different when alone) Sometimes two AI's slow each other down, alsmost as if they're waiting for each other.



It was a very fun game, and I lost against your AI. It's unbelievable how destructive fully upgraded speedlots can really be. And those Dark Archons with Maelstrom really gave me a hard time. /smile.gif' class='bbc_emoticon' alt=':)' />





I played this game with a few small tweaks to your AI script, namely these: (I've uploaded the slightly changed script below as well, you'll have to load that script if you want to see the replay)





Upgrades Templar:

--PMCx 0020--



wait(24)

wait_build(1, Protoss Templar Archives)

wait(24)



wait_train(1, Protoss High Templar)

wait(24)



tech(Psionic Storm, 50)

wait(2100)



tech(Maelstrom, 50)

wait(240)



stop()






Tech upgrades:



--PMCx 0009--

wait(24)

wait_build(3, Protoss Forge)

wait(24)



upgrade(1, Protoss Ground Weapons, 30)

upgrade(1, Protoss Plasma Shields, 30)

upgrade(1, Protoss Armor, 30)

wait(4100)



wait_build(1, Protoss Templar Archives)

wait_build(3, Protoss Forge)

wait(24)



upgrade(2, Protoss Ground Weapons, 30)

upgrade(2, Protoss Armor, 30)

upgrade(2, Protoss Plasma Shields, 30)

wait(4670)



wait_build(1, Protoss Templar Archives)

wait_build(3, Protoss Forge)

wait(24)



upgrade(3, Protoss Ground Weapons, 30)

upgrade(3, Protoss Plasma Shields, 30)

upgrade(3, Protoss Armor, 30)

wait(24)

stop()




When playing I did have a feeling it made a difference.
User avatar
Taranok
Posts: 256
Joined: Tue Sep 07, 2010 9:41 pm

Postby Taranok » Sun Jan 15, 2012 9:50 am

Thanks for more reps. Updated to v1.02! Changes include: Anti-air, and some upgrade timing changes.
User avatar
JH24
Posts: 323
Joined: Sat Mar 14, 2009 6:25 pm

Postby JH24 » Sun Jan 15, 2012 1:02 pm

Here's a new replay: played on Colosseum 1vs1. I realize I should be playing on 1vs2, but I'm not very good at this game and I'm pretty sure I wouldn't be able to hold off two of your AI's at the same time. ;)

The replay is uploaded below and played with Taranok AI 1.2

===

A few things I noticed:

- The AI builds a lot of Gateways in the beginning, but it does seem to slow down the AI a bit. If you wish, please consider using a resource loop like I posted earlier. This way the AI can continue producing units and if it has excess resources, it will build additional Gateways along the way.

- The AI builds several Gateways at the starting location. In big starting area's this isn't a problem, but on small starting locations units may get trapped. This happened on Colosseum with Archons and Dragoons being locked in. If possible, try to move some Gateways to your expansions instead to create more space.


I also noticed this in your script

--PMCx 0011--
player_need(1, Protoss Templar Archives)
attack_add(6, Protoss Archon)
wait_force(6, Protoss Archon)
defenseuse_gg(6, Protoss Archon)
defenseuse_ga(6, Protoss Archon)
stop()

--PMCx 0042--
player_need(1, Protoss Cybernetics Core)
attack_add(6, Protoss Dragoon)
wait_force(6, Protoss Dragoon)
defenseuse_gg(6, Protoss Dragoon)
defenseuse_ga(6, Protoss Dragoon)
stop()



In both cases defenseuse is being used after a certain amount of units have been produced. The problem with this is that until this happens, the already produced units like Archons won't be used to defend when the base is being attacked. I recommend putting defenseuse at the start of the block, so the units already on the field will be used when needed.

Like this:

--PMCx 0042--
player_need(1, Protoss Cybernetics Core)
wait(24)
defenseuse_gg(6, Protoss Dragoon)
defenseuse_ga(6, Protoss Dragoon)
defenseuse_aa(6, Protoss Dragoon)
defenseuse_ag(6, Protoss Dragoon)

wait(24)

attack_add(6, Protoss Dragoon)
wait_force(6, Protoss Dragoon)
wait(24)

stop()


--PMCx 0011--
player_need(1, Protoss Templar Archives)
wait(24)
defenseuse_gg(6, Protoss Archon)
defenseuse_ga(6, Protoss Archon)
defenseuse_aa(6, Protoss Archon)
defenseuse_ag(6, Protoss Archon)

wait(24)
attack_add(6, Protoss Archon)
wait_force(6, Protoss Archon)
wait(24)

stop()


Maybe you noticed that I've added some additional defenseuse commands. This is because both Archons and Dragoons can attack both ground and air units.

defenseuse_gg: (unit will be used to attack enemy ground units when they attack our ground units)
defenseuse_ga: (unit will be used to attack enemy ground units when they attack our air units)
defenseuse_ag: (unit will be used to attack enemy air units when they attack our ground units)
defenseuse_aa: (unit will be used to attack enemy air units when they attack our air units)



I hope this helps a bit. :)
User avatar
Taranok
Posts: 256
Joined: Tue Sep 07, 2010 9:41 pm

Postby Taranok » Sun Jan 15, 2012 5:15 pm

I thought defenseuse_gg meant that your unit was ground and use it for defense if ground units are attacking our troops. defenseuse_ga meant that your unit

defenseuse_gg (byte) (military)
Use %1(byte) %2(military) to defend against enemy attacking ground units.
defenseuse_ga (byte) (military)
Use %1(byte) %2(military) to defend against enemy attacking ground units.
e
The first letter means the type of unit (ground, air) and the second letter means the type of unit attacking our stuff.
Also from all help topic page 2:

defensebuild_aa 1 vulture (Vulture is not air, cannot attack air (2 times error))
defensebuild_gg 1 corsair (Corsair is nor ground, cannot attack ground (2 times error))
defensebuild_ag 1 siege_tank (Siege Tank can attack ground [G] BUT is not air unit (1 times error))
defensebuild_ga 1 devourer (Devourer can attack air [A] BUT is not ground unit (1 times error))
defensebuild_ga 1 dark_templar (Dark Templar is ground unit BUT cannot attack air (1 times error))
defensebuild_aa 1 guardian (Guardian is air unit BUT cannot attack air (1 times error))

At least thats what I thought...

Resource loops or whatever: I tried it (a long time) before, and didnt do anything before it built the additional gateways anyway, but I'll try again.

double post?
User avatar
JH24
Posts: 323
Joined: Sat Mar 14, 2009 6:25 pm

Postby JH24 » Sun Jan 15, 2012 5:32 pm

[quote name='Taranok' date='15 January 2012 - 09:15 AM' timestamp='1326647754' post='10616']
I thought defenseuse_gg meant that your unit was ground and use it for defense if ground units are attacking our troops. defenseuse_ga meant that your unit

defenseuse_gg (byte) (military)
Use %1(byte) %2(military) to defend against enemy attacking ground units.
defenseuse_ga (byte) (military)
Use %1(byte) %2(military) to defend against enemy attacking ground units.
e
The first letter means the type of unit (ground, air) and the second letter means the type of unit attacking our stuff.

At least thats what I thought...

Resource loops or whatever: I tried it (a long time) before, and didnt do anything before it built the additional gateways anyway, but I'll try again.

double post?
[/quote]

Sorry about the double post, I hadn't even noticed. I'll remove it.

Regarding defenseuse, the following is from Archon_Wing's thread:

You must account for every possbility. So a marine that attacks both land and air needs 4 defense statements (!)

defenseuse_gg(1, marine)- Fight ground units attacking our ground units
defenseuse_ga(1, marine)- Fight ground units attacking our air units
defenseuse_aa(1, marine)- Fight air units attacking our air units
defenseuse_ag(1, marine)- Fight air units attacking our ground units.

A vulture only needs two (gg and ga) because it can only attack ground units. Even more fun if you are writing an Ai for a mod and the ground/air weapons can be diffrent.

Fortunately, PYAI informs you if you use the wrong one, so not too much to worry about it. I recommend just looking into blizzard's scripts and just grabbing a whole bunch of them out. My scripts still did ok even with screwed up defense protocols but there were sporadic problems that would appear at the worst times.

Warning Do not have defenseuse commands in a loop. It seems to cause the AI to halt, so for the most part using it once in the script is good enough.

Return to “StarCraft Modding”

Who is online

Users browsing this forum: No registered users and 1 guest