Shared Debugging

Help - Resources - AI Scripting - Grafting - Plugins - Modding Projects
User avatar
Xerxes
Posts: 43
Joined: Wed Dec 24, 2008 9:38 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

Shared Debugging

Postby Xerxes » Fri Dec 26, 2008 9:35 pm

Click on the box below for the story behind this thread and its purpose, if you're curious.
[spoiler]About a week ago I started working on what I originally intended to be a minor enhancement to Entropy II for my Starcraft pals and I to play with. Simply put I wanted to integrate Blizzard's default AIs to expand the variety a bit more, and tell Entropy II's random selection scripts to select appropriate AI scripts for island maps (such as Blizzard's, or from the new scripts in Entropy II that use transports or air units), so that we could play any map without having to restart Brood War.

I am cursed with being a perfectionist, and the more I played with Entropy II and dissected its AI scripts, the more little things I found that bugged me (horrible pun, I know). What began as a minor change has transformed into a large-scale clean-up and debug of every AI script in Entropy II, and maybe even the addition of some of the Pro scripts from this website. I've learned quite a bit, and it has been fun.

While I was working on this though, it occured to me that I could give something back to this community. So I decided, rather than horde my discoveries for a private AI package that might never see life outside my own LAN games, to register here and share things with the other coders.

I do not expect everyone who's already written scripts to come rolling back in here on horse-drawn carriages and spend their free time fixing any issues I've found. If anyone does, that's merely an added bonus. Most of you feel you've done as much as you can and are finished for various reasons, and I understand and respect that.

It is our nature to make mistakes. We learn from these mistakes only by noticing and analyzing them. This thread is intended simply to provide helpful information to anyone still looking to write their own scripts. Because I'm trying to target widespread issues, I feel it's better to highlight them all in one place rather than go around posting about the exact same issues in 5 different AI threads, so my apology in advance if you are the creator of one of these scripts and feel offended that I made a thread about it instead of posting about the issue in your thread. I'll gladly remove your AI from these lists if you have any issue with it, so just send me a PM.

May the sun always shine on your AI's back!
[/spoiler]
This is a list of issues I've found that exist in at least two or more of the AI scripts on this website. I do my best to be thorough and accurate, but I may miss an AI or two that is also afflicted.

Here's the list of AIs I am currently working with; you won't see any others anywhere in this list simply because I don't intend to crack them open with a text editor (at least not yet). For the moment, they are all non-cheating AIs that came with Entropy II and pro AIs downloaded from this website. I might add some of the other ones being actively developed here. I haven't looked at the Pro AIs much yet.

Non-Cheating:
Ashara v1.1
Avance CounterZerg v1.3
Easy_Chat v1.1 Terran
Peppe v4b Protoss
Racine v1.0
Raynor 2.1
Zelduck v3.13

Pro
Adun's Fury II v1.1
Ahzz v1.12.5
BSW_Rama 1.0
Racine 3.0


==========================
Issue: Crash To Desktop (CTD)
Rating: Critical
[spoiler]Description: There's multiple causes for this, and you can learn more about them . There are a couple scripts that can cause crashes I've been trying to isolate using the . Here's what I have so far. (I am running Starcraft v1.15.3)

Known scripts with this issue:
Peppe v4b Protoss - Though these times seem to point to crashes between 27-28, I've seen them in games as early as 22 minutes and as late as 94, so the time elapsed may not be a reliable means of determining about where the issue is in the script. Occurs in all race matchups. Verification:
#11 PvZ LTg(3-9).rep ?? Crash at 28:26
#04 PvT HuntersG(11-5).rep ?? Crash at 27:26
#09 PvT Shine (10-2).rep ?? Crash at 27:34

Easy_Chat v1.1 Terran - This doesn't cause CTDs so much as completely freeze Starcraft. Verification:
#06 PvT FR.rep ?? Freeze at 29:40
#23 TvZ HuntersG(11-5).rep ?? Freeze at 32:17
#26 TvZ Katrina.rep ?? Freeze at 41:25

Ahzz v1.12.5 - I had a CTD running a 3 race FFA with this AI about 15+ minutes into the game, but haven't had time to isolate which race caused it specifically yet. I'll try to figure this out using the replays soon.[/spoiler]


==========================
Issue: No Transports
Rating: Moderate

[size=2]I'll be adding a list of scripts that don't appear to have any transport ability here soon. This can easily be added to any race using either check_transports or, in the case of the Zerg, the Ventral Sacs upgrade, which enables the AI to automatically use all Overlords as transports. No transports leaves an AI unable to use expansions with no ground access, and in the case of scripts that never use offensive air units, unable to launch any form of attack against enemy expansions in such locations.



==========================
Issue: Zerg and Detection
Rating: Moderate
[spoiler]Description: The Pneumatized Carapace upgrade is the speed upgrade for the Zerg Overlord, researched at a Lair or Hive. A script neglecting this tech leaves Overlords unable to provide detection support in a timely manner to units on the field, and leaves any Overlords that do venture away from the safety of the hive cluster vulnerable targets. It also leaves the Ventral Sacs (transportation) tech fairly worthless as well.

Solution: Because the AI doesn't intuitively use abilities such as Plague and Ensnare to reveal cloaked units in the absence of a detector, Overlords are the only viable mobile detection option a Zerg AI player has. There's no alternative to the Pneumatized Carapace upgrade, so make sure it's included and working in your script so entire scores of Zerg aren't effortlessly butchered time and time again by a pair of Dark Templar or Lurkers.

Known scripts with this issue:
Avance CounterZerg v1.3[/spoiler]
[/size]

I've reported some script-specific bugs to the creators of the scripts instead of posting them here, so this thread is a bit smaller than I'd anticipated. But that means there aren't very many problems with the scripts, which is a good thing. Great work everyone!
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 » Fri Dec 26, 2008 11:44 pm

Hah, if you're bored my entire script is located in the first spoiler tag for the unleaded terran thread. =p

Counterzerg was never finished, that's why it never gets ol speed. It doesn't get a lair. Since there are already unused post-lair parts in the script, a simple goto (the block) would work.

Upgrades may have been given low prority because they interfered with the build too much, or part of the script was made with the replay to ai program, which uses very low numbers for some reason. I've found nothing but pain trying to stick it in the grocery list for the comp to do. The only way I've gotten them to work well is to put as many upgrades as you can in the multithread blocks. Otherwise the comp will cry about not having an academy and do nothing. :/

But if units die or buildings are destroyed, this will still cause problems.

I've found 40-60 to work fine. Less than that, and the ai never gets them, higher than that and the ai will do nothing until it's researched. Though this is good for must have upgrades at times (such as siege_mode)

Peppe's Ai crashing seems kinda odd; I've never seen it happen before. Usually it crashes due to a lack of a wait statement before a loop, or building defensive structures. The AI freaks out a lot trying to build them, especially at expansions.
User avatar
Xerxes
Posts: 43
Joined: Wed Dec 24, 2008 9:38 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 Xerxes » Sat Dec 27, 2008 12:07 am

[quote name='Archon_Wing' post='5575' date='Dec 26 2008, 03:44 PM']Hah, if you're bored my entire script is located in the first spoiler tag for the unleaded terran thread. =p[/quote]
Well, when you put it that way, how can I resist perusing an AI that doesn't require first having to extract two layers of files? =P What can I say, I'm lazy. I'll definitely put that on my to-do list.

[quote name='Archon_Wing' post='5575' date='Dec 26 2008, 03:44 PM']Counterzerg was never finished, that's why it never gets ol speed. It doesn't get a lair. Since there are already unused post-lair parts in the script, a simple goto (the block) would work.[/quote]
I figured as much, and yes I see there were blocks existing that contain some of this. I already made a modified version of it and unlocked the Lair/Hive and Level 2 and 3 upgrades section and added a multirun to CNTZ 0067, which contains Pneumatized Carapace and Ventral Sacs research. That small change should make a huge difference in the script's effectiveness. I'm going to test it out this evening, and if it seems improved I might try PMing avance70 and see if he'd give it a thumbs up for being posted in his thread. It's a nice pressure script and really validated Zerg being called "The Swarm". :D

[quote name='Archon_Wing' post='5575' date='Dec 26 2008, 03:44 PM']Upgrades may have been given low prority because they interfered with the build too much, or part of the script was made with the replay to ai program, which uses very low numbers for some reason. I've found nothing but pain trying to stick it in the grocery list for the comp to do. The only way I've gotten them to work well is to put as many upgrades as you can in the multithread blocks. Otherwise the comp will cry about not having an academy and do nothing. :/

But if units die or buildings or destroyed, this will still cause problems.

I've found 40-60 to work fine. Less than that, and the ai never gets them, higher than that and the ai will do nothing until it's researched. Though this is good for must have upgrades at times (such as siege_mode)[/quote]
I noticed a lot of the scripts don't seem to have checks in place for lost buildings and are pretty much toast if you take out a key structure. I remember a game months ago against a Protoss Racine 3.0 (pro difficulty) AI where I was pushed to extinction on Lost Temple before managing to destroy his Cybernetics Core to give my combined airforce a brief respite and what I hoped would be a fighting chance. I don't think he tried to replace it and his flourishing bases all over the map fell with little resistance other than Photons. It would have been really nice if Blizzard had simply programmed the AI to automatically build missing prerequisites for something it's instructed to do, huh? Ah well. Hindsight is 20/20. I'll add your recommendation to the priority section. It's not a big deal for some upgrades, but again something like High Templar running around without any spells is a huge waste of resources on the AI's part that could have been spent on other units that actually fight.

[quote name='Archon_Wing' post='5575' date='Dec 26 2008, 03:44 PM']Peppe's Ai crashing seems kinda odd; I've never seen it happen before. Usually it crashes due to a lack of a wait statement before a loop, or building defensive structures. The AI freaks out a lot trying to build them, especially at expansions.[/quote]
I originally suspected the crashing might have been because of the seemingly incorrect usage of defensebuild and defenseuse commands on units that have no weapons such as High Templar, but I already made a modified version fixing all instances of that and it still caused crashes. I haven't looked at it too closely again since, but the only thing I can think of is the script looks pretty heavy on the multiruns. There could be an errant multirun somewhere in the tangled web of repeating blocks that starts multiple versions of the main thread, and eventually as whatever conditions are met to trigger this repeatedly there are so many copies of it running that it bombs the game.
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 » Sat Dec 27, 2008 12:27 am

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 » Sat Dec 27, 2008 12:28 am

User avatar
Xerxes
Posts: 43
Joined: Wed Dec 24, 2008 9:38 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 Xerxes » Sat Dec 27, 2008 1:37 am

I was wondering about that (priority relativity I mean). Thanks Mesk.

I just finished three several-hour matches with Ashara's Terran AI in it, and none of them crashed so I'm pretty sure that's not the culprit causing the crash in Terran Entropy II matches. I'll be starting some more in a bit with another AI and hopefully report back on that + modified CounterZerg + Unleaded Terran. Lots to do!

Edit: I thought I'd note on the priority issue that it doesn't seem to *always* hinder upgrades. A match I just played with scripts using priorities of 1 had mixed results. One of the two Zerg Racine v1.0 players maxed out at 3 upgrades in an hour and had all the Overlord techs, while the other didn't have any of those. One Protoss player had full tech at 3/3/3, and another running the same script that had just as many units, buildings and expansions was running around with 0/0/1 in the same game. Getting the AI to tech this way seems screwy and unreliable; works fine one round, doesn't work the next. I'm not seeing any pattern to pick out as far as conditions that might contribute to this.

Edit #2: I'm getting a little cluttered here juggling so many different goals at one time. Going to refocus and create new threads as appropriate for different things I'm doing. AI experimentation is off-topic in this one. I'll post the CounterZerg experiment results in a different thread.
User avatar
Xerxes
Posts: 43
Joined: Wed Dec 24, 2008 9:38 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 Xerxes » Tue Dec 30, 2008 1:31 am

I've been experimenting with priority changes, and by replacing 1/2 priorities with 40/70, I got Ashara's 1.1 PvZ using High Templar and Dark Archon spells on its first attack with them appropriately, instead of dashing around 3 waves later without spells still. I need to test it a few more matches and pit it in a match against the original version before I'm satisfied, but if it did the job without causing any apparent issues I'll try it on the other scripts and report results. Although... it might be a little trickier with some of the others, since they used priorities 5 and 10 in there and not just 1 and 2. I'll figure something out.
User avatar
Xerxes
Posts: 43
Joined: Wed Dec 24, 2008 9:38 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 Xerxes » Wed Dec 31, 2008 8:08 pm

Thanks, bajadulce.

Just to be clear, I'm not trying to force an update to the current version of Entropy II. My own project is a modification of Entropy II for my group's LAN games aimed at an expanded variety of AI scripts. For actually updating Entropy II officially here on the website, I'm just providing information that will hopefully benefit some of the scripts when that time comes. It will ultimately be the creator's choice to consider and implement suggestions or not.

Once I've examined my findings closely enough and feel comfortable that they are accurate, I will report them in the appropriate thread for each AI script. Here I'm documenting some things I'm investigating so far, so that others can provide input or even examine themselves.

So more or less your suggestion is already the purpose of this thread. The "overhaul" is for the mod I want to use in my LAN games, not a public replacement/update of Entropy II. My apologies for the confusion.

[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