Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: headdie on November 08, 2011, 06:28:33 pm

Title: Radar Adjustments
Post by: headdie on November 08, 2011, 06:28:33 pm
I was just reading through the My take on the 2D radar (http://www.hard-light.net/forums/index.php?topic=78936.0;topicseen) thread and had an idea, can we have the ability to set radar ranges depending on direction.  for example a modder can set the ship's forward 60 degree cone to 100% of the radar range limit if set, the next 60 degrees to 70% and the remainder to 30%.
Title: Re: Radar Adjustments
Post by: z64555 on November 09, 2011, 09:58:07 am
If I can find time this week, I'd like to take a look at it. I'm thinking it would be possible with some nested if arguments, but I don't know the details as far as adding new tbl options.
Title: Re: Radar Adjustments
Post by: headdie on November 09, 2011, 10:43:47 am
Cool, thanks alot
Title: Re: Radar Adjustments
Post by: Dragon on November 09, 2011, 02:38:33 pm
I think that's doable in FRED. Mathematics for that (heck, even dynamic decrease with subsystem health) are quite simple. If you're using SEXP to set radar maximum range, you could very easily tie that range to subsystem damage.
Title: Re: Radar Adjustments
Post by: headdie on November 09, 2011, 03:06:02 pm
I think that's doable in FRED. Mathematics for that (heck, even dynamic decrease with subsystem health) are quite simple. If you're using SEXP to set radar maximum range, you could very easily tie that range to subsystem damage.
I think you misunderstand, what i am asking for is a variation dependent on the angle in relation to the craft

[attachment deleted by a basterd]
Title: Re: Radar Adjustments
Post by: Dragon on November 09, 2011, 03:26:44 pm
Ah, that. OK. I must have misread your post.  :)
Title: Re: Radar Adjustments
Post by: z64555 on November 09, 2011, 04:01:26 pm
I think the overall effect is that you'll be able to see objects only within a polar rose petal. This image shows what a "polar rose" is, and it has three petals... we're interested in getting just one petal.

(http://www.math.rutgers.edu/~greenfie/mill_courses/math152/gifstuff/polar_cosine_rose.gif)

The current radar settings have it so that the lobes (or petals) look like a rotation of a pie slice. (spherical bottom and conical sides)

It turns out that radiation patterns of real directional antennas (including radar) are very similar.
Title: Re: Radar Adjustments
Post by: z64555 on January 01, 2012, 06:20:56 pm
Hey headdie, I've figured out a method that should work very well for modders, which will allow you to define the shape of the radar pattern in a tbl. Modder's would basically define the relative ranges for any number of FOV's, and the function will linearly interpolate between FOV definitions so you could get some cool curves.

Only problem is... I haven't figured out where to put the code for it... yet.  :nervous:
Title: Re: Radar Adjustments
Post by: headdie on January 01, 2012, 06:45:16 pm
That's half way there at least, which is a hell of a lot further along than it was at so serious respect there
Title: Re: Radar Adjustments
Post by: z64555 on January 02, 2012, 01:41:04 pm
I've tracked down a few possible suspects, and they look like they're a couple of original functions from when  :v-old: had messed with it.

My main concern is that the new code might mess with the secondaries when they're pursuing a target...

What I want to do is apply the code only to the pilot's radar (both the player and the ai's). I don't know if the secondaries use the ship's radar when locking on, but if so, I think that it would be perfectly acceptable. However it would be a problem if they used their own radar.

In other words, I'm going to have to sift through the code some more. (Thank goodness for graphvis and doxygen!)