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

#166
AI Development / Re: Map Disassembling
March 05, 2010, 04:00:31 PM
Oh, thanks. The launcher should also be placed within the \files directory.

My mod includes a modification to GameData\abildata.xml, does the launcher support other folders besides \TriggerLibs?

edit: Also, maps with these configuration would be nice:

observer maps for:
ZvZ comps
ZvP comps
ZvT comps
TvP comps
TvT comps
PvP 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

One map, like Lost Temple with all the above items preset would be nice. Would make things easier. If not, is there somewhere I can find a simple tutorial to edit maps and make the above myself?
#167
AI Development / Re: Map Disassembling
March 05, 2010, 02:16:23 PM
I get system error: code 2

The system cannot find the file specified.

my sc2 directory is not within the default install location. Could this be the reason?
#168
AI Development / Re: Help With Functions
March 05, 2010, 02:05:18 PM
is the code that tells the AI to start ordering units to attack found in
      AIGenericStock(player, nextState, e_mainSubState_GndA); ?because I have this:

Quote//This is enabled as soon as AI get more than 6 lings queued
    if ( (AITechCount(player, c_ZU_Zergling, c_techCountInProgressOrBetter) >= 12) && (AITechCount(player, c_ZU_Zergling, c_techCountCompleteOnly) > 6)   ) { // && (AITechCount(player, c_ZU_Zergling, c_techCountCompleteOnly) = 24)

        AIAddStringInt(player, c_ZU_Zergling, 6);
        AIAttackWaveAddUnits (-1, 6, c_ZU_Zergling);
        AIWaveMerge(player, c_waveMain, c_waveAttack);
        AISetAttackState(player, e_attackState_Attack);
        AIResetUserData(player);
    }
in my Zerg0.galaxy at the opening state to make the AI attack.Added this in because I wanted to stay longer in the opening state and still have the AI launch an attack, setting the transition to the next state to occur after 900 seconds.
#169
AI Development / Re: AI Script Editing Tool
March 05, 2010, 01:57:14 PM
A few first feature requests: (will update later for bugs, etc.)

1. Loading a folder instead of the mpq.
2. Load a folder, say, "\TriggerLibs" and all the files and save them into a clean base.sc2data file.
3. Change the background color of the editor. White hurts my eyes. 30% gray would be alright.
4. remove/hide line numbers.
5. Change font.

I'm using conTEXT atm, with the gray background. I'll test this more when my eyes have rested a bit.
#170
Can you notice that the carapace have tints on them? The purple ovie's carapace is purple-ish, while the orange is, well, orangey. :)

That's where the change comes from. It's the same model, but the skins are overlayed with team color as well. There might be different skins for different players?
#171
AI Scripts / Re: Advanced Melee AI 2(AMAI)
March 05, 2010, 12:40:41 PM
This AI is great, as with wc3's AMAI.

Anyway, patch 3 has had changes within the base.sc2data file. I had AMAI2's base.sc2data while updating. Would you mind uploading a clean patch#3 base.sc2data?

I get a crash when trying to watch a vs. AMAI2 replay, and the updated data as listed in the latest patch notes is not there when playing vs. AMAI2.

Thanks in advance.
#172
General Discussion / Re: SC2 Patch #3 is out
March 05, 2010, 12:31:07 PM
Getting a crash when trying to watch a replay played with vs AI. I'm using AMAI2 AI's base.sc2data.

I'm using the folder "\Triggerlibs" method next time. Would someone be so kind as to upload a clean patch3 base.sc2data?

edit: Fixed by removing TriggerLibs and GameData folder within my Starcraft II directory.
#173
AI Development / Re: Map Disassembling
March 05, 2010, 09:44:52 AM
Quote from: Yuna_Q on March 05, 2010, 09:13:18 AM
Blackcode, could u make 1vs1 ai observer map  for ai testers  with losttemple or other map?
it's very useful for test ai.
plz

Seconded.
#174
AI Development / Re: Code Snippets & Functions
March 05, 2010, 01:06:28 AM
Where do I insert these codes? Do I insert them at [race]0.galaxy?
#175
AI Development / Re: Getting the AI to wallin
March 05, 2010, 12:35:01 AM
Quote
    if( (AIHasRes (player, 300, 0) == true) && (AITechCount(player, c_ZB_Hatchery, c_techCountCompleteOnly) >= 2) ) {
        if ( AITechCount(player, c_ZB_SpineCrawler, c_techCountQueuedOrBetter) < 4) {
           AISetMainTown (player, c_townTwo);
           if ((AIGetTime() > 600) && ((AIHasRes (player, 300, 0) == true))) {
               AIBuild (player, c_makePriorityExpand, c_townMain, c_ZB_SpineCrawler, 3, c_makeDefense);
               // AISetStockEx (player, c_townOne, 5, c_ZB_SpineCrawler, c_nearChokePoint, c_makeNoFlags);
           }
        }
    }

