Let fragmentary particles explode after a short time

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

Screet
---- E L I T E ----
---- E L I T E ----
Posts: 1883
Joined: Wed Dec 10, 2008 3:02 am
Location: Bremen, Germany

Let fragmentary particles explode after a short time

Post by Screet »

Hi,

I've just had another encounter with a ship launching a real big amount of missiles. When the first salvo destroyed the target, some hundred other missiles became balls of "fragmentary particles".

The number of collisions rose up to 90 K.

I'm sure things would have been faster if I were not using this card/driver solution (much less than 1 FPS), but I cannot see a reason why these fragmentary particles have to stay, seemingly forever. Why not give them a timer to explode?

Yes, I do know that this salvo came from an OXP ship, namely one which is work in progress. However, who would want a missile that is targeted at a specific ship stay as an active mine in space forever? I gues noone! Those things should explode after a short while!

Sorry for sounding a bit angry...I guess noone ever thought of big missile salvos and what could happen with non-exploded missiles, but the idea of active warheads which stay as mines is non understandable for me. They are even a risk for the ship which launched them!

Screet
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

Sounds like a 'bad' AI. You could notify the author to correct it - shouldn't be a problem. Usually missiles are exploding if they've lost their target and then we don't need a timer.

BTW: Scary if hundreds of timers will be used :-)
Screet
---- E L I T E ----
---- E L I T E ----
Posts: 1883
Joined: Wed Dec 10, 2008 3:02 am
Location: Bremen, Germany

Post by Screet »

Svengali wrote:
Sounds like a 'bad' AI. You could notify the author to correct it - shouldn't be a problem. Usually missiles are exploding if they've lost their target and then we don't need a timer.

BTW: Scary if hundreds of timers will be used :-)
Hmmm...some missiles, but I don't know which, do leave fragmentary particles - someone did write a message about those recently, because that person did try to scoop it and got blown up.

Hundreds of timers would indeed be bad. But if there's one timer where the particles could attach to, then become notified, it should work...or just let those particles blow up. It's really that I fail to see the sense in leaving such a navigational threat around.

Screet
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 »

Screet wrote:
Hundreds of timers would indeed be bad. But if there's one timer where the particles could attach to, then become notified, it should work...or just let those particles blow up. It's really that I fail to see the sense in leaving such a navigational threat around.
As Svengali says, it is just a bad AI. All AI's run on a single timer that visits each individual AI 8 times per second. But AI's need instructions for all possible events. Sounds like it forgot to check one of those more rare events.
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 »

Screet, this sounds like the OSE WiP.

Eric, would you in your guise as master of scripts mind to direct a few words in my direction concerning the "AI's need instructions for all possible events. Sounds like it forgot to check one of those more rare events" how-to fixing part?

Greetings @all

L
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: ...

Post by Eric Walch »

Lestradae wrote:
Eric, would you in your guise as master of scripts mind to direct a few words in my direction concerning the "AI's need instructions for all possible events.
First I need a clue to which AI.
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

Re: ...

Post by Lestradae »

Eric Walch wrote:
Lestradae wrote:
Eric, would you in your guise as master of scripts mind to direct a few words in my direction concerning the "AI's need instructions for all possible events.
First I need a clue to which AI.
I'll look into it and report back.

Screet, any chance you already found the AI in question?
Screet
---- E L I T E ----
---- E L I T E ----
Posts: 1883
Joined: Wed Dec 10, 2008 3:02 am
Location: Bremen, Germany

Re: ...

Post by Screet »

Lestradae wrote:
Eric Walch wrote:
First I need a clue to which AI.
I'll look into it and report back.

Screet, any chance you already found the AI in question?
Not really. It's basically the missile salvos launched from Condors and Juggernauts...maybe they use a special sort of missile?

Screet
User avatar
Disembodied
Jedi Spam Assassin
Jedi Spam Assassin
Posts: 6885
Joined: Thu Jul 12, 2007 10:54 pm
Location: Carter's Snort

Post by Disembodied »

