Page 1 of 1

Bounty hunters from Anarchies

Posted: Sun Jun 12, 2011 7:12 pm
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.

Re: Bounty hunters from Anarchies

Posted: Sun Jun 12, 2011 9:04 pm
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.

Re: Bounty hunters from Anarchies

Posted: Sun Jun 12, 2011 9:22 pm
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)?

Re: Bounty hunters from Anarchies

Posted: Sun Jun 12, 2011 9:36 pm
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.)

Re: Bounty hunters from Anarchies

Posted: Mon Jun 13, 2011 6:10 am
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.

Re: Bounty hunters from Anarchies

Posted: Mon Jun 13, 2011 11:55 am
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.

Re: Bounty hunters from Anarchies

Posted: Thu Jun 16, 2011 8:41 am
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.

Re: Bounty hunters from Anarchies

Posted: Thu Jun 16, 2011 10:19 am
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)

Re: Bounty hunters from Anarchies

Posted: Thu Jun 16, 2011 12:23 pm
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:

Re: Bounty hunters from Anarchies

Posted: Thu Jun 16, 2011 4:23 pm
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!