Jump to content
Sign in to follow this  
mue

showing label as a dot mod

Recommended Posts

As most of you know spotting other aircraft in SF2 is quite difficult.
I think most are using the red targeting box to engage enemy aircraft. But only the currently targeted aircraft is marked with the red box and not the other aircrafts.
Another option would be to turn labels on (HUD Display option set to "Easy"). Unfortunately the label text is too verbose and is also shown at too long distances. Some people already had the idea to change the label text into a single dot but AFAIK nobody has accomplished it yet...until now...

I proudly present the "dot label mod": dot_label_mod.zip

With this mod labels are shown as a dot and only within a distance of 10 nm. This mod uses a modified text drawing shader that hides all characters and digits of the label text and only draws the "dot" character. Unfortunately there is a negative side effect: the text in the target info box is also "filtered" by this shader and therefore not correctly displayed. So I disabled the target info box. Furthermore to get rid of the way point label text (which shows up if the HUD Display option is set to "Easy") the shader also completely hides all text that is drawn with NormalColor. This means that also the text in the top info box and in the bottom left info box is hidden. But the afterburner message is still shown.

To install this mod just put the contents of the zip file (huddata.ini and twfont.fx) into your Flight folder and set the HUD Display option to "Easy".
The enemies are shown with red dots, and friendlies are shown with blue dots. But you can change the colors to your liking by changing the values of EnemyTargetColor and/or FriendlyTargetColor in the huddata.ini AND setting exactly the same values (without the alpha compononent) in the twfont.fx files:

 

e.g:
if you set in huddata.ini

EnemyTargetColor=0.1,0.2,0.3,0.4

you must set in twfont.fx

float3 EnemyTargetColor = float3(0.1,0.2,0.3);
  • Like 6
  • Thanks 1

Share this post


Link to post
Share on other sites

I've installed this mod but It's not having the desired effects in terms of only showing a dot. The full labels are displayed.

Share this post


Link to post
Share on other sites

Correction: the full labels are displayed whenever I make any changes to the TWFONT file (i.e. in order to change the colors)

Share this post


Link to post
Share on other sites

Correction: the full labels are displayed whenever I make any changes to the TWFONT file (i.e. in order to change the colors)

 

If you change the colors in the twfont.fx file you must also change the colors in huddata.ini. The enemy/friendly target color in twfont.fx must exactly be the same as in huddata.ini (ignoring the alpha value).

Or maybe you introduced a syntax error in the twfont.fx and the game engine fall back to the original fx file.

Can you send me your huddata.ini and twfont.fx file so that I can check it.

Edited by mue

Share this post


Link to post
Share on other sites

Lol got it working after digging up my CS101 knowledge from the depths of my brain. I actually realized this might be perfect for another project of mine - I've got two other questions: would it be possible to use this to hide the text displayed by the message system but only the white text? Second, would it be possible to make this show only digits but not characters (so that the distance is shown but not the type)?

Share this post


Link to post
Share on other sites

I have a question here. Is it possible to still have the target info displayed in the lower right?

 

The reason for this is that it's the only way on mission types like SEAD to determine which targets are you primary targets... I guess the full target info isn't even needed. Just a way to know when you've targeted a primary target...

 

Edit - NM. I re-read the OP and now see this is a limitation of how this was accomplished

Edited by malibu43

Share this post


Link to post
Share on other sites

For some reason I see labels not as dots, but as small vertical dashes. Can I make them into dots somehow? Also, what are the numbers do I put in for dark-grey color?

img00060.JPG

img00062.JPG

Share this post


Link to post
Share on other sites
13 hours ago, Dornil said:

For some reason I see labels not as dots, but as small vertical dashes. Can I make them into dots somehow? Also, what are the numbers do I put in for dark-grey color?

In the huddata.ini the following must be set:

[SmallLabelFont]
TextFontName=Courier
TextSize=10

The color numbers for grey are x,x,x. For dark-grey x is small, e.g EnemyTargetColor=0.1, 0.1, 0.1

Share this post


Link to post
Share on other sites

But it is set! Courier and 10:dntknw:

Edited by Dornil

Share this post


Link to post
Share on other sites

Could it be related to difference in system fonts or to ingame resolution? 

Which parameters in TWFONT.FX can I play with to try and make it work as it should be?

Share this post


Link to post
Share on other sites
11 hours ago, Dornil said:

