Getting the AI to wallin

Started by Aeg1s, March 04, 2010, 09:37:48 PM

Previous topic - Next topic

Aeg1s

Does anyone have any ideas on how we might go about this? I've looked at it and from what I've seen it just isn't possible :(


I can't find any function that lets us specify a point for the building (unless we could manually create the build order specifying the target point?). We'd also need the actual points which would probably need to be hard coded per map (is there even a way to get the map) or, I saw reference to being able to add regions to the map and referencing them in code?


The exposed code doesn't seem to have any concept of the maps topography either except for the function CliffLevel.

Kernel64

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?

NefiX

I was experimenting with build flags, but none of them points to the base entrance. You can try combining them like this:
AISetStockEx(player, c_townMain, 1, c_TB_Bunker, c_nearFarDefense | c_avoidCloseDefense | c_nearFarPowerOrCreep, c_noFlags);
But I don't think you will get it right, blizzard didn't implement c_nearEntrance.

Yuna_Q

AIGetDefaultBuildFlags function at buildai.galaxy

Quote
    if (objType == c_TB_Bunker) {
//        return c_makeDefense;
     return c_nearChokePoint;
    }

i was test this , it's good works except south base.

Aeg1s

Yeah, I've seen (and used) the build flags but they still don't make a wall in. I think that's the best we're going to get though :/