• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

P3D v2 V2.2 Radar

Messages
1,120
Country
australia
Thought I'd give the radar a try in P3D V2.2 so I just copied the sample code into the panel.cfg to create a new 2D panel.

Code:
[Window Titles]
Window00=Radar
[Window00]
size_mm=265,310
Background_color=1,1,1
visible=0
position=8
windowsize_ratio=0.4
gauge00=P3DRadar!Radar, 5, 5, 255, 305

Sadly, I can't seem to get any nice pretty images like the ones LM showed on their developers blog: http://www.prepar3d.com/news/2014/03/4904/

Mine end up as a blocky mess that not only looks bad plus it knocks about 20% off the framerates. The attached screenshot was taken in the same location as the ones from the developers blog.

Image1.jpg


Might have to do some more rummaging about to see what the problem is.
 
After a bit of rummaging it turns out I really should have followed the advice when installing the V2.1 to V2.2 patch.

Making a backup and then deleting these folders and then restarting P3D and the radar is now working.

%PROGRAMDATA%\Lockheed Martin\Prepar3D v2

%LOCALAPPDATA%\Lockheed Martin\Prepar3D v2

%APPDATA%\Lockheed Martin\Prepar3D v2

%USERPROFILE%\Documents\Prepar3D v2 Files

In the attached pic you can make out the airport, the river behind it and the black shadow caused by the hill to the left of the airport (Cairns, QLD in case you were wondering where).

One bug is that if I close the gauge (after resizing it) and then reopen it the radar display does not work. I need to resize the gauge and it comes back to life.

So, if you have installed the patch for P3D V2.2 it seems like you really do need to follow the installation advice and you should delete the above folders. You never know what else may be broken if you don't do that. After deleting those folders P3D will rebuild them. Then all I needed to do was copy a few things across from my backups to the Prepar3D.cfg and my standard.xml with my key assignments.

Image2.jpg
 
Anthony

That looks great.

Does the sweep arm build up the display during sweep ?
Can the radar be integrated into a panel as a normal instrument ?

Could you post a screenshot with that airport zoomed in to fill the display screen ?

Cheers
Karol
 
Yes, the sweep arm builds the display as it goes.

The radar can be used as part of a normal instrument. The radar on screen is the example gauge that LM provide (in the gauges/p3dradar folder).

The code they use to call it is simply this (using the fancy AceXML format):
Code:
        <Element FloatPosition="1.000,1.000">
            <Texture Name="P3DRadarTexture" Width="253" Height="253" />
        </Element>

There is a screenshot of an airport zoomed in on the developer blog link I provided. It Looks like the radar can even show individual buildings.
 
Thanks Anthony ,

Agree , it's time to buy P3D but first I need to clean my machine , re format , then the shear pain of
loading everything again ....."Groan" .

After the above reply I had a look at that link .. very cool , I presume you would see
bridge superstructure at close zooms.
It appears as a vast improvement of fs9:view with a graphic background (texture) ,
similar to their FLIR except Shadows instead of Heat , and different ENB style monochrome.

Could you try a temporary on display screen Hot spot switch without a background Bitmap to switch On/Off
a text overlay of GS or RADALT , it would be interesting to see if the screen can be utilised
as a touchscreen.
If it can be , then on ground locations could be nominated by a click to place Simconnect objects and
return Lat/Long , Elevation , Slant Range , etc ... a rather exciting prospect .
I could not use my fs9:view Pave Tack instrument as a Touchscreen as it had no solid background.

Cheers
Karol
 
Well, I'm having some trouble trying to get this radar to work in my own gauge.

Error messages range from cannot load P3DRadarTexture to a CTD. That's impressive. It takes a lot to CTD with an XML gauge.

The radar gauge example is in the AceXML format and I use the old XML format. It seems to me that I need to use a lua script to initialise some L and C variables of the radar gauge but the lua script, when copied straight from the example into my own gauge throws up a heap of errors.

I've lost interest in this at the moment (life's too short to be faffing about trying to get things like this to work)
 
Thought I would give this one last try.

Turns out the problem was with the !lua script. Apparently there can be absolutely no leading spaces or lines in front of the !lua otherwise it won't work. As you can see in the example below the !lua comes directly after <Value>. Anywhere else and it won't work.

Speaking of example below the example below is the bare minimum gauge you need to get the radar to display. The <Texture> call shows the radar display. All the lua code initialises the radar module,gets it running and sets some default values. You could probably do this without lua code but I haven't tried that yet.

Code:
<Gauge Name="Wallaby_EFIS2" Version="1.0">
  <Image Name="EFIS_background.bmp"/>

<Element>
    <Select>
        <Value>!lua
                -- first time update is called set some reasonable defaults because these states won't reset on
                -- closing the window
                if varget("L:P3DRadarInitialized","Number") ~= 1 then
                    varset("L:P3DRadarInitialized",1)
                    varset("L:P3DRadarFreezeEnabled",0)
                    varset("C:P3DRadar:RenderingEnabled",1)
                    varset("C:P3DRadar:ScanAzimuth",60)
                    varset("C:P3DRadar:ShowCursor",0)
                    varset("C:P3DRadar:VisualZoom",1)
                    varset("C:P3DRadar:DataZoom",1)
                    varset("L:P3DRadarTrackEnabled",0)
                    varset("C:P3DRadar:RangeMiles",5)
                end
         </Value>
    </Select>
