Kryose's AI question(s) - ongoing

Help - Resources - AI Scripting - Grafting - Plugins - Modding Projects
Kryose
Posts: 49
Joined: Fri Apr 25, 2008 4:26 pm

Kryose's AI question(s) - ongoing

Postby Kryose » Fri May 02, 2008 6:07 pm

Hello everyone,

Since it's not very busy here at work, I thought I would try my hand at coding a little AI. Of course because I read through the tutorial (start to finish) I thought 'hey, that's easy!' (how wrong I was). I based it mostly off of the tutorial so here is what I was able to do for a few hours at work.

The researching is all set to wait 3600 cause I don't know the researching times atm. I haven't been able to test it, and besides, I don't even know how to test it (I will look into it later when I have time at home).

I have a couple questions regarding some things though.

a) When a building get's destroyed. Does the AI automatically try to rebuild? Further, if an expansion is destroyed, does the AI automatically try to build it again?
-and-
:cool: Does the AI automatically fill bunkers? Or is there a command to do it?

Any and all criticisms are welcome. I am pretty sure there are alot of spelling mistakes and that it has alot of unnecessary code that could be cut. Anyways, here is the code. Tell me what you think.

[spoiler]; ASC3 File generated by ScAIEdit III
;
; Script name : Terran Expansion Custom Level
;
; Terran Multirun Script v1.0 - Created by Kryose
;

script_name Terran Expansion Custom Level
script_id TMCx

; === STARTUP COMMANDS ===
start_town
transports_off
farms_notiming

; === MAX UNIT DEFINITION ===

define_max 100 scv
define_max 75 marine
define_max 75 medic
define_max 25 firebat
define_max 50 ghost
define_max 75 vulture
define_max 20 siege_tank
define_max 20 goliath
define_max 40 wraith
define_max 20 battlecruiser
define_max 2 nuclear_missile
define_max 4 science_vessel
define_max 3 dropship
define_max 2 valkyrie


; === START ===

build 1 command_center 150
wait_build 1 command_center
build 4 scv 130
wait_build 4 scv

multirun m_funding


; === MAIN ===

; --- RESEARCH ---

multirun r_academy
multirun r_engineering_bay
multirun r_machine_shop
multirun r_control_tower
multirun r_armory
multirun r_covert_ops
multirun r_physics_bay
multirun r_science_facility

; --- ECONOMY/BUILDING ---

build 5 scv 80
wait_buildstart 5 scv
build 6 scv 80
wait_buildstart 6 scv
build 7 scv 80
wait_buildstart 7 scv
build 1 supply_depot 80
wait_buildstart 1 supply_depot
build 8 scv 80
wait_buildstart 8 scv

goto b_barracks1
:a_barracks1

farms_timing

build 9 scv 80
wait_buildstart 9 scv
build 10 scv 80
wait_buildstart 10 scv
build 1 refinery 80
wait_buildstart 1 refinery

goto b_bunker1
:a_bunker1

build 11 scv 80
wait_buildstart 11 scv

goto b_academy
:a_academy

build 12 scv 80
wait_buildstart 12 scv

goto b_barracks2
:a_barracks2

build 13 scv 80
wait_buildstart 13 scv

goto b_engineeringbay
:a_engineeringbay

multirun m_rushcheck

goto b_startdefense
:a_startdefense

expand 1 b_expansion

goto b_factory1
:a_factory1

build 4 scv 80

train 3 marine
train 1 medic
train 1 vulture
train 1 seige_tank

multirun m_rushcheck

build 4 scv 80

expand 1 b_expansion

goto b_factory2
:a_factory2

goto b_armory
:a_armory

multirun m_rushcheck

build 4 scv 80

goto b_starport
:a_starport

build 3 scv 80

multirun m_rushcheck

goto b_bunker2
:a_bunker2

goto b_turret
:a_turret

build 3 scv 80

multirun m_rushcheck

expand 1 b_expansion

goto b_starport2
:a_starport2

build 2 scv 80

goto b_sciencefacility
:a_sciencefacility

multirun m_rushcheck

goto b_finaldefense
:a_finaldefense

build 2 scv 80

goto b_turret
:a_turret

expand 1 b_expansion

multirun m_rushcheck

expand 1 b_expansion

; === END LOOP ===

:suicideloop
multirun m_masscheck
wait 4000
send_suicide 0

; === FUNDING MULTI-RUN ===

:m_funding
wait 1000
give_money
goto m_funding


; === EXPANSION SCRIPT ===

:b_expansion
start_town
build 1 command_center 80
wait_build 1 command_center
build 8 scv 70
wait_build 1 barracks
build 1 bunker 70
wait_build 1 engineering_bay
build 2 turret 70
build 1 refinery 70
build 1 comsat_station
a_expansion


; === BUILD SCRIPT ===

; --- BARRACKS ---

:b_barracks1
build 1 barracks 80
wait_buildstart 1 barracks
build 2 supply_depot 80
wait_buildstart 2 supply_depot
wait_build 1 barracks
train 1 marine
goto a_barracks1

; --- BUNKER1 ---

:b_bunker1
wait_build 1 barracks
build 1 bunker 80
wait_buildstart 1 bunker
train 4 marine
goto a_bunker1


; --- ACADEMY ---

:b_academy
wait_build 1 barracks
build 1 academy 80
wait_buildstart 1 academy
goto a_academy


; --- BARRACKS2 ---

:b_barracks2
build 4 barracks 80
wait_buildstart 4 barracks
wait_build academy
wait_build 4 barracks
train 6 marine
train 3 firebats
train 4 medic
goto a_barracks2


; --- ENGINEERING BAY ---

:b_engineeringbay
wait_build 1 barracks
build 1 engineering_bay 80
wait_buildstart 1 engineering_bay
wait_build 1 engineering_bay
build 3 turret 70
goto a_engineeringbay


; --- FACTORY1 ---

:b_factory1
wait_build 1 barracks
build 1 factory 80
wait_buildstart 1 factory
wait_build 1 factory
train 2 vulture
build 1 machine_shop 80
wait_buildstart 1 machine_shop
wait_build 1 machine_shop
train 2 seige_tank
train 2 vulture
goto a_factory1


; --- FACTORY2 ---

:b_factory2
wait_build 1 barracks
build 4 factory 80
wait_buildstart 4 factory
wait_build 4 factory
build 2 machine_shop 80
wait_buildstart 2 machine_shop
wait_build 2 machine_shop
train 3 seige_tank
goto a_factory2


; --- ARMORY ---

:b_armory
wait_build 1 factory
build 2 armory 80
wait_buildstart 2 armory
wait_build 1 armory
train 3 goliath
goto a_armory


; --- STARPORT ---

:b_starport
wait_build 1 factory
build 1 starport 80
wait_buildstart 1 starport
wait_build 1 starport
train 2 wraith
build 1 control_tower 80
wait_buildstart 1 control_tower
goto a_starport


; --- BUNKER2 ---

:b_bunker2
wait_build 1 barracks
build 5 bunker 80
train 10 marine
train 4 firebat
goto a_bunker2


; --- TURRET ---

:b_turret
wait_build 1 engineering_bay
build 10 turret 80
goto a_turret


; --- STARPORT ---

:b_starport
wait_build 1 factory
build 4 starport 80
wait_buildstart 4 starport
wait_build 4 starport
build 3 control_tower 80
goto a_starport


; --- SCIENCE FACILITY ---

:b_sciencefacility
wait_build 1 starport
build 2 science_facility 80
wait_buildstart 2 science_facility
wait_build 2 science_facility
train 2 science_vessel
build 1 physics_lab 80
wait_buildstart 1 physics_lab
build 1 covert_ops 80
wait_buildstart 1 covert_ops
wait_build 1 physics_lab
train 1 battlecruiser
wait_build 1 covert_ops
build 1 nuclear_silo
goto a_sciencefacility


; === DEFENSE SCRIPTS ===

; --- STARTING DEFENSE ---

