Improved combat AI

Started by Aeg1s, March 09, 2010, 12:32:46 AM

Previous topic - Next topic

hd

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.

Aeg1s

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?


Yeah that should be easy; the attack waves are usually controlled by setting the AI attack state.

Kernel64


Aeg1s

As an update I've decided to hard code a graph of points of interest on the map (right now just Lost Temple but it should be easy to determine the map based on starting positions) to help create a much improved tactical AI. As a start I'm rewriting the scouting routines.


Here's the graph I'm using for Lost Temple:





Connections have a type (blue lines are air only, orange cliffs, and black normal).

Astazha

Quote from: Doix on March 09, 2010, 03:56:29 PM
Hi Aeg1s. Nice work on changing the AI stuff. Do you have a reason to use an array instead of AISetUserInt/GetUserInt?


const int c_townGather = 109;

int GetTownGather(int player) {
    AIGetUserInt(player,c_townGather);
}

void SetTownGather(int player, int town) {
    AISetUserInt(player,c_townGather,town);
}


Don't you think that is better? This way it'd work for an unlimited number of players + you're not allocating space in an array which doesn't get used (assuming there are less than 8 players).

Sorry, if it looks like I'm trying to convince you :p, had this discussion with Sylvex and he really doesn't like AISetUserInt and AIGetUserInt for a reason which is beyond my comprehension.


I have a question about this.  Why 109?  The only documentation I can find on the UserInt functions is:

const int c_playerPropMinerals              = 0;
const int c_playerPropVespene               = 1;
const int c_playerPropSuppliesUsed          = 4;
const int c_playerPropSuppliesMade          = 5;


Is 109 an arbitrary user-defined spot in that player array?  How big is it? 


If they are user-defined, should we create a thread documenting which slots are being used and by what scripts for what purpose so that conflicts can be minimized?

Aeg1s

Quote from: Astazha on March 16, 2010, 04:23:20 AM
I have a question about this.  Why 109?  The only documentation I can find on the UserInt functions is:

const int c_playerPropMinerals              = 0;
const int c_playerPropVespene               = 1;
const int c_playerPropSuppliesUsed          = 4;
const int c_playerPropSuppliesMade          = 5;


Is 109 an arbitrary user-defined spot in that player array?  How big is it? 


If they are user-defined, should we create a thread documenting which slots are being used and by what scripts for what purpose so that conflicts can be minimized?


The player prop constants aren't used for Get/SetUserInt; I think blizzard's functions are using 1-10 (I remember seeing this somewhere). 109 is just an arbitrary index in the array; I'm not sure how large of an index we can use but so far I've been using indices below 256.

Astazha

Do you know where the player prop constants are used?  I'd like to directly read mineral/gas instead of using AIHasRes()

Doix

PlayerGetPropertyInt(player, c_playerPropMinerals);

Astazha

Thank you Doix.




256 is the maximum possible index for the UserInt() functions.  Accessing anything above that returns 0.