Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Fury on January 23, 2011, 03:13:54 am

Title: Question about flak weapons
Post by: Fury on January 23, 2011, 03:13:54 am
How exactly does FS determine when to detonate a flak projectile and how is size of the target taken into account?
Title: Re: Question about flak weapons
Post by: Snail on January 23, 2011, 06:11:15 am
I think it was either shield mesh or radius. But I don't know anything.
Title: Re: Question about flak weapons
Post by: Davros on January 24, 2011, 04:31:17 pm
Dont flak projectiles use a proximity fuse or the code equivalent
Title: Re: Question about flak weapons
Post by: Nuke on January 24, 2011, 07:27:03 pm
no they are told what distance they will travel before they detonate, they dont use a prox fuse. the distance is set when the flak shells are fired, they go that far, and then blow up.
Title: Re: Question about flak weapons
Post by: Dragon on January 25, 2011, 06:16:24 am
Are you referring to reality, or FS2?
That's how it works (or used to work, IIRC) in real life, are you sure that it's the same in FS?
Title: Re: Question about flak weapons
Post by: Fury on January 25, 2011, 06:47:53 am
I think it was either shield mesh or radius. But I don't know anything.
Not a valid hypothesis since flaks can be used against unshielded targets as well.

no they are told what distance they will travel before they detonate, they dont use a prox fuse. the distance is set when the flak shells are fired, they go that far, and then blow up.
Do you know this is how the code works or is it an assumption based on observation?

I guess I'm trying to find out if it is possible to utilize the flak weapon code to create different weapons, but this isn't possible without knowing how exactly the engine determines when flak shells detonate. Of course, being able to alter that detonation distance would be step two.

For example, one could do a weapon that has some delay added to the flak detonation distance. Meaning you get direct hits with it, but it detonates very soon after missing its presumed target. I can only guess the detonation distance is somehow based on target model's radius, distance and projectile velocity, so adding a radius multiplier could do wonders. This way the additional delay is directly proportional to target's radius.
Title: Re: Question about flak weapons
Post by: Iss Mneur on January 25, 2011, 10:55:40 pm
no they are told what distance they will travel before they detonate, they dont use a prox fuse. the distance is set when the flak shells are fired, they go that far, and then blow up.
Do you know this is how the code works or is it an assumption based on observation?
The engine picks a range based on the distance of the target and the "accuracy" of the gun.  This range is then randomized a bit so that the guns are less lethal and to make the "cool cone pattern."  However, during the pre-tick a flak weapon may be detonated early if the target is within detonation range.

The engine does not appear to take the size of the target in account at all.
Title: Re: Question about flak weapons
Post by: ION3 on January 26, 2011, 08:05:08 am
It appears to aim at subsystems with big ships.
Title: Re: Question about flak weapons
Post by: MatthTheGeek on January 26, 2011, 11:13:36 am
All turrets tend to target subsystems IIRC.