:b_startdefense
defenseclear_gg
defensebuild_gg 6 marine
defenseuse_gg 6 marine
defensebuild_gg 1 firebat
defenseuse_gg 1 firebat
defensebuild_gg 1 vulture
defenseuse_gg 1 vulture
defensebuild_gg 2 seige_tank
defenseuse_gg 2 seige_tank
defensebuild_gg 1 goliath
defenseuse_gg 1 goliath
defensebuild_gg 1 wraith
defenseuse_gg 1 wraith
defensebuild_gg 1 battlecruiser
defenseuse_gg 1 battlecruiser
defenseclear_ag
defensebuild_ag 6 marine
defenseuse_ag 6 marine
defensebuild_ag 1 goliath
defenseuse_ag 1 goliath
defensebuild_ag 1 wraith
defenseuse_ag 1 wraith
defensebuild_ag 1 battlecruiser
defenseuse_ag 1 battlecruiser
defenseclear_aa
defensebuild_aa 1 valkyrie
defenseuse_aa 1 valkyrie
defensebuild_aa 1 wraith
defenseuse_aa 1 wraith
defensebuild_aa 1 battlecruiser
defenseuse_aa 1 battlecruiser
defenseclear_ga
defensebuild_ga 1 wraith
defenseuse_ga 1 wraith
defensebuild_ga 1 battlecruiser
defenseuse_ga 1 battlecruiser
goto a_startdefense


; --- FINAL DEFENSE ---

:b_finaldefense
defenseclear_gg
defensebuild_gg 2 ghost
defenseuse_gg 2 ghost
defensebuild_gg 2 seige_tank
defenseuse_gg 2 seige_tank
defensebuild_gg 2 goliath
defenseuse_gg 2 goliath
defensebuild_gg 2 wraith
defenseuse_gg 2 wraith
defensebuild_gg 2 battlecruiser
defenseuse_gg 2 battlecruiser
defenseclear_ag
defensebuild_ag 1 goliath
defenseuse_ag 1 goliath
defensebuild_ag 4 ghost
defenseuse_ag 4 ghost
defensebuild_ag 1 wraith
defenseuse_ag 1 wraith
defensebuild_ag 1 battlecruiser
defenseuse_ag 1 battlecruiser
defenseclear_aa
defensebuild_aa 1 valkyrie
defenseuse_aa 1 valkyrie
defensebuild_aa 1 wraith
defenseuse_aa 1 wraith
defensebuild_aa 1 battlecruiser
defenseuse_aa 1 battlecruiser
defenseclear_ga
defensebuild_ga 1 wraith
defenseuse_ga 1 wraith
defensebuild_ga 1 battlecruiser
defenseuse_ga 1 battlecruiser
goto a_finaldefense


; === RUSH CHECKS ===

:m_rushcheck

; --- RUSH BATTLECRUISER/WRAITH CHECK---

notowns_jump physics_lab b_wraithcheck
notowns_jump control_tower b_wraithcheck
wait 1200
resources_jump 1800 1300 b_cruiserrush
:a_cruiserrush


; --- RUSH WRAITH CHECK ---

:b_wraithcheck
notowns_jump starport b_groundcheck
wait 800
resources_jump 900 600 b_wraithrush
:a_wraithrush


; --- RUSH MEDIC/MARINE/VULTURE/TANK CHECK ---

:b_groundcheck
notowns_jump machine_shop b_tankcheck
notowns_jump academy b_tankcheck
notowns_jump barracks b_tankcheck
wait 600
resources_jump 1600 575 b_groundrush
:a_groundrush


; --- RUSH VULTURE/TANK CHECK ---

:b_tankcheck
notowns_jump machine_shop b_marinecheck
wait 400
resources_jump 1125 500 b_tankrush
:a_tankrush


; --- RUSH MEDIC/MARINE CHECK ---

:b_marinecheck
notowns_jump academy nocheck
notowns_jump barracks nocheck
wait 200
resources_jump 700 100 b_marinerush
:a_marinerush

:nocheck
stop


; === RUSH ATTACK SCRIPTS ===

; --- MEDIC/MARINE RUSH ---

:b_marinerush
wait_build 1 barracks
wait_build 1 academy
train 10 marine
train 4 medic
attack_add 10 marine
attack_add 4 medic
attack_prepare
attack_do
attack_clear
goto a_marinerush


; --- VULTURE/TANK RUSH ---

:b_tankrush
wait_build 1 factory
wait_build 1 machine_shop
train 5 siege_tank
train 5 vulture
attack_add 5 siege_tank
attack_add 5 vulture
attack_prepare
attack_do
attack_clear
goto a_tankrush


; --- MEDIC/MARINE/VULTURE/TANK RUSH ---

:b_groundrush
wait_build 1 barracks
wait_build 1 academy
wait_build 1 factory
wait_build 1 machine_shop
train 5 siege_tank
train 4 vulture
train 8 marine
train 3 medic
attack_add 5 siege_tank
attack_add 4 vulture
attack_add 8 marine
attack_add 3 medic
attack_prepare
attack_do
attack_clear
goto a_groudrush


; --- WRAITH RUSH ---

:b_wraithrush
wait_build 1 starport
train 6 wraith
attack_add 6 wraith
attack_prepare
attack_do
attack_clear
goto a_wraithrush


; --- BATTLECRUISER/WRAITH RUSH ---

:b_cruiserrush
wait_build 1 starport
wait_build 1 control_tower
wait_build 1 science_facility
wait_build 1 physics_lab
train 4 wraith
train 2 battlecruiser
attack_add 4 wraith
attack_add 2 battlecruiser
attack_prepare
attack_do
attack_clear
goto a_cruiserrush


; === MASS CHECKS ===

:m_masscheck

; --- MASS BATTLECRUISER CHECK ---

notowns_jump control_tower b_masswraithcheck
notowns_jump physics_lap b_masswraithcheck
wait 1000
resources_jump 2000 2000 b_cruisermass
:a_cruisermass

; --- MASS WRAITH CHECK ---

:b_masswraithcheck
notowns_jump starport b_masstankcheck
wait 1000
resources_jump 2000 1800 b_wraithmass
:a_wraithmass

; --- MASS VULTURE/TANK/GOLIATH CHECK ---

:b_masstankcheck
notowns_jump machine_shop b_massinfantrycheck
notowns_jump armory b_massinfantrycheck
wait 1000
resources_jump 2000 1500 b_tankmass
:a_tankmass

; --- MASS MEDIC/MARINE/GHOST CHECK ---

:b_massinfantrycheck
notowns_jump academy b_massmedicmarinecheck
notowns_jump barracks b_massmedicmarinecheck
notowns_jump covert_ops b_massmedicmarinecheck
wait 1000
resources_jump 2000 500 b_infantrymass
:a_infantrymass

; --- MASS MEDIC/MARINE CHECK ---

:b_massmedicmarinecheck
notowns_jump academy b_massmarinecheck
notowns_jump barracks b_massmarinecheck
wait 1000
resources_jump 2000 250 b_medicmarinemass
:a_medicmarinemass

; --- MASS MARINE CHECK ---

:b_massmarinecheck
notowns_jump academy nomasscheck
notowns_jump barracks nomasscheck
wait 1000
resources_jump 2000 0 b_marinemass
:a_marinemass

:nomasscheck
stop


; === MASS ATTACK SCRIPTS ===

; --- MARINE MASS ---


:b_marinemass
wait_build 1 barracks
train 50 marine
goto a_marinemass


; --- MEDIC/MARIN MASS ---

:b_medicmarinemass
wait_build 1 barracks
wait_build 1 armory
train 40 marine
train 10 medic
goto a_medicmarinemass


; --- MEDIC/MARINE/GHOST MASS ---

:b_infantrymass
wait_build 1 barracks
wait_build 1 academy
wait_build 1 covert-ops
train 30 marine
train 10 medic
train 10 ghost
train 1 science_vessel
train 1 nuclear_missile
goto a_infantrymass


; --- VULTURE/TANK/GOLIATH MASS ---

:b_tankmass
wait_build 1 machine_shop
wait_build 1 armory
train 12 seige_tank
train 20 vulture
train 15 goliath
train 1 science_vessel
goto a_tankmass


; --- WRAITH MASS ---

:b_wraithmass
wait_build 1 starport
train 30 wraith
train 2 science_vessel
goto a_wraithmass


; --- BATTLECRUISER MASS ---


:b_cruisermass
wait_build 1 control_tower
wait_build 1 physics_lab
train 15 battlecruiser
train 2 science_vessel
goto a_cruisermass


; === RESEARCH MULTI-RUN ===

; --- ACADEMY UPGRADES ---

:r_academy
wait_build 1 academy
tech stim_pack 70
wait 3600
upgrade 1 marine_range 70
wait 3600
tech optical_flare 70
wait 3600
upgrade 1 medic_mana 70
wait 3600
tech restoration 70
stop


