Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - DKSlayer

#1
I have been a computer guy my whole life. It's a feature. Alt + F4 will close the application that has the active focus, be it a game or a firefox browser.
Funny people  :D
#2
   
psi = TriggerCreate("TriggerPsi");
    TriggerExecute(psi, false, true);
[\CODE]
This above is in the sc2.galaxy file. I am in agreement unit AI is definitly capable 2 ways. The XML file seems to be a quite powerful AI file. Definitly Micro. Also you could check to see if somewhere in the AI something is preventing the ai using PSI. Just a thought. Also yeah, the AI isn't done. As well as functions.
#3
Quote from: MiCrOMaN1 on March 03, 2010, 12:09:47 AM
Where do you see that? I can't for the life of me find that text...

That isn't in the script. He is wanting it added. It would be fairly easy At the begining of each Race AI script you could add the following line.

TriggerDebugOutput(1, StringToText("One computer is an Protoss"), true);

Obioudly you would change the protoss to the race name of whatever race AI file you are putting this line into. Then whenever the computer fires up it's AI files then it would pop these messages one for each computer and then showing which race.
You could add this yourself or bug the developer.
#4
Not enough Pylons / Re: Tutorial : How to play against ai
February 27, 2010, 09:41:52 AM
Just grabbed the cache off of some site and started looking at at the files. Obiously we have the triggers file. Which looks like this.
<?xml version="1.0" encoding="utf-8"?>
<TriggerData>
    <root>
        <item type="Trigger" id="DA585CDF"/>
    </root>
    <element type="Trigger" id="DA585CDF">
        <event type="FunctionCall" id="9FD28024"/>
        <action type="FunctionCall" id="D8249E80"/>
        <action type="FunctionCall" id="879D3981"/>
        <action type="FunctionCall" id="BB0E3A48"/>
        <action type="FunctionCall" id="C749188F"/>
    </element>
    <element type="FunctionCall" id="879D3981">
        <function type="FunctionDef" library="Ntve" id="00000145"/>
    </element>
    <element type="FunctionCall" id="9FD28024">
        <function type="FunctionDef" library="Ntve" id="00000120"/>
    </element>
    <element type="FunctionCall" id="BB0E3A48">
        <function type="FunctionDef" library="Ntve" id="00000150"/>
    </element>
    <element type="FunctionCall" id="C749188F">
        <function type="FunctionDef" library="Ntve" id="00000148"/>
    </element>
    <element type="FunctionCall" id="D8249E80">
        <function type="FunctionDef" library="Ntve" id="00000143"/>
    </element>
</TriggerData>


we can see that the lower functions are being pulled from the native Triggers file. Which I have been unable to find. My thought it this is probably coded in. Anyways the functions are called by a Code number and given an Id. In the enUS.SC2DAta\LocalizedData\TriggerStrings.txt you find this:

Trigger/Name/DA585CDF=Melee Initialization

in another map thought you get

Trigger/Name/6B580A10=Melee Initialization


and in the triggers file for the second map you see

<?xml version="1.0" encoding="us-ascii"?>
<TriggerData>
    <root>
        <item type="Trigger" id="6B580A10"/>
    </root>
    <element type="Trigger" id="6B580A10">
        <event type="FunctionCall" id="55F0159A"/>
        <action type="FunctionCall" id="32730DBD"/>
        <action type="FunctionCall" id="8C8C05D9"/>
        <action type="FunctionCall" id="414B4FFA"/>
        <action type="FunctionCall" id="4E1DE037"/>
    </element>
    <element type="FunctionCall" id="32730DBD">
        <function type="FunctionDef" library="Ntve" id="00000143"/>
    </element>
    <element type="FunctionCall" id="414B4FFA">
        <function type="FunctionDef" library="Ntve" id="00000150"/>
    </element>
    <element type="FunctionCall" id="4E1DE037">
        <function type="FunctionDef" library="Ntve" id="00000148"/>
    </element>
    <element type="FunctionCall" id="55F0159A">
        <function type="FunctionDef" library="Ntve" id="00000120"/>
    </element>
    <element type="FunctionCall" id="8C8C05D9">
        <function type="FunctionDef" library="Ntve" id="00000145"/>
    </element>
</TriggerData>

As you can see the ids in the Function Call portion are random. I am guessing the map editor just creates a random unique id for each one even though the native. But the actualy Native functions are the same. So one side defines the triggers and the other side calls them.
Anyways the link someone showed above showed that in one of the maps someone actually was able to pull a more full AI like file. Anyways looking through the maps here to see what they are.
#5
So I was going through the AI and was getting tired of typing everything so I wrote a program(very quickly so I am not saying it is awesome) to allow me to filter the file. It will filter a file or text for functions, constants, or custom critera. It also has additional options.

