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

#31
Quote from: turdburgler on March 18, 2010, 06:31:16 PM
Guys, you can't take functions from other AIs, change them a little then put your name on the end.

You really should credit the original maker of the function.

it's not made by me, but I agree with you.
#32
Quote from: Doix on March 17, 2010, 01:22:46 PM
I made a little program for this:

http://www.mediafire.com/?mumominmnm5

No gui or anything. Just run starcraft 2, then run my program. Press + + twice to get to top speed. Top speed is about 4 times faster than what it would normally be.

Enjoy :) .

Great. Can you add a hotkey for 4x speed, a hotkey for 1x speed, and a hotkey for 0.25x speed?
#33
AI Scripts / Re: IAI v2.0c (Beta release)
March 17, 2010, 10:32:38 PM
Quote from: DarkZeros link=topic=1218.msg10863#msg10863   date=1268850585
PD: I just tried a roach attack, and the AI response   was -> lots of immortals,
then I tryed a Battlecruiser attack   -> VoidRays :P

What if the player goes mass mutalisk after roach?  ;)

I think a good AI shall do more scouting   (to find whether the player is upgrading its troops), and only build   around 50% of forces using the reaction system. The other 50% shall be   some standard mixture of units, and better be some high-tech units in   the end game with strong anti-air and anti-ground attacks, such as mothership + mass carriers.
#34
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.
#35
Quote from: WeakNiZ on March 17, 2010, 07:07:27 PM
Where do I put the folder?

put the TriggerLibs directly under "C:\Program Files\StarCraft II Beta".
#36
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.]
#37
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.



#38
Quote from: godspiral on March 13, 2010, 09:50:02 PM
The first 2 are interesting.  I hope they're good, but I can't tell just looking.

The gas one I disagree with.  First, it should only ever consider removing gas workers if there are fewer than 2 per patch on minerals (18 usually).  Even then, it should focus on spending gas unless it has one base and is struggling to replace dead mineral workers.  Also, 3 workers on gas saturates it on every map released so far.

I have found the AI with 500+ gas and 100- minerals multiple times, especially during Terran opening stages... there is no way to spend these gas with such limited minerals
#39
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);
}