Page 1 of 1

A very strange Protoss AI bug?

Posted: Wed Jan 13, 2010 10:32 am
by Eredalis
Guys, have you ever heard of that?

I've created a custom Protoss AI for a Zerg campaign level.
But after this AI start, something strange happens: All probes of the Protoss computer player begin to build pylons in the outside area of his main base. Paradoxically the computer player has already enough pylons in his base, and definitely not too much units, which was mostly the major problem of such things.

To view the custom AI: (updated)
Spoiler
; ASC3 File generated by ScAIEdit III
;
; Script name : Brood Wars Terran 3 - Town A

script_name Brood Wars Terran 3 - Town A
script_id TB3A

start_campaign
wait 1

start_town
defaultbuild_off
default_min 0
wait 1

build 1 nexus 80
build 4 probes 80
build 1 gateway 80
build 1 forge 80
build 1 cybernetics_core 80
build 1 citadel_of_adun 80
build 1 templar_archives 80
build 1 robotics_facility 80
build 1 robotics_support_bay 80
build 1 observatory 80
build 1 stargate 80
build 1 fleet_beacon 80
max_force 1200
define_max 10 probe
define_max 12 zealot
define_max 20 dragoon
define_max 8 high_templar
define_max 6 archon
define_max 255 reaver
define_max 4 shuttle
define_max 5 observer
define_max 8 scout
define_max 2 carrier
define_max 255 arbiter
defensebuild_gg 1 zealot
defenseuse_gg 1 zealot
defensebuild_gg 1 dragoon
defenseuse_gg 1 dragoon
defensebuild_gg 1 archon
defensebuild_ag 1 dragoon
defenseuse_ag 1 dragoon
defensebuild_ag 1 archon
defensebuild_ga 1 scout
defenseuse_ga 1 scout
defensebuild_ga 1 carrier
defenseuse_ga 1 carrier
defensebuild_aa 1 scout
defenseuse_aa 1 scout
defensebuild_aa 1 carrier
defenseuse_aa 1 carrier
wait 1000

attack_add 2 dragoon
attack_add 3 zealot
attack_prepare
wait 500

attack_do
attack_clear
wait 900

attack_add 3 dragoon
attack_prepare
wait 500

attack_do
attack_clear
upgrade 1 p_ground_weapon 30
upgrade 1 p_air_weapon 30
upgrade 1 p_plasma_shield 30
upgrade 1 p_armor 30
upgrade 1 p_plating 30
upgrade 1 dragoon_range 30
wait 900

attack_add 3 zealot
attack_add 2 scout
attack_prepare
wait 500

attack_do
attack_clear
upgrade 1 templar_mana 30
upgrade 2 p_ground_weapon 30
upgrade 2 p_air_weapon 30
upgrade 2 p_armor 30
upgrade 2 p_plating 30
upgrade 1 shuttle_speed 30
upgrade 1 scout_sight 30
upgrade 1 observer_speed 30
wait 900

attack_add 3 zealot
attack_add 2 dragoon
attack_prepare
wait 500

attack_do
attack_clear
upgrade 1 zealot_speed 30
upgrade 1 scout_speed 30
upgrade 1 observer_sight 30
upgrade 2 p_plasma_shield 30
wait 900

attack_add 5 zealot
attack_add 2 dragoon
attack_prepare
wait 500

attack_do
attack_clear
upgrade 1 carrier_capacity 30

:block1
wait 1500

attack_add 5 scout
attack_prepare
wait 500

attack_do
attack_clear
wait 900

attack_add 4 zealot
attack_add 2 dragoon
attack_prepare
wait 500

attack_do
attack_clear
wait 1150

attack_add 2 archon
attack_add 4 dragoon
attack_prepare
wait 500

attack_do
attack_clear
wait 1150

attack_add 1 carrier
attack_add 4 scout
attack_prepare
wait 500

attack_do
attack_clear
wait 1150

attack_add 1 archon
attack_add 5 zealot
attack_prepare
wait 500

attack_do
attack_clear
wait 1150

attack_add 3 scout
attack_add 5 dragoon
attack_prepare
wait 500

attack_do
attack_clear
goto block1
This was not my first Protoss AI. That's never happened to me before.
Is this a bug or something?

Re: A very strange Protoss AI bug?

Posted: Fri Jan 15, 2010 9:16 pm
by bajadulce
Could be a location/trigger placement error?  The script looks fine at a quick glance.  About the only thing that jumps out are the 16 cannons.  If there wasn't ample room for them or they didn't pre-exist, then the cpu might go on a cannon binge and build more pylons at the perimeters.