You can either copy the code into the box or you can open the file. Primarily I have been testing it on aI\trigger files. But using a custom filter will work on any other file type.

I will be updating it. If you have any questions or thoughts or bugs please respond back. If you look in the file attached included with it , it will let you know of problems I have found or suggestions.

IT is compiled in .NET 3.5

--The Current Functions that are not native that it recognizes:--
=void
=string
=bool
=static
=int
=unit
=order



If you want to add a function report a bug, have it filter by more stuff please include some code of what it was filtering at the time.

Below is the link to snag it
http://rapidshare.com/files/355393855/Starcraft_2_Filter.zip

Version - Super Alpa .0000001
:)
oops that first version was duplicating the function name Fixed it

P.S. once again this is not a crack for starcraft 2.
#6
AI Development / Re: Compile AI Info here
February 23, 2010, 07:05:46 PM
Wrote a program real quick to pull out all comments from the AI\Trigger Files. I am also programming into it the ability to pull out functions and Constant Declarations. That way we can quickly create a manual of all of the items. After I am done with it I will post them somehwere.
#7
AI Development / Some Good AI stuff
February 23, 2010, 06:04:58 PM
Going through the AI.galaxy file for documentation. I ran across this:


//--------------------------------------------------------------------------------------------------
//  Difficulty
//--------------------------------------------------------------------------------------------------
const int c_diffAdvanceWave         = 0;
const int c_diffRepairDamage        = 1;
const int c_diffFleeDamage          = 2;
const int c_diffOptimizeGas         = 3;
const int c_diffDefendWithPeons     = 4;
const int c_diffNormalVision        = 5;
const int c_diffLimitAPM            = 6;
const int c_diffAutoLoadBunkers     = 7;
const int c_diffEarlyGameRepair     = 8;
const int c_diffEnableDangerMap     = 9;
const int c_diffWaveAvoidDanger     = 10;
const int c_diffNormalTargetPrio    = 11;
const int c_diffEarlyDefenseScout   = 12;
native void AISetDifficulty (int player, int index, bool state);
native bool AIGetDifficulty (int player, int index);


AISetDifficulty - So with this function you would be able to turn on or off these different Settings. So to turn on the Early Defense for Player 4 you would
issue the command as such AISetDifficulty(4(may be 3 if they start at 0), c_diffEarlyDefense, true).
AIGetDifficulty - This returns the status of a Difficulty setting. So to check to see if Player 4 is going to Auto Load Bunkers you would issue
the command AIGetDifficulty(4(may be 3 if they start at 0), c_diffAutoLoadBunkers) at which point it will return a true or False back to you.

You can see it used in the MeleeAI.galaxy file Here:

if (PlayerDifficulty(player) >= c_skirVeryHard) {       
        if (PlayerDifficulty(player) >= c_skirCheater) {
            AIHarvestBonus(player, 2.0);
            AISetDifficulty(player, c_diffNormalVision, false);
            AISetDifficulty(player, c_diffLimitAPM, false);
        }
        AISetFlag(player, e_flagsRunScared, false); // TODO fix scared and re-add this
    }
    else {       
        AISetDifficulty(player, c_diffAdvanceWave, false);
        AISetDifficulty(player, c_diffFleeDamage, false);
        AISetDifficulty(player, c_diffWaveAvoidDanger, false);
        AISetFlag(player, e_flagsRunScared, false);
    }

So you can see examples here player being the variable for the current AI player. So we can tweak them for sure.

Not all native Functions IE "AISetFlag(player, e_flagsRunScared, false); // TODO fix scared and re-add this" may work in this version of the beta, actually I am sure they don't. You can see that the flag e_flagsRunScared they comment is not working. Looking through the AI files and reading comments will allow us to find these issues. For Example in TacticalAI.galaxy there are whole functions that are Commented out due to not functioning or changes in the code, examples: AIThinkSetRallyDefault, AIThinkSetRallyWorker. So we can see that some AI functionality may not work 100% but with some good thinking we should be able to program around the majority of these.

You can see that a small part of the harder difficulties are programmed in, But most of it is hanging, meaning not there. So it will take a good player knowing strategy and a good AI Programmer to get it there. Or actually better Lots of good players offering advice and Programmers figuring it out.