; --- ENGINEERING BAY UPGRADES ---

:r_engineering_bay
wait_build 1 engineering_bay
upgrade 1 t_infantry_weapon 70
wait 3600
upgrade 1 t_infantry_armor 70
wait 3600
wait_build 1 science_facility
upgrade 2 t_infantry_weapon 70
wait 3600
upgrade 2 t_infantry_armor 70
wait 3600
upgrade 3 t_infantry_weapon 70
wait 3600
upgrade 3 t_infantry_armor 70
stop


; --- MACHINE SHOP UPGRADES ---

:r_machine_shop
wait_build 1 machine_shop
tech spider_mines 70
wait 3600
tech seige_mode 70
wait 3600
upgrade 1 vulture_speed 70
wait 3600
wait_build 1 armory
upgrade 1 goliath_range 70
stop


; --- CONTROL TOWER UPGRADES ---

:r_control_tower
wait_build 1 control_tower
tech cloaking_field 70
wait 3600
upgrade wraith_mana 70
stop


; --- ARMORY UPGRADES ---

:r_armory
wait_build 2 armory
upgrade 1 t_vehicle_weapon 70
upgrade 1 t_ship_weapon 70
wait 3600
wait_build 1 science_facility
upgrade 2 t_vehicle_weapon 70
upgrade 2 t_ship_weapon 70
wait 3600
upgrade 3 t_vehicle_weapon 70
upgrade 3 t_ship_weapon 70
stop


; --- COVERT OPS UPGRADES ---

:r_covert_ops
wait_build 1 covert_ops
tech personnel_cloaking 70
wait 3600
upgrade 1 ghost_mana 70
wait 3600
tech lockdown 70
wait 3600
upgrade 1 ghost_sight 70
stop


; --- PHYSICS LAB UPGRADES ---

:r_physics_lab
wait_build 1 physics_lab
tech yamato_gun 70
wait 3600
upgrade 1 battlecruiser_mana 70
stop

; --- SCIENCE FACILITY UPGRADES ---

:r_science_facility
wait_build 1 science_facility
tech emp_shockwave 70
wait 3600
upgrade science_vessel_mana 70
wait 3600
tech irradiate 70
wait 3600
tech defensive_matrix 70
stop[/spoiler]

Thanks,
Kryose
User avatar
ashara
Posts: 170
Joined: Wed Feb 06, 2008 11:12 pm

Postby ashara » Fri May 02, 2008 6:56 pm

Hi Kryose,

I'm glad to see new AI's coming maybe it will make me less lazy :P
Good luck with it.

The researching is all set to wait 3600 cause I don't know the researching times atm. I haven't been able to test it, and besides, I don't even know how to test it (I will look into it later when I have time at home).

I use datedit to get all training and research times. I'm not sure these are really important anyway. You just need to give the AI a good research timing and not to research everything at once.

When a building get's destroyed. Does the AI automatically try to rebuild?

Yes

Further, if an expansion is destroyed, does the AI automatically try to build it again?

No, although I don't know exactly at what point an expansion is considered lost and the AI won't rebuild in it. That's a problem if the main base is destroyed, the AI won't rebuild the buildings, except if you use player_need command.

Does the AI automatically fill bunkers? Or is there a command to do it?

This is automatic as far as I know. If you don't use defenseuse marine commands it might not work though.


Your coding is quite organized, that's definitely a good thing.
There is a mistake with the a_expansion and unless I'm wrong your suicide loop is not a loop for now.

I will give a closer a look at the code and try to run it and give more feedback after.
Kryose
Posts: 49
Joined: Fri Apr 25, 2008 4:26 pm

Postby Kryose » Fri May 02, 2008 7:13 pm

[quote name='Spirus' post='3760' date='May 2 2008, 01:30 PM']wow that's a huge script for your first attempt! :D

defenseuse_gg 1 marine
defenseuse_gg 1 firebat
and the Ai will put marines and firebats in bunkers. At least that's what I read somewhere and I tried it with the defense commands and without them and it seemed to do the job.

Also WinMPQ and add it (overwrite scripts/aiscript.bin) to any of the .exe's here on the site such as BlankAi_Vista.exe and you can avoid patching patch_rt.mpq. You might already know this tho. :P

Also there are some great premade replays in which you can test your ai with too without having to play a game.[/quote]

I will add more marines and firebats to the defense section then... can't have empty bunkers can we.

This brings me to another question though... I know that defenseuse_gg means for ground unit vs ground unit, ag for air unit vs ground unit, and so on. Now from what I have seen from other examples is that the gg, ag, ga and aa apply to the attacking force? Am I wrong on this?

Example:
defensebuild_gg 1 firebat
defenseuse_gg 1 firebat
defensebuild_ag 1 marine
defenseuse_ag 1 marine
defensebuild_ga 1 vulture
defenseuse_ga 1 vulture
defensebuild_aa 1 ghost
defenseuse_aa 1 ghost

Using the above example for my defense units...
-Lets say an enemy marine comes into your base and starts shootin up your SCVs. Because the enemy marine is a ground unit attacking other ground units, will the AI tell a firebat to go take that marine out?
-Then, an enemy guardian comes in and also starts to wreak havok on your helpless SCVs. Because the guardian is an air unit and is attacking ground units, will the AI tell a marine to start to defend the SCVs by shooting at the guardian?
-Then, an enemy dragoon comes into the fray and begins to harass your science vessels. Because the dragoon is a ground unit attacking air units, will the AI tell a vulture to go out and bravely defend those hapless science vessels?
-And when it couldn't get any worse, an enemy corsair comes into your base pushin around your 20 dropships that for some reason you amassed. Because the corsair is an air unit attacking other air units, will the AI send a ghost over to lockdown and nuke that damned corsair?

Am I completely wrong?

Thanks,
Kryose
Kryose
Posts: 49
Joined: Fri Apr 25, 2008 4:26 pm

Postby Kryose » Fri May 02, 2008 7:18 pm

[quote name='ashara' post='3761' date='May 2 2008, 01:56 PM']There is a mistake with the a_expansion and unless I'm wrong your suicide loop is not a loop for now.[/quote]

I am not sure where there might be a mistake in a_expansion, but I did find that there was no 'goto suicideloop', so I added it just before the funding section.

Thanks for the info, and if you do run the AI, I would definitely love to know how it goes.
Kryose

:EDIT:

I just ran through a syntax check, so this is what it looks like now...

[spoiler]; ASC3 File generated by ScAIEdit III
;
; Script name : Terran Expansion Custom Level
;
; Terran Multirun Script v1.0 - Created by Kryose
;

script_name Terran Expansion Custom Level
script_id TMCx

; === STARTUP COMMANDS ===
start_town
transports_off
farms_notiming

; === MAX UNIT DEFINITION ===

define_max 100 scv
define_max 75 marine
define_max 75 medic
define_max 25 firebat
define_max 50 ghost
define_max 75 vulture
define_max 20 siege_tank
define_max 20 goliath
define_max 40 wraith
define_max 20 battlecruiser
define_max 2 nuclear_missile
define_max 4 science_vessel
define_max 3 dropship
define_max 2 valkyrie


; === START ===

build 1 command_center 150
wait_build 1 command_center
build 4 scv 130
wait_build 4 scv

multirun m_funding


; === MAIN ===

; --- RESEARCH ---

multirun r_academy
multirun r_engineering_bay
multirun r_machine_shop
multirun r_control_tower
multirun r_armory
multirun r_covert_ops
multirun r_physics_lab
multirun r_science_facility

; --- ECONOMY/BUILDING ---

build 5 scv 80
wait_buildstart 5 scv
build 6 scv 80
wait_buildstart 6 scv
build 7 scv 80
wait_buildstart 7 scv
build 1 supply_depot 80
wait_buildstart 1 supply_depot
build 8 scv 80
wait_buildstart 8 scv

goto b_barracks1
:a_barracks1

farms_timing

build 9 scv 80
wait_buildstart 9 scv
build 10 scv 80
wait_buildstart 10 scv
build 1 refinery 80
wait_buildstart 1 refinery

goto b_bunker1
:a_bunker1

build 11 scv 80
wait_buildstart 11 scv

goto b_academy
:a_academy

build 12 scv 80
wait_buildstart 12 scv

goto b_barracks2
:a_barracks2

build 13 scv 80
wait_buildstart 13 scv

