Author Topic: HUD Overhaul Test Build  (Read 43077 times)

0 Members and 1 Guest are viewing this topic.

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: HUD Overhaul Test Build
Scripting features involving the new HUD specification are planned. The plan would be to perhaps have the Custom gauge HUD object type have a Script: field which a user can define a Lua function or source file that will provide additional logic for a more dynamic user-defined gauge with access to the HudGauge class methods so the script writer won't have to worry about the various transformations that FS2 does (TrackIR, afterburner shakes, screen position)

In any case, would it really bother anyone if we change the behavior of On HUD Draw to not disable the HUD? If someone really wants to completely replace the HUD with this new HUD spec, they can just set Load Retail Configuration to No in hud_gauges.tbl and not define any gauges.

i kinda think it should still use the existing overrides and toggles. one way to toggle the hud is to use hu.HUDDrawn, this allows you to turn the hud on and off say, if youre using a camera view. unfortunately it doesnt give you control over when the hud is rendered, and i assume it runs immediately after scene render. the other is with the +override: tag in the scripting.tbl. i think if the existing features remain functional that should be satisfactory, and should allow for complete hud replacement.

So, should we create a new hook then? Something called With HUD Draw?

Custom gauges already have a "Gauge Type" field. If you want to hypothetically replace the weapons gauge, you'd define a Custom gauge in hud_gauges.tbl with Gauge Type: WEAPONS_GAUGE and Script: hud_new_weapons.lua or something like that.

That's the best I can think of a scripting interface that plays nice with the new HUD spec.

id make available an array of hud gauges available to scripting (much how ships or weapons would work).  you could iterate through gauges, or pull one up by name, and each one would have all the relevant parameters associated with that gauge, size, position, etc, including the ability to turn it on or off, render it, and so on. this could be used in the embedded script, or in your usual scripting files. it would be the most convenient and familiar way to go about it.
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 Aardwolf

  • 211
  • Posts: 16,384
    • Minecraft
Possibly something that comes up before the normal HUD draw code is called, which gives the Lua scripting a chance to modify how that will be done (disable specific gauges, change positions, etc.)

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
ideally pre draw and post draw hooks, say i wanted to set a render target and unset post draw.  of course it still dont fix the transparency issue i had.
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 swashmebuckle

  • 210
  • Das Lied von der Turd
    • The Perfect Band
Sweet, the Target viewer/extra target info are now working great, and wingman1-3 have been unlocked.  I still can't use the wingman "Dot Filename" line, and there are collisions between the lowest dots (in their retail positions) and the wing name text--will there be an option to control the wing name's Y-position based on the number of dots present?  And would it be possible to now enable more than 6 dots per wing?  It'd be great for SWC if we could do full squadrons of 12 Tie Fighters, etc.

Damn, other than that and the lines to rename gauge headers, I can't think of anything else I might need.  Impressive...most impressive :)

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️À➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Bigger wings I think might be limited by more than just the HUD, but I'm not sure about that.
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 Swifty

  • 210
  • I reject your fantasy & substitute my own
Bigger wings I think might be limited by more than just the HUD, but I'm not sure about that.
It's limited by MAX_SHIPS_PER_WING. It's used by the code everywhere from mission management, AI, FRED, and of course, the HUD. God knows what will happen if you arbitarily changed that value. It's not something we can willy nilly cap off.

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️À➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
So, bout how close are we now?  Need to get something into Antipodes soon.
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 Swifty

  • 210
  • I reject your fantasy & substitute my own
I guess all I have to do now is write in support to replace the headers of the gauges and I think I'm done. Unless people have more bugs to report.

 

Offline Swifty

  • 210
  • I reject your fantasy & substitute my own
I still can't use the wingman "Dot Filename" line, and there are collisions between the lowest dots (in their retail positions) and the wing name text--will there be an option to control the wing name's Y-position based on the number of dots present?
BTW, swashmebuckle, can you give me a screenshot in 1024x768 res of the wingmen gauge with wings of 6? I'd like to do some pixel counting to make sure the retail defaults are correct. :P

 

Offline swashmebuckle

  • 210
  • Das Lied von der Turd
    • The Perfect Band
