Zerg AI problem

Help - Resources - AI Scripting - Grafting - Plugins - Modding Projects
User avatar
Archon_Wing
Posts: 903
Joined: Wed Jul 25, 2007 11:22 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby Archon_Wing » Tue Aug 18, 2009 7:51 pm

Scourge_Splitter
Posts: 36
Joined: Fri May 11, 2007 12:56 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby Scourge_Splitter » Wed Aug 19, 2009 4:05 pm

User avatar
Archon_Wing
Posts: 903
Joined: Wed Jul 25, 2007 11:22 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby Archon_Wing » Wed Aug 19, 2009 11:16 pm

User avatar
pandut
Posts: 26
Joined: Tue Jul 03, 2007 6:17 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby pandut » Thu Aug 27, 2009 5:36 am

Sorry, been busy as of late and didn't get enough time to check up. Now I do.

I've looked over your posts, and attempted to revise my script.

Heres the result-

CODE# stat_txt.tbl entry 1344: Zerg Expansion Custom Level<0>
ZMCx(1344, 111, aiscript):
start_town()
transports_off()
farms_notiming()
define_max(20, Zerg Defiler)
define_max(70, Zerg Drone)
define_max(100, Zerg Zergling)
define_max(20, Zerg Overlord)
define_max(40, Zerg Hydralisk)
define_max(16, Zerg Ultralisk)
build(1, Zerg Hatchery, 80)
build(4, Zerg Drone, 40)
multirun(dronebuild)
wait(100)

multirun(moneyloop)
wait(300)

attack_add(4, Zerg Zergling)
attack_prepare()
attack_do()
attack_clear()
clear_combatdata()
multirun(ZMCx 0005)
wait(200)

attack_add(14, Zerg Zergling)
attack_prepare()
attack_do()
attack_clear()
clear_combatdata()
build(2, Zerg Hatchery, 80)
build(1, Zerg Evolution Chamber, 80)
upgrade(1, Ventral Sacs, 70)
multirun(ZMCx 0005)
build(2, Zerg Evolution Chamber, 80)
train(1, Zerg Zergling)
build(1, Zerg Overlord, 40)
train(1, Zerg Zergling)
train(1, Zerg Ultralisk)
multirun(ZMCx 0001)
build(3, Zerg Hatchery, 80)
attack_add(18, Zerg Zergling)
attack_add(1, Zerg Defiler)
attack_add(6, Zerg Hydralisk)
build(1, Zerg Overlord, 40)
multirun(ZMCx 0005)
attack_prepare()
attack_do()
attack_clear()
clear_combatdata()
multirun(ZMCx 0002)
build(4, Zerg Hatchery, 80)
expand(1, ZMCx 0000)
wait(400)

attack_add(20, Zerg Zergling)
attack_add(2, Zerg Defiler)
attack_add(10, Zerg Hydralisk)
attack_add(2, Zerg Ultralisk)
attack_prepare()
attack_do()
attack_clear()
clear_combatdata()
multirun(ZMCx 0005)
train(1, Zerg Zergling)
build(1, Zerg Overlord, 40)
build(1, Zerg Overlord, 40)
train(1, Zerg Zergling)
train(1, Zerg Ultralisk)
multirun(ZMCx 0003)
defensebuild_gg(1, Zerg Zergling)
build(1, Zerg Overlord, 40)
build(5, Zerg Hatchery, 80)
expand(2, ZMCx 0000)
multirun(ZMCx 0005)
wait(300)

attack_add(24, Zerg Zergling)
attack_add(2, Zerg Defiler)
attack_add(16, Zerg Hydralisk)
attack_add(4, Zerg Ultralisk)
attack_prepare()
attack_do()
attack_clear()
clear_combatdata()
train(1, Zerg Zergling)
train(1, Zerg Hydralisk)
train(1, Zerg Ultralisk)
build(1, Zerg Overlord, 40)
multirun(ZMCx 0004)
expand(3, ZMCx 0000)
multirun(ZMCx 0005)
wait(100)

attack_add(28, Zerg Hydralisk)
attack_add(4, Zerg Ultralisk)
attack_prepare()
attack_do()
attack_clear()
clear_combatdata()
build(1, Zerg Overlord, 40)
train(1, Zerg Zergling)
train(1, Zerg Hydralisk)
upgrade(2, Zerg Carapace, 70)
train(1, Zerg Zergling)
train(1, Zerg Ultralisk)
wait(300)

attack_add(38, Zerg Zergling)
attack_add(3, Zerg Defiler)
attack_add(22, Zerg Hydralisk)
attack_add(6, Zerg Ultralisk)
attack_prepare()
attack_do()
attack_clear()
clear_combatdata()
multirun(ZMCx 0005)
build(1, Zerg Overlord, 40)
expand(4, ZMCx 0000)
wait(200)

attack_add(48, Zerg Zergling)
attack_add(8, Zerg Ultralisk)
attack_prepare()
attack_do()
attack_clear()
clear_combatdata()
train(1, Zerg Zergling)
train(1, Zerg Hydralisk)
train(1, Zerg Zergling)
train(1, Zerg Ultralisk)
build(1, Zerg Overlord, 40)
wait(150)

attack_add(18, Zerg Zergling)
attack_add(16, Zerg Hydralisk)
attack_add(10, Zerg Ultralisk)
attack_prepare()
attack_do()
attack_clear()
clear_combatdata()
train(1, Zerg Zergling)
train(1, Zerg Hydralisk)
train(1, Zerg Zergling)
train(1, Zerg Ultralisk)
build(1, Zerg Overlord, 40)
upgrade(3, Zerg Carapace, 70)
multirun(ZMCx 0005)
wait(200)


--block1--
attack_add(48, Zerg Zergling)
attack_add(5, Zerg Defiler)
attack_add(26, Zerg Hydralisk)
attack_add(8, Zerg Ultralisk)
attack_prepare()
attack_do()
attack_clear()
clear_combatdata()
expand(5, ZMCx 0000)
build(1, Zerg Overlord, 40)
clear_combatdata()
defensebuild_gg(1, Zerg Zergling)
defensebuild_gg(1, Zerg Hydralisk)
wait(500)

goto(block1)


--ZMCx 0000--
start_town()
build(1, Zerg Hatchery, 80)
wait_build(1, Zerg Hatchery)
build(1, Zerg Overlord, 40)
build(1, Zerg Drone, 40)
build(2, Zerg Drone, 40)
build(3, Zerg Drone, 40)
defensebuild_gg(1, Zerg Zergling)
build(4, Zerg Drone, 40)
build(5, Zerg Drone, 40)
build(6, Zerg Drone, 40)
multirun(ZMCx 0005)
place_guard(Zerg Ultralisk, 1)
stop()


--ZMCx 0001--
upgrade(1, Zerg Missile Attacks, 70)
wait(900)

upgrade(1, Zerg Melee Attacks, 70)
stop()


--ZMCx 0002--
train(4, Zerg Zergling)
upgrade(2, Zerg Melee Attacks, 70)
wait(900)

upgrade(2, Zerg Missile Attacks, 70)
stop()


--ZMCx 0003--
train(1, Zerg Zergling)
train(1, Zerg Ultralisk)
upgrade(1, Chitinous Plating, 70)
wait(500)

upgrade(1, Anabolic Synthesis, 70)
upgrade(1, Zerg Carapace, 70)
stop()


--ZMCx 0004--
train(1, Zerg Hydralisk)
train(1, Zerg Defiler)
upgrade(3, Zerg Missile Attacks, 70)
upgrade(3, Zerg Melee Attacks, 70)
stop()


--moneyloop--
give_money()
wait(100)

goto(moneyloop)


--ZMCx 0005--
build(1, Zerg Creep Colony, 80)
wait_build(1, Zerg Creep Colony)
build(1, Zerg Sunken Colony, 80)
wait_build(1, Zerg Sunken Colony)
build(2, Zerg Creep Colony, 80)
wait_build(2, Zerg Creep Colony)
build(2, Zerg Sunken Colony, 80)
wait_build(2, Zerg Sunken Colony)
creep(1)
build(3, Zerg Creep Colony, 80)
wait_build(3, Zerg Creep Colony)
build(3, Zerg Sunken Colony, 80)
wait_build(3, Zerg Sunken Colony)
build(4, Zerg Creep Colony, 80)
wait_build(4, Zerg Creep Colony)
build(1, Zerg Spore Colony, 80)
wait_build(1, Zerg Spore Colony)
stop()


--dronebuild--
build(1, Zerg Drone, 40)
wait(50)

goto(dronebuild)

-I thought that maybe I'd put the drone morph into a multirun thingy, so it'd build a drone every few seconds.
-Zerg AI now ignores all other commands, and instead spams Hydralisks, will occasionally get a few zerglings and a creep colony.
-Crashes the game for some reason, don't know why or how.
User avatar
Myk
Posts: 257
Joined: Sat Jun 13, 2009 12:56 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby Myk » Thu Aug 27, 2009 6:14 am

User avatar
pandut
Posts: 26
Joined: Tue Jul 03, 2007 6:17 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby pandut » Thu Aug 27, 2009 7:22 pm

Alright, I did something so the AI won't crash the game anymore.

I also tried to edit it so certain units for each faction requires an upgrade building in order to be buildable.

The AI will get a few zerglings and attack, but after they build the Evo chamber, they start spamming Hydralisks again. And the AI still ignores the dronebuild code.

Is there something I can put in, so that the zerg AI will not use Hydralisks until a certain time?
pandabb
Posts: 73
Joined: Fri Jul 10, 2009 2:19 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby pandabb » Mon Sep 21, 2009 9:24 pm

Equalizer
Posts: 83
Joined: Wed Sep 23, 2009 3:49 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby Equalizer » Wed Sep 23, 2009 4:15 am

There is the command,

defaultbuild_off

This seems to decrease the amount of random units built but I don't believe it completely gets rid of it.
It tends to be used in Blizzard scripts where they wanted the comp to do something more specific, so I'm fairly sure it does take out some built-in auto build.

Would need more testing to be sure of its effect.
User avatar
Archon_Wing
Posts: 903
Joined: Wed Jul 25, 2007 11:22 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby Archon_Wing » Mon Sep 28, 2009 5:38 am

If the comp is building too many of a unit, it almost always has to do with defensebuild. For my own scripts, I have moved defensebuild to a place where all the major tech is complete before using it. It is only good for late game situations. Basically, for every section you want the AI to execute exactly as you want, don't use defensebuild. It's for this version that sometimes earlier versions of my AI would never get a factory if harassed enough, because defensebuild just keeps firing.

Another solution is to just put every building in a multirun, and only have unit training in the main part. (and wait_build if you need prereqs.)

If you're still having trouble with it not building buildings, give everything the same priority. A lot of times, low priority to the AI is no priority at all, and it just doesn't build it and thus the script never moves on to stuff below.

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Return to “StarCraft Modding”

Who is online

Users browsing this forum: No registered users and 11 guests