Author Topic: [CODE REVIEW] Adaptable HUD, a.k.a. No more HUD stretching, for real this time  (Read 42283 times)

0 Members and 1 Guest are viewing this topic.

Offline niffiwan

  • 211
  • Eluder Class
Re: [CODE REVIEW] Adaptable HUD, a.k.a. No more HUD stretching, for real this time
UPDATE: now committed; let me know if there are any issues and I'll clean them up pronto.

Right, I'm happy with all the "retail" screenshots (see below) and code.  Scaling can be set in three places in the hud gauges table:

1) At the top - also sets whether "missing retail gauges" will scale or not
2) At the start of each specified resolution filter (will override the setting from the top)
3) At each individual gauge (will override settings at both the top of the file and in the relevant resolution filter.

Any further comments before I commit this?  (I've left scaling ON by default for now, but it's easy to change the other way if desired)

Screenies (scaled on the left, not scaled on the right)

1024x768
 

1280x1024
 

1440x900
 

1600x900
 

1680x1050
 

1680x480
 

3200x960
 

Code: (minimal no-scaling hud gauge table) [Select]
$Scale Gauges: no
« Last Edit: January 01, 2014, 03:01:21 am by niffiwan »
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline Yarn

  • 210
Re: [CODE REVIEW] Adaptable HUD, a.k.a. No more HUD stretching, for real this time
It seems all right to me.
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178

 

Offline niffiwan

  • 211
  • Eluder Class
Re: [CODE REVIEW] Adaptable HUD, a.k.a. No more HUD stretching, for real this time
Thanks.

I've also just committed two minor tweaks:
1) ensure that origin & offset are used together
2) moved one of the $Scale Gauges options to avoid causing issues when both it & $Reticle Style are used.

Any comments are welcome.

(next up will be a review of the other trio of patches from Yarn)
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 
Re: [CODE REVIEW] Adaptable HUD, a.k.a. No more HUD stretching, for real this time
Is current fs2_open_3_7_1_SSE2_Yarn.exe version compatible with MediaVPS2014?

They say exec version must be later than 1 of january

In other hand:

Can someone place an example of hud_gauges.tbl with the "$Scale Gauges: no" sentence to see exact placement and "ortography"

(excuse mi poor english and tk in advance)

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: [CODE REVIEW] Adaptable HUD, a.k.a. No more HUD stretching, for real this time
Is current fs2_open_3_7_1_SSE2_Yarn.exe version compatible with MediaVPS2014?

They say exec version must be later than 1 of january
Current nightly builds should have the adaptable HUD code.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline wookieejedi

  • 29
  • Intensify Forward Firepower
Re: [CODE REVIEW] Adaptable HUD, a.k.a. No more HUD stretching, for real this time
I searched through this thread but didn't find an answer to this: Is the scaling, origin, and offset compatible with RTT, such as on a cockpit display?

 

Offline niffiwan

  • 211
  • Eluder Class
Re: [CODE REVIEW] Adaptable HUD, a.k.a. No more HUD stretching, for real this time
Can someone place an example of hud_gauges.tbl with the "$Scale Gauges: no" sentence to see exact placement and "ortography"

This should be all you need to get a retail Freespace 2 hud without scaling:

Code: [Select]
$Scale Gauges: no
#End

