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
[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 Kryose » 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.
Kryose
Posts: 49
Joined: Fri Apr 25, 2008 4:26 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 Kryose » Fri May 30, 2008 3:49 pm

That would explain alot, I will give it a shot. Though something that I noticed from Ahzz's AI is that it goes through only attack_add commands to train units before sending them out. What he described was that it will attempt to train all the units in the attack add commands, but if it gets hung up on one or the other, it will just attack with a smaller than expected force. I will try that tonight (hopefully) as it would shorten my code considerably. If that doesn't do what I want it to do, I will try the wait_train or wait xx approach. Hell, I didn't even know that there was a wait_train command. Goes to show I am still a noob at this.
Kryose
Posts: 49
Joined: Fri Apr 25, 2008 4:26 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 Kryose » Mon Jun 09, 2008 1:26 pm

Something really weird and disappointing is happening with my non cheating terran AI. Whenever I play a game with the AI and there is more than one terran computer in the game, only one of the terrans does anything past a certain point. I have tested and tested the AI in replays but I cannot seem to duplicate the problem if there is only one terran on the map at the same time.

This doesn't make any sense to me at all. The one Terran does fine, but any additional Terran seems to get hung up on the random_jumps at the beginning where it decides which build sequence it will go through.

Has anyone had this problem before? I cannot for the life of me figure out what is going on! Any help would be great.

My AI script and executable is posted .

Kryose
User avatar
ashara
Posts: 170
Joined: Wed Feb 06, 2008 11:12 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 ashara » Mon Jun 09, 2008 4:27 pm

The problem may be that a multirun command is ignored. It can happen if there are already too many threads. But I never encountered it without doing it purposefully.
Kryose
Posts: 49
Joined: Fri Apr 25, 2008 4:26 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 Kryose » Mon Jun 09, 2008 4:35 pm

I wonder if it is something similar to how sometimes the standard BW AI has a dud computer opponent. Do you know what I am talking about? Where the ai only builds a refinery, then it just collects for the entire game until it is killed? Is there any explanation as to why that happens? It could be what my ai is going through.
User avatar
ashara
Posts: 170
Joined: Wed Feb 06, 2008 11:12 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 ashara » Mon Jun 09, 2008 4:45 pm

I never saw that one, for me it was the Zerg building 13 drone then only mining. I don't know why it happens though.
Kryose
Posts: 49
Joined: Fri Apr 25, 2008 4:26 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 Kryose » Mon Jun 09, 2008 4:53 pm

Yeah, sorry, thats what I was talking about. I knew that it didn't do anything, I just didn't know what it did before it didn't do anything.
IskatuMesk
Posts: 329
Joined: Wed May 16, 2007 5:57 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 IskatuMesk » Thu Jun 12, 2008 9:14 pm

It's random and doesn't seem to be avoidable. Some map locations can contribute it to it as well (6 and 10 on BGH are really nasty spots for zerg it seems).
Symmetry
Posts: 78
Joined: Mon May 07, 2007 10:57 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 Symmetry » Fri Jun 13, 2008 10:02 pm

[quote name='bajadulce' post='4105' date='May 19 2008, 02:27 AM'][quote name='Killer_Kow' post='4093' date='May 18 2008, 01:27 PM']:lol:

Edit: Gah, the animated version is so much cooler. Ah, here we are: [/quote]I don't see any difference? :lol:
[/quote]

:roll:

[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 2 guests