Tested your AI, it very good, it keeps a distance from the enemy base but it keep dancing too much, can you fix that problem ? . Also I included your AI to Green Tea for testing, hope you don't mind.
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 MenuQuotevoid AIMeleeStart (int player) {
point targDPoint;
point targOPoint;
wavetarget targD;
wavetarget targO;
if (DEBUG) {
DebugMeleeInit();
}
AIStart(player, false, DifficultyAPM(PlayerDifficulty(player)));
if (PlayerDifficulty(player) >= c_skirCheater) {
AIHarvestBonus(player, 2.0);
}
AISetDifficulty(player, c_diffNormalVision, (PlayerDifficulty(player) != c_skirCheater));
AISetDifficulty(player, c_diffLimitAPM, (PlayerDifficulty(player) != c_skirCheater));
AISetDifficulty(player, c_diffSpotChangelings, (PlayerDifficulty(player) >= c_skirVeryHard));
AISetDifficulty(player, c_diffWaveAvoidDanger, (PlayerDifficulty(player) >= c_skirHard));
AISetDifficulty(player, c_diffFleeDamage, (PlayerDifficulty(player) >= c_skirHard));
AISetDifficulty(player, c_diffEarlyDefenseScout, (PlayerDifficulty(player) >= c_skirHard));
AISetDifficulty(player, c_diffUseExtraScouts, (PlayerDifficulty(player) >= c_skirHard));
AISetDifficulty(player, c_diffHoldAtIdleChokes, (PlayerDifficulty(player) >= c_skirHard));
AISetDifficulty(player, c_diffPressForward, (PlayerDifficulty(player) >= c_skirMedium));
AISetDifficulty(player, c_diffFleeWorkers, (PlayerDifficulty(player) >= c_skirMedium));
AISetDifficulty(player, c_diffFleeDanger, (PlayerDifficulty(player) >= c_skirMedium));
AISetDifficulty(player, c_diffRepairDamage, true);
AISetDifficulty(player, c_diffOptimizeGas, true);
AISetDifficulty(player, c_diffDefendWithPeons, true);
AISetDifficulty(player, c_diffEnableDangerMap, true);
AISetDifficulty(player, c_diffNormalTargetPrio, true);
AISetDifficulty(player, c_diffAllowResourceReq, true);
AISetDifficulty(player, c_diffAutoLoadBunkers, false);
AISetDifficulty(player, c_diffEarlyGameRepair, false);
//AISetFlag(player, e_flagsRunScared, AIDiffThreshold(player, false, c_skirVeryHard, true));
AISetFlag(player, e_flagsRunScared, false); // TODO fix scared and re-add this
AISetFlag(player, e_flagsLateScout, false);
AISetFlag(player, e_flagsClearObs, false);
AIDeclareTown(player, c_townOne, PlayerStartLocation(player));
AISetMainTown(player, c_townOne);
AIHarvest(player, c_townOne);
AISetNumScouts(player, 1);
AIScout(player);
AISetAllStates(player, 1);
targDPoint = AIWaveTargetGatherDPoint(player, c_townMain);
targOPoint = AIWaveTargetGatherOPoint(player, c_townMain);
targD = AIWaveTargetGatherD(player, c_townMain);
targO = AIWaveTargetGatherO(player, c_townMain);
AIWaveSet(player, c_waveMain, AIWaveCreate(AIWaveInfoCreate(), player, targOPoint));
AIWaveSet(player, c_waveAttack, AIWaveCreate(AIWaveInfoCreate(), player, targOPoint));
AIWaveSet(player, c_waveDivert1, AIWaveCreate(AIWaveInfoCreate(), player, targOPoint));
AIWaveSet(player, c_waveDivert2, AIWaveCreate(AIWaveInfoCreate(), player, targOPoint));
AIWaveSet(player, c_waveClearObs, AIWaveCreate(AIWaveInfoCreate(), player, targOPoint));
AIWaveSet(player, c_waveHome, AIWaveCreate(AIWaveInfoCreate(), player, targDPoint));
AIWaveSet(player, c_waveDefend, AIWaveCreate(AIWaveInfoCreate(), player, targDPoint));
AIWaveSetType(AIWaveGet(player, c_waveMain), c_waveStateIdle, targO);
AIWaveSetType(AIWaveGet(player, c_waveAttack), c_waveStateIdle, targO);
AIWaveSetType(AIWaveGet(player, c_waveDivert1), c_waveStateIdle, targO);
AIWaveSetType(AIWaveGet(player, c_waveDivert2), c_waveStateIdle, targO);
AIWaveSetType(AIWaveGet(player, c_waveClearObs), c_waveStateIdle, targO);
AIWaveSetType(AIWaveGet(player, c_waveHome), c_waveStateIdle, targD);
AIWaveSetType(AIWaveGet(player, c_waveDefend), c_waveStateIdle, targD);
AISetMaxBestAttackersLimit(player, AIMeleeDiffSelect(player, 1, 1, 2, 4, 6, );
AITransportIgnore(player, "VikingAssault");
AITransportSetPanic(player, 0.6);
AITransportSetReturn(player, targDPoint);
AISpecifiedMakers();
AISpecifiedHealers(player);
AISetDefaultCombatFlags(player, true);
AIAddDetectionDangerUnits(player);
//AISetNukeConstants(player);
}
Quotenative void AISetAllStates (int player, int state);
Quoteconst int c_invalidConversationId = 0;
const int c_invalidReplyId = 0;
const int c_conversationReplyStateUnread = 0;
const int c_conversationReplyStateRead = 1;
const int c_conversationReplyStateOld = 2;
native int ConversationCreate (bool visible);
native int ConversationLastCreated ();
native void ConversationDestroy (int intId);
native void ConversationDestroyAll ();
native void ConversationShow (int intId, playergroup to, bool visible);
native bool ConversationVisible (int intId, int player);
native int ConversationReplyCreate (int intId, text inText);
native int ConversationReplyLastCreated ();
native void ConversationReplyDestroy (int intId, int replyId);
native void ConversationReplyDestroyAll (int intId);
native void ConversationReplySetText (int intId, int replyId, text inText);
native text ConversationReplyGetText (int intId, int replyId);
Quotenative point Point (fixed x, fixed y);
native point PointWithOffset (point p, fixed x, fixed y);
native point PointWithOffsetPolar (point p, fixed distance, fixed angle);
native point PointFromId (int id);
native fixed PointGetX (point p);
native fixed PointGetY (point p);
native void PointSet (point p1, point p2);
native fixed PointGetFacing (point p);
native void PointSetFacing (point p, fixed inFacing);
native fixed PointGetHeight (point p);
native void PointSetHeight (point p, fixed inHeight);
native bool PointsInRange (point p1, point p2, fixed range);
native fixed AngleBetweenPoints (point p1, point p2);
native fixed DistanceBetweenPoints (point p1, point p2);
native int PointPathingCost (point p1, point p2);
native fixed PointPathingCliffLevel (point p);
native bool PointPathingPassable (point p);
native bool PointPathingIsConnected (point p1, point p2);
native point PointReflect (point source, point dest, fixed angle);
Quotenative fixed SquareRoot (fixed x);
native fixed Pow (fixed x, fixed power);
native fixed ModF (fixed x, fixed m);
native fixed MinF (fixed x1, fixed x2);
native fixed MaxF (fixed x1, fixed x2);
native fixed AbsF (fixed x);
native int ModI (int x, int m);
native int MinI (int x1, int x2);
native int MaxI (int x1, int x2);
native int AbsI (int x);
// Trigonometry
// Note: All angles are in degrees
native fixed Sin (fixed degrees);
native fixed Cos (fixed degrees);
native fixed Tan (fixed degrees);
native fixed ASin (fixed x);
native fixed ACos (fixed x);
native fixed ATan (fixed x);
native fixed ATan2 (fixed y, fixed x);
Quotenative region RegionEmpty ();
native region RegionEntireMap ();
native region RegionPlayableMap ();
native void RegionPlayableMapSet (region r);
native region RegionRect (fixed minx, fixed miny, fixed maxx, fixed maxy);
native region RegionCircle (point center, fixed radius);
native region RegionFromId (int id);
native void RegionAddRect (region r, bool positive, fixed minx, fixed miny, fixed maxx, fixed maxy);
native void RegionAddCircle (region r, bool positive, point center, fixed radius);
native void RegionAddRegion (region r, region regToAdd);
native void RegionSetOffset (region r, point offset);
native point RegionGetOffset (region r);
native bool RegionContainsPoint (region r, point p);
// RegionRandomPoint attempts to find a random point somewhere within the region. For regions
// containing only a single positive shape, this is guaranteed to work, but for more complex
// sets of shapes it may give up after a maximum number of tries and return (0, 0).
//
native point RegionRandomPoint (region r);
native point RegionGetBoundsMin (region r);
native point RegionGetBoundsMax (region r);
native point RegionGetCenter (region r);
// Setting the center will adjust the offset such that
// the region becomes centered on the given point.
//
native void RegionSetCenter (region r, point p);
// RegionAttachToUnit will attach the region to the given unit such that the region center
// is always at the unit's position plus the given offset. Use a null unit to detach the region
// from whatever unit it may already be attached to.
//
native void RegionAttachToUnit (region r, unit u, point offset);
native unit RegionGetAttachUnit (region r);
QuotePretty cool. Hopefully one day AIs can block chokepoints.@Suxue:
QuoteChainaw,Yeah, it is possible. The most apparent work-around is typing something. As simple as 1,2,3, or Enter, 12, Enter, will then set the AI to the 12th opening, which then leads to the 12th tier 1.5, and so forth.