ja check PMs.  They do look kinda cramped if that's what you're referring to

 
All this screen space is blowing my mind, great work. I did notice that there isn't a "Launch" or "Evaded" indicator when a missile is fired at me though.
Did you hear that fellas? She says I have a Meritorious Unit.

 

Offline swashmebuckle

  • 210
  • Das Lied von der Turd
    • The Perfect Band
Hey Swifty, I've been testing with chief's mac build at r6481 and the wingman dots are up and running for me.  I'm now trying to integrate some new fonts in, and having some difficulty with vertical spacing.  Basically, my replacement 9pt font seems to be a little taller than what can be cleanly supported atm and I am getting collisions in the messages window and the objectives gauge.  I got around this problem with my replacement for the smaller font01 by putting in an extra blank pixel of height under each character in the font file, but there seems to be a set line spacing value that the 9 point font is just too large for.  With even larger fonts it starts to clip the bottoms of the characters off.  If the line spacing and how many lines appear at once in the messages could be controlled in the table that would enable me to use the bigger font for all of the gauges (though training messages seems a little odd too--no assignable image or text spacing so far?).

That and the documentation for how to implement the wing name spacing and custom headers are all I can think of for how to improve the HUD.  It's really looking fantastic: Huge props :yes:

 
Quickly skimming through this thread... are you referring to the existing cockpit hud by moving it around the screen?  (i.e. not the render to texture one being proposed?)
That's cool and ....disturbing at the same time o_o  - Vasudan Admiral

"Don't play games with me. You just killed someone I like, that is not a safe place to stand. I'm the Doctor. And you're in the biggest library in the universe. Look me up."

"Quick everyone out of the universe now!"

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️À➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Have you been under a rock lately?  :)

If you're asking what this entire thread is about, it's about revamping the retail ship HUD to be much, much, much more flexible, including things like full repositioning of gauges, full custom gauge support, and fixing non-4:3 stretching issues.  I don't know how else to take your question if that's not what you meant, it doesn't seem like it's in the context of a recent reply.  In fact, this code is just about ready for Antipodes testing, either preceded or followed by taylor's go_faster code likely.
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 Swifty

  • 210
  • I reject your fantasy & substitute my own
Hey Swifty, I've been testing with chief's mac build at r6481 and the wingman dots are up and running for me.  I'm now trying to integrate some new fonts in, and having some difficulty with vertical spacing.  Basically, my replacement 9pt font seems to be a little taller than what can be cleanly supported atm and I am getting collisions in the messages window and the objectives gauge.  I got around this problem with my replacement for the smaller font01 by putting in an extra blank pixel of height under each character in the font file, but there seems to be a set line spacing value that the 9 point font is just too large for.  With even larger fonts it starts to clip the bottoms of the characters off.  If the line spacing and how many lines appear at once in the messages could be controlled in the table that would enable me to use the bigger font for all of the gauges (though training messages seems a little odd too--no assignable image or text spacing so far?).

That and the documentation for how to implement the wing name spacing and custom headers are all I can think of for how to improve the HUD.  It's really looking fantastic: Huge props :yes:
It doesn't matter how big your font is. The engine will always use the individual gauge's "Entry Height" value. You have to change the line spacing for each and every gauge to account for your new font. Look for an option called "Entry Height" in some of the gauge fields.

EDIT: I guess I don't have "entry height" for all of the gauges. Especially Training Messages.
« Last Edit: September 22, 2010, 10:52:26 am by Swifty »

 

Offline swashmebuckle

  • 210
  • Das Lied von der Turd
    • The Perfect Band
Ah, my bad--I figured out how to use the Y value controls for the objectives gauge, but yeah, Entry Height: isn't doing anything for the messages gauge.

 
Have you been under a rock lately?  :)

If you're asking what this entire thread is about, it's about revamping the retail ship HUD to be much, much, much more flexible, including things like full repositioning of gauges, full custom gauge support, and fixing non-4:3 stretching issues.  I don't know how else to take your question if that's not what you meant, it doesn't seem like it's in the context of a recent reply.  In fact, this code is just about ready for Antipodes testing, either preceded or followed by taylor's go_faster code likely.

Sorry, I was half asleep trying to read though it.  Very cool now you'll be able to modify the helmet hud however you like. (I was original referring to render hud to texture for cockpit models)
That's cool and ....disturbing at the same time o_o  - Vasudan Admiral

