Computer AI Information

Started by DKSlayer, February 21, 2010, 07:18:12 PM

Previous topic - Next topic

DKSlayer

I first worked on AI for the Warcraft 3 Beta. The crackers for that time made it to where we could put a computer player in but it wouldn't do anything. Well the problem was the AI files were not completed in that beta. Luckily though they had left the AI file in for the E3 demo in there. We were able then to start programming the AI to get something useful. It looks like it may not be necessary to do any changes to the AI to battle against the computer. But also if we want to tweak it this data will be helpful.
All the info below if based on what is in the files and some educated guesses at this point since we can't do anything with the AI at this point. THE PURPOSE OF THIS POST IS SO THAT WHEN WE ARE ABLE TO GET IN THE GAME AND GET A COMP PLAYER WE WILL BE READY IF AI CHANGES ARE NEEDED. So don't think that this Thread is for getting the Human vs AI working. Also if I post anything incorrect feel free to correct me.  Want lots of help from People.
This first post is to do the Basic intro as well as point out the location of the AI\Trigger files.
To find these files then get WinMPQ and open the files I list below to find all the ones mentioned below.
In \Mods\Core.SC2Mod\Base.SC2Data
·         AI\sc2.galaxy
·         TriggerLibs\AI.galaxy
·         TriggerLibs\BuildAI.galaxy (Placeholder AI Script File)
·         TriggerLibs\GameData\Abil.galaxy
·         TriggerLibs\GameData\AchievementTerm.galaxy
·         TriggerLibs\GameData\Effect.galaxy
·         TriggerLibs\GameData\Game.galaxy
·         TriggerLibs\GameData\GameData.galaxy
·         TriggerLibs\GameData\Unit.galaxy
·         TriggerLibs\GameData\Weapon.galaxy
·         The TriggerLibs\nativesLib_beta.galaxy does includes for the 3 files(TrigggerLibs/AI,TriggerLibs/MeleeAI,TriggerLibs/TacticalAI)
·         TriggerLibs\NativeLib_beta.galaxy pulls in TriggerLibs/natives(not sure where natives file is)
·         TriggerLibs\RequirementsAI.Galaxy (Placeholder AI Script)

In \Mods\Liberty.SC2Mod\Base.SC2Data\
·         TriggerLibs\BuildAI.galaxy
·         TriggerLibs\Computer.galaxy
·         TriggerLibs\MeleeAI.galaxy
·         TriggerLibs\MeleeNotHardAI.galaxy
·         TriggerLibs\Protoss.galaxy
·         TriggerLibs\Protoss0.galaxy
·         TriggerLibs\RequirementsAI.galaxy
·         TriggerLibs\TacticalAI.galaxy
·         TriggerLibs\TactProAI.galaxy
·         TriggerLibs\TactTerrAI.galaxy
·         TriggerLibs\TactZergAI.galaxy
·         TriggerLibs\Terran.galaxy
·         TriggerLibs\Terran0.galaxy
·         TriggerLibs\Zerg.galaxy
·         TriggerLibs\Zerg0.galaxy
Also in the map file there is a Trigger file called "Triggers." Also SC2 probably will be similar to WC3 in that you will be able to provide a custom AI for your Maps\MODS. We'll see when we get to start playing around with it.
If you find anymore please says so.
I will also post what some of the AI files are used as well as which ones are quite pertinent. So this Thread is for all AI related info

MiCrOMaN1

The thing is see,

The only thing we need to do to play against AI is somehow open the maps while playing SC2. And I mean using Starcraft 2. If we can somehow create a menu that lets us open a map, and a race, then we'll be able to play against the AI.
Our Greatest Resource is Our Mind ~ Kareem Abdul-Jabbar
Check this: http://img123.exs.cx/img123/4497/gif1.gif

Laer07

@DKSlayer

You bring up a good point and something I had been thinking about for a while: even if we get the game setup to play against comps, I saw in some of the replays that the comp on very easy is damn retarded. If we can get in there and make it smarter and more fun to play against, well that's icing on the cake.

One thing though... Not sure how easy it's going to be to edit the galaxy files without the SC2 editor. I know you can open them in plain text (and at least they are actual code  :) ), but you would still need either good luck or serious skill to make meaningful changes to the AI.

One possibility, like you said, is taking the AI from the E3 demo and replacing the "very easy" AI with that one, that way at least the AI does something other than build a single zealot...  :-[

MiCrOMaN1

Lol, Let's try and first make the AI work, then we can worry about they're difficulty xD
Our Greatest Resource is Our Mind ~ Kareem Abdul-Jabbar
Check this: http://img123.exs.cx/img123/4497/gif1.gif

DKSlayer

#4
MiCr0MaN1 - I am aware that the map needs to be loaded. Just start a thread where we can compile the info on the AI. I can't help with programming, or RE. But am aware of AI. So might as well do something that may be useful if we aren't there yet. :)

Laser07 - Sorry I meant that that the WC3 AI we got from E3. Don't see any AI from any other Starcraft Events. Although they may not be happy with the Level of the AI for them, ie Very Easy.
Also modifying AI isn't too hard. Obviously though we need to be able to get a computer in the game first, :) but when it's there the fun will begin as we might as well be ready.

MiCrOMaN1

Ok, the first thing we need to do before we do anything, is make an option in Starcraft 2 to load maps.
Our Greatest Resource is Our Mind ~ Kareem Abdul-Jabbar
Check this: http://img123.exs.cx/img123/4497/gif1.gif

DKSlayer

Quote from: MiCrOMaN1 on February 21, 2010, 07:59:54 PM
Ok, the first thing we need to do before we do anything, is make an option in Starcraft 2 to load maps.
Yeah, good luck. I will be working on getting the AI info available and hopefully get some understanding to it as well.

You can extract the AI files from the MPQ's I mentioned above. You canmodify all those files with notepad. You can then(Guessing based off of Warcraft 3) reimport then(you will want to keep a backup of the original. I know in Warcraft III if we kept the paths of the files we didn't have to reimport them.

Oh, and looking at it someone who is familiar with the AI of WC3 more recently then me would have a lot better Idea too.

MiCrOMaN1

Apparently sc2_switcher is trying to see if he can make a launcher plus options screen.
Our Greatest Resource is Our Mind ~ Kareem Abdul-Jabbar
Check this: http://img123.exs.cx/img123/4497/gif1.gif

DKSlayer

I recommend if you are to start looking at AI you extract all the above files somewhere. Anyways there are still comments in the AI in here so read through, also functions are pretty self evident.

if (AILastAttackRatio(w) >= 120) {
        // if the last attack was successful (we killed a good bit more than we lost)
        // then attack again as soon as we've gathered 20 units or it's been a short amount of time
        if (count >= 20) {


Also I am looking around it looks like the AI is not finished to be more than very easy for each race by default. We may have to work on some AI. Though I do see spots with Hard AI referenced.

MiCrOMaN1

Post all the compiled info on the "Compile AI Info here" Topic :D
Our Greatest Resource is Our Mind ~ Kareem Abdul-Jabbar
Check this: http://img123.exs.cx/img123/4497/gif1.gif

DKSlayer

#10
Quote from: MiCrOMaN1 on February 21, 2010, 08:23:12 PM
Post all the compiled info on the "Compile AI Info here" Topic :D
OK Will do.
Thanks