Could it be related to difference in system fonts or to ingame resolution? 

Which parameters in TWFONT.FX can I play with to try and make it work as it should be?

The relevant parameters are uvMin and uvMax in lines 93 and 94. These parameters define the rectangular area (which should contain the "dot") on the font texture. Only fragments (pixels) with texture coordinates within that rectangular area are drawn visibly.

Share this post


Link to post
Share on other sites

Any method to find this dot spot, other that try and fail?

Share this post


Link to post
Share on other sites
20 minutes ago, Dornil said:

Any method to find this dot spot, other that try and fail?

None that I know of.
I think I used some kind of binary search:
1.) split the texture in two halfs: rectangle1 with uvMin / uvMax = (0.0,0.0) / (0.5,1.0); rectangle2 with  (0.5,0.0) / (1.0, 1.0)
2.) try both rectangles and check with which the dot (besides other characters) is drawn.
3.) split this rectangle further on (step 1.)): e.g. if the dot is in rectangle 2, then the next two (smaller) rectangle areas to check are (0.5,0.0) / (1.0,0.5) and (0.5,0.5) / (1.0,1.0)

Share this post


Link to post
Share on other sites

Sorry, I'm not following:( What is that texture we are talking about?

Currently I can't see any characterts in the labels, just some frangments.

Share this post


Link to post
Share on other sites
9 hours ago, Dornil said:

Sorry, I'm not following:( What is that texture we are talking about?

Currently I can't see any characterts in the labels, just some frangments.

The font texture is internally generated by the game accordingly to the given font type and size. An example you can see here: https://learnopengl.com/In-Practice/Text-Rendering

If your defined texture area (uvMin, uvMax) cuts some characters then only fragments of those characters are drawn .

Share this post


Link to post
Share on other sites

Where can I see this particular texture, generated by SF2? Just to understand where to move the rectangle. Can I also somehow increase the size of this rectangle temporarily, to see where it is on the texture?

Share this post


Link to post
Share on other sites

Oh, finally got the idea!:) Narrowed down to (0.228,0.0);(0.272,0.05), will finish tomorrow.

Thank you!

Share this post


Link to post
Share on other sites

Hey I'm curious what lines determine the 10nm limit for this. Curious if its possible to limit display of labels to within 10nm but not modify the text?

Share this post


Link to post
Share on other sites
5 hours ago, Neurosci said:

Hey I'm curious what lines determine the 10nm limit for this. Curious if its possible to limit display of labels to within 10nm but not modify the text?

The draw distance for labels is determined by the game engine and AFAIK can not be changed.
What my mod does is, it blocks all characters but the 'dot'. The distance text for distances greater 10 nm is drawn in the format x nm (e.g. 23 nm). That text contains no 'dot', all text is blocked. If the distance is less than 10 nm, the format changes to x.x nm (e.g. 9.9 nm). That text contains a 'dot' and the dot is visible because it's not blocked.

Edited by mue
changed wording

Share this post


Link to post
Share on other sites
7 hours ago, mue said:

The draw distance for labels is determined by the game engine and AFAIK can not be changed.
What my mod does is, it blocks all characters but the 'dot'. The distance text for distances greater 10 nm is drawn in the format x nm (e.g. 23 nm). That text contains no 'dot', all text is blocked. If the distance is less than 10 nm, the format changes to x.x nm (e.g. 9.9 nm). That text contains a 'dot' and the dot is visible because it's not blocked.

Gotcha. Do you think its possible to use that same concept to block all text over that distance as it already does, but still display all text under that distance?

Share this post


Link to post
Share on other sites
16 hours ago, Neurosci said:

Gotcha. Do you think its possible to use that same concept to block all text over that distance as it already does, but still display all text under that distance?

No.

Share this post


Link to post
Share on other sites

Excuse the Necroposting, but don't feel my question deserves a new threat.

- Is there any way to asignate Labels to SAM and or missiles?

Thanks!

Share this post


Link to post
Share on other sites

I supose is a "NO" then. 

Share this post


Link to post
Share on other sites
Posted (edited)

not necessarily a no. just not a yes :lol:

my guess however, is that the labels apply to targetable vehicles, while AAMs/SAMs are considered ammo and thus dont get labels

Edited by daddyairplanes
  • Haha 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use, Privacy Policy, and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..