Entropy III v1.0 RC4 (Updated 2/19/10)

Help - Resources - AI Scripting - Grafting - Plugins - Modding Projects
User avatar
JH24
Posts: 323
Joined: Sat Mar 14, 2009 6:25 pm

Postby JH24 » Tue May 19, 2009 7:33 pm

@ Bajalduce.


Thank you for your kind words. :)


=====================


I'm really sorry about the crash in Rocky AI, Archon_Wing. :( I had no idea that player_need would do that. There's still a lot I don't know or understand about AI scripting.



Is it alright if I continue working on my AI and upload a new script in the future? I realize I said I would stop working, but I got an idea yesterday to change something to make my scripts simpler and more adaptive and I want to try it out. I'm also still considering to add Island support one day. If/When I have a new version, could you please upload that to Entropy+ too? I'll use the Rocky scripts from the most recent/modified Entropy+ version.


Thanks again for everything and my apologies for the crash and giving you extra work. Thanks for fixing the script in your new version, Archon_Wing! :)
User avatar
Archon_Wing
Posts: 903
Joined: Wed Jul 25, 2007 11:22 pm

Postby Archon_Wing » Tue May 19, 2009 10:39 pm

*it referring to a loop without a wait statement. So does the following block you've posted not get reported as a loop without a wait statement with PyAI? If so then you should report this to pq and the PyAI thread.


edit: NVM, apparently the wait can be anywhere in the block, which makes utterly no sense to me, but what else about AI scripts make sense?

Maybe even go AsharaP/Zons/Zbath on those guys.. that'll teach em!


Rofl that'd be funny. ;)

JH24:

Sure go ahead, though note I had to convert it to pyai form, so I recomend you use that as the labels are not saved if you try opening aiscript.bin from the entropy plus file. I'll upload your scripts in pyai form if you want to use them.

About pyai...
[spoiler]Note: for it to read the names correctly, you should put pyms http://www.broodwarai.com/index.php?page=pyms in the program files folder

If you open up the text files, you'll see this at the top
extdef C:/Program Files/PyMSwinEXE/unitdef.txt

The unitdef.txt is included in the folder so you don't have to worry about that. But change the path in bold if you decide to put pyms elsewhere.

To actually use PYAI, open pyai.exe, then click file---> new to start a new aiscript.bin. Then click edit---> import scripts, and import those text files.

If you have any questions you can post back or consult the pyai forum here.[/spoiler]
User avatar
Archon_Wing
Posts: 903
Joined: Wed Jul 25, 2007 11:22 pm

Postby Archon_Wing » Wed May 20, 2009 10:56 pm

Update:

My note about the wait statements was incorrect. You can have a wait statement anywhere in the loop, which didn't seem to make any sense to me. If that's true I can remove many wait statements from mine. Also Racine's script would be clean, and the crashes it caused in BWwaiAi III will remain unsolved. :( So if Racine's script is clear, might as well look at Peppe's script again.

Anyhow, I suddenly realized there was an asc3 of the original peppe script lying around, and it was much easier. Here's what I found and I'd like people's opinions:

