Bounty hunters from Anarchies

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

Moderators: winston, another_commander

Post Reply
UK_Eliter
---- E L I T E ----
---- E L I T E ----
Posts: 1246
Joined: Sat Sep 12, 2009 11:58 pm
Location: Essex (mainly industrial and occasionally anarchic)

Bounty hunters from Anarchies

Post by UK_Eliter »

Those bounty hunters do not resume attack on a player fugitive after the player has decloaked - even if the player attacks them! But they do hail the player when the player is cloaked.
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:

Re: Bounty hunters from Anarchies

Post by Commander McLane »

UK_Eliter wrote:
Those bounty hunters do not resume attack on a player fugitive after the player has decloaked - even if the player attacks them! But they do hail the player when the player is cloaked.
Yes, I have to revisit their AI. I think it gets stuck somewhere.
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:

Re: Bounty hunters from Anarchies

Post by Commander McLane »

Hmmm. I cannot reproduce the problem. After I de-cloak the bounty hunter resumes his attack immediately.

Do you have the latest version of Anarchies installed (2.5)?
UK_Eliter
---- E L I T E ----
---- E L I T E ----
Posts: 1246
Joined: Sat Sep 12, 2009 11:58 pm
Location: Essex (mainly industrial and occasionally anarchic)

Re: Bounty hunters from Anarchies

Post by UK_Eliter »

Dear Cmr McLane

