Page 1 of 1

Skyrim-Style HUD?

Posted: Thu Nov 07, 2019 6:08 pm
by IAmTheClayman
Is it currently possible to create a Skyrim-style HUD for Heatlth, Stamina and Magicka? What I'd love for MVP is for the bars to display horizontally and be screen-centered, with stretch goals to have the UI show current level for each bar out of the total (visually, not via text although that could be an even stretchier goal lol)

I know this is feasible in Unity, I just don't know if it's currently doable in the DFU framework. Anyone have tips?

Re: Skyrim-Style HUD?

Posted: Thu Nov 07, 2019 11:48 pm
by pango
Hi,
This is handled by HUDVitals.cs, that uses VerticalProgress.cs and VerticalProgressSmoother.cs. I haven't seen horizontal counterparts, but it shouldn't be too hard to adapt them :)

I'm a noob when it comes to modding, but HUDVitals doesn't do much more than displaying gauges, so I guess it would be fine for a mod to override then entire class...

Re: Skyrim-Style HUD?

Posted: Fri Nov 08, 2019 12:12 am
by IAmTheClayman
pango wrote:
Thu Nov 07, 2019 11:48 pm
Hi,
This is handled by HUDVitals.cs, that uses VerticalProgress.cs and VerticalProgressSmoother.cs. I haven't seen horizontal counterparts, but it shouldn't be too hard to adapt them :)

I'm a noob when it comes to modding, but HUDVitals doesn't do much more than displaying gauges, so I guess it would be fine for a mod to override then entire class...
Thanks for the starting point! Seems like VerticalProgress inherits from BaseScreenComponent, VerticalProgressSmooter inherits from VerticalProgress, and HUDVitals has several VerticalProgressSmoother objects, three each for each vitals bar. Interesting that, for example, base health is treated as a separate bar from health gain and health loss.

I think the best way to attack this is to create two new classes: HorizontalProgress and HorizontalProgressSmoother, which mimic the respective "Vertical" versions, and then overwrite HUDVitals to use HorizontalProgress bars in place of VerticalProgress bars. Someone stop me if that seems like a ridiculous solution

Re: Skyrim-Style HUD?

Posted: Fri Nov 08, 2019 7:49 am
by IAmTheClayman
Quick update after Day 1. Made more progress than I expected. Figured out how the Alignment enums work, how to move the Vitals bars around the screen and how their containing Rect can be resized. End result is the following:
Render 1.png
Render 1.png (1.65 MiB) Viewed 162 times
Transparent white background is just to make sure that the bars line up with the container. The end goal is to have a UI that looks more or less like this:
End Goal.png
End Goal.png (1.65 MiB) Viewed 162 times
I want the bar textures and frames to be customizable, and for there to be a vertical offset option that will allow, as examples, all three bars to be at the same height, or the Magicka and Fatigue bars to be below the Health bar. Adding the interaction mode text would be an optional .dfmod, and is mainly there to take up some of the dead space left behind after moving the vitals bars.

Would love to know what you all think

Re: Skyrim-Style HUD?

Posted: Fri Nov 08, 2019 5:52 pm
by Ommamar
I think the bars would look better running across the bottom of the screen. Other then that looks like a good implementation of what you are wanting.

Re: Skyrim-Style HUD?

Posted: Fri Nov 08, 2019 6:48 pm
by Firebrand
Ommamar wrote:
Fri Nov 08, 2019 5:52 pm
I think the bars would look better running across the bottom of the screen. Other then that looks like a good implementation of what you are wanting.
I agree.

Re: Skyrim-Style HUD?

Posted: Fri Nov 08, 2019 9:41 pm
by IAmTheClayman
Ommamar wrote:
Fri Nov 08, 2019 5:52 pm
I think the bars would look better running across the bottom of the screen. Other then that looks like a good implementation of what you are wanting.
Firebrand wrote:
Fri Nov 08, 2019 6:48 pm
I agree.
Fair enough. I plan to make it customizable enough where you can have the bars at the very top of the screen, the very bottom, or anywhere in between. Right now in testing I'm noticing that the text that pops up when you change interaction modes gets covered by the bars, so I may have to write a bit of code to handle that corner case

Re: Skyrim-Style HUD?

Posted: Sun Nov 10, 2019 1:51 am
by Narf the Mouse
...Enemy health bars wen? :D

Seriously, though, although Skyrim's GUI in general is bleh (IMO), I like the modern positioning and invisibile-when-full of Skyrim's Health/Magicka/Fatigue bars. Enemy health bars would be cool, but take your time.

Re: Skyrim-Style HUD?

Posted: Sun Nov 10, 2019 2:35 am
by pango
Invisible-when-full seems to make sense only in games where your vitals constantly regen, so that full gauges is the norm...

Re: Skyrim-Style HUD?

Posted: Sun Nov 10, 2019 2:45 am
by Narf the Mouse
pango wrote:
Sun Nov 10, 2019 2:35 am
Invisible-when-full seems to make sense only in games where your vitals constantly regen, so that full gauges is the norm...
Mod options are a thing, and I've recently recreated my Magicka Regeneration mod.