(If these aren't the cause, then it's too bad. I'm only responsible for debugging my own script. :lol:)

Probable
The script has a lot of the capt_expand commands. In fact there's an entire loop of it. The command is listed as unknown and Blizzard only uses it once per script. It seems to cause the AI to expand at will, as my Protoss AI only has one expand command but it keeps expanding despite the fact that I have no expo loop.

My solution: Keep the capt_expand commands, but remove the loop

- Massive player_need multirun in expo commands

[spoiler]:player_needs
player_need 1 nexus
player_need 1 pylon
player_need 1 gateway
player_need 1 cybernetics_core
player_need 1 forge
wait_train 1 shuttle
goto player_needs_2

:player_needs_2
player_need 1 nexus
player_need 1 pylon
player_need 1 gateway
player_need 1 citadel_of_adun
player_need 1 cybernetics_core
player_need 1 forge
player_need 1 templar_archives
wait_train 1 corsair
goto player_needs_3

:player_needs_3
player_need 2 nexus
player_need 2 pylon
player_need 2 gateway
player_need 1 citadel_of_adun
player_need 1 cybernetics_core
player_need 1 forge
player_need 1 templar_archives
player_need 1 robotics_facility
player_need 1 stargate
wait_build 1 fleet_beacon
player_need 1 fleet_beacon
wait_train 1 observer
player_need 1 observatory
stop[/spoiler]

I am not sure what the effect of repeating the same player_need command in a single base would do, but it never has been good. If this were to apply to every single expo, that could be bad. This could also easily softlock the ai with any wait statements as it might have been asking for tech buildings that aren't supposed to come so fast. For some bizzare reason, player_need is not a blocking command sometimes and will cause screw ups. It sometimes "leaks" or the AI reads ahead of itself and just gets ignored, but not always so that confuses the hell out of me. You must use notowns_jump to confirm the existence of a prequisite. The other note is that too many of them cause very odd behavior.

For those that want to know about the correct use of player_need to make sure expo buildings will go along smoothly, btw:

[spoiler]--expo--
build(1, nexus, 80)
build(1, pylon, 50)
multirun(expo cannons)
wait_build(1, nexus)
get_oldpeons(9)
build(25, probes, 40)
stop()
--expo cannons--
wait_build(1, pylon)
player_need(1, forge)
--expo cannons 2--
notowns_jump(forge, wait expo forge)
build(3, photon_cannon, 30)
stop()

--wait expo forge--
wait(300)
goto(expo cannons 2)

This ensures that the script does not continue until the forge is really there.[/spoiler]


My solution: Just use Unleaded Protoss's sanity check for expos.

- Defense Protocols

PYAI warns you if you use a defense command for a unit without a weapon. In any case, the place_guard command for defense and attack_add command for offense would make a defense command for units such as high templar redundant. I recall a game with an entropy P, where it was mostly defeated and had only a few templars left. The game crashed the moment a vulture grenade hit a high templar, making this highly likely to be the cause of the crash.

My solution: Remove all defense commands concerning any units without weapons, done for all scripts.

- The script just ends
I've read around that a script should end in a loop and shouldn't just stop, otherwise weird crap will happen. Incidentially, the reported crashes I've gotten from ai vs ai reps and Xerxes's threads note that the crash occurs late game, which would probaly be around where it reaches the end of the script. The last item on the main block is arbiters, which would explain why the crash coincides with arbiters. All of Blizzard's scripts end in loops, even the ones like campaign area town which don't do much anyways, so maybe it is important to end in a loop.

My solution: Since it has a final attack loop in a multirun somewhere in the script, I just added a blank loop to the end of the main thread.

Less likely causes


-Multiruns within multiruns
The comp is already screwy with multithreads. Having multiruns within multiruns may push the comp over the edge.

My Solution: Try merging some of the nested multiruns, though I am not going to do it for all of them.


- Many multiruns
The entire script is almost operated by multiruns. I am quite aware that the comp sometimes ignores multiruns and could possibly skip over something very vital
My Solution: None. Would require rewriting too much of the script.


Highly Unlikely

-- The entire expo building block is a loop
As the comp will rebuild buildings on its own, and it really can't be forced, this is really unecessary and may cause problems once there are many expos
Solution: Nuke the loop

-- High templars and Archons
define_max 10 high_templar
define_max 8 archon

The script has a loop training 8 archons somwhere

If you tell the AI to train archons, it will automatically train the high templar it needs if it doesn't have them already. But I never really understood would happen in this example. If you tell the comp to train 8 archons, would it train up to the defined max for templars, merge them and make more? Or does it try to make 16 hts at once anyways?

Solution: Change the max for templar to 16; the script never calls for more than a few hts anyways.

Anyhow, I hope I don't sound like I'm tearing into the script :lol: It's actually probaly one of the best non-cheating Ps around but it happens to be involved in many of the crashes I've seen involving Entropy. This is all I'm going to do to fix. If it happens to be another script, well that's too bad, there's just way too many lines to wade through. Perhaps if someone is brave enough... ;)
User avatar
JH24
Posts: 323
Joined: Sat Mar 14, 2009 6:25 pm

Postby JH24 » Thu May 21, 2009 11:02 am

This is very interesting and informative to read. Thanks for sharing your experiences, Archon_Wing.



So capt_expand makes the computer decide for itself to expand? I like that, so after the initial first expo the computer will do the rest? Do I only need one 'capt_expand' command?



I'm currently experimenting with my script to let it react to certain buildings of an opponent. If an opponent is not teching/upgrading but instead focusing on attacking my AI will do the same. If the opponent decides to tech my Ai will mirror that by executing the next part of the script. Not sure how this will work out though.


Unfortunately, I had already began working on the Rocky scripts in Entropy+, so I couldn't use the scripts you posted anymore. I'm really sorry, but I'll convert them when I'm done.
User avatar
Archon_Wing
Posts: 903
Joined: Wed Jul 25, 2007 11:22 pm

Postby Archon_Wing » Thu May 21, 2009 5:47 pm

So capt_expand makes the computer decide for itself to expand? I like that, so after the initial first expo the computer will do the rest? Do I only need one 'capt_expand' command?


I have no idea. :lol: It doesn't work for any script other I have.
Actually, it looks like I took it out in the newer versions :o, but in versions where it did exist, it seemed to expand very fast

Which makes it even odder how my script is expanding. If you have a command like "expand 99" it only expands once per call of the command

Everything involving expanding...
[spoiler]--expand--
wait(4300)
expand(99, more expo)
stop()
....
panic(natural expo)
....[/spoiler]

So it expands when it gets attacked? I think it only expands once if you take out the panic command. I'm guessing that's what panic does, but I've seen it continue to expand when nothing has happened, so yea. I just sorta left it as is because it seems to work fine.

I'm currently experimenting with my script to let it react to certain buildings of an opponent. If an opponent is not teching/upgrading but instead focusing on attacking my AI will do the same. If the opponent decides to tech my Ai will mirror that by executing the next part of the script. Not sure how this will work out though.


Easiest way is to run a check once for gas at a certain point early game, along with a rush 0 (military building)check earlier in the script. No gas= no tech, but you don't want that to be exploited by someone going 13 nexus.

Such as... [spoiler]multirun tech_check
...
:tech_check
wait_buildstart 13 probe
rush 0 tech_check 2
enemyowns_jump command_center double_expo
:attack_early
wait_build 1 gateway
attack_add 3 zealot
attack_do
attack_clear
stop

:tech_check2
wait_buildstart 18 probe
enemyowns_jump refinery tech
enemyowns_jump assimilator tech
enemyowns_jump extractor tech
build 3 gateway 80
stop

:double_expo
enemyowns_jump command_center double_expo2
stop

:double_expo2
random_jump 180 attack_early
expand 1 expo
wait 1000
expand 2 expo
stop[/spoiler]

This would:
Rush 3 zealots if no military buildings are up, or randomly double expand vs terran
build 3 gateways if no tech from enemy

. If there are only one computer opponent, then complex multithreaded scripts seem to perform as desired. As soon as a second computer opponent is added the complex scripts always seem to suffer or effect others scripts. I think simple is better for something like Entropy AI. So if you have doubts about certain blocks of code, I'd just axe them or replace them with proven winners.


Yea, it does seem my AIs will break in larger games. :lol: While my script is pretty multirun heavy, I usually try to multirun stuff the AI can do without (ie not training unts or attacking). I think I will just replace lines with either blizzard script or just externally linking it to my own script.

I won't bag on any one for being having too complex scripts , since my terran script is actually 43 kb /sleep.gif' class='bbc_emoticon' alt='-_-' />, making it about 3x as big as the zerg one which never screws up. However, before anyone says anything, the large amount of lines is mostly due to a large number of random builds (~3 per matchup and a bunch of minor variations), race specific blocks, and island scripts. So it doesn't run all at once, and even when my ai does softlock, it hardly locks forever and can still win games for some reason. :) And there's always Ashara's scripts which are very complex, but seem practically perfect. :o

This is more of me sharing a file, than an actual project, so I probaly will be done editing it soon, most likely after jh24 considers his script done. Just to keep folks occupied until BWAPI finishes; then this will be sorta obsolete anyways. ;)