For those wanting to learn:
Many of the AI files contain Functions & Constants used by the AI. The really AI start is in Melee AI with the AIMeleeStart function. After that you can follow functions off the the other sections. But then there is a start for the each of the Races as well in their respective AI file : ie Zerg.Galaxy (ZergInit & AIMeleeZerg) same for each race. You can then branch off from their. Obviously all the AI files get used and studying them all will only make you more capable in programming.
#8
Starcraft II Beta / Re: Flasm works...
February 23, 2010, 05:26:12 PM
Quote from: RaTcHeT302 on February 23, 2010, 05:02:02 PM
Nice job. Cool, there is a insane difficulty for the bots, I wonder how much INSANE it is!

Actually for Melee(Multiplayer\Skirmish) when they are done there will be 6 Difficulty levels as you can see from the AI below:

const int c_skirVeryEasy    = 0; // difficulty settings
const int c_skirEasy        = 1;
const int c_skirMedium      = 2;
const int c_skirHard        = 3;
const int c_skirVeryHard    = 4;
const int c_skirCheater     = 5;

For the Campaign there will be 4 levels of difficulty

const int c_campBeginner    = 0; // difficulty settings
const int c_campNormal      = 1;
const int c_campAdvanced    = 2;
const int c_campExpert      = 3;


This was pulled from the AI.galaxy file.


#9
AI Development / Re: Compile AI Info here
February 23, 2010, 02:51:15 PM
Here is a run down of the information in the AI files located in the "TriggerLibs\GameData\" Folder. It included all the sections of each file as well as a description of the constants in those sections as well as some examples. These Files only contain Constants. No Functions.

==Abil.galaxy== - All Constants - Below is the various sections and then a short description of what they pertain to)
-EClassIDCAbil (Abilities:Warpable)
-EAbilBehaviorStag (Button Status Untoggled/Toggled)
-EABuildStage (Building/Construction)
-EAbilEffectState (Spec Effects)
-EAbilHarvestStage (Resource Gathering)
-EAbilMorphStage (Appears to be about Collision Detection to enable morphing of unit))
-EAbilArbMagazinCmd  (Ammo)
-EAbilAttackCmd (Execute Attack)
-EAbilAugmentCmd (Execute Augment)
-EAbilBatteryCmd (Execute Battery)
-EAbilBeaconCmd (Beacon:BaconMove, BeaconCancel)
-EAbilBehaviorCmd (Enabling/Disabling ability)
-EAbilBuildCmd (Build Status)
-EAbilBuildableCmd (Buildable?)
-EAbilEffectInstantCmd (Execute/Cancel Instant)
-EAbilEffectTargetCmd (Execute/Cancel Target Command)
-EAbilHarvestCmd (Gather,Return,Cancel Harvesting)
-EAbilInteractCmd (Designate Interaction Command)
-EAbilInventoryCmd (Interact with Inventory: Drop, Move, Take)
-EAbilLearnCmd (Learning)
-EabilMergeCmd (Merge ie: Merge Selected Units, Merge With Target Name)
-EAbilMorphCmd (Execute/Cancel Merging)
-EAbil MergeableCmd (MergeableCmdCancel)
-EAbilMoveCmd (Moving: Patrol, Hold Pos, Turn)
-EAbilPawnCmd (Pawn?)
-EAbilQueueCmd (Ability to Queue commands)
-EAbilRallyCmd (Rally Points?)
-EAbilRedirectInstantCmd (ie: RedirectInstantCmdExecute)
-EAbilRedirectTargetCmd (Redirect the Targer)
-EAbilResearchCmd (Research Status?)
-EAbilReviveCmd (Reviving)
-EAbilSpecializeCmd
-EAbilStopCmd (Stop Commands: StopCmdDanceName, StopCmdHoldFireName, StopCmdDanceName)
-EAbilTrainCmd (Training)
-EAbilTransportCmd (Loading and Unloading units from Transports)
-EAbilWarpableCmd (Cancel the warpable status of Item)
-EAbilWarpTrainCmd (Warp Training)

==AchievementTerm.galaxy== - All Constants - Below is the various sections and then a short description of what they pertain to)
-EClassIdCAchievementTerm (This has to do with some of the Achievement Terms: Combine, Quantity, Race, Effects, AbilUse, ScoreValue)

==Effect.galaxy== - All Constants - Below is the various sections and then a short description of what they pertain to)
-EClassIdCEffect (Diffferent Effects: UseCallDown, ModifyPlayer, Destroy Healer, Apply Behavior)

