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 - Kernel64

#151
AI Development / Re: Map Disassembling
March 06, 2010, 03:59:59 PM
Horray! ???
#152
AI Development / Re: Idea for AI unit detection...
March 06, 2010, 01:32:00 PM
Thanks, Heinermann!

This is brilliant,Hd! So, with the wavethink function, we can use the evalLargestenemy to get the enemyPlayer.

The WaveThink tries to simulate a LoS awareness for the AI. It doesn't remember what he had before, and constantly needs to see units in order to decide, if I'm not mistaken?

Have you tested the WaveThink yet?

I'm trying to discover how the functions involving waves and their strengths and ratios, for the purpose of having the AI evaluate itself, with regards to what it has vs. the enemy atm.

Waves in retreat, in the base, attacking, divert, etc.
#153
So, A few besides the Starcraft Team could make use of build orders and unit compos, response to such build orders, where to proceed when what and when.

The idea is to post your opening BOs, what units you get, when you expand, and what conditions prompt you to do such things. Timings on when you attack using what, etc, and what you would do when facing a certain BO. Say, for example, a 7-rax reaper harass build to fast-expo, banshee.

Post your own, and they might get included in the upcoming releases of AI scripts.

The more we have stored here, the more the devs have to work with and fast. :)
#154
yeah. I hate to go online just to get authentication because I want to make a map or just play single player. I'm still buying the game, but this thing they made is too elitist imo.
#155
AI Development / Re: Idea for AI unit detection...
March 06, 2010, 09:45:43 AM
EDIT:

this function seems to get the Overseer's range:

Quote
fixed AIRangeOverseer (int player, unit aiUnit) {   
    return AIUnitFixed(player, c_ZU_Overseer, c_fieldSightDawn) + 1;

    //return MaxF(MaxF(AIAbilityFixed(player, c_AB_FungalGrowth, c_fieldRange0),
    //    AIAbilityFixed(player, c_AB_AcidSpores, c_fieldRange0)),
    //    AIAbilityFixed(player, c_AB_Changeling, c_fieldRange0)) + 1;
}

c_fieldSightDawn is something.

Quote
fixed AIUnitFixed (int player, string entry, string field) {
    return StringToFixed(AIUnitStr(player, entry, field));
}

AIUnitFixed() seems to return data from somewhere.

then we have this catalog:

Quote
//--------------------------------------------------------------------------------------------------
//  CATALOG ACCESSOR CONSTANTS
//--------------------------------------------------------------------------------------------------

const string c_fieldAmount          = "Amount";
const string c_fieldAreaRadius0     = "AreaArray[0].Radius";
const string c_fieldAreaRadius1     = "AreaArray[1].Radius";
const string c_fieldAreaRadius2     = "AreaArray[2].Radius";
const string c_fieldAreaFraction0   = "AreaArray[0].Fraction";
const string c_fieldAreaFraction1   = "AreaArray[1].Fraction";
const string c_fieldAreaFraction2   = "AreaArray[2].Fraction";
const string c_fieldAttrStructure   = "AttributeBonus[Structure]";
const string c_fieldAttrArmored     = "AttributeBonus[Armored]";
const string c_fieldAttrPsionic     = "AttributeBonus[Psionic]";
const string c_fieldAttrLight       = "AttributeBonus[Light]";
const string c_fieldDrainFactor     = "DrainVitalCostFactor";
const string c_fieldEffectChange0   = "VitalArray[0].Change";
const string c_fieldEffectChange1   = "VitalArray[1].Change";
const string c_fieldEffectChange2   = "VitalArray[2].Change";
const string c_fieldEnergyCost      = "Cost[0].Vital[Energy]";
const string c_fieldEnergyMax       = "EnergyMax";
const string c_fieldFilters         = "SearchFilters";
const string c_fieldMinRange        = "MinimumRange";
const string c_fieldModification0   = "Modification.VitalRegenArray[Energy]";
const string c_fieldPeriodCount     = "PeriodCount";
const string c_fieldRadius          = "Radius";
const string c_fieldRadiusBonus0    = "AreaArray[0].RadiusBonus";
const string c_fieldRange0          = "Range[0]";
const string c_fieldRange           = "Range";
const string c_fieldSightDawn       = "Sight";
const string c_fieldTargetFilters   = "TargetFilters";
const string c_fieldTargetFiltersAB = "TargetFilters[0]";
const string c_fieldTargetFilters0  = "ValidatorArray[0].value.value";