I will just post the script version numbers/changes for all the scripts that I have altered and will be included in the next file I upload in case someone manages to get those debug messages working again. Note:completely arbitrary

Zelduck P 3.14 <<---The defense command and noncombat unit issue mentioned above
Peppe v5 - See above
Rocky 0.8 (1.0 if considered complete) - see above
EasyChat TvP 2.0 - edited, go watch the ai vs ai rep TVP shine to see the diffrence. ;)
Unleaded AIs 2.35 - Just some minor edits in the mean time. The AI was horribly unprepared for 2 hatch mutas, (designed with 3 hatch muta in mind) so I'd like to change this.

edit: What's with the spike in downloads!? ;D
pig_bomb
Posts: 2
Joined: Sat May 23, 2009 3:54 pm

Postby pig_bomb » Sat May 23, 2009 3:59 pm

hey, my graphics setup doesn't allow me to use the proper graphics settings for the starcraft application, i can get around this by using the window mode but this means i have to use a launcher application like iccup launcher. Is there any way to use an ai mod with iccup launcher and if not it would be sick if you implemented a windowed mode in your application.
User avatar
Archon_Wing
Posts: 903
Joined: Wed Jul 25, 2007 11:22 pm

Postby Archon_Wing » Sat May 23, 2009 7:56 pm

