Page 1 of 1

Help with AI wanted

Posted: Fri Jun 13, 2008 10:02 pm
by Lestradae

Code: Select all

{
    "ATTACK_SHIP" = {
        "ENERGY_LOW" = ("setStateTo: FLEE");
        ENTER = (performAttack);
        EXIT = ();
        "INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE");
        "TARGET_DESTROYED" = ("setStateTo: DOCK_WITH_STATION");
        "TARGET_LOST" = ("setStateTo: DOCK_WITH_STATION");
        UPDATE = ();
    };
    "DOCK_WITH_STATION" = {
                "ACCEPT_DISTRESS_CALL" = (setTargetToFoundTarget, "commsMessage: [policecondor-plea]", "setAITo: NavyInterceptAI.plist");
                ATTACKED = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
                ENTER = (setTargetToStation, "setDesiredRangeTo: 5000.0", performIntercept);
                "DESIRED_RANGE_ACHIEVED" = ("setAITo: dockingAI.plist");
                EXIT = ();
        "INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE");
                UPDATE = ();
        };
    FLEE = {
        "ENERGY_FULL" = ("setStateTo: ATTACK_SHIP");
        "TARGET_LOST" = ("setStateTo: DOCK_WITH_STATION");
        "TARGET_DESTROYED" = ("setStateTo: DOCK_WITH_STATION");
        ENTER = (performFlee);
        EXIT = ();
        "INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE");
        UPDATE = ();
    };
    GLOBAL = {ENTER = (setUpEscorts, "commsMessage: [policecondor-plea]", "setStateTo: ATTACK_SHIP"); EXIT = (); UPDATE = (); };
}
Hi,

this is the SwatCondorAI.plist ...

Found a typo in there, want to be sure not to overlook anything else.

Could someone in the know have a quick glance at this and tell me if all is OK?

Work on Realistic Shipyards 3.02 has started, can use a bit of help here and there while bugfixing ...

Thanks in advance

L

Posted: Sat Jun 14, 2008 5:56 am
by Commander McLane
Hmm. The biggest problem seems to be that it is only half of an AI. When the Condor is spawned it goes immediatly into attack-mode. What if there is nothing to attack? Then it goes docking. What's completely missing is sort of a PATROL-state as its default state, before it goes attacking.

Posted: Sat Jun 14, 2008 8:55 pm
by TGHC
You mean like hide behind an asteroid and pounce on an unsuspecting victim!




p.s. I missed out the u in pounce when I first typed this, good thing I previewed it first...... :D

Posted: Mon Jun 16, 2008 7:49 am
by Eric Walch
It looks mostly OK to me. It just depends how you use it. Look at Oolites internal policeInterceptAI.plist. Your one is just a copy with additions of commsMessages.

In this current state it can only be used with defense-ships. They have a target on launch. But for a defense-ship you cant use setUpEscorts. That way you would have a launching ship that suddenly out of nothing adds escorts out of nothing.

If it was not mend as defense-ship that McLanes comment applies.

...

Posted: Mon Jun 16, 2008 8:14 am
by Lestradae
Thanks for your feedback(s)!

I will possibly give the SWATCondor one of the police AI`s and tell it to patrol back to the witchpoint instead of docking.

It was meant to be a powerful police carrier, so.

:idea:

L