And we find "const string c_fieldSightDawn       = "Sight";"

Thus, it could possibly mean that since:

"AIUnitStr(player, entry, field)" used as:  "return StringToFixed(AIUnitStr(player, entry, field));"

where field is c_fieldSightDawn       = "Sight";

We can get a unit's sight range through something like this:


Fixed MyUnitRange = StringToFixed(AIUnitStr(player, [wave_unit(i)], "Sight"));

Where wave_unit(i) is a unit among an array of units taken from a group of units.

Thus, our function will be:

Quote
void AIWaveThinkZerg (int player, wave w, int type) {
    // hd: seeing if we can pick up opposing unit activity
    unitgroup found;
    unitgroup enemyGroup;
    unitgroup waveGroup = AIWaveGetUnits(w);
    int enemyCount;
    aifilter filter;
   
    AIWaveThinkDefault(player, w, type);
   
    for (int i = 0; i < UnitGroupCount(waveGroup); i++) {
        found = AIFindUnits(player, null, UnitGetPosition(UnitGroupUnit(waveGroup, i)),
                                                           ( StringToFixed( AIUnitStr(player, UnitGroupUnit(waveGroup, i), "Sight")  ) ),
                                                           c_noMaxCount);
        // filter = AIFilter(player);
        //AISetFilterAlliance(filter, c_playerGroupEnemy);
        enemyGroup = UnitGroupFilterThreat(found, [wave unit], null, 0);
        enemyCount = UnitGroupCount(enemyGroup, c_unitCountAlive);
       
        if (enemyCount <= 0) { return; }
        else {
            // found something, add found enemy unit/building to an array of enemy units
            // set a priority system based off count of enemy units found / type of units
        }
    }
}

Now this:
Quote
int ZealotCount;