It's possible, but unforunately the way to do it is very crude.

It basically involves replacing one of the files in starcraft, which means that the mod will always be there, unless you delete the new file and bring the backup back. Also you will no longer be able to play in games where the normal ai is being used without swapping files.

The other problem is that I took out the UMS scripts which would mean many custom games won't work. I will add them back in when I update this file as well as include a patch_rt.mpq (which is the file you'd have to replace in sc)
pig_bomb
Posts: 2
Joined: Sat May 23, 2009 3:54 pm

Postby pig_bomb » Sun May 24, 2009 1:01 pm

sounds great
User avatar
Archon_Wing
Posts: 903
Joined: Wed Jul 25, 2007 11:22 pm

Postby Archon_Wing » Sun May 24, 2009 7:51 pm

Ok updated. The file was renamed Entropy Prime, and this will probaly be the last edit unless someone ever figures out the debug thing. I just don't feel like dealing with it anymore, and also I didn't really bother with island support, so that'll remain crappy too. Then again, there never seemed to be a high demand for island ais anyways.

I can't tell if the crashes are there, but they should be mostly gone. Unleaded AI was updated slightly so that should be a bit better too, most of the updates can be found earlier in this thread.

I didn't bother to record any replays, but here's a few ai vs ai rep notables

Because of the lack of debug messages, I could be wrong about what AI it is, but it shouild be close enough. I only saved pics of the ones with the more distinct AIs. ;)

PvT Shine -- Rocky 0.8 P vs Easychat T v2

Interestingly, the last version had the same matchup, so the scripts were easy to identify. In the previous encounter, the edited version of Easychat's script took an easy victory after doing damage with the initial rush and expanding about 5 times which it often does to many of the other P AIs. But Rocky 0.8 would prove stronger, as the opposite happened.

Image

PvZ LT -- Peppe P vs Storm Zerg
Because the strats for Peppe don't seem race specific, it leads to problems where harassing the enemy with a few goons won't work. Storm zerg eventually takes down the expansion despite the defending dts with the help of a slow overlord.

Image

PvT Tau Cross -- Unleaded T vs Peppe P

Below is why you do not push with half your army.

Image

Raynor P vs Racine T
A demonstration of how 14 nexus into 3 gate goon is so friggin difficult to deal with.

Image

Return to “StarCraft Modding”

Who is online

Users browsing this forum: No registered users and 1 guest