Page 1 of 2

Font size for targeting system?

Posted: Tue Feb 05, 2013 8:54 am
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.

Re: Font size for targeting system?

Posted: Tue Feb 05, 2013 10:34 am
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.

Re: Font size for targeting system?

Posted: Tue Feb 05, 2013 5:07 pm
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)

Re: Font size for targeting system?

Posted: Tue Feb 05, 2013 5:16 pm
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.)

Re: Font size for targeting system?

Posted: Tue Feb 05, 2013 5:23 pm
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:
...

Re: Font size for targeting system?

Posted: Tue Feb 05, 2013 5:51 pm
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.

Re: Font size for targeting system?

Posted: Tue Feb 05, 2013 5:53 pm
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:

Re: Font size for targeting system?

Posted: Wed Feb 06, 2013 12:06 am
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.

Re: Font size for targeting system?

Posted: Wed Feb 06, 2013 7:22 am
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.

Re: Font size for targeting system?

Posted: Thu Feb 07, 2013 5:45 am
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...

Re: Font size for targeting system?

Posted: Thu Feb 07, 2013 7:37 am
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...!

Re: Font size for targeting system?

Posted: Tue Oct 08, 2013 6:15 am
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?

Re: Font size for targeting system?

Posted: Tue Oct 08, 2013 6:25 am
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.

Re: Font size for targeting system?

Posted: Wed Oct 09, 2013 12:57 am
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.)

Re: Font size for targeting system?

Posted: Wed Oct 09, 2013 9:02 am
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.