==Game.galaxy== - All Constants - Below is the various sections and then a short description of what they pertain to)
-EClassIDGame (GameClass: c_classIDCGameName = "CGame")
-EAllianceID (The different Alliance Options: Defeat, Trade, Vision, SeekHelp)
-EPlayerType (Different Player Types:User, Computer, Heutral, Referee, Spectator)
-ETargetFilter (Attributes of targeted Objects(although most likely allowing you to filter targetable objects, hence the Filter part: Dead, Self, Ally, Enemy,
Structure, Biological)
-EMarkerMatch (?: ID, Link, CasterPlayer, CasterUnit)
-EHeightMap (Heights: Air, Glide, Ground)
-EPlane (Planes: Ground, Air)
-EDamageKind (Damage Kinds: Spell, Melee, Ranged, Splash)
-EDeathType (The manner in which unit dies: Normal, Blast, Salvage, Fire, Eat(Eaten), Squish)
-EResourceType (The resource Types: Minerals, Vepsene, Terrazine, Custom)
-ETeamColor (Diffuse/Emissive)
-EBeacon (Beacon Types: Rally, Attack, Defend, Expand, Harass, Scout)
-EUnitTaunt (The unit Taunt Options: Cheer, Dance)


==GameData.galaxy== - All Constants - Below is the various sections and then a short description of what they pertain to)

-EGameCatalog (The Different Game Catalogs, Abil, Achievement, Error, DSP, Footprint, Game UI, Button, Validator)


==Unit.galaxy== - All Constants - Below is the various sections and then a short description of what they pertain to)
-EClasssIdCUnit (Class ID for Units: CUnit)
-EUnitFlag (Many attribute Flags for units: Movable, Hero, Undetectable, NoDeathEvent, AILifeTime)
-EUnitAttribute (Unit Attributes: Light, Biological, Psionic, Structure, Heroic)
-ECmdFlags (Command Flags: Alternate, Queued, SmartClick, Subgroup, SetAutoCastOn)


Inreference to omeenesss - We aren't working on a hack here. We are just getting AI information together and start looking on how to increase the difficulty of the AI
#10
Hey SC2_Switcher,
  I don't know what features you have in mind. From a program mind of things. You should have a subfolder wherever your app is going to be. In it all the files that will be imported would be inside, as well as a custimizeable XML stating the file information for all the files to be patched/changed/imported, as well as where they should go. It when asked to patch should backup the files listed in that XML from the Untouched Starcraft 2 Location and place them into another Subfolder called Backup or something. As well as a Log stating the success or what not. These would be used if something goes wrong and need to revert. After backup is done it would then import and overwrite the needed files stated in the XML or INI file. This would make your program very easy to update as well as for devs to use it as a patching tool. They could just modify the included XML file and place the files into the Subfolder. Just some thoughts. If you want you could allow multiple patches, and allow the user to select the patch they want to install. I don't really know my thoughts on this last Idea. But just a thought. For example if someone wanted to be able to play the game that could be one patch. If they wanted better AI that could be another. Holler your thoughts.
Thanks
Todd
#11
AI Development / Creating Various Difficulty Levels
February 22, 2010, 02:40:06 AM
I am currently writing documentation on the basic jist of each AI file, have to go to sleep though. I will do this more tomorrow. But before I go to sleep. I wanted to share something

The Following Files Protoss0, Terran0, Zerg0, in the computer Headings are referred to as (The Race Name) & "Melee Very Easy" ie "Terran Melee Very Easy." So the easiest way to step up the difficulty would be to copy the Terran0 file and create a Terran1 for Easy, Terran 2 for Medium, and so forth. You could then modify those files to the difficulty you wanted. Easiet way to get them implemented would be then to change the include in Terran to point to the one you want to play against ie include "TriggerLibs/Terran1". Also though there are some IF statements in other AI files referring to the Difficulty level, so you would need to take those in to account. Anyways there is my 2 cents for tonight. See yall tomorrow.
Night
#12
AI Development / AI INCLUDE TREE
February 22, 2010, 02:00:53 AM
AI INCLUDE TREE
Here is The AI related files. What I have done is shown which files include which files. Now as you can see most of them are in the same logical path that Blizzard has, if you want to see which file they are located  in though go to the second post of this thread.

It is in outline form so files with the - are at the root and most likely called by the application. The files with the + are included by the file with the previous -. The files with the = are included by the previous file with the +. Sorry if it's difficult to understand.

