Font size for targeting system?

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
Keeper
---- E L I T E ----
---- E L I T E ----
Posts: 273
Joined: Fri Feb 01, 2013 7:44 am
Location: Indian Hills, Nevada, USA

Font size for targeting system?

Post by Keeper »

I made my own HUD suitable for widescreen use and with smaller fonts all around, but I can't seem to figure how to change the size of the target information from the Scanner Targeting Enhancement, where it draws a box around the current target and displays next to that box, in gigantic letters, the name of and distance to the target. I'd really like to halve (or more) the size of those letters, but adding height/width and/or row_height values to the Targeting Enhancement's entry in the HUD plist has no effect, and I can't seem to find where in any other game files this font size is determined. Is it hard-coded? If so, phooey.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6626
Joined: Wed Feb 28, 2007 7:54 am

Re: Font size for targeting system?

Post by another_commander »

I don't think you can change the size of the font used in the reticle at this time. It is not exactly hard-coded, but it is the only HUD string element for which size depends on the position of the player and the target. If you move the target towards the bottom corners of the screen, you will notice that the text is rendered with bigger characters than when facing the target directly.

We can probably introduce a user settable size factor in the calculation, but this would have to be considered once we have liberty to add features again. If you would add a feature request on Berlios, it would be great and would give us a chance to have this, together with the rest of the requests made so far, in one place for when feature-freeze is lifted.
User avatar
GGShinobi
---- E L I T E ----
---- E L I T E ----
Posts: 291
Joined: Tue Dec 25, 2012 7:20 pm

Re: Font size for targeting system?

Post by GGShinobi »

another_commander wrote:
If you would add a feature request on Berlios, it would be great and would give us a chance to have this, together with the rest of the requests made so far, in one place for when feature-freeze is lifted.
Cool, I didn't know that such a feature-request-side existed! 8)
忍 knowing that enough is enough, you'll always have enough.

Running Oolite 1.77 on Ubuntu Linux 12.04 LTS
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Font size for targeting system?

Post by Cody »

GGShinobi wrote:
I didn't know that such a feature-request-side existed!
Yeah, the Devs love feature requests... they've got a big spike ready and waiting for them!

(Merely jesting, your Lordships.)
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
GGShinobi
---- E L I T E ----
---- E L I T E ----
Posts: 291
Joined: Tue Dec 25, 2012 7:20 pm

Re: Font size for targeting system?

Post by GGShinobi »

El Viejo wrote:
GGShinobi wrote:
I didn't know that such a feature-request-side existed!
Yeah, the Devs love feature requests... they've got a big spike ready and waiting for them!

(Merely jesting, your Lordships.)
:lol: yeah, than they can celebrate now, I've got a myriad of awesome requests!! Surely very easy to implement!
... let's see... :roll:
multiplayer!! Oh, already on the list... why hasn't that been implemented yet? *shake head* :wink:
...
忍 knowing that enough is enough, you'll always have enough.

Running Oolite 1.77 on Ubuntu Linux 12.04 LTS
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Font size for targeting system?

Post by cim »

GGShinobi wrote:
multiplayer!! Oh, already on the list... why hasn't that been implemented yet? *shake head* :wink:...
Well, it's more interesting to do things that can't already be done with OXPs.
User avatar
GGShinobi
---- E L I T E ----
---- E L I T E ----
Posts: 291
Joined: Tue Dec 25, 2012 7:20 pm

Re: Font size for targeting system?

Post by GGShinobi »

cim wrote:
GGShinobi wrote:
multiplayer!! Oh, already on the list... why hasn't that been implemented yet? *shake head* :wink:...
Well, it's more interesting to do things that can't already be done with OXPs.
:lol:
忍 knowing that enough is enough, you'll always have enough.

Running Oolite 1.77 on Ubuntu Linux 12.04 LTS
User avatar
Keeper
---- E L I T E ----
---- E L I T E ----
Posts: 273
Joined: Fri Feb 01, 2013 7:44 am
Location: Indian Hills, Nevada, USA

Re: Font size for targeting system?

Post by Keeper »

another_commander wrote:
I don't think you can change the size of the font used in the reticle at this time. It is not exactly hard-coded, but it is the only HUD string element for which size depends on the position of the player and the target. If you move the target towards the bottom corners of the screen, you will notice that the text is rendered with bigger characters than when facing the target directly.
I will? Well, I didn't until it was pointed out. Yeah, don't think that's necessary. A simple constant size which can be set in the HUD parameters is much more preferable.

You say it isn't exactly hard-coded, though... Where IS this string element, then, for those of us who want to poke around and tweak the base size in the mean time?

I'll definitely add this to the suggestion box anyway.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6626
Joined: Wed Feb 28, 2007 7:54 am

Re: Font size for targeting system?

Post by another_commander »

Keeper wrote:
Yeah, don't think that's necessary. A simple constant size which can be set in the HUD parameters is much more preferable.
Actually, I think this is a very nice effect and I like how the text seems to follow the OpenGL 3D field of view visualization style. My vote is that it stays in and a user scaling factor is used to change the size if and when needed.
You say it isn't exactly hard-coded, though... Where IS this string element, then, for those of us who want to poke around and tweak the base size in the mean time?
HeadUpDisplay.m, static void hudDrawReticleOnTarget function, around line 3009:

