Help with AI wanted

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

Help with AI wanted

Post 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
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post 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.
User avatar
TGHC
---- E L I T E ----
---- E L I T E ----
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Post 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
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post 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.
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

...

Post 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
Post Reply