-AI/sc2.galaxy
-TriggerLibs/nativeLib_beta.galaxy (Does an include for TriggerLibs/natives, Can't find it though)
-TriggerLibs/GameData/AchievementTerm.galaxy
-TriggerLibs/natives_beta.galaxy
     +TriggerLibs/GameData/Abil.galaxy
     +TriggerLibs/GameData/Effect.galaxy
     +TriggerLibs/GameData/Game.galaxy
     +TriggerLibs/GameData/GameData.galaxy
     +TriggerLibs/GameData/Unit.galaxy
     +TriggerLibs/GameData/Weapon.galaxy
     +TriggerLibs/AI
     +TriggerLibs/RequirementsAI (The Core one is ignored for the Liberty one)
          =TriggerLibs/BuildAI (The Core one is ignored for the Liberty one)
          =TriggerLibs/MeleeAI
     +TriggerLibs/MeleeNotHardAI
     +TriggerLibs/TacticalAI
          =TriggerLibs/TactProtAI
          =TriggerLibs/TactTerrAI
          =TriggerLibs/TactZergAI
-TriggerLibs/Computer.galaxy (Weirdly this one calls the MeleeAI file too, note sure how this works)
     +TriggerLibs/MeleeAI
          =TriggerLibs/MeleeNotHardAI
     +TriggerLibs/Terran
          =TriggerLibs/Terran0
     +TriggerLibs/Protoss
          =TriggerLibs/Protoss0
     +TriggerLibs/Zerg
          =TriggerLibs/Zerg0


This should allow you to do changes multiple ways one way though is I could Create a Protoss1 with all the contents of Protoss0 and then modify it as I deemed fit. I could then just change the include in Protoss to point to Protoss1 instead of Protoss0.

If you find any mistakes post.
#13
UNDERSTANDING THE MOD FOLDERS AND HOW THEY WORK

This information is not just pertinent to AI files but all files so a good read for everyone.

So as you have seen the AIs are stored in 2 different logical folders: Core.SC2MOD in the Base.SC2Data and Liberty.SC2MOD in the Base.SC2Data. Inside each of these files are more files in folders. So first of all Starcraft2 loads the Core.SC2MOD file no matter what then loads the MOD folder for that mod you are running obviously we are running the Liberty.SC2MOD(This being "Wings of Liberty".) So both files are loaded. Now They even though they are in 2 seperate spots the files in each don't know this. So ie the natives_beta.galaxy file in Core.SC2MOD, in the Folder TriggerLibs calls the TacticalAI.galaxy file in the same folder but in the Liberty.SC2MOD. This is important because when you look at files in both it appears that the on top takes precedence. So the LIBERTY.SC2MOD files would "overwrite" per see the files with the same name and paths of the CORE.SC2MOD files. For Example There is a BuildAI.galaxy file in the Core.SC2MOD file. It's Contents are shown below:
//==================================================================================================
//Placeholder AI script file
//
//  Since natives.galaxy in Core includes AI files in Liberty, placeholder files are necessary
//  such that Core-only mods can compile properly.
//
//==================================================================================================

And there is a BuildAI file in the Liberty.SC2MOD below I will just show a small sample of the code:

//--------------------------------------------------------------------------------------------------
//  AI Get Default Build Flags Functions
//--------------------------------------------------------------------------------------------------
int AIGetDefaultBuildFlags (int player, string objType)
// special protoss units
    if (objType == c_PB_Nexus) {
        return c_makeCenter;
    }
    if (objType == c_PB_Pylon) {
        return c_makePower;
    }

As you can see the BuildAI.Galaxy from Liberty.SC2Mod is the one being used. The comment in the first file clarifies this.

So now that you can see this. It will help you as you either work with the AI or other items. Blizzard in my mind has done a great way of allowing mods this way. This allows Modders to not have to modify all files just the ones they need changed, and these can be in their on MOD folder. Now somewhere there has to be a way declaring which mod you want to run. But that is not something I have found nor probably will since I am focusing on the AI.

Hope this helps. My next post will be the AI tree(ie which files include which)
#14
Trash Can / Re: *Sigh* I think we've done it...
February 21, 2010, 10:14:07 PM
Just remember the little guy that found and pointed out the file. :P Nifty to see the files. Cool part is that we can see what the menus should look like. You should pull open the Single Player file.
#15
AI Development / Peons like starcraft 2 too
February 21, 2010, 10:10:21 PM
So the AI was most likely structored like existing Warcraft III many stuff. One thing is the copyright on many of the files is 2003-2005. Also you their is a function in the MeleeAI.galaxy file for AI called ..... AISetGasPeons. Anyone know of any Peons in Starcraft II? I am writing documentation stating which files include what. Will get it up when I get a chance.

Also the AI is definitly not completed and that is why we only have Very Easy. They have many comments in the AI.