You should upload the map or a test map that demonstrates what's happening.  I made a post in our shoutbox at BroodwarAI.com.  Maybe somebody will respond from our forum.

Re: A very strange Protoss AI bug?

Posted: Sat Jan 16, 2010 5:15 am
by Eredalis
Thank you for your reply, baja.
Unfortunately, I cannot upload pictures of the map here, because these levels are not yet for public.
I've tried it with the 16 photon cannons and without it, I've tried even another Protoss AI from the Protoss campaign, the result is always the same. My question was, whether such a bug is known.

And no, it's not a radius problem of the pylon energy or something. I've checked this out via the unit placement of SCM Draft. The computer disposes from the beginning over twenty pylons. And he begin to build as he would dispose of no pylons.

He build not three or five, he build over twenty-five pylons. The entrance to his own base is in the end full of pylons. Like I said, I have never seen something like this before...

Re: A very strange Protoss AI bug?

Posted: Sat Jan 16, 2010 8:40 am
by bajadulce
Eredalis wrote:I've tried even another Protoss AI from the Protoss campaign, the result is always the same. My question was, whether such a bug is known.
Nothing that I've experienced in our "melee" AI's.  The fact that this is happening with other AI scripts seems to suggest an error with the trigs/locations?  Seems odd that this same thing would happen with another script?
He build not three or five, he build over twenty-five pylons. The entrance to his own base is in the end full of pylons.
Nice!  This bug could be quite useful to take advantage of or to be used by our AIwar scripts such as Mesk's Protoss Xtreme.  
Unfortunately, I cannot upload pictures of the map here, because these levels are not yet for public.
What about recreating this in a basic test map?  A plain simple map devoid of your terrain, trigs, etc won't "give away" your map.   I'd build a test map myself, as I enjoy helping ppl, but I'm a bit strapped for time/energy to expend such effort.  Nonetheless,  i'll probably do it anyways cause I'm a sucker for this sort of thing.  Expect a reply with something concrete to test here shortly.

EDIT: And that didn't take too much of my Saturday morning :)
Eredalis AI Bug.zip
Here is a package that contains a quick sample map + an .exe + your script converted to PyAI.  I'm not seeing this bug you are describing tho I didn't watch for too long.  The AI builds the missing Fleetbeacon + some assimilators and then goes on about its merry way.  Hopefully you can modify this map to recreate your issues and reupload.  If you do find the error, please report back regardless as I am very curious to what causes the glitch.  Gluck with your custom AI/Map.  Hope this proves useful.

Edit2: Bah!  I should have added a debug message to that ai script to demonstrate how poiuy's PyAI > SCAIEdit as well as confirm that this script was actually running in the map.. tho it clearly is.  If you'd like to add this to your script for testing purposes add these lines:
Spoiler
    start_town()
    defaultbuild_off()
    default_min(0)
    wait(1)

debug(null, Eredalis AI test)
--null--


    build(1, nexus, 80)
    build(4, probe, 80)
    build(1, gateway, 80)

Re: A very strange Protoss AI bug?

Posted: Sat Jan 16, 2010 1:48 pm
by Eredalis
bajadulce...

Again, thank you very much for your help and support.
Unfortunately, I cannot use the link you have posted. The link lead to a private message window of the bwai-board. Text informs me, that I haven't the permission to use their service. (Of course, I am not a member of bwai) Therefore I can't use the debug line in the script. (Or should I use *my* script?)

So, after you decided to dive deep in the whole problem, I've resized the scenario to 64x64 (the problem zone is in the corner upper left) and create a new mpq with the AI script inside. Test this thing out and... nothing! Nothing happens. The computer build, techs and create units. No need of building pylons. How should I show this now, when the described problem doesn't exist anymore?

Ironically I forgot to mention, that this scenario and AI works fine last year we've created them. In the last few days I've played the scenario again (with added audio material) and I bumped into the problem.

I've decided to post some commented screenshots.
Spoiler
As every campaign level the scenario start with a couple of units, buildings and... pylons!
[imgwh 640x480]http://img51.imageshack.us/img51/5304/34868992.gif[/imgwh]

But a few seconds later and a few bars to the left, the first pylon will warped in.
(NOTE: The computer player has at this time over twenty pylons)

[imgwh 640x480]http://img190.imageshack.us/img190/7790/22777542.gif[/imgwh]

As you see, the photon cannons in the cycle are the same in the picture before. A few spacebar movements to the upper left and the next pylon is on the way. This is, by the way, the only way out of this base.
[imgwh 640x480]http://img17.imageshack.us/img17/4486/78869887.gif[/imgwh]