Ah yes, I should have said. Yes, I do have version 2.5 installed. And I have trunk 1.75.3.4558-dev.win32. And I am flying a Fer-de-Lance 3G+(t). (I haven't tried it with a different ship.)
User avatar
Staer9
---- E L I T E ----
---- E L I T E ----
Posts: 570
Joined: Fri Feb 18, 2011 4:53 pm
Location: Hatfield, Hertfordshire (poor industrial)

Re: Bounty hunters from Anarchies

Post by Staer9 »

The same thing happens when I cloak/decloak, they stop attacking me... but they do tell me to stop when I attack them.
Image
UK_Eliter
---- E L I T E ----
---- E L I T E ----
Posts: 1246
Joined: Sat Sep 12, 2009 11:58 pm
Location: Essex (mainly industrial and occasionally anarchic)

Re: Bounty hunters from Anarchies

Post by UK_Eliter »

I think I managed to fix the problem by altering the 'attack_ship' routine in the bounty hunter's AI. I added entries for the other two 'rolls', those entries consisting in 'performAttack'.

One more thing: do you fancy including some of the ships from my Fer-de-Lance 3G OXP - namely, those ships with the roles ferdelance3Hunter, ferdelance3HardHunter, and ferdelance3HardestHunter - as bounty hunters? By 'include' I mean: check whether my OXP is installed, and, if it is, have a chance of using one of those ships as a bounty hunter? That said, you might have to use my AI ('ferdelance3-hunterAI'); because that AI operates the cloaks that some of those ships have, and also allocates their missiles. So I reckon that the simplest thing to do - if you are at all up for the suggestion - is just to 'spawn' some ship(s) from my OXP and let my OXP handle the ships from then on. My AI does include 'I'll get you, you brigand!' type messages.
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:

Re: Bounty hunters from Anarchies

Post by Commander McLane »

UK_Eliter wrote:
I think I managed to fix the problem by altering the 'attack_ship' routine in the bounty hunter's AI. I added entries for the other two 'rolls', those entries consisting in 'performAttack'.
I wouldn't advise to do this. While in ATTACK_SHIP the AI is performing an attack anyway. It's not necessarily a good idea to have it start its attack mode over and over again.

AIs are performing one action at a time. Once a performAction command is issued to the AI, it will continue to perform this action until told otherwise (read: until a new performAction command is issued). Therefore it doesn't really make sense to repeat the same performAction command (in this case performAttack) over and over. It certainly won't intensify the attack. It may on the other hand cause the AI to break up the current action and return to the beginning of the sequence, which is not what you want.

In other words: the additional performAttacks don't actually add anything to the AI.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Bounty hunters from Anarchies

Post by Eric Walch »

Commander McLane wrote:
UK_Eliter wrote:
I think I managed to fix the problem by altering the 'attack_ship' routine in the bounty hunter's AI. I added entries for the other two 'rolls', those entries consisting in 'performAttack'.
I wouldn't advise to do this. While in ATTACK_SHIP the AI is performing an attack anyway. It's not necessarily a good idea to have it start its attack mode over and over again.
The problem is mainly in a missing "TARGET_LOST" response. It should do something similar than "TARGET_DESTROYED".

Restarting a performAttack is not by definition bad. And some stuff has been fixed in 1.75.
e.g. in the past restarting the action resulted never starting with a rear laser. That is the reason the rear laser was rarely used by npc before 1.75. because a lot of AI did restart the performAttack action on hitting the target. For 1.75 it is less bad and even results in resetting the jink position when flying away from the target. (Better evasive movement)
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:

Re: Bounty hunters from Anarchies

Post by Commander McLane »

Eric Walch wrote:
The problem is mainly in a missing "TARGET_LOST" response. It should do something similar than "TARGET_DESTROYED".
:oops: I only now realize that for some reason the AI in Anarchies 2.5 isn't up to date. It seems that I am personally working with a post-2.5 version where this issue is already fixed. Specifically I have added responses to TARGET_CLOAKED and TARGET_LOST.

So it looks like another version of Anarchies is due in the near future. I think I also wanted to check the rest of the AIs before releasing it. Anyway, if you want to fix the issue of the non-responsive Bounty Hunters, please replace the whole ATTACK_SHIP part of anarchiesBountyhunterAI.plist with the code from below (alternatively just insert the TARGET_CLOAKED and TARGET_LOST parts from below):

Code: Select all

    "ATTACK_SHIP" =     {
        ATTACKED =         (
            setTargetToPrimaryAggressor,
            "rollD: 3",
            "setStateTo: ATTACK_SHIP"
        );
        ENTER =         (
            performAttack
        );
        "INCOMING_MISSILE" =         (
            fireECM,
            fightOrFleeMissile
        );
        "ROLL_1" =         (
            "sendTargetCommsMessage: [anarchies_bountyHunter_distress]"
        );
        "TARGET_CLOAKED" =         (
            "dropMessages: TARGET_LOST",
            "commsMessage: [anarchies_bountyHunter_cloaked]",
            "setStateTo: LOOK_FOR_TARGETS"
        );
        "TARGET_DESTROYED" =         (
            "commsMessage: [anarchies_bountyHunter_triumph]",
            "setStateTo: LOOK_FOR_TARGETS"
        );
        "TARGET_LOST" =         (
            "setStateTo: LOOK_FOR_TARGETS"
        );
    };
Then insert the following into descriptions.plist:

Code: Select all

	<key>anarchies_bountyHunter_cloaked</key>
	<array>
		<string>Dirty coward! Get back!</string>
		<string>I know that you're out there.</string>
		<string>You think you're smart with that cloak? It won't last forever.</string>
		<string>Just waiting for you to decloak.</string>
		<string>Hey, my lasers are still waiting for you!</string>
	</array>
Save both files and restart Oolite while holding down SHIFT. From now on the Bounty Hunters won't lose you anymore. :twisted:
UK_Eliter
---- E L I T E ----
---- E L I T E ----
Posts: 1246
Joined: Sat Sep 12, 2009 11:58 pm
Location: Essex (mainly industrial and occasionally anarchic)

Re: Bounty hunters from Anarchies

Post by UK_Eliter »

Thanks McLane.

By the way, I am about to release a new Thargoid that, when you cloak, tries to turn your cloak off. So those guys never (well, not when they're successful in their turn-offing) lose you!
Post Reply