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

Topics - SuXue

#1
1) Use SC2Launcher 2.3.1
2) Delete everything inside \Plugins\
3) Copy your AI to \Mods\AI Name\TriggerLibs\
4) Select your AI as Mod in the launcher

Notable Code changes:
1) AICombatDiffFlagCatSpecialHighPrio, etc.
2) c_diffHoldAtIdleChokes, etc.
3) AISetMaxBestAttackersLimit
4) AIDefendTown  => AIDefendWithWave
5) c_PU_Sentry, etc.
#2
HOW TO USE:
1) Use SC2Launcher 2.3.1
2) Delete everything inside \Plugins\
3) Copy AI to \Mods\AI Name\TriggerLibs\
4) Select AI as Mod in the launcher

Remember to change maps when you see bugs. AIs will often behave differently (and come with different strengths) on different maps.

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

Alpha 12 is out. Compatible with patch 10.

DO NOT mix it with any other AIs. Because all other AIs are NOT compatible with patch 10.

One issue: in patch 10 the new API won't move peons to expansions in many cases, which is terrible. I don't know any easy fixes.


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

Alpha 9 is out. Better than ever. Comments are welcome.

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

Alpha 7 is out, with earlier and more effective attacks.

Fixed many issues, including the "never attack" bug.

I suggest using the 1.26x resources cheating version for best simulation of real-life players.

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

Alpha 4 is out, with new DT / HT / 4 Gateway openings, and many issues fixed.

Writing the HT opening is particularly tough, because AIs can't use HT very effectively.

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

Alpha 3 is out.

Much, much stronger, with 4 deadly openings.

Now the only thing that can easily stop it is extreme rush... I will try to deal with it later.

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

Alpha 2 is more like a benchmark AI for AI authors, nevertheless I think it's already fairly strong at current stage.

Protoss only, hence the name. Non-cheating, but with full-map vision for debugging issues.

There are 11 (yes, eleven) openings at the moment. All the timings and building orders are quite okay.

If you can survive the first wave then most likely you will win. On the other hand, the first wave will be quite interesting, as you will see  ;)

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

#3
When I try to control the drop attack function, I notice this strange phenomenon which prevents the AI from using it.

Please let me know if any of you has been successful in using it. Thanks!
#4
I found this AI has lots of variations and strategies built into it, so playing against it is quite fun.

Expand the zip to your SC2 ROOT directory and then you can try it. :)

That is, put the "TriggerLibs" directory directly under "C:\Program Files\StarCraft II Beta".

It is only semi-non-cheating because I find this line in its source:

AISetDifficulty(player, c_diffNormalVision, false);

Hence it has full map information and can see your units all the time.
#5
I found this AI quite stronger than Starcrack or AMAI, or anything else available at the moment.

It is called Ghost AI 0.6, and it will balance its troops according to your forces and do harassment.

The Zerg and Protoss AI in it is considerably weaker but still very good.

Expand the zip to your SC2 ROOT directory and then you can play against it. That is, put the "TriggerLibs" directory directly under "C:\Program Files\StarCraft II Beta".

[EDIT: I find it still cheating. It has full map information which is why its harassment are so effective. It does not have resources bonus though.]
#6
If there could be a "super speed" tweak making the game running at 4x speed, then testing AI scripts will be far easier.

One can have a rapid view of AIs fighting each other and spot problems.



#7
AI Scripts / Fixing three issues of Starcrack v6.1.1
March 13, 2010, 02:42:28 PM
I watched multiple games of AI fighting each other, spotted quite some issues, felt like programming, and wrote some codes  :)

0) This solves the dread "kiting" issue... With it the AI will defend itself much better, especially in early stages:


void AIWaveThinkDefault (int player, wave w, int type) {

      point pHome = AIGetTownLocation(player, c_townMain);
    int pDist;
    int pDistMax = 9999999;
    int i = 1;
    unit u;
   
    if (AIWaveUnitCount(w) < 1)
    {
        return;
    }
   
      while(i <= AIWaveUnitCount(w))
       {
         u = UnitGroupUnit(AIWaveGetUnits(w),i);
         pDist = FixedToInt(DistanceBetweenPoints(pHome, UnitGetPosition(u)));
     
      //* retreat idle groups when far away from base *
      if (AIWaveGetTimeInCombat(w) == 0)
      {
        pDistMax = 32;
      }
      else
      {
        pDistMax = 38;
      }
         if ((pDist >= pDistMax) && (type == c_waveMain))
         {
        if ( (AIWaveState(w) == c_waveStateIdle) || (AIWaveState(w) == c_waveStateDefend) )
        {
          AIWaveSetType(w, c_waveStateRetreat, AIWaveTargetGatherO(player, c_townMain));
            return;
           }
         }
      i = i + 1;
      }
   
    if (type == c_waveMain) {
        AIWaveMain(player, w);
    }
    else if (type == c_waveDefend) {
        AIWaveDefend(player, w);
    }
    else if (type == c_waveAttack) {
        AIWaveAttack(player, w);
    }
    else if (type == c_waveDivert1) {
        AIWaveDivert(player, w, e_divert1State);
    }
    else if (type == c_waveDivert2) {
        AIWaveDivert(player, w, e_divert2State);
    }
    else if (type == c_waveClearObs) {
        AIWaveClearObs(player, w);
    }
    else if (type == c_waveHome) {
        AIWaveHome(player, w);
    }
}


