AI scripts Not Working with Patch 9?

Started by Kernel64, April 22, 2010, 09:08:04 PM

Previous topic - Next topic

Kernel64

Are you guys having problems with the AI? I can't seem to get them to work.


Kernel64

#2
I'm trying this one:

It seems that the AI stuff within the core.sc2data and all that stuff were updated as well. I'm extracting everything from the patch file and manually putting them together.

I'll report back.

Edit:

Now having problems with ShadowFlare's WinMpQ

gardenofaiur

yup, patch 9 breaks AI. Which is a shame, because now we can launch custom maps.

I've already done a clone of Garden Of Aiur, but the launchers go bizerk with player numbers.
[Garden Of Aiur] - http://www.gardenofaiur.com - The Blood Of The Fallen

Kernel64

#4
Quote from: gardenofaiur on April 22, 2010, 10:12:04 PM
yup, patch 9 breaks AI. Which is a shame, because now we can launch custom maps.

I've already done a clone of Garden Of Aiur, but the launchers go bizerk with player numbers.

I think there were just a few tweaks like the NativesLib in core/base.sc2data will try reinstalling since WinMPQ is not working.

edit:
I'm stuck. There's this error that says Invalid mainstate or something, even with the default AI.

Somehow, I'm also seeing problems when compiling a .galaxy from within the Editor. Not sure if they're both related, or if the editor supports script editing fully yet.

You guys have any luck?

ptanhkhoa

I think the problem within the launcher, there are some extensive function that the launcher do not supported. Also I think they change the way to implement code too, I even didn't see the Exit Button Screen.
Let wait for Vernam update launcher tonight, i'm eager to use the new function in this patch which very interesting  :D .

Kernel64

I'm using the LazyLaunch 2.0 and no other gui launchers. Still, I'm getting the error.

I suspect, that AI.galaxy is not being parsed.

sopen55

im goin with kernels theory.. i think its something abote the nativeslib cause i get an error related to that certain file. it also says the parameter is incorrect in timer natives

ptanhkhoa

#8
haha , I found it out Kernel, the Melee AI in liberitymod galaxy don't have the AISetMainState Function .
Quotevoid 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, 8) );

    AITransportIgnore(player, "VikingAssault");
    AITransportSetPanic(player, 0.6);
    AITransportSetReturn(player, targDPoint);
   
    AISpecifiedMakers();
    AISpecifiedHealers(player);
    AISetDefaultCombatFlags(player, true);
    AIAddDetectionDangerUnits(player);

    //AISetNukeConstants(player);
}

Instead of this he uses the AISetAllStates Function, maybe the Lazy Launcher do not know to call it from the core, just change it to the old AISetMainStates function.

I found this AISetALLState in current AI.galaxy script in the Core
Quotenative void AISetAllStates (int player, int state);

Like you said, AI.galaxy doesn not parsed, . May be I should try to copy that to the Mod folder.
I'm backing up the Patch.Archive , 800 Mb =.=' , modified something then report to you guys.

AlsoKnownAs

A week gone and everything went wild  ??? ? So we are currently stuck with Blizzard's default AI until we get an appropriate launcher for patch 9  :( ?

mtma15

Quote from: AlsoKnownAs on April 23, 2010, 07:09:01 PM
A week gone and everything went wild  ??? ? So we are currently stuck with Blizzard's default AI until we get an appropriate launcher for patch 9  :( ?

What blizzard AI are you talking about?

Kernel64

Strange. Initializing and running a Melee AI from a custom map trigger works without problems.

Somethings up. It's either they changed the map structure, or this has something to do with something else.

Someone should take a look from this angle, since I have zero idea how lazylaunch works.

Custom map trigger has this for melee start:

AIMeleeStart(3); where 3 is the AI player slot.


With the pre patch 9-10 maps:

MeleeInitAI();