goto b_engineeringbay
:a_engineeringbay

multirun m_rushcheck

goto b_startdefense
:a_startdefense

expand 1 b_expansion

goto b_factory1
:a_factory1

build 4 scv 80

train 3 marine
train 1 medic
train 1 vulture
train 1 siege_tank

multirun m_rushcheck

build 4 scv 80

expand 1 b_expansion

goto b_factory2
:a_factory2

goto b_armory
:a_armory

multirun m_rushcheck

build 4 scv 80

goto b_starport1
:a_starport1

build 3 scv 80

multirun m_rushcheck

goto b_bunker2
:a_bunker2

goto b_missile_turret
:a_missile_turret

build 3 scv 80

multirun m_rushcheck

expand 1 b_expansion

goto b_starport2
:a_starport2

build 2 scv 80

goto b_sciencefacility
:a_sciencefacility

multirun m_rushcheck

goto b_finaldefense
:a_finaldefense

build 2 scv 80

goto b_missile_turret
:a_missile_turret

expand 1 b_expansion

multirun m_rushcheck

expand 1 b_expansion

; === END LOOP ===

:suicideloop
multirun m_masscheck
wait 4000
send_suicide 0
goto suicideloop

; === FUNDING MULTI-RUN ===

:m_funding
wait 1000
give_money
goto m_funding


; === EXPANSION SCRIPT ===

:b_expansion
start_town
build 1 command_center 80
wait_build 1 command_center
build 8 scv 70
wait_build 1 barracks
build 1 bunker 70
wait_build 1 engineering_bay
build 2 missile_turret 70
build 1 refinery 70
build 1 comsat_station 70
:a_expansion


; === BUILD SCRIPT ===

; --- BARRACKS ---

:b_barracks1
build 1 barracks 80
wait_buildstart 1 barracks
build 2 supply_depot 80
wait_buildstart 2 supply_depot
wait_build 1 barracks
train 1 marine
goto a_barracks1

; --- BUNKER1 ---

:b_bunker1
wait_build 1 barracks
build 1 bunker 80
wait_buildstart 1 bunker
train 4 marine
goto a_bunker1


; --- ACADEMY ---

:b_academy
wait_build 1 barracks
build 1 academy 80
wait_buildstart 1 academy
goto a_academy


; --- BARRACKS2 ---

:b_barracks2
build 4 barracks 80
wait_buildstart 4 barracks
wait_build 1 academy
wait_build 4 barracks
train 6 marine
train 3 firebat
train 4 medic
goto a_barracks2


; --- ENGINEERING BAY ---

:b_engineeringbay
wait_build 1 barracks
build 1 engineering_bay 80
wait_buildstart 1 engineering_bay
wait_build 1 engineering_bay
build 3 missile_turret 70
goto a_engineeringbay


; --- FACTORY1 ---

:b_factory1
wait_build 1 barracks
build 1 factory 80
wait_buildstart 1 factory
wait_build 1 factory
train 2 vulture
build 1 machine_shop 80
wait_buildstart 1 machine_shop
wait_build 1 machine_shop
train 2 siege_tank
train 2 vulture
goto a_factory1


; --- FACTORY2 ---

:b_factory2
wait_build 1 barracks
build 4 factory 80
wait_buildstart 4 factory
wait_build 4 factory
build 2 machine_shop 80
wait_buildstart 2 machine_shop
wait_build 2 machine_shop
train 3 siege_tank
goto a_factory2


; --- ARMORY ---

:b_armory
wait_build 1 factory
build 2 armory 80
wait_buildstart 2 armory
wait_build 1 armory
train 3 goliath
goto a_armory


; --- STARPORT1 ---

:b_starport1
wait_build 1 factory
build 1 starport 80
wait_buildstart 1 starport
wait_build 1 starport
train 2 wraith
build 1 control_tower 80
wait_buildstart 1 control_tower
goto a_starport1


; --- BUNKER2 ---

:b_bunker2
wait_build 1 barracks
build 5 bunker 80
train 10 marine
train 4 firebat
goto a_bunker2


; --- TURRET ---

:b_missile_turret
wait_build 1 engineering_bay
build 10 missile_turret 80
goto a_missile_turret


; --- STARPORT2 ---

:b_starport2
wait_build 1 factory
build 4 starport 80
wait_buildstart 4 starport
wait_build 4 starport
build 3 control_tower 80
goto a_starport2


; --- SCIENCE FACILITY ---

:b_sciencefacility
wait_build 1 starport
build 2 science_facility 80
wait_buildstart 2 science_facility
wait_build 2 science_facility
train 2 science_vessel
build 1 physics_lab 80
wait_buildstart 1 physics_lab
build 1 covert_ops 80
wait_buildstart 1 covert_ops
wait_build 1 physics_lab
train 1 battlecruiser
wait_build 1 covert_ops
build 1 nuclear_silo 80
goto a_sciencefacility


; === DEFENSE SCRIPTS ===

; --- STARTING DEFENSE ---

:b_startdefense
defenseclear_gg
defensebuild_gg 6 marine
defenseuse_gg 6 marine
defensebuild_gg 1 firebat
defenseuse_gg 1 firebat
defensebuild_gg 1 vulture
defenseuse_gg 1 vulture
defensebuild_gg 2 siege_tank
defenseuse_gg 2 siege_tank
defensebuild_gg 1 goliath
defenseuse_gg 1 goliath
defensebuild_gg 1 wraith
defenseuse_gg 1 wraith
defensebuild_gg 1 battlecruiser
defenseuse_gg 1 battlecruiser
defenseclear_ag
defensebuild_ag 6 marine
defenseuse_ag 6 marine
defensebuild_ag 1 goliath
defenseuse_ag 1 goliath
defensebuild_ag 1 wraith
defenseuse_ag 1 wraith
defensebuild_ag 1 battlecruiser
defenseuse_ag 1 battlecruiser
defenseclear_aa
defensebuild_aa 1 valkyrie
defenseuse_aa 1 valkyrie
defensebuild_aa 1 wraith
defenseuse_aa 1 wraith
defensebuild_aa 1 battlecruiser
defenseuse_aa 1 battlecruiser
defenseclear_ga
defensebuild_ga 1 wraith
defenseuse_ga 1 wraith
defensebuild_ga 1 battlecruiser
defenseuse_ga 1 battlecruiser
goto a_startdefense


; --- FINAL DEFENSE ---

:b_finaldefense
defenseclear_gg
defensebuild_gg 7 ghost
defenseuse_gg 7 ghost
defensebuild_gg 2 siege_tank
defenseuse_gg 2 siege_tank
defensebuild_gg 2 goliath
defenseuse_gg 2 goliath
defensebuild_gg 2 wraith
defenseuse_gg 2 wraith
defensebuild_gg 2 battlecruiser
defenseuse_gg 2 battlecruiser
defenseclear_ag
defensebuild_ag 1 goliath
defenseuse_ag 1 goliath
defensebuild_ag 7 ghost
defenseuse_ag 7 ghost
defensebuild_ag 1 wraith
defenseuse_ag 1 wraith
defensebuild_ag 1 battlecruiser
defenseuse_ag 1 battlecruiser
defenseclear_aa
defensebuild_aa 1 valkyrie
defenseuse_aa 1 valkyrie
defensebuild_aa 1 wraith
defenseuse_aa 1 wraith
defensebuild_aa 1 battlecruiser
defenseuse_aa 1 battlecruiser
defenseclear_ga
defensebuild_ga 1 wraith
defenseuse_ga 1 wraith
defensebuild_ga 1 battlecruiser
defenseuse_ga 1 battlecruiser
goto a_finaldefense


; === RUSH CHECKS ===

:m_rushcheck

; --- RUSH BATTLECRUISER/WRAITH CHECK---

notowns_jump physics_lab b_wraithcheck
notowns_jump control_tower b_wraithcheck
wait 1200
resources_jump 1800 1300 b_cruiserrush
:a_cruiserrush


; --- RUSH WRAITH CHECK ---

:b_wraithcheck
notowns_jump starport b_groundcheck
wait 800
resources_jump 900 600 b_wraithrush
:a_wraithrush


; --- RUSH MEDIC/MARINE/VULTURE/TANK CHECK ---

:b_groundcheck
notowns_jump machine_shop b_tankcheck
notowns_jump academy b_tankcheck
notowns_jump barracks b_tankcheck
wait 600
resources_jump 1600 575 b_groundrush
:a_groundrush


; --- RUSH VULTURE/TANK CHECK ---

:b_tankcheck
notowns_jump machine_shop b_marinecheck
wait 400
resources_jump 1125 500 b_tankrush
:a_tankrush


; --- RUSH MEDIC/MARINE CHECK ---

:b_marinecheck
notowns_jump academy nocheck
notowns_jump barracks nocheck
wait 200
resources_jump 700 100 b_marinerush
:a_marinerush

:nocheck
stop


; === RUSH ATTACK SCRIPTS ===

; --- MEDIC/MARINE RUSH ---

:b_marinerush
wait_build 1 barracks
wait_build 1 academy
train 10 marine
train 4 medic
attack_add 10 marine
attack_add 4 medic
attack_prepare
attack_do
attack_clear
goto a_marinerush


; --- VULTURE/TANK RUSH ---

:b_tankrush
wait_build 1 factory
wait_build 1 machine_shop
train 5 siege_tank
train 5 vulture
attack_add 5 siege_tank
attack_add 5 vulture
attack_prepare
attack_do
attack_clear
goto a_tankrush


; --- MEDIC/MARINE/VULTURE/TANK RUSH ---

:b_groundrush
wait_build 1 barracks
wait_build 1 academy
wait_build 1 factory
wait_build 1 machine_shop
train 5 siege_tank
train 4 vulture
train 8 marine
train 3 medic
attack_add 5 siege_tank
attack_add 4 vulture
attack_add 8 marine
attack_add 3 medic
attack_prepare
attack_do
attack_clear
goto a_groundrush


; --- WRAITH RUSH ---

:b_wraithrush
wait_build 1 starport
train 6 wraith
attack_add 6 wraith
attack_prepare
attack_do
attack_clear
goto a_wraithrush


; --- BATTLECRUISER/WRAITH RUSH ---

:b_cruiserrush
wait_build 1 starport
wait_build 1 control_tower
wait_build 1 science_facility
wait_build 1 physics_lab
train 4 wraith
train 2 battlecruiser
attack_add 4 wraith
attack_add 2 battlecruiser
attack_prepare
attack_do
attack_clear
goto a_cruiserrush


; === MASS CHECKS ===

:m_masscheck

; --- MASS BATTLECRUISER CHECK ---

notowns_jump control_tower b_masswraithcheck
notowns_jump physics_lab b_masswraithcheck
wait 1000
resources_jump 2000 2000 b_cruisermass
:a_cruisermass

; --- MASS WRAITH CHECK ---

:b_masswraithcheck
notowns_jump starport b_masstankcheck
wait 1000
resources_jump 2000 1800 b_wraithmass
:a_wraithmass

; --- MASS VULTURE/TANK/GOLIATH CHECK ---

:b_masstankcheck
notowns_jump machine_shop b_massinfantrycheck
notowns_jump armory b_massinfantrycheck
wait 1000
resources_jump 2000 1500 b_tankmass
:a_tankmass

; --- MASS MEDIC/MARINE/GHOST CHECK ---

:b_massinfantrycheck
notowns_jump academy b_massmedicmarinecheck
notowns_jump barracks b_massmedicmarinecheck
notowns_jump covert_ops b_massmedicmarinecheck
wait 1000
resources_jump 2000 500 b_infantrymass
:a_infantrymass

; --- MASS MEDIC/MARINE CHECK ---

:b_massmedicmarinecheck
notowns_jump academy b_massmarinecheck
notowns_jump barracks b_massmarinecheck
wait 1000
resources_jump 2000 250 b_medicmarinemass
:a_medicmarinemass

; --- MASS MARINE CHECK ---

:b_massmarinecheck
notowns_jump academy nomasscheck
notowns_jump barracks nomasscheck
wait 1000
resources_jump 2000 0 b_marinemass
:a_marinemass

:nomasscheck
stop


; === MASS ATTACK SCRIPTS ===

; --- MARINE MASS ---


:b_marinemass
wait_build 1 barracks
train 50 marine
goto a_marinemass


; --- MEDIC/MARIN MASS ---

:b_medicmarinemass
wait_build 1 barracks
wait_build 1 armory
train 40 marine
train 10 medic
goto a_medicmarinemass


; --- MEDIC/MARINE/GHOST MASS ---

:b_infantrymass
wait_build 1 barracks
wait_build 1 academy
wait_build 1 covert_ops
train 30 marine
train 10 medic
train 10 ghost
train 1 science_vessel
train 1 nuclear_missile
goto a_infantrymass


; --- VULTURE/TANK/GOLIATH MASS ---

:b_tankmass
wait_build 1 machine_shop
wait_build 1 armory
train 12 siege_tank
train 20 vulture
train 15 goliath
train 1 science_vessel
goto a_tankmass


; --- WRAITH MASS ---

:b_wraithmass
wait_build 1 starport
train 30 wraith
train 2 science_vessel
goto a_wraithmass


; --- BATTLECRUISER MASS ---


:b_cruisermass
wait_build 1 control_tower
wait_build 1 physics_lab
train 15 battlecruiser
train 2 science_vessel
goto a_cruisermass


; === RESEARCH MULTI-RUN ===

; --- ACADEMY UPGRADES ---

:r_academy
wait_build 1 academy
tech stim_packs 70
wait 3600
upgrade 1 marine_range 70
wait 3600
tech optical_flare 70
wait 3600
upgrade 1 medic_mana 70
wait 3600
tech restoration 70
stop


; --- ENGINEERING BAY UPGRADES ---

:r_engineering_bay
wait_build 1 engineering_bay
upgrade 1 t_infantry_weapon 70
wait 3600
upgrade 1 t_infantry_armor 70
wait 3600
wait_build 1 science_facility
upgrade 2 t_infantry_weapon 70
wait 3600
upgrade 2 t_infantry_armor 70
wait 3600
upgrade 3 t_infantry_weapon 70
wait 3600
upgrade 3 t_infantry_armor 70
stop


; --- MACHINE SHOP UPGRADES ---

:r_machine_shop
wait_build 1 machine_shop
tech spider_mines 70
wait 3600
tech siege_mode 70
wait 3600
upgrade 1 vulture_speed 70
wait 3600
wait_build 1 armory
upgrade 1 goliath_range 70
stop


; --- CONTROL TOWER UPGRADES ---

:r_control_tower
wait_build 1 control_tower
tech cloaking_field 70
wait 3600
upgrade 1 wraith_mana 70
stop


; --- ARMORY UPGRADES ---

:r_armory
wait_build 2 armory
upgrade 1 t_vehicle_weapon 70
upgrade 1 t_ship_weapon 70
wait 3600
wait_build 1 science_facility
upgrade 2 t_vehicle_weapon 70
upgrade 2 t_ship_weapon 70
wait 3600
upgrade 3 t_vehicle_weapon 70
upgrade 3 t_ship_weapon 70
stop


; --- COVERT OPS UPGRADES ---

:r_covert_ops
wait_build 1 covert_ops
tech personnel_cloaking 70
wait 3600
upgrade 1 ghost_mana 70
wait 3600
tech lockdown 70
wait 3600
upgrade 1 ghost_sight 70
stop


; --- PHYSICS LAB UPGRADES ---

:r_physics_lab
wait_build 1 physics_lab
tech yamato_gun 70
wait 3600
upgrade 1 battlecruiser_mana 70
stop

; --- SCIENCE FACILITY UPGRADES ---

:r_science_facility
wait_build 1 science_facility
tech emp_shockwave 70
wait 3600
upgrade 1 science_vessel_mana 70
wait 3600
tech irradiate 70
wait 3600
tech defensive_matrix 70
stop[/spoiler]
matefkr
Posts: 86
Joined: Tue Jun 05, 2007 9:38 pm

Postby matefkr » Fri May 02, 2008 8:14 pm

I'm not entirely sure about that, but i think that defensebuild_xx nn unit will rebuild the unit as some of those died (or haven't reached max) in a situation where xx occured. So if you don't use defensebuild for weak unit, it will mostly rebuild stronger units first, and they can stand longer against the enemy; while the atackers could easili kill any new-built marine (for example) one by one. But it need some tests.
User avatar
ashara
Posts: 170
Joined: Wed Feb 06, 2008 11:12 pm

Postby ashara » Fri May 02, 2008 8:52 pm

Okay here is a small pack with your AI and 2 replays, you can find more of them in BWAI replay pack.
[attachment=763:Kryose_T_byAshara.zip]