(yes, just two lines is all you should need, and it'll even work without the 2nd one :))

I searched through this thread but didn't find an answer to this: Is the scaling, origin, and offset compatible with RTT, such as on a cockpit display?

Sorry, I didn't actually test RTT with the new parameters. I didn't think Origin/Offset/Scaling were related to RTT but I didn't examine the code to make sure.
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 
Re: [CODE REVIEW] Adaptable HUD, a.k.a. No more HUD stretching, for real this time
Hi again

I receive this error when addinh non scaling line...

hud_gauges.tbl(line 61):
Error: Missing required token: [#End]. Found [$Scale Gauges: no] instead.

KERNELBASE.dll! ReleaseMutex + 109 bytes
kernel32.dll! WaitForSingleObjectEx + 67 bytes
kernel32.dll! WaitForSingleObject + 18 bytes
fs2_open_3_7_1-20140104_r10277.exe! <no symbol>
fs2_open_3_7_1-20140104_r10277.exe! <no symbol>

can someone help?

 

Offline niffiwan

  • 211
  • Eluder Class
Re: [CODE REVIEW] Adaptable HUD, a.k.a. No more HUD stretching, for real this time
Are you using the most recent nightly build? http://www.hard-light.net/forums/index.php?topic=86488.0
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: [CODE REVIEW] Adaptable HUD, a.k.a. No more HUD stretching, for real this time
fs2_open_3_7_1-20140104_r10277.exe
Certainly looks like it.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 
Re: [CODE REVIEW] Adaptable HUD, a.k.a. No more HUD stretching, for real this time
Yup, near the last

I think that's not poblem reason...

 

Offline Yarn

  • 210
Re: [CODE REVIEW] Adaptable HUD, a.k.a. No more HUD stretching, for real this time
Can you post your HUD table?
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178

 
Re: [CODE REVIEW] Adaptable HUD, a.k.a. No more HUD stretching, for real this time
#Gauge Config
 $Base: (1280, 640)
 $Min: (1280, 640)
 $Gauges:
  +Messages:
   Origin: (0.34, 0.0)
   Offset: (8, 5)
  +Wingman Status:
   Origin: (0.66, 0.0)
   Offset: (-92, 144)
  +Auto Speed:
   Origin: (0.66, 1.0)
   Offset: (-64, -96)
  +Auto Target:
   Origin: (0.66, 1.0)
   Offset: (-64, -120)
  +Countermeasures:
   Origin: (0.66, 1.0)
   Offset: (-144, -166)
  +Talking Head:
   Origin: (0.34, 0.0)
   Offset: (5, 56)
  +Directives:
   Origin: (0.34, 0.5)
   Offset: (5, -106)
  +Weapons:
   Origin: (0.66, 1.0)
   Offset: (-144, -257)
  +Squad Message:
   Origin: (0.66, 0.0)
   Offset: (-197, 5)
  +Escort View:
   Origin: (0.66, 0.5)
   Offset: (-159, -54)
  +Mission Time:
   Origin: (0.66, 1.0)
   Offset: (-55, -52)
  +Target Monitor:
   Origin: (0.34, 1.0)
   Offset: (5, -178)
  +Extra Target Data:
   Origin: (0.34, 1.0)
   Offset: (5, -216)
  +Multiplayer Messages:
   Origin: (0.34, 0.5)
   Offset: (8, -144)
  +Voice Status:
   Origin: (0.34, 0.5)
   Offset: (8, -129)
  +Ping:
   Origin: (0.66, 0.0)
   Offset: (-128, 5)
  +Kills:
   Origin: (0.66, 1.0)
   Offset: (-144, -144)
  +Fixed Messages:
  +ETS Retail:
   Origin: (0.66, 1.0)
   Offset: (-144, -120)
 $End Gauges
#End

 
Re: [CODE REVIEW] Adaptable HUD, a.k.a. No more HUD stretching, for real this time
mi real res is 3840x1024

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: [CODE REVIEW] Adaptable HUD, a.k.a. No more HUD stretching, for real this time
Does that mean you're trying to put it after "$End Gauges"?
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline niffiwan

  • 211
  • Eluder Class
Re: [CODE REVIEW] Adaptable HUD, a.k.a. No more HUD stretching, for real this time
fs2_open_3_7_1-20140104_r10277.exe
Certainly looks like it.

Oh derp!  :banghead:

For that table, add it on the line before: "#Gauge Config"

Code: [Select]
$Scale Gauges: no
#Gauge Config
 $Base: (1280, 640)
 $Min: (1280, 640)
 $Gauges:
  +Messages:
   Origin: (0.34, 0.0)
   Offset: (8, 5)
(etc)
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 
Re: [CODE REVIEW] Adaptable HUD, a.k.a. No more HUD stretching, for real this time
Now is working

Ty very much

 
Re: [CODE REVIEW] Adaptable HUD, a.k.a. No more HUD stretching, for real this time
Complete Newb Questions so I apologize in advace. I am trying to play Blue Planet but I would like to use Yarn's adaptable Hud as I really like the look of it in the Freespace 2 campaign. Originally it looks like their was a Blue Planet Build that had that hud in the original post but it is not crossed out and can't be accessed. Is there a BP build that uses the adaptable hud? Any help is greatly appreciated. Thanks

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: [CODE REVIEW] Adaptable HUD, a.k.a. No more HUD stretching, for real this time
Even if there is, I'm not sure it's a good idea. BP adds a ton of custom hud gauges, and I'd have to ask a coder how well those are supported. (A coder will probably be by shortly to tell us!)

e: You can always install the BP Compatibility Package and then play on a recent nightly build. That should have the adaptable HUD stuff.

 

Offline niffiwan

  • 211
  • Eluder Class
Re: [CODE REVIEW] Adaptable HUD, a.k.a. No more HUD stretching, for real this time
Even if there is, I'm not sure it's a good idea. BP adds a ton of custom hud gauges, and I'd have to ask a coder how well those are supported. (A coder will probably be by shortly to tell us!)

Custom gauges should be fully supported with the new adaptable hud code.  The only caveat being that depending on the hud table config, the new code may not be used (and I would guess that the current BP HUD would be like this since it pre-dates the adaptable HUD)

e: You can always install the BP Compatibility Package and then play on a recent nightly build. That should have the adaptable HUD stuff.

Yeah - I've done this a few times and it works just fine, but I haven't been examining the HUD in detail to look for differences created by the new HUD code.
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...