The underlined at least makes the AI build the structure near choke points. Have you tried this?
#176
AI Development / Re: Chrono Boost working
March 05, 2010, 12:30:41 AM
Can you post them? I'd like to see.

edit: Oh, and Aeg1s, where did you put the ChronoBoost code? The one you posted on the opening post of this thread.
#177
please do. Also, where do you put the chrono boost function you posted up yesterday? I can't seem to figure out where to call it, since at Protoss0.galaxy, it makes the game blank.
#178
Quote
//--------------------------------------------------------------------------------------------------
//  *** Nexus CB ***
//--------------------------------------------------------------------------------------------------
static order ChronoBoostGate (int player, unit aiUnit) {     // gateway boosting
    unitgroup scanGroup;

    int scanCount;
    unit depot;
    order ord;
    aifilter filter;

    ord = AICreateOrder(player, "TimeWarp", 0);
    if (!UnitOrderIsValid(aiUnit, ord)) {
        return null;
    }

    filter = AIFilter(player);
    AISetFilterBits(filter, UnitFilterStr(AIAbilityStr(player, "TimeWarp", c_fieldTargetFiltersAB)));
    AISetFilterBehaviorCount(filter, c_noBehaviorMin, c_noBehaviorMax, "TimeWarp");


    scanGroup = AIFindUnits(player, "Gateway", UnitGetPosition(aiUnit),
                            AIUnitFixed(player, c_PB_Nexus, c_fieldRadius)
                            + AIAbilityFixed(player, "TimeWarp", c_fieldRange0),
                            c_noMaxCount
    );
    scanGroup = AIGetFilterGroup (filter, scanGroup);
    return AIUnitGroupGetValidOrder(scanGroup, ord, aiUnit, c_backwards);
}

static order ChronoBoostNex (int player, unit aiUnit) {     // Nexus boosting
    unitgroup scanGroup;

    int scanCount;
    unit depot;
    order ord;
    aifilter filter;

    ord = AICreateOrder(player, "TimeWarp", 0);
    if (!UnitOrderIsValid(aiUnit, ord)) {
        return null;
    }

    filter = AIFilter(player);
    AISetFilterBits(filter, UnitFilterStr(AIAbilityStr(player, "TimeWarp", c_fieldTargetFiltersAB)));
    AISetFilterBehaviorCount(filter, c_noBehaviorMin, c_noBehaviorMax, "TimeWarp");


    scanGroup = AIFindUnits(player, "Nexus", UnitGetPosition(aiUnit),
                            AIUnitFixed(player, c_PB_Nexus, c_fieldRadius)
                            + AIAbilityFixed(player, "TimeWarp", c_fieldRange0),
                            c_noMaxCount
    );
    scanGroup = AIGetFilterGroup (filter, scanGroup);
    return AIUnitGroupGetValidOrder(scanGroup, ord, aiUnit, c_backwards);
}

static order ChronoBoostCore (int player, unit aiUnit) {     // Core boosting
    unitgroup scanGroup;

    int scanCount;
    unit depot;
    order ord;
    aifilter filter;

    ord = AICreateOrder(player, "TimeWarp", 0);
    if (!UnitOrderIsValid(aiUnit, ord)) {
        return null;
    }

    filter = AIFilter(player);
    AISetFilterBits(filter, UnitFilterStr(AIAbilityStr(player, "TimeWarp", c_fieldTargetFiltersAB)));
    AISetFilterBehaviorCount(filter, c_noBehaviorMin, c_noBehaviorMax, "TimeWarp");


    scanGroup = AIFindUnits(player, "CyberneticsCore", UnitGetPosition(aiUnit),
                            AIUnitFixed(player, c_PB_Nexus, c_fieldRadius)
                            + AIAbilityFixed(player, "TimeWarp", c_fieldRange0),
                            c_noMaxCount
    );
    scanGroup = AIGetFilterGroup (filter, scanGroup);
    return AIUnitGroupGetValidOrder(scanGroup, ord, aiUnit, c_backwards);
}