ZealotCount = UnitGroupCount(AIFilterPathable(AIFindUnits(enemyPlayer, c_PU_Zealot,
                                                  UnitGetPosition(UnitGroupUnit(waveGroup, i)),
                                                  StringToFixed( AIUnitStr(player, UnitGroupUnit(waveGroup, i),
                                                  enemyCount),
                                                  UnitGetPosition(UnitGroupUnit(waveGroup, i))),
                                                  c_unitCountAlive)

will get the number of Zealots found within range of waveGroup, among the number of enemy units found.

What I also don't know how is getting the AI to determine the human player's int value.
#156
in SC1, 0,0 is the bottom left corner of the playable area. Not sure though.
#157
AI Development / Re: Idea for AI unit detection...
March 05, 2010, 08:29:25 PM
I thought about reusing the filtering done within the Think functions. The get would be in groups, and each unit type is then counted and appropriate actions are taken.

I'm at the very conceptual stages though, and haven't examined all the functions yet.

If I do stumble upon something, I will post them here.

edit:

this lines for example:

Quote
//    findResults = AIFindUnits(0, c_NU_Minerals, UnitGetPosition(aiUnit), 8, c_noMaxCount);
//    if (UnitGroupCount(findResults, c_unitCountAll) == 0) {
//        findResults = AIFindUnits(0, c_NU_HighYieldMinerals, UnitGetPosition(aiUnit), 8, c_noMaxCount);
//        if (UnitGroupCount(findResults, c_unitCountAll) == 0) {
//            OrderSetTargetPoint(ord, UnitGetPosition(aiUnit));
//            AICast(aiUnit, ord, c_noMarker, c_castHold);
//            return;
//        }
//    }
//
//    OrderSetTargetUnit(ord, UnitGroupUnit(findResults, 1));
//    AICast(aiUnit, ord, c_noMarker, c_castHold);
//}

Somehow, it counts the number of high yield meeaneraaallz (female voiced). So, through this, each unit will have to be listed, checked, etc. The code will be hell though.

I'm certain you can find better means to do the same with fewer lines, by cycling through each race specific unit type in your array.

I'm shooting in the dark, as always. I'm hoping you find it.
#158
Not enough Pylons / Re: change gamespeed?????
March 05, 2010, 07:24:59 PM
Isn't there a file somewhere we can edit so that its set at faster every time? Like what you can do with the fps thing.
#159
SC2 Tools / Re: Starcraft II RaceLocker - By CraniX
March 05, 2010, 07:20:26 PM
Problems with replay of the second restart.
Adjutant, hud, music is still of the other races.

Anything I'm doing wrong?
#160
Quote from: apriores on March 05, 2010, 06:03:45 PM
I think you don't need all that maps. You can do anything you want with this launcher http://darkblizz.org/Forum2/sc2-tools/starcraft-ii-launcher/ be observer of computers play, manipulate number of computers on map etc. You can read more about it on posts or just try it.  ;D I'm testing AIs a lot and this one is making my work much easier. :)

P.S.
Those errors with TriggerLibs are gone with the latest version 2.0.2.

I'd like to work on one AI at a time, and also fight with it to debug the functions. How it responds to certain changes in my base, unit compo, etc. So, having the preset matchups will help a lot.
#161
AI Development / Re: AI Script Editing Tool
March 05, 2010, 06:44:13 PM
Quote from: Heinermann on March 05, 2010, 06:42:21 PM
Quote from: Kernel64 on March 05, 2010, 01:57:14 PM
3. Change the background color of the editor. White hurts my eyes. 30% gray would be alright.
Don't ever change the colours of default form elements (edit box background for example). This is something that users can change themselves in Windows' Theme settings.

That's the problem. I have my defaults set to 30% gray. This form may not be defined to use windows' default.
#162
Also having this problem. It loads to 40%, jumps back to 25%, and CTD. Also, when I restart a match, I cannot control the units anymore. Sometimes at 9/11 supply for terran, the adjutant asks for more supply depots/overlords/pylons.

Edit: fixed.

Removing the GameData folder which contains a modded xml fixed the problem. The appropriate Base.sc2data must be there. The replay you're watching with a certain AI, must have the appropriate modded Base.sc2data for that AI, for instance.
#163
AI Development / Re: Code Snippets & Functions
March 05, 2010, 06:37:12 PM
Quote from: Aeg1s on March 05, 2010, 05:04:52 PM
Quote from: Kernel64 on March 05, 2010, 01:06:28 AM
Where do I insert these codes? Do I insert them at [race]0.galaxy?


Personally I put them in a seperate file that I just include in the [race]0.galaxy files but they can go directly in the race files if you want.

Okay, thanks. I'm also wondering how exactly you got the ChronoBoost func running without having errors. Would love to know where you put it and where you call it. And if there are other files you had to modify for it to work?
#164
AI Development / Re: AI Script Editing Tool
March 05, 2010, 06:32:04 PM
Quote from: kblood on March 05, 2010, 05:25:04 PM
Try:
http://mwolk.com/blog/advanced-notepa/


Thanks, Kblood. This is awesome. Wish I had this 15 years ago.

Again, thanks a lot!
#165
Could someone make these? If not, can someone point me to where I can learn to hack maps and set the following:

observer maps for: (1v1)
ZvZ all comps
ZvP all comps
ZvT all comps
TvP all comps
TvT all comps
PvP all comps

1v1 Player vs AI:

ZvZ Player vs. comp
ZvP Player vs. comp
ZvT Player vs. comp
TvP Player vs. comp
TvT Player vs. comp
PvP Player vs. comp

Onemap, like Lost Temple with all the above items preset would be alright.Would make testing build orders for AI development lot smoother.

Is this even possible?