Author Topic: My take on the 2D radar  (Read 9898 times)

0 Members and 1 Guest are viewing this topic.

Offline Angs

  • 22
My take on the 2D radar
Hello everyone, first time posting here. First, I want to thank the whole community for being awesome.

I recently started replaying the fs2 retail campaign and wasn't pleased with the radar(s), so I decided to dive into the source and make my own. Without further ado, here's what I came up with: The rear mirror radar:



It has the same projection (azimuthal equidistant) as the original 2D radar, but without vertical flattening (for extra math pureness). The rear mirror is the 90 degree cone behind the player. The forward radar has a projection of a cube with the player centered in it for visualization.

If someone is interested in it, I can give the code/build/graphics. Any comments and/or criticism?

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: My take on the 2D radar
Code would be appreciated. I like the idea, and it's an option that is missing at the moment, so I definitely would like to check it out.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Angs

  • 22
Re: My take on the 2D radar
Here is a patch and a .vp containing the bitmaps. There are some changes to the -orbradar command line switch for testing purposes: it is renamed to -radar and it takes a int parameter: 0 is standard 2D radar, 1 is orb radar and 2 is the new one.

There are two new additional files in the patch, "radar/radarrm.*", which is not reflected in the project files or makefiles, so they probably have to be added manually.

Edit: changed attached awful code to rewrited more modular one

[attachment deleted by a basterd]
« Last Edit: November 08, 2011, 12:54:39 pm by Angs »

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: My take on the 2D radar
not bad. i rather like this projection.

i should point out that radars are fairly easy to script. i dont see the point of hard coding every potential radar into the game, which it would be far more sane to allow scripted hud gauges (moddable through in hud_gauges.tbl, but defined in lua). of course its easier to get scripters to write c than it is to get modders to write script. screw it, enjoy your feature creep. :P
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Angs

  • 22
Re: My take on the 2D radar
Yeah, I agree that it would be best if it would be possible to define the radar without a recompilation of the entire code, but is there a hud_gauges.tbl for the default retail gauges? The wiki article is a little bit vague on the subject and MediaVP doesn't seem to have one. I just put the code in the first place I could think of as I was in a hurry to play the retail game. With a C++ subclass I could reuse almost all code from the standard hud. :)

 
 

Offline Rodo

  • Custom tittle
  • 212
  • stargazer
    • Steam
Re: My take on the 2D radar
cool radar, I'm getting it if that's ok with you.
el hombre vicio...

 

Offline chief1983

  • Still lacks a custom title
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: My take on the 2D radar
An old fork of the SCP codebase, Imperial Alliance, once had a split radar just like like this, except it was symettrical, and they had moved it to the upper left and right corners of the screen, similar to the X-wing games.  Is this dynamic enough that with the right HUD config and bitmap files, that effect could still be achieved?
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Steam
Re: My take on the 2D radar
Do you know if you can add an option that makes the forward radar an N-gon instead of an ellipse? I know of at least 2 projects that have octogonal radar (FringeSpace and maybe Diaspora)

I have an idea of how to do it, but haven't gotten around to playing with the code. :(

Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 

Offline Angs

  • 22
Re: My take on the 2D radar
cool radar, I'm getting it if that's ok with you.

I don't mind at all.

An old fork of the SCP codebase, Imperial Alliance, once had a split radar just like like this, except it was symettrical, and they had moved it to the upper left and right corners of the screen, similar to the X-wing games.  Is this dynamic enough that with the right HUD config and bitmap files, that effect could still be achieved?

I twiddled "a little bit" with the code, and came up with a nice way to do this. I added a few hudgauges.tbl options to the standard radar for cutoff angle and whether it points forward or backward. The just load as many radars as you want (well, I couldn't image you'd want more than two but..)
Now I can load the radar presented in the first photo without any command line funnyness with
Code: [Select]
#Gauge Config
$Base: (1024, 768)
$Gauges:
+Radar:
Position: (411, 560)
Axes: (193, 193)
Origin: (100.0, 100.0)
Filename: 2_radar2
Crosshair Filename: 2_target1
Angle: 270
Rear: false
+Radar:
Position: (411, 560)
Axes: (64, 64)
Origin: (215.4, 36.033)
Filename: 2_radar2
Crosshair Filename: 2_target1
Rear: true
Angle: 90
$End Gauges
#End
or
Code: [Select]
#Gauge Config
$Base: (1024, 768)
$Gauges:
+Radar:
Position: (411, 590)
Axes: (187, 155)
Origin: (104.0, 85.0)
Filename: 2_radar1
Angle: 180
+Radar:
Position: (10, 10)
Axes: (187, 155)
Origin: (104.0, 85.0)
Filename: 2_radar1
Rear: true
Angle: 180
$End Gauges
#End
for this one:

Do you know if you can add an option that makes the forward radar an N-gon instead of an ellipse? I know of at least 2 projects that have octogonal radar (FringeSpace and maybe Diaspora)

I have an idea of how to do it, but haven't gotten around to playing with the code. :(

How would it work? Are the corners cut off or is the circle projected onto the n-gon, so that the distance to blip to real turning distance wouldn't be equal always?

