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

#16
As far as I'm aware, you won't be able to save data from within the scripting engine. Which means, without using third party software, you couldn't feasibly do what you're describing. The AI we're able to put in will be unable to "learn" because it has no way of saving or storing information about what is going on. While a truly adaptive AI would be fun to develop, it's just not do-able.
#17
Quote from: Kernel64 on March 12, 2010, 04:36:52 PM
That's very interesting! Can you explain more on creating triggers, what triggers are?

a trigger is exactly how it sounds. they are "triggered" once specific conditions are met. they're like if statements but usually just lie in way for conditions to be met and then they ... "trigger"
#18
AI Development / Re: Improved combat AI
March 12, 2010, 09:29:49 PM
Quote from: Kernel64 on March 12, 2010, 04:38:43 PM
Do you guys know how to make multiple waves? Like, two main attack waves, one for main attack and the other for back door drops?

Or is this even possible?

How do we control attack waves?

waveDivert1 and waveDivert2 are already in the game for harassing / drop attacks.
#19
...but why not just do...

if (AITechCount(player, c_ZU_Drone, c_techCountInProgressOrBetter) >= 10)
{
    AISetStock(player, 2, c_ZU_Overlord);
}

if (AITechCount(player, c_ZU_Overlord, c_techCountInProgressOrBetter) >= 2)
{
    AISetStock(player, 1, c_ZB_SpawningPool);
}

if (AITechCount(player, c_ZB_SpawningPool, c_techCountInProgressOrBetter) >= 1)
{
    AISetStock(player, 13, c_ZU_Drone);
}

if (AITechCount(player, c_ZU_Drone, c_techCountInProgressOrBetter) >= 13)
{
    ASetStock(player, x, whatever);
}


^ that ensures the same thing without convoluted functions. you can essentially stack those in the order in which you want. with custom states set up, you could easily set up an entire early game build order just like that and then another build order for something else and have it randomly pick between the 2 or even give each build a % chance of occurring. From there go into either specific mid games based on which early game was chosen or go in to a random mid game.

my point being, most of your functions already exist in a less complex way.
#20
I don't get why you have half the functions you do...
#21
AI Development / Unit speed
March 11, 2010, 03:02:31 PM
Anyone know if there's a way to get unit speed besides me creating my own function that returns the values listed in the unitdata.xml?
#22
AI Development / Re: Improved combat AI
March 10, 2010, 11:28:38 PM
Quote from: Astazha on March 10, 2010, 11:17:44 PM
From what I've seen of the scouting AI so far, it's pretty weak.  I've been playing with that flag today, trying to get the AI to even scout all expansion locations with multiple scouts and I haven't been able to do it, even when it can operate largely unopposed.


I agree with the priorities, I just think that in the longer term the AI will need a framework to become really good.  The beauty of modularity is that it allows the contributors to focus on what interests them.


The reason I'm interested in scouting is because it relates to the attack logic.  Not just from a unit counter standpoint, which is complicated, but because the AI needs to be taking out expansions.  The current Starcrack AI often doesn't even know that I have expansions unless it stumbles into them accidentally.  Especially on maps with hidden island expansions, you can just set up camp there and be left alone more or less indefinitely, even if all of your ground accessible bases have been destroyed.  I'd like to teach the AI to exhibit better map control.

I don't think that it's that the AI doesn't know about the expansion but rather it's not told to attack it.
#23
AI Development / Re: Improved combat AI
March 10, 2010, 09:32:05 PM
Quote from: Astazha on March 10, 2010, 09:10:24 PM
I'm extremely interested in this.  I just got an MPQ editor and started poking around the day before yesterday so it will take me some time to get up to speed, but I'm envisioning a modular AI with multiple states to track, and a priority based system of control.


The key part is to make it modular in such a way that multiple people can work on it.


I'd also like to deal with the unknown.  The priority of scouting changes dramatically if you haven't seen your opponent's army in the last 10 minutes, or if it's been that long since you've verified what expansions they have. 


Assumptions can also be made about what the player is building based on how far into the game we are, what the race is, and what units have been seen (particularly recently.)  There might also be some anticipatory functions.  If I just exposed my Brood Lords to my opponent for the first time then I expect an uptake in anti-air.  Doubly so if they wiped out his expansion.


Over time the behavior can be tuned by adjusting constants and multipliers.  We'll also be able to set different versions of play just by tweaking values for Aggressiveness or Defensiveness, and to change those values based on what happens in game.


Initially in creating the framework we can make dummy function that always return "yes, you should be scouting now." or return a random build order.  Once the structure is in place we can begin to refine the individual components.


I don't have anything concrete right now, but this is the direction I'm thinking in.

By turning e_flagsScouting, or something along those lines, on and off, it will scout or stop scouting.

Personally, I think the top priority is attack logic, then build logic. Responding to what the opponent does should be last. I assure you, with good attack logic and build logic, the AI will be pretty tough while response logic alone won't really do much with out giving the AI extra resources to pump massive units.
#24
AI Development / AIDefenseThreat
March 10, 2010, 07:33:00 PM
Anyone know exactly how this function works?
#25
Quote from: Kernel64 on March 10, 2010, 03:24:07 AM
It does. My above post is really not refined nor exactly useful (sort of inductive). They're vague concepts still, as I'm yet trying to get a handle on the whats that gets swapped around within the first 5mins of the game.

