DarkBlizz

Game On => Land of AI => STARCRAFT II: WINGS OF LIBERTY => AI Development => Topic started by: Aeg1s on March 04, 2010, 09:37:48 PM

Title: Getting the AI to wallin
Post by: Aeg1s on March 04, 2010, 09:37:48 PM
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.
Title: Re: Getting the AI to wallin
Post by: Kernel64 on 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?
Title: Re: Getting the AI to wallin
Post by: NefiX on March 05, 2010, 07:35:47 AM
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.
Title: Re: Getting the AI to wallin
Post by: Yuna_Q on March 05, 2010, 09:02:04 AM
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.
Title: Re: Getting the AI to wallin
Post by: Aeg1s on March 05, 2010, 05:04:04 PM
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 :/