Anyways, here are resources for the radar(s) if someone wants them.

[attachment deleted by a basterd]
« Last Edit: November 08, 2011, 12:36:42 pm by Angs »

 

Offline chief1983

  • Still lacks a custom title
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: My take on the 2D radar
Awesome, looks good functionally.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline JGZinv

  • 211
  • The Last Dual! Guardian
    • The FringeSpace Conversion Mod
Re: My take on the 2D radar
Angs, this is what we're trying to do.  I've got this as a PSD if you want a
better look at it.


True power comes not from strength, but from the soul and imagination.
Max to PCS2 to FS2 SCP Guide
The FringeSpace Conversion Mod

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Steam
Re: My take on the 2D radar
Do you know if you can add an option that makes the forward radar an N-gon instead of an ellipse? I know of at least 2 projects that have octogonal radar (FringeSpace and maybe Diaspora)

I have an idea of how to do it, but haven't gotten around to playing with the code. :(

How would it work? Are the corners cut off or is the circle projected onto the n-gon, so that the distance to blip to real turning distance wouldn't be equal always?

I was originally just thinking of constraining them to fit inside the n-gon, but they would still be projected to an ellipse. JGZ's picture shows the hud gauges used for a majority of the craft in FringeSpace, but one faction has an octagon instead of an ellipse.

Sorry I couldn't find a bigger picture...  :nervous:

All of the faction's radars have 359 degree forward viewing cone... if that makes any sense. The inside ellipse there marks where the target "should" be on the player's screen, but that will be probably done using some texture magic. Edit: Now that I think of it, the actual radar itself may be a 180 degree viewing cone, but everything beyond 180 is constrained to the edges of its nearest projection. I'm just not sure... this is a weird radar to say the least, Lol.

I was also thinking of adding an option to the n-gon so that you could rotate where the vert's would be, so that people could get something like a heptagon with one vertix pointing up, down, left, etc... if they ever wanted to.


Shoot, I really need to find time to code more fun stuff like this.
« Last Edit: November 08, 2011, 06:35:07 pm by z64555 »
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 

Offline JGZinv

  • 211
  • The Last Dual! Guardian
    • The FringeSpace Conversion Mod
Re: My take on the 2D radar
You made a good point, sorry about forgetting the other hud style.
True power comes not from strength, but from the soul and imagination.
Max to PCS2 to FS2 SCP Guide
The FringeSpace Conversion Mod

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Steam
Re: My take on the 2D radar
You made a good point, sorry about forgetting the other hud style.

It happens  :P
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 

Offline TwentyPercentCooler

  • Operates at 375 kelvin
  • 28
Re: My take on the 2D radar
No welcome beam? Ah well, welcome to HLP, Angs! Is your name related to angstroms, by any chance?

Good work on the radar, I'll actually try this out. For whatever reason, I prefer the 2D radars.

 

Offline Commander Zane

  • 212
  • Spoot Knight of Anvils
Re: My take on the 2D radar
You made a good point, sorry about forgetting the other hud style.

It happens  :P
It's just the Bora. :p
GalSpan all the way. ;7

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Steam
Re: My take on the 2D radar
You made a good point, sorry about forgetting the other hud style.

It happens  :P
It's just the Bora. :p
GalSpan all the way. ;7

Well there's also the 'neutral' hud seen in the Mako, but as far as the radar hud goes, it's the same.

I guess Bora just like being different than the rest of Sol space.

Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

  

Offline Angs

  • 22
Re: My take on the 2D radar

I was originally just thinking of constraining them to fit inside the n-gon, but they would still be projected to an ellipse. JGZ's picture shows the hud gauges used for a majority of the craft in FringeSpace, but one faction has an octagon instead of an ellipse.

Constraining to an ellipse is simpler than a general n-gon. Before scaling and transposing x and y offsets, draw only if abs(x)<cos(pi/8) && abs(y)<cos(pi/8) && abs(x)+abs(y)<(3-sqrt(2))*cos(pi/8).


All of the faction's radars have 359 degree forward viewing cone... if that makes any sense. The inside ellipse there marks where the target "should" be on the player's screen, but that will be probably done using some texture magic. Edit: Now that I think of it, the actual radar itself may be a 180 degree viewing cone, but everything beyond 180 is constrained to the edges of its nearest projection. I'm just not sure... this is a weird radar to say the least, Lol.

After watching a few youtube clips, I must agree that it sure is weird :)

No welcome beam? Ah well, welcome to HLP, Angs! Is your name related to angstroms, by any chance?

Good work on the radar, I'll actually try this out. For whatever reason, I prefer the 2D radars.

Thank you! And no, not related. :) (Where I come from those would be called ångströms)
Well in any case, the radar is a mapping of the 3D space to a 2D screen, it's just a matter whether it tries to look 3D. The orb radar is quite ambiguous when something is close to the borders, not to mention that there are almost always two points that are projected to the same place. This gets especially bad with radar icons.

 

Offline chief1983

  • Still lacks a custom title
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: My take on the 2D radar
Really, having two full circles for the radar makes the icons even more attractive to use if you ask me, they have all that radar real estate to use now :)
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays