Posted: Thu May 29, 2008 3:50 pm
I did several tests last night regarding the kill_thread and attack_add commands. This is what I found.
The first thing I wanted to test was if the attack_add command created any problems when adding more marines to the attack then their were available. I don't have the sample code, but I basically set the AI up to build a barracks, train 5 marine, attack_add 10 and go through with the attack.
The interesting thing with this test was that it did actually initiate an attack when there were only 5 marine, but then it started building more marines and sending them straight to the attack for a total of 10 marines... And then it continued to build marines, but they just chilled at the main base. I decided to test something different, so I removed the train 5 marine from the code and tried again. As I suspected, the AI started training marines and just when they got out of the barracks, they were sent to attack. Unfortunately, this is not helpful to me.
My next test was to try the kill_thread command when training 15 marines. I built a barracks and went into a killable multirun to train the marines. While the multirun was going, I setup a wait command for 300 followed by the kill_thread command (since marines take 60 to build, it should pop out no more than 5 marines). After the kill_thread, I had the AI build a couple of buildings to tell me when it got past the kill_thread.
From my tests, the kill_thread command either does not kill a command when it is in the middle of processing, or the kill_thread command didn't work at all. So I did another test to check. I basically had the same setup, but I separated the train 15 marine into train 2 marine, train 4 marine,...train 16 marine. If the kill_thread command works, it would pop out a multiple of 2 marines and with the wait 300, it should only pop out 6 marines at the most.
The kill_thread did not work. It finished training all 16 marines.
The code I had was basically...
CODE
script_name Terran Expansion Custom Level
script_id TMCx
; === STARTUP COMMANDS ===
start_town
transports_off
farms_notiming
; === START ===
build 1 command_center 150
wait_build 1 command_center
build 4 scv 130
wait_build 4 scv
build 5 scv 80
wait_buildstart 5 scv
build 1 barracks 80
wait_build 1 barracks
multirun train_marine
wait 300
kill_thread
:end_loop
build 3 engineering_bay 80
wait_build 3 engineering_bay
build 3 missile_turret 80
wait_build 3 missile_turret
wait 5000
goto end_loop
:train_marine
killable
train 2 marine
train 4 marine
train 6 marine
train 8 marine
train 10 marine
train 12 marine
train 14 marine
train 16 marine
stop
Is there anything that I am doing wrong with the kill_thread and killable commands?
Thanks,
Kryose
EDIT:
I was wrong... I don't know where I got the idea that the build time for a marine was 60, but it is actually only 24... I will have to test again to see if the kill_thread actually did work.
The first thing I wanted to test was if the attack_add command created any problems when adding more marines to the attack then their were available. I don't have the sample code, but I basically set the AI up to build a barracks, train 5 marine, attack_add 10 and go through with the attack.
The interesting thing with this test was that it did actually initiate an attack when there were only 5 marine, but then it started building more marines and sending them straight to the attack for a total of 10 marines... And then it continued to build marines, but they just chilled at the main base. I decided to test something different, so I removed the train 5 marine from the code and tried again. As I suspected, the AI started training marines and just when they got out of the barracks, they were sent to attack. Unfortunately, this is not helpful to me.
My next test was to try the kill_thread command when training 15 marines. I built a barracks and went into a killable multirun to train the marines. While the multirun was going, I setup a wait command for 300 followed by the kill_thread command (since marines take 60 to build, it should pop out no more than 5 marines). After the kill_thread, I had the AI build a couple of buildings to tell me when it got past the kill_thread.
From my tests, the kill_thread command either does not kill a command when it is in the middle of processing, or the kill_thread command didn't work at all. So I did another test to check. I basically had the same setup, but I separated the train 15 marine into train 2 marine, train 4 marine,...train 16 marine. If the kill_thread command works, it would pop out a multiple of 2 marines and with the wait 300, it should only pop out 6 marines at the most.
The kill_thread did not work. It finished training all 16 marines.
The code I had was basically...
CODE
script_name Terran Expansion Custom Level
script_id TMCx
; === STARTUP COMMANDS ===
start_town
transports_off
farms_notiming
; === START ===
build 1 command_center 150
wait_build 1 command_center
build 4 scv 130
wait_build 4 scv
build 5 scv 80
wait_buildstart 5 scv
build 1 barracks 80
wait_build 1 barracks
multirun train_marine
wait 300
kill_thread
:end_loop
build 3 engineering_bay 80
wait_build 3 engineering_bay
build 3 missile_turret 80
wait_build 3 missile_turret
wait 5000
goto end_loop
:train_marine
killable
train 2 marine
train 4 marine
train 6 marine
train 8 marine
train 10 marine
train 12 marine
train 14 marine
train 16 marine
stop
Is there anything that I am doing wrong with the kill_thread and killable commands?
Thanks,
Kryose
EDIT:
I was wrong... I don't know where I got the idea that the build time for a marine was 60, but it is actually only 24... I will have to test again to see if the kill_thread actually did work.