Code: Select all

   // add text for reticle here
	range *= 0.001f;
	if (range < 0.001f) range = 0.0f;	// avoids the occasional -0.001 km distance.
	NSSize textsize = NSMakeSize(rdist * ONE_SIXTYFOURTH, rdist * ONE_SIXTYFOURTH);
	float line_height = rdist * ONE_SIXTYFOURTH;
	NSString*	info = [NSString stringWithFormat:@"%0.3f km", range];
	if (legal_desc != nil) info = [NSString stringWithFormat:@"%@ (%@)", info, legal_desc];
	// no need to set colour here
	OODrawString([player1 dialTargetName], rs0, 0.5 * rs2, 0, textsize);
	OODrawString(info, rs0, 0.5 * rs2 - line_height, 0, textsize);
textsize is the variable you want to tweak. rdist is the magnitude of the vector resulting from the subtraction of the player's viewpoint position and target position vectors and is low-capped to the ONE_SIXTYFOURTH value.
User avatar
Keeper
---- E L I T E ----
---- E L I T E ----
Posts: 273
Joined: Fri Feb 01, 2013 7:44 am
Location: Indian Hills, Nevada, USA

Re: Font size for targeting system?

Post by Keeper »

another_commander wrote:
Actually, I think this is a very nice effect and I like how the text seems to follow the OpenGL 3D field of view visualization style. My vote is that it stays in and a user scaling factor is used to change the size if and when needed.
Yeah, that's certainly ideal. I was just thinking for ease of implementation, if one had to take precedence over the other. After all, the text in "reality" isn't where the ship is; it's on a screen right in front of you, projected into your field of view. So there's no requirement for the text scaling other than to make it appear more like the text really is not on your display screen.
textsize is the variable you want to tweak. rdist is the magnitude of the vector resulting from the subtraction of the player's viewpoint position and target position vectors and is low-capped to the ONE_SIXTYFOURTH value.
Got it. First try, I've ended up with text that is just dots at a distance and super-huge up close. Obviously I broke the scaling cap. I'll poke around a bit more...
User avatar
Keeper
---- E L I T E ----
---- E L I T E ----
Posts: 273
Joined: Fri Feb 01, 2013 7:44 am
Location: Indian Hills, Nevada, USA

Re: Font size for targeting system?

Post by Keeper »

Success!

I realized, when having trouble figuring out how to change the font alone, that I didn't really need to change the font alone; the smallest permissible size of the target box was rather large too. Seeing that ONE_SIXTYFOURTH was used only for the target box and the text, I just changed its definition to 0.0078125 (one_onehundredtwentyeighth, if you will).

A few quick full-size screenshots from far, medium and close distances:
http://www.keeper1st.com/pics/oolite/ta ... istant.png
http://www.keeper1st.com/pics/oolite/targettextfar.png
http://www.keeper1st.com/pics/oolite/ta ... tclose.png

Thanks! Now I hope this 1.77.1 is stable...!
User avatar
Keeper
---- E L I T E ----
---- E L I T E ----
Posts: 273
Joined: Fri Feb 01, 2013 7:44 am
Location: Indian Hills, Nevada, USA

Re: Font size for targeting system?

Post by Keeper »

Digging up this old thread just to say thanks to cim for adding the "reticle_scale" parameter today. Yay!

Updated my HUD OXP to use it. Now, I see the commit, but is it in the trunk build yet or should I wait a few days to compile a new build?
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Font size for targeting system?

Post by cim »

At the moment it's just in the "hud-improvements" branch, which is waiting for me to finish and test another HUD feature before I merge it back into the main build.

So you can do "git checkout hud-improvements" and then build if you want to test it now, or you can wait a couple of weeks (hopefully not longer...) and just build master.
User avatar
Keeper
---- E L I T E ----
---- E L I T E ----
Posts: 273
Joined: Fri Feb 01, 2013 7:44 am
Location: Indian Hills, Nevada, USA

Re: Font size for targeting system?

Post by Keeper »

As I'm now playing Oolite on a 64-bit Windows system, I think I'll wait, as it looks like I may have to compile it on the old 32-bit system then transfer it over to this system. (Haven't tried compiling it from source on this 64-bit system but apparently others have had trouble, so I'm not keen on it. I haven't played with the new 1.77.1 deployment version yet -- only installed it -- so we'll see if I get annoyed enough by having a giant reticle and text again after so long having the smaller version in my previous build.)
User avatar
JazHaz
---- E L I T E ----
---- E L I T E ----
Posts: 2991
Joined: Tue Sep 22, 2009 11:07 am
Location: Enfield, Middlesex
Contact:

Re: Font size for targeting system?

Post by JazHaz »

Keeper wrote:
I realized, when having trouble figuring out how to change the font alone, that I didn't really need to change the font alone; the smallest permissible size of the target box was rather large too. Seeing that ONE_SIXTYFOURTH was used only for the target box and the text, I just changed its definition to 0.0078125 (one_onehundredtwentyeighth, if you will).

A few quick full-size screenshots from far, medium and close distances:
http://www.keeper1st.com/pics/oolite/ta ... istant.png
http://www.keeper1st.com/pics/oolite/targettextfar.png
http://www.keeper1st.com/pics/oolite/ta ... tclose.png
Nice screenshots. The text size is nice, but only if you have 20/20 vision lol. If you have a problem with your eyesight that could be a little difficult to read.

What HUD is that? I like that the comms is next to the scanner.
Keeper wrote:
As I'm now playing Oolite on a 64-bit Windows system, I think I'll wait, as it looks like I may have to compile it on the old 32-bit system then transfer it over to this system. (Haven't tried compiling it from source on this 64-bit system but apparently others have had trouble, so I'm not keen on it.
If you do manage to make a 64-bit Windows build, please report back on what's its like. I have 64-bit Windows (Windows 7) also here, but just running the 32-bit build like most people.
Post Reply