On these replays your AI is not very offensive, it seems to work better against the Blizzard default AI, with many small attacks.
Maybe I just wrongly modified something in your script.

Nice first AI, it's pretty well balanced for a not tested one, maybe we will get something to stand with Ahzz one :)
Kryose
Posts: 49
Joined: Fri Apr 25, 2008 4:26 pm

Postby Kryose » Fri May 02, 2008 11:35 pm

[quote name='ashara' post='3765' date='May 2 2008, 03:52 PM']Okay here is a small pack with your AI and 2 replays, you can find more of them in BWAI replay pack.
[attachment=763:Kryose_T_byAshara.zip]

On these replays your AI is not very offensive, it seems to work better against the Blizzard default AI, with many small attacks.
Maybe I just wrongly modified something in your script.

Nice first AI, it's pretty well balanced for a not tested one, maybe we will get something to stand with Ahzz one :)[/quote]

Thanks Ashara, I looked through the code and saw what you changed. I will make some further changes based on your suggestions in the comments.

I also watched through the replays. It looked to me that not all of the buildings that I wanted to build were being built, ie 4 barracks, 4 factories and so on. And I don't remember telling it to build that many valkyries... It looks like the AI still has a mind of its own and it just thinks of my coded instructions as a suggestion /blink.gif' class='bbc_emoticon' alt=':blink:' /> Is this normal?

Also, I noticed in the TvZ replay that my production completely stopped after the first science facility finished (I ask it to build 2). Could this be because the SCV chosen to build was stuck in between buildings? Is there a way around this?

I agree that the AI is not very aggressive, but that is not what I was planning. They only seem to attack twice and never really go through the suicide loop once. I am stumped :S I will look at it more tomorrow.

Kryose
User avatar
ashara
Posts: 170
Joined: Wed Feb 06, 2008 11:12 pm

Postby ashara » Sat May 03, 2008 8:41 am

I also watched through the replays. It looked to me that not all of the buildings that I wanted to build were being built, ie 4 barracks, 4 factories and so on.

Strange, on the 2 replays in the pack, it seems to build all of them. I'm using version 1.15.2.

And I don't remember telling it to build that many valkyries... It looks like the AI still has a mind of its own and it just thinks of my coded instructions as a suggestion /blink.gif' class='bbc_emoticon' alt=':blink:' /> Is this normal?