</Element>

<Element>
    <Texture Name="P3DRadarTexture" Width="509" Height="415" />
</Element>
</Gauge>

Anyway, here is a pic of the radar in my fictional Swamp Wallaby EFIS display. I haven't figured out how to get it to display anything other than as a square shape (at least without distorting the display). The only controls I am using are range (C:P3DRadar:RangeMiles).

Did I mention it knocks about 20% of your framerates using the radar gauge?

Image3.jpg
 
Looks great.

I experience a frame rate hit with my fs:view based Pave Tack instrument in FSX .

The above screenshots and those at the Link are all God's eye views , ie; 90 degrees vertically down.
You will probably find that there is a Pitch variable that enables the Tilt view to be adjusted ,
generally a radar will be pointing forwards, or for Ground mapping at a Pitch angle of between
0 to 20 degrees down .
That would result in mountains appearing somewhat in profile in the radar display.

Below are a couple of shots of the FSX Pave Tack instrument , with one showing variations in
Pitch angle (Tilt) .

Cheers
Karol

Panel.

rn0CI.jpg


Composite.

jxDm.jpg
 
I don't think the P3D radar works like that Karol (ie adjusting the view angle). It looks like there is only a top down view available. Here is a list of the parameters from the SDK (the formatting is a bit haphazard as I've copied and pasted from a table)

ClearRadarImage Set non zero value to trigger a radar image clear.
ShowRangeRings 1 - Show range rings 0 - Hide range rings
ShowCursor 1 - Show Cursor 0 - Hide Cursor
FarShoreEnhance 1 - Enable Far Shore Enhancement 0 - Disable Far Shore Enhancement
VisualZoom Zoom in on radar display. Display is centered on current cursor position. Values less than 1.0 are not supported.
DataZoom Remap radar sensor coverage to area surrounding the current cursor position to increase data resolution. When set to the same value as visual zoom, this works well as an approximation of Doppler Beam Sharpening. Values less than 1.0 are not supported.
ScanAzimuth Maximum deviation from center of the radar system sweep. Valid Range is 1.0-60.0.
SweepRate Sweep rate in degrees per second
RangeMiles Maximum range of radar in Nautical Miles.
RenderingEnabled The effectively disables the radar service. This should be set to 0 when not displaying the radar texture element with the radar for best performance. 1 - Enable rendering 0 - Disable rendering
FreezeEnabled 1 - Enable Image and Radar Beam Freeze 0 - Disable Image and Radar Beam Freeze
CursorPositionX Set cursor horizontal cursor location. The range 0.0-1.0 maps from left to right across the extents of the un-zoomed radar gauge image. Zoom calculation must be done by developer.
CursorPositionY Set cursor vertical cursor location. The range 0.0-1.0 maps from top to bottom down the extents of the un-zoomed radar gauge image. Zoom calculation must be done by developer.
CursorPositionLat Latitude of cursor position. Actual cursor poistion in radar is relative to display. Getting or setting this value will trigger conversions in the C++. For best results set Latitude and Longitude in pairs.
FrontBlindSpotDegrees Width of the current front blindspot in degrees. This is generally only used for Doppler Beam Sharpening and should otherwise be set to 0.
SideBlindSpotDegrees Width of the current side blindspot in degrees. This is generally only used for Doppler Beam Sharpening and should otherwise be set to 0.
RadarResolutionX Horizontal resolution of radar data texture.
RadarResolutionY Vertical resolution of radar data texture.
GaugeResolutionX Horizontal resolution of radar gauge texture in pixels.
GaugeResolutionY Vertical resolution of radar gauge texture in pixels.
CurrentRadarBeamOffset Get the current angular offset of the radar beam. Read-only value determined by radar simulation.
CurrentRadarScanElevationDegrees Current elevation of the radar beam in degrees. Read-only value set by radar system. This value will vary by altitude, range, and data zoom.
 
Cool , thanks for that.
Some interesting parameters in that lot.

Specifically;
FIRSTLY:
( Elevation ?? )
CurrentRadarScanElevationDegrees Current elevation of the radar beam in degrees. Read-only value set by radar system. This value will vary by altitude, range, and data zoom.

and,
DataZoom Remap radar sensor coverage to area surrounding the current cursor position to increase data resolution. When set to the same value as visual zoom, this works well as an approximation of Doppler Beam Sharpening. Values less than 1.0 are not supported.

