Radar Control (GuiRadarCtrl) for TGEA v1.0+
by James Laker (BurNinG) · 05/14/2007 (3:05 pm) · 78 comments
Download Code File
Hey again. Just in the process of porting my old resource found here .
To install and use:
1) Backup old guiRadarCtrl.h/guiRadarCtrl.cc (If you already have it installed)
2) Add the files from this resource. I created a new folder called "Hud" in my game folder. So in guiRadarCtrl.cpp you'll find that the .h file is referenced in to that loacation. You can just change it to match yours. Look for it at the #includes at the top of the file.
3) Recompile (Full Build)
4) In the GUI editor (F10) add the GuiRadarCtrl
5) Change the properties in the GUI editor
Extra:
Randy sent me some updates to this to allow for different blip dots (which are now small images). So when a target on the Radar is higher than your player, you can have a different blip image. So you should see 3 different blip files in the Properties (Above,Below,Level). You can make them all the same if you prefer that.
The LevelRange is the variable to set when the LevelBlip should be shown. If the value is 10, then all object on the Radar 10 meters above and 10 meters below you will still be shown as level.
The default is 20.
Then there's the RadarRange variable which is how far your radar will pick up objects. The default is 2500
Community Contribution:
The Scrolling Map and Radar Compass fix has been contributed (09 August 2007) by Matt Huston and Stickman Studios. Thanx you guys!
Last Update:
10 March 2008
Hey again. Just in the process of porting my old resource found here .
To install and use:
1) Backup old guiRadarCtrl.h/guiRadarCtrl.cc (If you already have it installed)
2) Add the files from this resource. I created a new folder called "Hud" in my game folder. So in guiRadarCtrl.cpp you'll find that the .h file is referenced in to that loacation. You can just change it to match yours. Look for it at the #includes at the top of the file.
3) Recompile (Full Build)
4) In the GUI editor (F10) add the GuiRadarCtrl
5) Change the properties in the GUI editor
Extra:
Randy sent me some updates to this to allow for different blip dots (which are now small images). So when a target on the Radar is higher than your player, you can have a different blip image. So you should see 3 different blip files in the Properties (Above,Below,Level). You can make them all the same if you prefer that.
The LevelRange is the variable to set when the LevelBlip should be shown. If the value is 10, then all object on the Radar 10 meters above and 10 meters below you will still be shown as level.
The default is 20.
Then there's the RadarRange variable which is how far your radar will pick up objects. The default is 2500
Community Contribution:
The Scrolling Map and Radar Compass fix has been contributed (09 August 2007) by Matt Huston and Stickman Studios. Thanx you guys!
Last Update:
10 March 2008
About the author
#42
I'll look into your problem if I can reproduce Stefan.
Edit: I'd love to test but it seems its just the old resource repacked with shiny graphics? :) Check that out :P
11/30/2007 (6:19 pm)
Whoops, seemed too easy. Thanks for the fix and cleaning up. I was pretty much half asleep when I wrote that, no big surprise there was something horribly wrong ^^.I'll look into your problem if I can reproduce Stefan.
Edit: I'd love to test but it seems its just the old resource repacked with shiny graphics? :) Check that out :P
#43
11/30/2007 (7:16 pm)
@Stefan: I don't understand what you're saying your problem is. Are you saying you have flickering? Or is it just a matter of scaling of the graphic? If it's scaling then what setting are you putting for Extent, and what is the resolution of your graphics (they should be the same)?
#44
11/30/2007 (8:55 pm)
@Arcanor: it looks like you just re-zipped and uploaded the original files from this resource. I did a winmerge on them and they are 100% identical. It looks like you need to create a new zip with your modified files.
#45
*image*
Here are the control settings I used:
12/01/2007 (12:38 am)
Arcanor that example from above was extreme :) As soon as compass and radar image are drawn on top of each other, it looks like flickering because the visible difference isn't that big. Here's an example with your compass image, radar turned off and extends set to 192 192:*image*
Here are the control settings I used:
new GuiRadarCtrl(Radar) {
canSaveDynamicFields = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "top";
position = "20 250";
Extent = "192 192";
MinExtent = "8 8";
canSave = "1";
Visible = "1";
hovertime = "1000";
offset = "0 0";
RadarBitmap = "./compass/radar-compass2.png";
wrap = "0";
blip_above = "./compass/blip_up.png";
blip_below = "./compass/blip_down.png";
blip_level = "./compass/blip.png";
RadarRange = "100";
ShowRadar = "0";
CompassBitmap = "./compass/compass.png";
ShowCompass = "1";
MapBitmap = "./compass/maplayout.png";
ShowMap = "0";
RadarShowPlayers = "1";
RadarShowVehicles = "1";
RadarShowShapeBase = "1";
LevelRange = "1101004800";
HideAll = "0";
};
#46
@Stefan: I don't understand why you would have two nearly identical images to be drawn on top of one another. What do the two images represent in your screenshot? Do you normally have two controls on the screen at the same time? I'm not sure what you're showing us. What is the problem you're seeing?
One thing I notice from your setup script is that you've got your ShowRadar and ShowMap turned off, so the only thing you'll see is the compass overlay. The RadarBitmap (controlled by ShowRadar) is underneath everything (usually this would be an alpha-faded image to be used as the background layer for the whole control), then the CompassBitmap (controlled by ShowCompass) is an overlay (for something like the directional letters N, E, S, & W, and maybe a crosshair). Also, if you decide to use a MapBitmap (controlled by ShowMap) it should normally take the place of the RadarBitmap (i.e. you'll want to turn OFF the ShowRadar boolean). Does that help at all?
Also, Stefan, please note that I updated the zip file as per Matt Kronyak's post above, so you may be interested in downloading the new version.
12/01/2007 (3:25 am)
@Matt Kronyak: Yikes, you're right!! I've fixed it now and uploaded a new zipfile at: www.arcanoria.com/resources/guiradarctrl.tgea-working3.zip Thanks for pointing this out!@Stefan: I don't understand why you would have two nearly identical images to be drawn on top of one another. What do the two images represent in your screenshot? Do you normally have two controls on the screen at the same time? I'm not sure what you're showing us. What is the problem you're seeing?
One thing I notice from your setup script is that you've got your ShowRadar and ShowMap turned off, so the only thing you'll see is the compass overlay. The RadarBitmap (controlled by ShowRadar) is underneath everything (usually this would be an alpha-faded image to be used as the background layer for the whole control), then the CompassBitmap (controlled by ShowCompass) is an overlay (for something like the directional letters N, E, S, & W, and maybe a crosshair). Also, if you decide to use a MapBitmap (controlled by ShowMap) it should normally take the place of the RadarBitmap (i.e. you'll want to turn OFF the ShowRadar boolean). Does that help at all?
Also, Stefan, please note that I updated the zip file as per Matt Kronyak's post above, so you may be interested in downloading the new version.
#47
The problem occurs as soon as the CompassBitmap is drawn. I've intentionally turned off ShowRadar to better point out the problem. With ShowRadar on, that effect is even harder to see.
I've made a animated gif to better show you what happens (ignore the blip in the middle, look at the border of the compass):
*image*
Note that the "flickering" frequence changes depending on player/bot names to be drawn are not constant like in that image.
12/01/2007 (6:51 am)
Sorry Arcanor, seems like I explained the problem badly - I just had put two screenshots into one image for better comparison. We only have one compass in our game.The problem occurs as soon as the CompassBitmap is drawn. I've intentionally turned off ShowRadar to better point out the problem. With ShowRadar on, that effect is even harder to see.
I've made a animated gif to better show you what happens (ignore the blip in the middle, look at the border of the compass):
*image*
Note that the "flickering" frequence changes depending on player/bot names to be drawn are not constant like in that image.
#48
In guiRadarCtrl.cpp
-> void GuiRadarCtrl::onRender(Point2I offset, const RectI &updateRect)
-> inside of if (mCompassTextureObject && mShowCompass)
->From Line 573 to line 578
Change:
To
The difference is, the original implementation uses the width of the compass image, whereas the fix uses the extent. The other layers of this control (the map and whatnot) appear to scale correctly.
12/01/2007 (1:38 pm)
By the way, I noticed the latest version from Arcanor doesn't have the fix I posted a few months ago for correctly scaling the compass extent. To fix it only 3 lines need to be changed. In guiRadarCtrl.cpp
-> void GuiRadarCtrl::onRender(Point2I offset, const RectI &updateRect)
-> inside of if (mCompassTextureObject && mShowCompass)
->From Line 573 to line 578
Change:
F32 width = mCompassTextureObject.getWidth() * 0.5; MatrixF rotMatrix(EulerF(0.0, 0.0, mDegToRad(cameraAngle))); Point3F offset(offset.x + mCompassTextureObject.getWidth() / 2, offset.y + mCompassTextureObject.getHeight() / 2, 0.0);
To
F32 width = mBounds.extent.x * 0.5; MatrixF rotMatrix( EulerF( 0.0, 0.0, mDegToRad(cameraAngle))); Point3F offset( offset.x + mBounds.extent.x / 2, offset.y + mBounds.extent.y / 2, 0.0);
The difference is, the original implementation uses the width of the compass image, whereas the fix uses the extent. The other layers of this control (the map and whatnot) appear to scale correctly.
#49
@Matt Kronyak: Sorry for the omission. I tested it out and it doesn't seem to break anything so I've gone ahead and added your fix into my source file and repackaged the archive as www.arcanoria.com/resources/guiradarctrl.tgea-working3.zip Thanks for pointing it out!
12/01/2007 (5:14 pm)
@Stefan: Sorry, but I'm not seeing anything like this. The edge of my compass looks as smooth as silk.@Matt Kronyak: Sorry for the omission. I tested it out and it doesn't seem to break anything so I've gone ahead and added your fix into my source file and repackaged the archive as www.arcanoria.com/resources/guiradarctrl.tgea-working3.zip Thanks for pointing it out!
#50
01/27/2008 (9:11 am)
My radar doesn't show anything. The compass works fine, but the radar doesn't. I've got only ShowVehicles activated. Any ideas?
#51
01/28/2008 (11:14 am)
It should show anything of VehicleObjectType, but I didn't do any testing of that, since I have no vehicles in my game. I'd suggest putting a breakpoint in the onRender() and checking to see if anything's getting past line 495.
#52
I've updated the resource with all the fixes... Thanks guys.
03/10/2008 (7:12 am)
Sheeesh... for some reason I didnt get any Notification on new comments... Sorry guys. Arcanor. Your link seems to be dead. I've updated the resource with all the fixes... Thanks guys.
#53
www.arcanoria.com/resources/guiradarctrl.tgea-working3.zip
Edit: there was one post above still pointing to a dead link (my "working2" file), but I've edited that one as well so all the links point to the latest version.
03/10/2008 (7:18 am)
Which link is dead? I've just tested the latest one (in my Dec 01 post) and it's working for me. Here it is again for clarity:www.arcanoria.com/resources/guiradarctrl.tgea-working3.zip
Edit: there was one post above still pointing to a dead link (my "working2" file), but I've edited that one as well so all the links point to the latest version.
#55
www.garagegames.com/mg/forums/result.thread.php?qt=75803
the final link to resources about HorizontalCompassCtrl and GuiRadarCtrl ;-)
06/06/2008 (12:58 pm)
For TGEA 1.7 read here :www.garagegames.com/mg/forums/result.thread.php?qt=75803
the final link to resources about HorizontalCompassCtrl and GuiRadarCtrl ;-)
#56
06/24/2008 (5:49 pm)
Andrea that resource you posted still has some problems. It skews the map real bad when you turn no matter what map you have defined. the map looks correct until you turn then the map gets drawn all screwy.
#57
01/02/2009 (7:47 am)
Anyone get this to work in TGE 1.8?
#58
03/09/2009 (4:58 am)
Bump, TGEA 1.8.1 working?
#59
03/09/2009 (5:00 am)
Nope. Someone will have to port it unfortunately.
#60
resource_12726_2009.03.31.zip
03/31/2009 (3:45 am)
Please check the following one. I've tried to adapted for the TGEA 1.8.1 version. Maybe I missed something?resource_12726_2009.03.31.zip

Torque Owner Shaderman
*image*
Looks like it's scaled / zoomed in (right half of that image) when player names are drawn.
Any ideas?