I think the AI followed your instructions so far...
I haven't seen many valkyries, but the explanation is probably with defensebuild commands, the AI will choose how many units to build and I don't know how it works.
The maximum number of valkyries you put is 2, that's good, with 4 starports you shouldn't see more than 5 valkyries at the same time (maybe only 2, I don't know exactly how it counts them for defensebuild).

Also, I noticed in the TvZ replay that my production completely stopped after the first science facility finished (I ask it to build 2). Could this be because the SCV chosen to build was stuck in between buildings? Is there a way around this?

I didn't see that, but SCV stuck in between buildings is probably the reason, I had the same thing many times before. I don't know how to avoid it, you can try to build buildings slower, build less of them, or maybe dropships (I'm not sure this last one could work though). The best solution is probably to play your AI only on maps with big mains like LunaAI, FR, Rofflecakes.

I agree that the AI is not very aggressive, but that is not what I was planning. They only seem to attack twice and never really go through the suicide loop once. I am stumped :S I will look at it more tomorrow.

If it doesn't build all the buildings the AI won't go in suicide loop, since there are wait_build and wait_buildstart statements.
It might block with the train commands too. If you ask the AI to build 15 battlecruisers, you will be blocked in this instruction until you've got 15 battlecruisers alive or in training at the same time.



You've done a straight line script (except for funding and researching), so if one step doesn't work it won't go further.
Here is the code structure I use now, that might be helpful, it's probably not the best way, just find what suits you the most.

main initilisation:

multirun give_me_money
multirun research
unit max definition

main:

Main part is a mix with the following elements, you can put them several times in whatever order. when the main is finished call the final loop.
building
multirun training
expanding
suiciding
modifying unit max numbers
defenseuse and defensebuild commands


sometimes I also put some researches that need to be timed well in the main part

I also put some research commands early for example researching stimpacks before starting academy because it make the AI gathering gas faster.
Warning: this might be blocking even if the priority of stimpacks researching is less than academy building. It works really well but can bring some difficult to understand errors.

final loop:

expanding
suiciding

I don't put multirun calls for training in the final loop.

training:
training are called from main part. There are often one way trainings, such as train 5 Zealot, train 10 Dragoon, stop.
I use attacking commands in training part only when I have only one training thread.

I use multi training threads, for the different buildings that train units. e.g. One training thread for barracks, one for factories and when for starport.
This avoid locking the production of infantry and spaceships if all your tanks have been destroyed and you're in a train 15 tank command.

I use a final training loop it needs at least one "wait time" command in it.

expanding:
I only put buildings and scv's here.
Buildings build in the main don't count for the expansion.
A "wait_build 1 barracks" will be blocking if you didn't put "build 1 barracks 80" before in the expansion part.



researching:
I put all researches in a straight line, you can use many multirun as well.
I often separate different parts of researching with notowns_jump or resources_jump loops.
I've read somewhere you need to put at least the research time between "upgrade 1 p_air_weapon 30" and "upgrade 2 p_air_weapon 30" but I don't think it's necessary. You can put "upgrade 3 p_air_weapon 30" without the other two before and it seems to work fine. The main problem is having too much researches waiting at the same time and getting locked. That's probably why it's better to put

Code: Select all

upgrade 1 p_air_weapon 30
wait 4000
upgrade 2 p_air_weapon 30
wait 4480
upgrade 3 p_air_weapon 30
Kryose
Posts: 49
Joined: Fri Apr 25, 2008 4:26 pm

Postby Kryose » Sat May 03, 2008 1:56 pm

Like the noob I am, I ran through the replays without running the AI executable first. Everything was so off from what it should have been because I was watching the BroodAI rather than my own. I ran through it again and I am well pleased. I only saw a few things that didn't work out with the timing too well. One was that I didn't build many SCVs at the start, the second was that it only built one expansion... I hope the fix I made takes care of that... Next the Physics Lab and Covert Ops were delayed because of the research script on the science facility. I am not waiting till they are build before I research for Science Vessel stuff. I noticed in the Zerg replay that I almost got screwed over right at the beginning cause I wasn't using the bunker. I moved the starting defense script up to take care of that. Also, the AI did not build any comsat. I took care of this by using notowns_jump in the expansion script as Ashara suggested.

Now... How do I make the AI an executable... I will do some searching on the forums.

UPDATE: I tried to compile a self-executable CWAD file in SCAIEdit, but it doesn't run correctly. It does not look like it is the same kind of method that Ashara used when she did it for my AI yesterday. Whats wrong with it?

Thanks for all your input, the script is below.

Kryose

[spoiler]; ASC3 File generated by ScAIEdit III
;
; Script name : Terran Expansion Custom Level
;
; Terran Multirun Script v1.01 - Created by Kryose - Modified by Ashara
;

script_name Terran Expansion Custom Level
script_id TMCx

; === STARTUP COMMANDS ===
start_town
transports_off
farms_notiming

; === MAX UNIT DEFINITION ===

define_max 100 scv
define_max 75 marine
define_max 75 medic
define_max 25 firebat
define_max 50 ghost
define_max 75 vulture
define_max 20 siege_tank
define_max 20 goliath
define_max 40 wraith
define_max 20 battlecruiser
define_max 2 nuclear_missile
define_max 4 science_vessel
define_max 3 dropship
define_max 2 valkyrie


; === START ===

build 1 command_center 150
wait_build 1 command_center
build 4 scv 130
wait_build 4 scv

multirun m_funding


; === MAIN ===

; --- RESEARCH ---

multirun r_academy
multirun r_engineering_bay
multirun r_machine_shop
multirun r_control_tower
multirun r_armory
multirun r_covert_ops
multirun r_physics_lab
multirun r_science_facility

; --- ECONOMY/BUILDING ---

build 5 scv 80
wait_buildstart 5 scv
build 6 scv 80
wait_buildstart 6 scv
build 7 scv 80
wait_buildstart 7 scv
build 1 supply_depot 80
wait_buildstart 1 supply_depot
build 8 scv 80
wait_buildstart 8 scv

goto b_barracks1
:a_barracks1

farms_timing

build 9 scv 80
wait_buildstart 9 scv
build 10 scv 80
wait_buildstart 10 scv
build 1 refinery 80
wait_buildstart 1 refinery

goto b_bunker1
:a_bunker1

build 11 scv 80
wait_buildstart 11 scv

goto b_academy
:a_academy

build 12 scv 80
wait_buildstart 12 scv

goto b_barracks2
:a_barracks2

goto b_startdefense
:a_startdefense

build 13 scv 80
wait_buildstart 13 scv
build 14 scv 80
wait_buildstart 14 scv
build 15 scv 80
wait_buildstart 15 scv
build 16 scv 80
wait_buildstart 16 scv
build 17 scv 80
wait_buildstart 17 scv

goto b_engineeringbay
:a_engineeringbay

multirun m_rushcheck

expand 99 b_expansion

goto b_factory1
:a_factory1

build 4 scv 80

multirun m_rushcheck

build 4 scv 80

expand 99 b_expansion

goto b_factory2
:a_factory2

goto b_armory
:a_armory

multirun m_rushcheck

build 4 scv 80

goto b_starport
:a_starport

build 3 scv 80

multirun m_rushcheck

goto b_bunker2
:a_bunker2

goto b_turret
:a_turret

build 3 scv 80

multirun m_rushcheck

expand 99 b_expansion

goto b_starport2
:a_starport2

build 2 scv 80

goto b_sciencefacility
:a_sciencefacility

multirun m_rushcheck

goto b_finaldefense
:a_finaldefense

build 2 scv 80

expand 99 b_expansion

multirun m_rushcheck

expand 99 b_expansion

; === END LOOP ===

:suicideloop
multirun m_masscheck
wait 4000
send_suicide 0
goto suicideloop

; === FUNDING MULTI-RUN ===

:m_funding
wait 1000
give_money
goto m_funding


; === EXPANSION SCRIPT ===

:b_expansion
start_town
build 1 command_center 80
wait_build 1 command_center
build 8 scv 70
wait_build 1 barracks
build 1 bunker 70
build 1 refinery 70

notowns_jump engineering_bay b_comsatexpo
build 4 missile_turret 70

:b_comsatexpo
notowns_jump academy endexpo
build 1 comsat_station 80

:endexpo
stop


; === BUILD SCRIPT ===

; --- BARRACKS ---

:b_barracks1
build 1 barracks 80
wait_buildstart 1 barracks
build 2 supply_depot 80
wait_buildstart 2 supply_depot
wait_build 1 barracks
train 1 marine
goto a_barracks1

; --- BUNKER1 ---

:b_bunker1
wait_build 1 barracks
build 1 bunker 80
wait_buildstart 1 bunker
train 4 marine
goto a_bunker1


; --- ACADEMY ---

:b_academy
wait_build 1 barracks
build 1 academy 80
wait_buildstart 1 academy
goto a_academy


; --- BARRACKS2 ---

:b_barracks2
build 4 barracks 80
wait_buildstart 4 barracks
wait_build 1 academy
wait_build 4 barracks
train 4 marine
train 2 firebat
train 2 medic
goto a_barracks2


; --- ENGINEERING BAY ---

:b_engineeringbay
wait_build 1 barracks
build 1 engineering_bay 80
wait_buildstart 1 engineering_bay
wait_build 1 engineering_bay
build 3 missile_turret 70
goto a_engineeringbay


; --- FACTORY1 ---

:b_factory1
wait_build 1 barracks
build 1 factory 80
wait_buildstart 1 factory
wait_build 1 factory
train 2 vulture
build 1 machine_shop 80
wait_buildstart 1 machine_shop
wait_build 1 machine_shop
train 2 siege_tank
train 2 vulture
goto a_factory1


; --- FACTORY2 ---

:b_factory2
wait_build 1 barracks
build 4 factory 80
wait_buildstart 4 factory
wait_build 4 factory
build 2 machine_shop 80
wait_buildstart 2 machine_shop
wait_build 2 machine_shop
train 3 siege_tank
goto a_factory2


; --- ARMORY ---

:b_armory
wait_build 1 factory
build 2 armory 80
wait_buildstart 2 armory
wait_build 1 armory
train 3 goliath
goto a_armory


; --- STARPORT ---

:b_starport
wait_build 1 factory
build 1 starport 80
wait_buildstart 1 starport
wait_build 1 starport
train 2 wraith
build 1 control_tower 80
wait_buildstart 1 control_tower
goto a_starport


; --- BUNKER2 ---

:b_bunker2
wait_build 1 barracks
build 5 bunker 80
train 10 marine
train 4 firebat
goto a_bunker2


; --- TURRET ---

:b_turret
wait_build 1 engineering_bay
build 10 missile_turret 80
goto a_turret


; --- STARPORT2 ---

:b_starport2
wait_build 1 factory
build 4 starport 80
wait_buildstart 4 starport
wait_build 4 starport
build 3 control_tower 80
goto a_starport2


; --- SCIENCE FACILITY ---

:b_sciencefacility
wait_build 1 starport
build 2 science_facility 80
wait_buildstart 2 science_facility
wait_build 2 science_facility
train 2 science_vessel
build 1 physics_lab 80
wait_buildstart 1 physics_lab
build 1 covert_ops 80
wait_buildstart 1 covert_ops
wait_build 1 physics_lab
train 1 battlecruiser
wait_build 1 covert_ops
build 1 nuclear_silo 80
goto a_sciencefacility


; === DEFENSE SCRIPTS ===

; --- STARTING DEFENSE ---

:b_startdefense
defenseclear_gg
defensebuild_gg 2 marine
defenseuse_gg 2 marine
defensebuild_gg 1 firebat
defenseuse_gg 1 firebat
defensebuild_gg 1 vulture
defenseuse_gg 1 vulture
defensebuild_gg 2 siege_tank
defenseuse_gg 2 siege_tank
defensebuild_gg 1 goliath
defenseuse_gg 1 goliath
defensebuild_gg 1 wraith
defenseuse_gg 1 wraith
defensebuild_gg 1 battlecruiser
defenseuse_gg 1 battlecruiser
defenseclear_ag
defensebuild_ag 2 marine
defenseuse_ag 2 marine
defensebuild_ag 1 goliath
defenseuse_ag 1 goliath
defensebuild_ag 1 wraith
defenseuse_ag 1 wraith
defensebuild_ag 1 battlecruiser
defenseuse_ag 1 battlecruiser
defenseclear_aa
defensebuild_aa 1 valkyrie
defenseuse_aa 1 valkyrie
defensebuild_aa 1 wraith
defenseuse_aa 1 wraith
defensebuild_aa 1 battlecruiser
defenseuse_aa 1 battlecruiser
defenseclear_ga
defensebuild_ga 1 wraith
defenseuse_ga 1 wraith
defensebuild_ga 1 battlecruiser
defenseuse_ga 1 battlecruiser
goto a_startdefense


; --- FINAL DEFENSE ---

:b_finaldefense
defenseclear_gg
defensebuild_gg 2 ghost
defenseuse_gg 2 ghost
defensebuild_gg 2 siege_tank
defenseuse_gg 2 siege_tank
defensebuild_gg 2 goliath
defenseuse_gg 2 goliath
defensebuild_gg 2 wraith
defenseuse_gg 2 wraith
defensebuild_gg 2 battlecruiser
defenseuse_gg 2 battlecruiser
defenseclear_ag
defensebuild_ag 1 goliath
defenseuse_ag 1 goliath
defensebuild_ag 2 ghost
defenseuse_ag 2 ghost
defensebuild_ag 1 wraith
defenseuse_ag 1 wraith
defensebuild_ag 1 battlecruiser
defenseuse_ag 1 battlecruiser
defenseclear_aa
defensebuild_aa 1 valkyrie
defenseuse_aa 1 valkyrie
defensebuild_aa 1 wraith
defenseuse_aa 1 wraith
defensebuild_aa 1 battlecruiser
defenseuse_aa 1 battlecruiser
defenseclear_ga
defensebuild_ga 1 wraith
defenseuse_ga 1 wraith
defensebuild_ga 1 battlecruiser
defenseuse_ga 1 battlecruiser
goto a_finaldefense


; === RUSH CHECKS ===

:m_rushcheck

; --- RUSH BATTLECRUISER/WRAITH CHECK---

notowns_jump physics_lab b_wraithcheck
notowns_jump control_tower b_wraithcheck
wait 1200
resources_jump 1500 1000 b_cruiserrush
:a_cruiserrush


; --- RUSH WRAITH CHECK ---

:b_wraithcheck
notowns_jump starport b_groundcheck
wait 800
resources_jump 750 400 b_wraithrush
:a_wraithrush


; --- RUSH MEDIC/MARINE/VULTURE/TANK CHECK ---

:b_groundcheck
notowns_jump machine_shop b_tankcheck
notowns_jump academy b_tankcheck
notowns_jump barracks b_tankcheck
wait 600
resources_jump 1200 300 b_groundrush
:a_groundrush


; --- RUSH VULTURE/TANK CHECK ---

:b_tankcheck
notowns_jump machine_shop b_marinecheck
wait 400
resources_jump 750 300 b_tankrush
:a_tankrush


; --- RUSH MEDIC/MARINE CHECK ---

:b_marinecheck
notowns_jump academy nocheck
notowns_jump barracks nocheck
wait 200
resources_jump 500 50 b_marinerush
:a_marinerush

:nocheck
stop


; === RUSH ATTACK SCRIPTS ===

; --- MEDIC/MARINE RUSH ---

:b_marinerush
wait_build 1 barracks
wait_build 1 academy
train 10 marine
train 4 medic
attack_add 10 marine
attack_add 4 medic
attack_prepare
attack_do
attack_clear
goto a_marinerush


; --- VULTURE/TANK RUSH ---

:b_tankrush
wait_build 1 factory
wait_build 1 machine_shop
train 5 siege_tank
train 5 vulture
attack_add 5 siege_tank
attack_add 5 vulture
attack_prepare
attack_do
attack_clear
goto a_tankrush


; --- MEDIC/MARINE/VULTURE/TANK RUSH ---

:b_groundrush
wait_build 1 barracks
wait_build 1 academy
wait_build 1 factory
wait_build 1 machine_shop
train 5 siege_tank
train 4 vulture
train 8 marine
train 3 medic
attack_add 5 siege_tank
attack_add 4 vulture
attack_add 8 marine
attack_add 3 medic
attack_prepare
attack_do
attack_clear
goto a_groundrush


; --- WRAITH RUSH ---

:b_wraithrush
wait_build 1 starport
train 6 wraith
attack_add 6 wraith
attack_prepare
attack_do
attack_clear
goto a_wraithrush


; --- BATTLECRUISER/WRAITH RUSH ---

:b_cruiserrush
wait_build 1 starport
wait_build 1 control_tower
wait_build 1 science_facility
wait_build 1 physics_lab
train 4 wraith
train 2 battlecruiser
attack_add 4 wraith
attack_add 2 battlecruiser
attack_prepare
attack_do
attack_clear
goto a_cruiserrush


; === MASS CHECKS ===

:m_masscheck

; --- MASS BATTLECRUISER CHECK ---

notowns_jump control_tower b_masswraithcheck
notowns_jump physics_lab b_masswraithcheck
wait 1000
resources_jump 2000 2000 b_cruisermass
:a_cruisermass

; --- MASS WRAITH CHECK ---

:b_masswraithcheck
notowns_jump starport b_masstankcheck
wait 1000
resources_jump 2000 1800 b_wraithmass
:a_wraithmass

; --- MASS VULTURE/TANK/GOLIATH CHECK ---

:b_masstankcheck
notowns_jump machine_shop b_massinfantrycheck
notowns_jump armory b_massinfantrycheck
wait 1000
resources_jump 2000 1500 b_tankmass
:a_tankmass

; --- MASS MEDIC/MARINE/GHOST CHECK ---

:b_massinfantrycheck
notowns_jump academy b_massmedicmarinecheck
notowns_jump barracks b_massmedicmarinecheck
notowns_jump covert_ops b_massmedicmarinecheck
wait 1000
resources_jump 2000 500 b_infantrymass
:a_infantrymass

; --- MASS MEDIC/MARINE CHECK ---

:b_massmedicmarinecheck
notowns_jump academy b_massmarinecheck
notowns_jump barracks b_massmarinecheck
wait 1000
resources_jump 2000 250 b_medicmarinemass
:a_medicmarinemass

; --- MASS MARINE CHECK ---

:b_massmarinecheck
notowns_jump academy nomasscheck
notowns_jump barracks nomasscheck
wait 1000
resources_jump 2000 0 b_marinemass
:a_marinemass

:nomasscheck
stop


; === MASS ATTACK SCRIPTS ===

; --- MARINE MASS ---


:b_marinemass
wait_build 1 barracks
train 50 marine
goto a_marinemass


; --- MEDIC/MARIN MASS ---

:b_medicmarinemass
wait_build 1 barracks
wait_build 1 armory
train 40 marine
train 10 medic
goto a_medicmarinemass


; --- MEDIC/MARINE/GHOST MASS ---

:b_infantrymass
wait_build 1 barracks
wait_build 1 academy
wait_build 1 covert_ops
train 30 marine
train 10 medic
train 10 ghost
train 1 science_vessel
train 1 nuclear_missile
goto a_infantrymass


; --- VULTURE/TANK/GOLIATH MASS ---

:b_tankmass
wait_build 1 machine_shop
wait_build 1 armory
train 12 siege_tank
train 20 vulture
train 15 goliath
train 1 science_vessel
goto a_tankmass


; --- WRAITH MASS ---

:b_wraithmass
wait_build 1 starport
train 30 wraith
train 2 science_vessel
goto a_wraithmass


; --- BATTLECRUISER MASS ---


:b_cruisermass
wait_build 1 control_tower
wait_build 1 physics_lab
train 15 battlecruiser
train 2 science_vessel
goto a_cruisermass


; === RESEARCH MULTI-RUN ===

; --- ACADEMY UPGRADES ---

:r_academy
wait_build 1 academy
tech stim_packs 70
wait 3600
upgrade 1 marine_range 70
wait 3600
tech optical_flare 70
wait 3600
upgrade 1 medic_mana 70
wait 3600
tech restoration 70
stop


; --- ENGINEERING BAY UPGRADES ---

:r_engineering_bay
wait_build 1 engineering_bay
upgrade 1 t_infantry_weapon 70
wait 3600
upgrade 1 t_infantry_armor 70
wait 3600
wait_build 1 science_facility
upgrade 2 t_infantry_weapon 70
wait 3600
upgrade 2 t_infantry_armor 70
wait 3600
upgrade 3 t_infantry_weapon 70
wait 3600
upgrade 3 t_infantry_armor 70
stop


; --- MACHINE SHOP UPGRADES ---

:r_machine_shop
wait_build 1 machine_shop
tech spider_mines 70
wait 3600
tech siege_mode 70
wait 3600
upgrade 1 vulture_speed 70
wait 3600
wait_build 1 armory
upgrade 1 goliath_range 70
stop


; --- CONTROL TOWER UPGRADES ---

:r_control_tower
wait_build 1 control_tower
tech cloaking_field 70
wait 3600
upgrade 1 wraith_mana 70
stop


; --- ARMORY UPGRADES ---

:r_armory
wait_build 2 armory
upgrade 1 t_vehicle_weapon 70
upgrade 1 t_ship_weapon 70
wait 3600
wait_build 1 science_facility
upgrade 2 t_vehicle_weapon 70
upgrade 2 t_ship_weapon 70
wait 3600
upgrade 3 t_vehicle_weapon 70
upgrade 3 t_ship_weapon 70
stop


; --- COVERT OPS UPGRADES ---

:r_covert_ops
wait_build 1 covert_ops
tech personnel_cloaking 70
wait 3600
upgrade 1 ghost_mana 70
wait 3600
tech lockdown 70
wait 3600
upgrade 1 ghost_sight 70
stop


; --- PHYSICS LAB UPGRADES ---

:r_physics_lab
wait_build 1 physics_lab
tech yamato_gun 70
wait 3600
upgrade 1 battlecruiser_mana 70
stop

; --- SCIENCE FACILITY UPGRADES ---

:r_science_facility
wait_build 1 science_facility
wait_build 1 physics_lab
wait_build 1 covert_ops
tech irradiate 70
wait 3600
tech emp_shockwave 70
wait 3600
upgrade 1 science_vessel_mana 70
wait 3600
tech defensive_matrix 70
stop[/spoiler]

Return to “StarCraft Modding”

Who is online

Users browsing this forum: No registered users and 1 guest