"Don't play games with me. You just killed someone I like, that is not a safe place to stand. I'm the Doctor. And you're in the biggest library in the universe. Look me up."

"Quick everyone out of the universe now!"

 
edit: photobucket is scaling my screenshot to a wayyy lower res...



I went ahead and created a hud for 16:10 triple monitor configs. (might also work for 16:9, haven't tested). I'm running 3x 1920*1200, for a 5760*1200 display. Problem is, when I fire my primary weapons, the bolts seem to be firing a bit left of the reticule. Checked my table, and it appears the reticle is right in the middle of the screen, so I'm not sure what is wrong.

Edit: Fixed center reticle, code below is now usable. Thanks The E!

Code: [Select]
#Gauge Config
$Base: (5760, 1200)
$Required Aspect: Wide Screen ; Can be "Wide Screen" or "Full Screen" ATM
$Min: (4320, 900);
$Max: (7680, 1600) ; These Min and Max fields are Inclusive
$Gauges:
+Messages:
Position: (1930, 8)
+Training Messages:
Position: (2651, 195)
+Multiplayer Messages:
Position: (1935, 375)
+Support:
Position: (2805, 833)
+Damage:
Position: (2769, 95)
+Wingman Status:
Position: (3718, 225)
+Auto Speed:
Position: (3771, 1051)
+Auto Target:
Position: (3771, 1012)
+Countermeasures:
Position: (3618, 940)
+Talking Head:
Position: (1930, 88)
+Directives:
Position: (1930, 435)
+Weapons:
Position: (3618, 820)
+Objective Notify:
Position: (2761, 288)
+Squad Message:
Position: (3515, 8)
+Escort View:
Position: (3618, 435)
+ETS Weapons:
Position: (3618, 1012)
+ETS Shields:
Position: (3652, 1012)
+ETS Engines:
Position: (3686, 1012)
+Target Monitor:
Position: (1930, 921)
+Extra Target Data:
Position: (1930, 863)
+Target Shields:
Position: (2610, 1047)
+Radar:
Position: (2766, 921)
+Player Shields:
Position: (3054, 1047)
; If you want different types of radar running, be my guest
;+Radar Orb:  
; Position: (2763, 921)
+Afterburner Energy:
Position: (2507, 585)
+Weapon Energy:
Position: (3187, 585)
+Text Warnings:
Position: (2907, 429)
+Center Reticle:
Position: (2860, 584)
+Mini Target Shields:
Position: (2887, 736)
+Throttle:
Position: (2592, 423)
+Threat Indicator:
Position: (3082, 423)
+Voice Status:
position: (1930, 257)
+Ping:
Position: (3648, 8)
+Lag:
Position: (3128, 827)
+Supernova:
Position: (2248, 265)

+Target Brackets: ; Target Brackets, Lock Indicator, Lead Indicator, and Offscreen Indicator don't need a "Position:" field.
+Lead Indicator:
+Lock Indicator:
+Offscreen Indicator:
+Hostile Triangle:
Position: (2907, 600)
+Target Triangle:
Position: (2907, 600)
+Missile Triangles:
Position: (2907, 600)
+Orientation Tee:
Position: (2907, 600)
+Mission Time:
Position: (2907, 1119)
+Kills:
Position: (3618, 975)
; FS1 specific gauge
;+Weapon Linking:
; Position: (3073, 604)
; Komet's lead sight. Looks for "leadsight.ani"
;+Lead Sight: default
$End Gauges
#End
« Last Edit: September 28, 2010, 06:53:59 pm by hurleybird »

 

Offline The E

  • He's Ebeneezer Goode
  • Global Moderator
  • 213
  • Nothing personal, just tech support.
    • Skype
    • Steam
    • Twitter
The problem is that the reticle x coordinate is exactly on the center. It needs to be on (Screenwidth - Reticlewidth)/2 instead.
Since the retail reticle is 40 pixels wide, you should place it at 2860, not 2880.
**** every cause that ends in murder and children crying. ― Iain Banks
Join the fun at the HLP IRC channel. Get the latest spam and gossip as long as it's fresh!

 
Ah, got it. Is there a list somewhere of how wide/tall all of these elements are so that I don't misplace the rest (even though they probably don't matter so much unlike the center reticle)