1) The AI is not building supplies quickly enough after the middle stage of the game... After this fix one will see the AI developing faster:


void AIManageSupply (int player)
{
    string supplyType;
    string p_race = PlayerRace(player);
   
    int supply_made = PlayerGetPropertyInt(player, c_playerPropSuppliesMade);
    int supply_gap = supply_made / 9;
    if (supply_gap < 5)
    {
      supply_gap = 5;
    }
   
    if(p_race == "Terr")
    {
        supplyType = c_TB_SupplyDepot_Alias;
    }
    else if(p_race == "Prot")
    {
        supplyType = c_PB_Pylon;
    }
    else if(p_race == "Zerg")
    {
        supplyType = c_ZU_Overlord_Alias;
    }
   
    if ( (PlayerGetPropertyInt( player, c_playerPropSuppliesUsed ) >= PlayerGetPropertyInt( player, c_playerPropSuppliesMade ) - supply_gap )
        && (AITechCount ( player, supplyType, c_techCountIncompleteOnly ) == 0 ))
    {
        AISetStockUnitNext( player, AITechCount( player, supplyType, c_techCountCompleteOnly ) + 1, supplyType, c_stockAlways);
    }
}


2) The Peon management code is bugged. After this fix the AI will build more workers and use them much more effectively:


void AIBalancePeons(int player)
{
    int a = 0;
    int gas = PlayerGetPropertyInt(player, c_playerPropVespene);
    int minerals = PlayerGetPropertyInt(player, c_playerPropMinerals);
    int totalTowns = AIGetTotalTowns(player);
    int nRefinery = 0;

    int gcount = 0;
    int totalPeons = 0;
    int needPeons = 0;
    int gasPeons = 0;
    string refine;
    string worker;
    string mbase;
    string p_race = PlayerRace(player);

    if(p_race == "Terr")
    {
        refine = "Refinery";
        worker = "SCV";
        mbase = c_TB_CommandCenter_Alias;
    }
    else if(p_race == "Prot")
  {
        refine = "Assimilator";
        worker = "Probe";
        mbase = c_PB_Nexus;
  }
  else if(p_race == "Zerg")
  {
        worker = "Drone";
        refine = "Extractor";
        mbase = c_ZB_Hatchery_Alias;
  }
 
  a = 0;
    while(a != 8 )
    {
    gasPeons = 0;
        if (AIGetTownState(player, a) == c_townStateEstablished)
        {
      nRefinery = AIGetBuildingCountInTown(player, a, refine, c_techCountCompleteOnly);
          if(AIGetCurPeonCount(player, a) > 12)
            {
                AISetStockEx (player, a, 2, refine, c_makeCollector, 0);
        if (gas > minerals + 1200)
              {
                gasPeons = 0;
              }
        else if (gas > minerals + 900)
              {
                gasPeons = 1;
              }
        else if (gas > minerals + 600)
              {
                gasPeons = 2;
              }
              else if (gas > minerals + 300)
              {
                gasPeons = 3;
              }
              else
              {
                gasPeons = 3 * nRefinery;
              }
            }
            else if(AIGetCurPeonCount(player, a) > 6)
            {
                AISetStockEx (player, a, 1, refine, c_makeCollector, 0);
                gasPeons = 3;
            }
            else
            {
                gasPeons = 0;
            }
        }
        AISetGasPeonCountOverride(player, a, gasPeons);
        a = a + 1;
    }

    //making zerg spam hatchs
    //AISetStockUnitNext(player, totalTowns, mbase ,c_stockIdle);
   
    // build peons
  totalPeons = AITechCount (player, worker, c_techCountCompleteOnly);
    if(p_race == "Zerg")
    {
            needPeons = totalTowns * 28;
    }
    else
    {
            needPeons = totalTowns * 33;
    }
    if (needPeons > 90)
    {
        needPeons = 90;
    }
    if (needPeons < totalPeons)
    {
        needPeons = totalPeons;
    }
    AISetStockUnitNext(player, needPeons, worker, c_stockAlways);
}