void AIThinkNexus(int player, unit aiUnit, unitgroup scanGroup) {
    order ord;
    marker mark;

    if (AIEvalTacticalData(aiUnit, null)) {
        return;
    }

    if (AIIsCampaign(player)) {
        return;
    }
   
    //----for saving energy; might be useful.
    //if (AISuspectDetectionDanger(player)) {
    //    if (UnitGetPropertyInt(aiUnit, c_unitPropEnergy, c_unitPropCurrent) < 150) {
    //        return; // save for two comsats
    //    }
    //}


    // less that 120seconds only into the game, and we have a probe in production
    if ((AITechCount(player, c_PU_Probe, c_techCountInProgressOnly) == 1) && (UnitGetPropertyInt(aiUnit, c_unitPropEnergy, c_unitPropCurrent) > 25) && (AIGetTime() < 120) ) {
        ord = ChronoBoostNex(player, aiUnit);
        if (ord != null) {
            AICast(aiUnit, ord, c_noMarker, c_castHold);
            return;
        }
    }

// we have Zealot in production...
    else if (AITechCount(player, c_PU_Zealot, c_techCountInProgressOnly) == 1) {

        //mark = AIMarker(aiUnit, c_MK_PhaseShift);
        //ord = ChronoBoost(player, AIGrabUnit( player, c_PB_Gateway, c_prioNone, AIGetTownLocation(player, c_townOne) )  );
        ord = ChronoBoostGate(player, aiUnit);
        if (ord != null) {
            AICast(aiUnit, ord, mark, c_castHold);
            return;
        }
    }

    // if we have cybernetics core, and warpgate researching, target chronoboost!
    else if (AITechCount(player, c_PR_WarpGateResearch, c_techCountInProgressOnly) == 1) {
        ord = ChronoBoostCore(player, aiUnit);
        if (ord != null) {
            AICast(aiUnit, ord, mark, c_castHold);
            return;
        }
    }


}

Each structure is given it's own order. ChronoBoostNex for nexus, ChronoBoostGate for gateways, etc.

Here are the issues:
- The filter does not work with gateways. Nexus fires the ability twice on it given 50 energy.
- The AIThinkNexus clearly needs better logic so priority can be set. At this point it's who gets to have a go when the Nexus has energy to spare.

#179
Holy! Thanks a lot! I used the CC supply drop for this and just added <TacticalAIThink value="AIThinkNexus"/> into the xml.

here's the code for the Nexus's Chrono boost:

Quote
//--------------------------------------------------------------------------------------------------
//  *** Nexus CB ***
//--------------------------------------------------------------------------------------------------
static order ChronoBoost (int player, unit aiUnit) {
    unitgroup scanGroup;
    int scanCount;
    unit depot;
    order ord;
    aifilter filter;
   
    ord = AICreateOrder(player, "TimeWarp", 0);
    if (!UnitOrderIsValid(aiUnit, ord)) {
        return null;
    }

    scanGroup = AIFindUnits(player, "Nexus", UnitGetPosition(aiUnit),
                            AIUnitFixed(player, c_PB_Nexus, c_fieldRadius)
                            + AIAbilityFixed(player, "TimeWarp", c_fieldRange0),
                            c_noMaxCount
    );

    //  Filter out supply depots that are already buffed.
    //
    filter = AIFilter(player);
    AISetFilterBits(filter, UnitFilterStr(AIAbilityStr(player, "TimeWarp", c_fieldTargetFiltersAB)));
    AISetFilterBehaviorCount(filter, c_noBehaviorMin, c_noBehaviorMax, "TimeWarp");
   
    scanGroup = AIGetFilterGroup (filter, scanGroup);
    return AIUnitGroupGetValidOrder(scanGroup, ord, aiUnit, c_backwards);
}

void AIThinkNexus(int player, unit aiUnit, unitgroup scanGroup) {
    order ord;

    if (AIEvalTacticalData(aiUnit, null)) {
        return;
    }

    if (AIIsCampaign(player)) {
        return;
    }
   
    //----for saving energy; might be useful.
    //if (AISuspectDetectionDanger(player)) {
    //    if (UnitGetPropertyInt(aiUnit, c_unitPropEnergy, c_unitPropCurrent) < 150) {
    //        return; // save for two comsats
    //    }
    //}

    //  For now do supply only if we can't do mule,
    //  tempted to comment this out entirely
    ord = ChronoBoost(player, aiUnit);
    if (ord != null) {
        AICast(aiUnit, ord, c_noMarker, c_castHold);
        return;
    }
}


This goes into the TactProtAI.galaxy file.

This however applies to itself only. Any ideas on how we can control the nexus and where it casts the ability? I'm looking to manually order the nexus to cast chronoboost on specific structures at different conditions through Protoss0.galaxy
#180
Quote from: Yuna_Q on March 04, 2010, 08:16:15 AM
queen related functions at tactzergai.galaxy

Okay, I found the functions. But, Yuna_Q, I want to find the codes that call these functions.

You see, I want to use this as template for making ChronoBoost. The one discovered doesn't work.