The second pylon has arrived and (wohoo) the warp gaps for next two pylons too.
[imgwh 640x480]http://img190.imageshack.us/img190/8463/33548161.gif[/imgwh]

The computer sends every probe he got to the already existing pylon warp gap. Why? Don't ask me!
[imgwh 640x480]http://img191.imageshack.us/img191/8873/12612147.gif[/imgwh]

And the next two pylons... This area here is in the next 20 minutes over and over full of pylons.
[imgwh 640x480]http://img62.imageshack.us/img62/4145/58347090.gif[/imgwh]

Re: A very strange Protoss AI bug?

Posted: Sat Jan 16, 2010 2:33 pm
by bajadulce
sorry about that link.  I put the zip in a thread in a private forum without thinking.  the link/attachment should work now.

Tho sounds like you might  have solved your problem by building a new map?  Something sounds fishy with your original map if you ask me.  better check the two and see if you can spot any differences with locations maybe? 

K, nice screenshots.  I now understand why you didn't want to upload your map.  Looks like nice terrain and prob is a fun campaign.

Re: A very strange Protoss AI bug?

Posted: Sat Jan 16, 2010 4:10 pm
by Eredalis
My fault, I don't have made myself clear enough.
I mean, I've used SCM Draft and resize the existing scenario (128x128) to a 64x64, only for presentation. I was going to send this to you, bundled with the AI script. But in this new 64x64 level, the problem doesn't exist anymore. So maybe you're right, I should try to make the original map convert into a new scenario file.

As far as the location goes, it is only one location inside of the protoss base, it is the around the nexus called Protoss AI.

I'm so grateful to you, baja, for your hints, informations and efforts.
Thank you. 3+ pie to you.

Re: A very strange Protoss AI bug?

Posted: Mon Jan 18, 2010 3:35 pm
by Eredalis
bajadulce, I've tried it out with your fixed AI and you won't believe it...
It is the same sh... in green. In other words, yes, the computer builds pylons as he got money for it. :D

Nah. It doesn't matter anymore, because I have solved this problem in another way. ;)

Re: A very strange Protoss AI bug?

Posted: Wed Jan 20, 2010 3:35 pm
by Pr0nogo
What the heck is a 'Treffer' or 'Sonde?' O.O

Re: A very strange Protoss AI bug?

Posted: Wed Jan 20, 2010 3:52 pm
by Eredalis
That is german, Pr0nogo.
Sonde --> probe
Treffer --> hits
Now you stop spamming in my thread. Thank you. ;)

Re: A very strange Protoss AI bug?

Posted: Wed Jan 20, 2010 4:08 pm
by Pr0nogo
Oh, I thought it was Spanish or something.

Thanks for clearing that up.

Didn't you already resolve this issue?

Re: A very strange Protoss AI bug?

Posted: Wed Jan 20, 2010 4:50 pm
by Eredalis
No, not really. I have simply locked the option "pylon build" in the editor itself. This entails, that the computer player can't build pylons in the scenario anymore. He attacks now with all the units he disposes from the beginning, exactly like it's written in the AI script. But as soon as all these units are destroyed (so after 20 minutes), he don't build new units. It is as whether the computer player don't possesses pylons, but like I mentioned before, he dispose over 20 pylons.

This is without a doubt the strangest bug I have ever seen in a map. Maybe it pertains to the great plan of the Xel'Naga, maybe Duran is the cause for that fishy problem. As far as I see, I'll have no choice except to create a new map...

Re: A very strange Protoss AI bug?

Posted: Wed Jan 20, 2010 5:07 pm
by bajadulce
S;rechen Sie Deutsch?  :)  I could use some help translating a few strings if you find yourself bored and can spare a half hour or so! :)
Eredalis wrote: bajadulce, I've tried it out with your fixed AI and you won't believe it...
It is the same sh... in green. In other words, yes, the computer builds pylons as he got money for it. :D
This happens in the map I supplied with the package?  Or in your map?  Cause I didn't do anything to your AI other than compile it.  And I didn't see that happening in the test map in that package.  Or did I not watch long enough?

Re: A very strange Protoss AI bug?

Posted: Thu Jan 21, 2010 7:29 am
by Eredalis
Sprechen Sie Deutsch? I could use some help translating a few strings if you find yourself bored and can spare a half hour or so!
Very nice! Send the stuff that you want to have translated. I'm sure, I can help you. :)

That problem happens in my map, not in yours. It is the same problem, wherefore I've open this topic. ;)
Like I have written above, this problem doesn't exist in your map. But I don't know why... Really!