Anyway, I'll post what I find.

The first 5 minutes of the game really isn't that big of a deal. It's pretty straight forward.

1.) Rush or no rush.
2.) Fast expand or no fast expand
3.) Harass or no harass.

That's all early game consists of. It's really hard to combine all three of those in a single game and to some extent, harassing and rush are almost hand in hand. Drops, nukes, pressure, map control, trapping someone inside their base, teching... those are all middle game.
#26
AI Development / Re: Improved combat AI
March 09, 2010, 04:44:54 PM
Quote from: Aeg1s on March 09, 2010, 03:42:17 PM
Quote from: hd on March 09, 2010, 12:51:59 AM
I am curious how you set the gather location and I assume it can be adjusted on the fly...


I just made a function to set which town the attack waves gather at (it was using c_townMain). So once your nat goes up you can just call it and set it to the natural and they'll start gathering outside of it.

I wonder, can we set a location like UnitGetPosition(UnitGroupUnit(AIWaveGetUnits(c_waveAttack), RandomInt(1, AIWaveUnitCount(c_waveAttack)))) and modify it to be a little ways back towards their main base so we can set a rally location not too far from where they last fought if an attack was successful.

For example...

point hdGetOffensiveGatherLocation(int player, wave w)
{
    point pHome = AIGetTownLocation(player, c_townMain);
    point pWave = UnitGetPosition(UnitGroupUnit(AIWaveGetUnits(w), RandomInt(1, AIWaveUnitCount(w))));
    point pTest = PointAlongLine(pHome, pWave, DistanceBetweenPoints(pHome, pWave) * 0.9);
   
    // hd: return 90% of the distance between where the wave is and where the wave is from but make sure it's pathable.
    if (AIFilterPathable(AIWaveGetUnits(w), pTest))
    {
        return pTest;
    }
   
    // hd: otherwise, go recursive subtracting some distance until we find a pathable spot
    // TODO add recursive check
}
#27
Quote from: Kernel64 on March 09, 2010, 05:37:47 AM
Cool.

I'm currently needing a function that returns the free available food supply with two conditions:

Now -- the number of free resource from hatch/lair/Hive + ovies already completed.
Soon -- Now + number of ovies in queue or already in production.

I'm using this to test a script that will only spawn lings when necessary, and depending on the number of what target it needs to counter and the counter value for ling vs that specific target in question.

Also, one question, will two while blocks run simultaneously?

Say,

while(A) {
   do(x)...
}
while(!B) {
   do(y)...
}

Will do(x) and do(y) run simultaneously?

No like that. It will run the code in the order it's typed. while(a) will run, finish then while(!b) will run.

You can however put

while(a) {
    while(!b) {
    }
}
#28
AI Development / Re: Improved combat AI
March 09, 2010, 02:19:06 AM
Quote from: Aeg1s on March 09, 2010, 12:36:06 AM

Ability Improvements:
Guardian Shield
function for the Sentry:
http://pastebin.com/dEJeJLG0
(As of right now the sentry will default to using the Guardian Shield. Also, all sentries with enough energy in a group will use it as soon as possible; I intend to fix this soon.


include and add the following to the begging of AIThinkDisruptor in TactProtAI.galaxy:


    if (GuardianShield(player, aiUnit, scanGroup)) {
        return;
    }



Todo:
-Command Centers lift off when under attack.

As for the cc lifting, one thing you should keep in mind is to do a sweep around the command center for vikings, phoenix and whatever teh zerg one is called

you need to do a risk reward analysis for lifting the cc, in some situations it might be more beneficial to the ai to keep it on the ground rather than lift off.
#29
AI Development / Re: Improved combat AI
March 09, 2010, 12:51:59 AM
i've almost completely finished my early game attack rush logic and afterwords am going to work on harassment logic. i think getting at least the early and mid game attack logic should be our first priority.

i also have a few ideas for build logic once i get a usable early/mid attack logic. I plan on making a few posts with code / details once its a little bit more polished. I am curious how you set the gather location and I assume it can be adjusted on the fly...
#30
Quote from: Neverborn on March 08, 2010, 10:50:24 PM
Quote from: hd on March 08, 2010, 10:47:09 PM
Yes we can. why would you even post a thread like this?


Did you even read it? I posted it because it's something that none of the AIs I've seen are taking advantage of. They could be much stronger and play much more intelligently.

Yes they could... and you're an ass for coming in here and assuming we aren't trying to do that. I've seen several people on these boards researching, posting their finds, doing trial and error, all to get a more realistic AI. Day after day we're writing hundreds to thousands of lines of code trying to create solid attack logic, build logic and response logic. And you come in here, apparently opting not to read the threads in here and make a post essentially saying we're not succeeding.

People were crying over how bad the ai is, people here made one that wasn't complete crap.

If you want one that's more realistic sooner, you can write thousands of lines of code with reference material that only contains a third of the information needed, you can spend hours writing code, doing trial and error, launching sc2 hundreds of times just to test minor little changes incase there's a syntax or spelling error.

Unless you have something to contribute besides blatantly obvious statements, I'd suggest you leave this to the people who are contributing and working very hard to make a solid ai.