Game Development Community

3D Spherical Radar for TGEA 1.7.x

by James Laker (BurNinG) · 02/20/2009 (11:32 am) · 7 comments

Back once again with some a nice little Radar resource. The one everyone has been waiting for I hope. A 3D spherical Radar!

I will be porting this to TGEA 1.8.x is nobody beats me to it ;-)

Hopefully everyone knows how to add these to your engine. If you have questions or comments, please just post them below.

Installation

1) Download and extract the files from the archive into your engine folder. Then make sure you add them to your Project.

2) Update the Include file to point to the location you added it to. The default I use for Solar Battles is this:
#include "t3d/hud/guiRadarTSCtrl.h"

3) Rebuild your Solution

4) There are 2 ways of adding it to your game. One is by just dropping it in using the GUI Editor (F10). The other is to open up your playGui.gui found in gamescriptsAndAssetsclientui
and the following piece of code:

new GuiRadarTSCtrl(Radar) {
      canSaveDynamicFields = "0";
      Enabled = "1";
      isContainer = "0";
      Profile = "GuiDefaultProfile";
      HorizSizing = "right";
      VertSizing = "bottom";
      Position = "9 2";
      Extent = "149 152";
      MinExtent = "8 2";
      canSave = "1";
      Visible = "1";
      hovertime = "1000";
      Margin = "0 0 0 0";
      Padding = "0 0 0 0";
      AnchorTop = "1";
      AnchorBottom = "0";
      AnchorLeft = "1";
      AnchorRight = "0";
      cameraZRot = "0";
      forceFOV = "0";
      PlaneBitmap = "scriptsAndAssets/client/ui/hud/radar3D.png";
      PlaneColor = "0 0.3 1 0.75";
      BlipBitmap = "../../../../..";
      BlipColor = "1 1 1 1";
      BlipSize = "1";
      StemColor = "1 1 1 1";
      SphereColor = "0 0.5 1 0.25";
      SphereDetail = "4";
      range = "250";
   };

Here is the PlaneBitmap (it's also in the archive):
burningza.googlepages.com/radar3D.png
Usage:
- Range is the Radar Range in Meters and can be changed by SetRange using the console

That should do it - Enjoy

Screenshot (from Solar Battles):
burningza.googlepages.com/3dRadarScreeny.jpg
Note! This was created by Guy Allard so thanks goes out to him for sharing :)

#1
02/20/2009 (11:54 am)
screenshot?
#2
02/20/2009 (11:57 am)
nice resource James, works straight out the box with 1.7.1

off topic, sorry, but you where having trouble with physx joints, I got them to work again in 1.7.1. if you still having trouble with them, I'll help you get it working
#3
02/20/2009 (12:44 pm)
Thanx Deepscratch,

Was just a little side Project while I was waiting for TGEA 1.8.1. I will give it a go again later when Solar Battles is done.
#4
02/20/2009 (4:57 pm)
Oh yeah, much nicer than a "flat" radar -- I like being able to judge apparent height relationships as well as range -- thanks James!
#5
02/20/2009 (6:34 pm)
Good stuff here for a wing commander style space game.
#6
03/22/2009 (7:44 pm)
Can anyone tell me why I get an exact replica of my camera view on screen and then within that camera view is an even smaller radar where it is supposed to be. It's almost like I have picture in picture then the radar. Can anyone help me fix that?

Thanks,

Rob
#7
09/23/2009 (2:17 am)
I have attempted porting this to 1.8.1, below are the changes i made :

I commented out all lines to do with(which i have seen been done in many resources)

GFX->setTextureStageColorOp

as well as this section

#if (TORQUE_GAME_ENGINE >= 1800)
#else
   GFX->setAlphaBlendEnable(true);
   GFX->setSrcBlend(GFXBlendSrcAlpha);
   GFX->setDestBlend(GFXBlendInvSrcAlpha);
   GFX->setZEnable( false );
   GFX->setCullMode( GFXCullNone );
   GFX->setTextureStageColorOp(0, GFXTOPModulate);
	GFX->setTextureStageColorOp(1, GFXTOPDisable);
   GFX->disableShaders();
#endif

and changed

GFXTexHandle(mBlipBitmap, &GFXDefaultStaticDiffuseProfile);

to

GFXTexHandle(mBlipBitmap, &GFXDefaultStaticDiffuseProfile, "Adescription");

The control places and works, however it does not look quite right.

Can some one please tell me what else is required, or what above should be adjusted to help display it correctly.

Thx

maldieve