The older thread about fragmentary particles is here. I presume these are a result of either the AS-2 Red Pivot Fragmentation Missile or the AS-3 Green Spark Laydown Fragmentation Bomb from the Missiles and Bombs OXP.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

IIRC, the fragmentary particles come from Missiles & Bombs, so would be introduced by OSE as it's an incorporated OXP. I think the AI you want is fragparticleAI.plist.
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 »

Hi Thargoid,

quick finding!

OK, the fragparticleAI.plist reads like this:

Code: Select all

{


        FRAGMENT = {

        ENTER = (setDestinationToCurrentLocation, "setDesiredRangeTo: 250", performFlyToRangeFromDestination);
 "DESIRED_RANGE_ACHIEVED" = ("setStateTo: DETONATE");
        EXIT = ();
         UPDATE = ();


                };

        DETONATE = {
        ENTER = ("setDesiredRangeTo: 500.0", dealEnergyDamageWithinDesiredRange, becomeExplosion);
        EXIT = ();
        UPDATE = ();
    };

            GLOBAL = {
        ENTER = ("setSpeedFactorTo: 0.75", "setStateTo: FRAGMENT");
        EXIT = ();
        UPDATE = ();
    };



}
... so what has to be done that the frag particles dissolve again? Eric? Perhaps this should also be brought to Ramirez' attention as the original oxp creator. I will change what he changes, or propose my changes to him if this finds a solution here ...

Cheers guys & thanks for the spotting and advice,

L

PS: @Screet:
It's basically the missile salvos launched from Condors and Juggernauts...maybe they use a special sort of missile?
Yeah they do, and in the endversion of OSE every ship will, according to type and role, fire specific forms of missiles. Which is one of the two reasons why I will probably include missile oxps into final OSE, too. The second being that with the faster and more powerful ships of OSE, missiles need to be faster and much more accurate, too.
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 »

Hmm. The AI is correct. It should not hang in any state. But as a backup one could always explode it after some time by changing fragment into:

Code: Select all

        FRAGMENT = { 

        ENTER = (setDestinationToCurrentLocation, "setDesiredRangeTo: 250", performFlyToRangeFromDestination, "pauseAI: 10"); 
 "DESIRED_RANGE_ACHIEVED" = ("setStateTo: DETONATE"); 
         UPDATE = ("setStateTo: DETONATE"); 

                }; 
This way, when not at its destination after ten seconds, it will also explode on the update.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

I must admit I've bumped into these things "loose" on occasion in the past, although they've never given me any particular issues other than a minor wonder about where they came from.

All I can think is as they have a secondary role of missile(0) that is confusing something somewhere? I can't see why, but stranger things have been know. As Eric says there shouldn't be any issue with the AI, so what may be useful is the next time someone comes across one in-flight is to check what AI it is actually running, and also what AI state it's in.
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 »

Thargoid wrote:
....there shouldn't be any issue with the AI, so what may be useful is the next time someone comes across one in-flight is to check what AI it is actually running, and also what AI state it's in.
For those that don't have the console: target the blue dot and press "shift-H". A few things that might give a clue will than be written in the log file.

On a related topic: For me the missile(0) doesn't make sense at all. Role missile is added to tell other NPC ships that they can use this munition also. And (0) is added to disallow the use. Leave the missile role away in the first place than!
User avatar
Ramirez
---- E L I T E ----
---- E L I T E ----
Posts: 628
Joined: Mon Nov 07, 2005 9:52 am
Location: London, UK

Post by Ramirez »

Sorry, I thought I posted a reply to this on Friday but I must have missed the submit button! Yes, it's my OXP that's at fault on this one. I thought I had fixed it by setting the role of the frag particle as missile(0) but they still seem to be launched by NPCs as missiles in their own right, and when they do they don't seem to explode.

There's no need for the missile role really - I've already added a line in the shipdata to give them a missile scan class. Deleting this role should fix the immediate problem - I've done a quick re-upload of v2.1 on my site.

That said, I don't know the cause of the AI hanging, but as Eric said if anything strange happens use the console to see what state the AI is in.
Download Resistance Commander plus many other exciting OXPs HERE
Post Reply