Yes we can. why would you even post a thread like this?
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 MenuQuote from: Kernel64 on March 08, 2010, 11:08:11 AM
Nah, I think the AI needs to cheat since it has no memory like humans have. We actually become cheaters when we get the gameplay down like in SCBW.
We always know what to expect, where things are, what things are likely to be, because of experience. The AI doesn't have this, so having it cheat balances things out.
Besides, the AI has very limited micro control.
HD, thanks again. I'll try it all over again. Actually, I had difficulty set for the vision to false. This means the AI should see.
It triggered sometime when I had a significantly larger base than it has: 1 hatch + 6 drones vs my 3 pylons + 14 probes.
int howManyPlayers(int player)
{
int iCount = player;
while (iCount < 12)
{
// echo a msg in game as to the value of PlayerRace() on a null value, then filter out the null value.
if (PlayerRace(iCount) == "Prot" || PlayerRace(iCount) == "Terr" || PlayerRace(iCount) == "Zerg")
{
iCount = iCount + 1;
}
else
{
TriggerDebugOutput(1, StringToText("Invalid race found @ " + IntToString(iCount)), true);
return iCount;
}
return iCount;
}
Quote from: Kernel64 on March 08, 2010, 04:45:41 AM
I'm confused about OrderSetTargetUnit(). But maybe I'm doing something wrong, somewhere else though.
Also, I was trying this one:Quote
if ((AIGetTime() > 0) && (AIGetTime() < 340) &&
( AIKnownUnitCount(player, AIEvalLargestEnemy(player), c_PU_Probe) >= 1)
) {
TriggerDebugOutput(2, StringToText("Enemy is Toss!"), true);
}
Doesn't seem to work. I hate myself.
Quote from: 1337 on March 08, 2010, 05:10:15 AMQuote from: Aeg1s on March 05, 2010, 05:02:17 PMAlso, all variables have to be declared at the top of the function before anything else.QFE - you will forget this one so many times.
Variables must be declared like this:
int a;
int b;
point p;
unitgroup g;
p = PlayerStartLocation(player);
This code doesn't work:
int a;
int b;
point p = PlayerStartLocation(player);
unitgroup g;
One more gotcha, don't try to assign the value of functions that return fixed to int variables. For example:
int dist;
dist = DistanceBetweenPoints(UnitGetPosition(u2), UnitGetPosition(u1)); //error
dist = FixedToInt(DistanceBetweenPoints(UnitGetPosition(u2), UnitGetPosition(u1))); //works
You will have to look up the function declarations to see which ones return a fixed...
void ProtossCheckSupply(int player, int iSafe)
{
int iMaxSupply = AITechCount(player, c_PB_Nexus, c_techCountInProgressOrBetter) * 10 + AITechCount(player, c_PB_Pylon, c_techCountInProgressOrBetter) * 8;
if (iMaxSupply - PlayerGetPropertyInt(player, c_playerPropSuppliesUsed) < iSafe)
{
AISetStock(player, AITechCount(player, c_PB_Pylon, c_techCountQueuedOrBetter) + 1, c_PB_Pylon);
}
}
Quote from: DarkZeros on March 07, 2010, 07:51:09 AM
The tool seems interesting. But there is an easyer way to edit the galaxy files without opening the MPQ.
I place the files in /SC2_DIR/TriggerLibs/ when the game needs a file, first searcher its main dir. So, no need to put the files inside the MPQ.
Quote from: 1337 on March 06, 2010, 08:32:41 PM
Name says it all, I want to know how to check how many units/upgrades are in the build queue at a particular building. I'm writing a Chrono Boost func that prioritizes based on what units are being built.
void ProtossCastChronoBoost(int player)
{
if (AITechCount(player, c_PU_Zealot, c_techCountQueuedOrBetter) > 0)
{
// cast chrono boost on gateway
return;
}
if (AITechCount(player, c_PU_Stalker, c_techCountQueuedOrBetter) >0)
{
// cast chrono boost on gateway
return;
}
}
ProtossCastChronoBoost(player);
void ProtossChronoBoostCheck(int player)
{
bool bFound = false;
int iBuildingCount = 0;
int iCount = 0;
string sBuildingList[x];
unit uChronoBoost;
order oChronoBoost;
sBuildingList[0] = c_PB_Gateway;
sBuildingList[1] = c_PB_RoboticsFacility;
sBuildingList[2] = c_PB_Nexus;
iBuildingCount = 3;
while (iCount < iBuildingCount && !bFound)
{
uChronoBoost = AIGrabUnit(player, sBuildingList[iCount], c_prioNone, null);
iCount = iCount + 1;
// get unit property and check it
// maybe try UnitOrderCount(aiUnit) > 0
if (UnitOrderCount(uChronoBoost) > 0)
{
bFound = true;
}
}
if (bFound)
{
oChronoBoost = AICreateOrder(player, "TimeWarp", 0);
OrderSetTargetUnit(oChronoBoost, uChronoBoost);
if (UnitOrderIsValid(uChronoBoost, oChronoBoost))
{
// casting chrono boost
AICast(uChronoBoost, oChronoBoost, c_noMarker, c_castHold);
}
}
}
Quote from: Kernel64 on March 06, 2010, 04:05:29 PM
What if we make the script omniscient first, then add in the simulation later? It will check as the script rolls and gets updated of what's on the board all the time.
It should then do what it considers the best set of actions based on some rating.
I'll post the full concept of this later, after some rest.
Quote from: Kernel64 on March 06, 2010, 01:32:00 PM
Thanks, Heinermann!
This is brilliant,Hd! So, with the wavethink function, we can use the evalLargestenemy to get the enemyPlayer.
The WaveThink tries to simulate a LoS awareness for the AI. It doesn't remember what he had before, and constantly needs to see units in order to decide, if I'm not mistaken?
Have you tested the WaveThink yet?
I'm trying to discover how the functions involving waves and their strengths and ratios, for the purpose of having the AI evaluate itself, with regards to what it has vs. the enemy atm.
Waves in retreat, in the base, attacking, divert, etc.