Above you have.
Code:
                if varget("L:P3DRadarInitialized","Number") ~= 1 then
                    varset("L:P3DRadarInitialized",1)
                    varset("L:P3DRadarFreezeEnabled",0)
                    varset("C:P3DRadar:RenderingEnabled",1)
                    varset("C:P3DRadar:ScanAzimuth",60)
                    varset("C:P3DRadar:ShowCursor",0)
                    varset("C:P3DRadar:VisualZoom",1)
                    varset("C:P3DRadar:DataZoom",1)
                    varset("L:P3DRadarTrackEnabled",0)
                    varset("C:P3DRadar:RangeMiles",5)

It would be interesting to see what happens if
DataZoom",1

was changed to a larger number
ie;
DataZoom",25
or , replace "1" with a settable L:Variable.

SECONDLY:
Love this one,
CursorPositionLat Latitude of cursor position. Actual cursor poistion in radar is relative to display. Getting or setting this value will trigger conversions in the C++. For best results set Latitude and Longitude in pairs.

If I'm correct you should be able to get a Lat/Long text readout , then with a GeoCalc a Distance/Bearing from your
aircraft, also a Slant Range.
With Simconnect you could place an invisible object at that Lat/Long location and derive it's Elevation.
With that info you could create a Targeting algorythm for bomb ballistics with TTG and TTI , and
even auto release of bomb trigger.

Cheers
Karol
 
Generally radar displays give a God's eye view, plotting the returns by range and bearing, what happens is that mountains etc. cause a shadow on the display. There are radars that build up a picture as per your Pave Tack gauge but that's a more specialist radar as you'll have to do processing to convert the returns as you'll either be using a pencil beam to build up the image or a fan beam, the motion of the aircraft and processing. Both of which take a certain amount of time.

Looks great.

I experience a frame rate hit with my fs:view based Pave Tack instrument in FSX .

The above screenshots and those at the Link are all God's eye views , ie; 90 degrees vertically down.
You will probably find that there is a Pitch variable that enables the Tilt view to be adjusted ,
generally a radar will be pointing forwards, or for Ground mapping at a Pitch angle of between
0 to 20 degrees down .
That would result in mountains appearing somewhat in profile in the radar display.

Below are a couple of shots of the FSX Pave Tack instrument , with one showing variations in
Pitch angle (Tilt) .

Cheers
Karol

Panel.
rn0CI.jpg


Composite.

jxDm.jpg
 
Karol

If you have a look at the two screenshots I put up first (these are of the P3D default radar gauge) you should be able to see a blue crosshair. This can be set with a mouse click on screen (in this particular gauge) and if you then use ZOOM you can zoom into or out of that point which is presumably the VisualZoom. I presume Datazoom may need to be increased as visualzoom increases?

Your theory about using this lat and lon position of the blue cursor sounds like it could work.

I haven't really gone much further into the radar beyond my simple demo display of it.
 
Anthony,

I like the fact that the screen is clickable ,( presumeably because it has a "Texture" which probably acts as a background ,
I can't do that with my Pave Tack .

1. Regards ,
CursorPositionLat
it is reasonable to presume that there is also,
CursorPositionLong

If it's of any use to you the following is from my Radar- Mission adaptive Flight Plan Editor Instruments.

( in UPDATE )
GeoCalc from your aircraft to crosshairs

Code:
(L:StandOff mode,enum) 4.5 &lt; 
         if{
          (A:PLANE LATITUDE, degrees) (>@c:GeoCalcLatitude1,degrees)
                (A:PLANE LONGITUDE, degrees) (>@c:GeoCalcLongitude1,degrees)
                (L:RequiredWaypointLatitude,degrees) (>@c:GeoCalcLatitude2,degrees)
                (L:RequiredWaypointLongitude,degrees) (>@c:GeoCalcLongitude2,degrees)
                (@c:GeoCalcBearing,degrees) (>L:BearingStandOff,degrees)
                (@c:GeoCalcDistance,nmiles) (>L:DistanceStandOff,nmiles)
            }

In your case
replace L:RequiredWaypointLatitude,degrees with L:CursorPositionLat,degrees
replace L:RequiredWaypointLongitude,degrees with L:CursorPositionLong,degrees

( in a formatted text Element )
text readout of Distance and Bearing to crosshairs

Code:
%Dst : %((L:DistanceStandOff,nmiles))%!03d!% nm% %Brg : %((L:DistanceStandOff,nmiles) 0.5 &gt;)%{if}%((L:BearingStandOff,degrees) (A:GPS MAGVAR, degrees) - d360)%!03d!\{dplo= }%{end}

2. Regards this bit ,
CurrentRadarScanElevationDegrees Current elevation of the radar beam in degrees. Read-only value set by radar system. This value will vary by altitude, range, and data zoom.

What I meant to point out above is the fact that the Parameter contains the following words ElevationDegrees .

I am assuming here that if you Change
"C:P3DRadar:DataZoom",1
by going from 1 to a larger value such as 25 ,
then you will be altering => Current elevation of the radar beam in degrees.
Effectively , it might represent a method to control and vary the Tilt of the radar beam .
That is how I interpret that Parameter description .

I apologise if I'm complicating it too much .
I have a tendancy to try to wring the maximum information out of an instrument , and
make the data available for the pilot's use

Cheers
Karol
 
Back
Top