#Spectator HUD v1.0

1 messages ยท Page 2 of 1

minor apex
#

Spectator HUD v1.0

cinder perch
#

I'd like a metal efficiency stat, that changes raw HP damage done into HP damage per metal damage, if that makes sense. High HP per metal units, like Sumos can make the raw damage efficiency misleading in a way.

thorny hill
#

After the sampling time was changed, widget is great!

#

EE is energy excessed? I don't think ME and EE are neccesary main stats, as they don't tell the state of the game like the others do

wary spire
#

Would it be possible to post the statistics as WG globals for other widgets to use?

minor apex
#

If people have ideas how the settings should work I would love to hear your ideas.

minor apex
slate pilot
#

short feedback:
you could consider using the function unit finished to track buildpower.

in this case it shows that the blue player has more BP than he actually has. the 200 BP from the turret aren't available, yet

minor apex
#

There must be something else going on ๐Ÿค”

slate pilot
#

interesting...
this did not happen with my widget sofar...
but perhaps something changed. I was lazy the last few month.

minor apex
#

Would you mind sending the replay?

slate pilot
minor apex
#

lol I think I was one of the spectators this game

#

btw the BP of autopilot goes up to 600 before the t1 con is made so it's clearly not because of the nano.

#

I wonder if the BP includes the rezzbot.

#

Yeah, it's definitely because of the rezzbot. The source code makes it very obvious there's no special treatment for rezzbots. The BP of every unit is taken as is.

#

Should we change it?

#

It has always been like this pepesweat

#

I think it should be changed and BP should only include units that can put down blueprints and assist building. But I would love to hear what others think.

hardy plover
#

rezunits have canassist = false, which you can use to filter out things which cant actually build but have BP

slate pilot
#

mine layers can't assist, too ๐Ÿ™‚

#

but that is an edge case.

I think rez bots should be excluded. But that's just my opinion. It's power can't be used to build.

minor apex
#

New release:

  • Rezzbots no longer count towards total BP
  • Text drawing is optimized a ton by redrawing only when needed
#

v1.1 (edit: bugged, don't use)

hardy plover
#

Reproduce: be a spec, use Player View

[t=03:31:12.050702][f=0001840] Error in DrawGenesis(): [string "LuaUI\Widgets\spectator_hud_new.lua"]:1552: bad argument #1 to 'RenderToTexture' (string expected, got nil)

hardy plover
minor apex
#

v1.1.1

lyric flare
#

is the font meant to look this weird?

umbral hull
#

No, it looks like you have it scaled weirdly for some reason

#

This is how mine looks

#

at 1440p

lyric flare
#

what resolution you on?

umbral hull
#

2560โ€‰ร—โ€‰1440

lyric flare
#

hmm idk, rest of UI looks fine

#

i'm 1920x1080 but idk if that's relevant

umbral hull
#

If you mess with the scaling on the widget what happens?

lyric flare
#

oh and I don't have the top part for some reason

#

maybe version diff

#

I saw my interface scale was 0.96 for some reason, changed it to 1 but didn't seem to fix it

umbral hull
#

I might have an older version tbh

#

@minor apex any idea on the font weirdness?

minor apex
minor apex
#

The font is, unsurprisingly, same quality as it is for other elements.

lyric flare
minor apex
#

I'm not sure if you want me to change something?

#

I feel like the right solution would be to increase widget size to get clearer numbers.

#

Another solution would be to draw text in higher resolution and then downscale when rendering. This is now possible as the text is now drawn to a buffer. But I somehow feel it's not the right approach.. don't you usually want to upscale rather than downscale game graphics pepesweat

lyric flare
#

idk, but I don't see this kind of font rendering problem on any other widget

#

e.g. the regular buttons above the widget (statistics/changes etc)

#

so maybe just copy w/e they do?

edgy jasper
sharp thistle
#

Congratz @minor apex !!

minor apex
#

From LDM stream

#

Maybe I'm going crazy, but I think Jaz is onto something.

#

It's late in my timezone so I'm not going to implement anything today, but would appreciate ideas if anyone has.

#

I'm thinking of trying to make font size bigger in case it can still fit the "knobs". I.e. reduce the vertical border paddings.

#

Another idea is to simply increase the height of the metric bars so that a bigger font size fits.

serene bramble
#

I'm not home to check, but perhaps some other fonts scale better? Would be quick to try. There's also outline colours you could experiment with adding/disabling, and shadows etc

minor apex
minor apex
#

This is the current version

#

here I have increased the bar heights by around 10% and fontsize by over 33%

#

both rendered in 1080p

edgy jasper
#

major improvement ๐Ÿ™‚

#

you can actually see similar text artifacts in the top menu text too, but it's mitigated by the text being bold. I bet if it wasn't you'd see much bigger failures there. Small text is really hard

minor apex
#

Thanks for the feedback, Joe ๐Ÿ™‡โ€โ™‚๏ธ
I will open PR.

wispy drum
#

how do i get the old hud back? after i turned on this hud idk how to turn the only metal and energy one back on

minor apex
minor apex
wispy drum
#

im not unhappy w/ it i jsut got use to the old one

wispy drum
hardy plover
#

The old base game one was ecostats

wispy drum
minor apex
#

oooooh if you disable Spectator HUD in settings, it doesn't re-enable ecostats?

#

it should

wispy drum
minor apex
#

thanks for reporting, I have to look into it tomorrow ๐Ÿ‘

fleet girder
# minor apex Care to elaborate why you are unhappy with the new Specator HUD?

im unhappy because things are different, or rather i got used to the old one and i'm not sure if the view i was using is available with whats now in the base game and i have both installed so i'm doubly confused. i think at one point i had both my locally installed widget and the base game running at the same time

#

so its not your fault

#

but i'm blaming you

wispy drum
sharp thistle
#

Using old one as well, cause of player view

hardy plover
fleet girder
minor apex
#

Volshok streaming on BeyondAllReasonOfficial twitch channel with old version pepehmm

hardy plover
umbral hull
#

I have to keep two entirely different sets of configs for player/streamer

#

So shit gets all fucked when I swap back and forth

umbral hull
#

Also, what is all of this judgement around my widgets over here!?

wispy drum
#

i switch to this new hud finally getting use to it nice widget

hardy plover
minor apex
#

Yeah not a dig from my part either. I was interested in hearing if there was a reason you prefer old version. Hence the monkaHmm pepehmm

minor apex
crisp ermine
#

would it be possible to remove reclaim from metal income somehow? makes it so unreadable theres almost always at least 1 guy reclaiming stuff, same for reclaim on total metal produced especially a reclaimed lab throws the stats off alot

umbral hull
#

I also used to have different widgets, but in reviewing it now they're actually more or less the same.

#

I don't think it's that big of a deal tbh

knotty crescent
#

ld

fossil sand
#

Hi, I opened a ticket for the issue where enabling spectator HUD disables ecostats and then it's tricky to enable it back

hardy plover
#

$text f11

prime anvilBOT
#

Nowadays, most custom widgets can be enabled in the in-game options, in the Custom tab.

In the past, the recommended way of toggling custom widgets was opening the Widget Selector with the F11 hotkey, scrolling down past all the built-in widgets, and clicking the names of your custom downloaded widgets. Because it allowed users to inadvertently disable widgets they really need, like most of the UI, it was made opt-in - F11 is disabled until you do.

If you still wish to enable the "retro" Widget Selector, opt into it by ||typing /widgetselector into all-chat in a match or replay||.

hardy plover
#

to enable ecostats again you'll need to use widget selector and toggle it on manually

fossil sand
#

yep but initially it's on when first starting the game isnt it?

#

or how did I enable it initially XD

hardy plover
#

yes, but spectator hud replaces it; so its on by default until you installed spec hud

fossil sand
#

but then if I enable spec HUD, and disable it I end with nothing

#

and no way to know you need to enable through F11->ecostats

hardy plover
#

yes, zod i'm sure will look into that once he see's these msgs i was just letting you know how to fix your immediate issue ๐Ÿ™‚

fossil sand
#

imo it should be enabled again at deInit() or widget:Shutdown or something similar, at least if the widget knows it disabled ecostats, even then it might be fragile so not sure what the best solution could be

#

yeah, I already fixed it for myself that's not the issue ๐Ÿ˜„

hardy plover
#

ah, ty for the bug report in that case ๐Ÿ™‚

fossil sand
#

just trying to get it fixed for good, also if I know the desired behaviour I can try and code it into the spec hud

#

I did spend like more than 1 hour trying to get it back before resorting to discord, so my guess is for other people can be the same

#

went through all widgets in selector and settings several times and still didn't find it lol

#

(didn't know it was called ecostats so that's why i didn't find it at f11)

hardy plover
#

Yeah, that's why widgetselector got more hidden; people kept turning stuff off and getting stuck

fossil sand
#

I made this modifications to gui_spectator_hud.lua... I think it handles better most cases since instead of disabling ecostats it just hides and shows it again, I think it can be useful but needs review since I'm new to this

#

With this, if its disabled by user at F11, gui_spectator_hud will just ignore it (ie, not enable it again in any case)

#

If enabled, then enabling and disabling the spectator hud will correctly hide and show the ecostats widget

#

I'm basically using RemoveWidget and InsertWidget instead of Enable/Disable as looking at lua api looks like the best way to hide and show it to me, then it's some boilerplate to properly know when to actually do it

#

Note discord shows spacing a bit borked in the internal viewer above, but should be ok in the attached .diff file

hardy plover
#
[t=00:21:40.729499][f=0029706] [SpringApp::MainEventHandler][SDL_WINDOWEVENT_SHOWN][1] fullScreen=1
[t=00:21:40.729508][f=0029706] [~ScopedOnceTimer][Sound::Iconified] 0ms
[t=00:21:40.729519][f=0029706] [~ScopedOnceTimer][FBO::GLContextReinit] 0ms
[t=00:21:40.729526][f=0029706] [SpringApp::MainEventHandler][SDL_WINDOWEVENT_SHOWN][2]

[t=00:21:41.133758][f=0029714] Set "shadows" config-parameter to 1
[t=00:21:41.187466][f=0029715] Sagrav added point: 
[t=00:21:41.710965][f=0029744] Error: gl.CreateList: error(2) = [string "LuaUI\Widgets\metal_tracker.lua"]:492: attempt to use a deleted font
[t=00:21:45.574508][f=0029859] Error: gl.RenderToTexture: error(2) = [string "LuaUI\Widgets\spectator_hud.lua"]:1477: attempt to use a deleted font
[t=00:21:45.601470][f=0029859] Error in DrawGenesis(): [string "LuaUI\Widgets\spectator_hud.lua"]:1477: attempt to use a deleted font
[t=00:21:45.601491][f=0029859] Removed widget: Spectator HUD New
[t=00:21:45.601499][f=0029859] Error: DrawGenesis: OpenGL stack check error, matrix mode = GL_MODELVIEW, depth = 1, please make sure to pop all matrices before end
[t=00:21:45.867308][f=0029867] enderOS1 added point: AA i make air
[t=00:21:49.017475][f=0029961] X1x2 added point: lets last pus
[t=00:21:50.874695][f=0030016] Input grabbing is enabled!

Changing display from boarderless to a fixed res and back again crashes new spec hud (and old ones)

#

i've reported the same error (since it crashes Metal Tracker) in #1262082209817296909 message

fossil sand
hardy plover
#

Seems to work great, was able to change from boarderless to normal and back again on Win11 w/o it crashing, and I flicked through a lot of the toggle options and had no crashes either ๐Ÿ™‚

#

@fossil sand nicely done ๐Ÿ™‚

fossil sand
#

great, should be the same fix for the other widget you mentioned, or very similar

#

thx for testing so fast ๐Ÿ™‚

hardy plover
#

Very welcome, thank you for fixing!

minor apex
fossil sand
#

isn't that one merged already?

hardy plover
#

yeah, it means i must have accidentally been running an old version ๐Ÿ˜ฆ

#

and reported a bug Zod already fixed in this widget

#

๐Ÿ˜ฆ really sorry

fossil sand
#

haha maybe, ok, but it's bit strange since other widgets do run in that screenresize callback, anyways if it's that no biggie just playing around (looking again, its true it was already working XD)

minor apex
fossil sand
#

@minor apex yes, it should be respecting that

fossil sand
#

k, got the pull request accepted (that was fast) ๐Ÿ™‚

#

but thinking about what you said, for some people the change would mean ecostats can stay disabled with the new version, and tricky to enable again (since old version disabled it, and new one doesn't re-enable it), I created another pull request that saves a flag to make sure to force enable it one time for everyone https://github.com/beyond-all-reason/Beyond-All-Reason/pull/3801.

#

I think it's the right call, this way transition will be mostly painless

minor apex
#

some of the top BAR you've ever seen!

My Discord - https://discord.gg/ymJXGWsR5K
Twitch - https://www.twitch.tv/brightworkstv
-- Feel Free to follow over there for more... miscellaneous content

https://challonge.com/communities/BARFight
BPL Discord for Tournament Events - https://discord.gg/3sjXNquDzH

Official Beyond All Reason Discord - http...

โ–ถ Play video
#

After resuming from player view, the background for "M/s" shows for a second or two and then disappears for the rest of the game.

tame apex
#

one note:
buildpower stats don't take into account the labs even though imo it should

minor apex
#

Note that BP isn't added until unit (in this case lab) is fully complete.

minor apex
#

Raghna's right, the Build Power from the lab is not counted towards the total BP.

#

Also, I switched back and forth with the player view many times and was able to reproduce the missing background.

fossil sand
#

in that last screenshot the second stat background (E/s) is missing as well

fossil sand
#

@minor apex noticed ecostats flickers on player camera change as well... took a look and seems fixing that also fixes the 'missing background' issue (or at least makes it much less likely). Managed to reproduce the missing background quite easily with the ecostats flickering, while with a fix I couldn't manage.

#

fix here, I'm preparing a PR but since the devs are busy with desync issue likely will take some time to be looked and acted upon.

#

I just made the ecostats toggle happen in Initialize()/Shutdown() directly instead of init() and deInit() that get triggered all the time through reInit(). I don't think ecostats toggling needs to support reInits since conditions to show it instead of spectator hud don't change during the game.

#

PR for bar here, also direct download of modified file here in case someone wants to test the fix.

#

The missing background itself seems to be some kind of memory corruption/race condition issue, since it shows but then dissapears in a few seconds after the lua has done it's things... I'm guessing the lua side should not be doing that but not totally sure... maybe further investigation would be warranted on the engine side, not sure tbh, don't want to be alarmist but looks bad.

#

(i tried to debug it on the lua side before tackling the ecostats flicker, but didn't see anything evidently wrong)

minor apex
#

I have to be honest, I don't know how the earlier patch worked, I don't know why it broke the widget the way it did and I don't know why the new PR "fixes" the issue.

#

Nevertheless, I just tried to spectate a game and I switched back and forth the "Player View" and could no longer reproduce the issue.

#

When the issue was spotted, the game was suffering from desync problems.

#

I have a rather strong feeling the desync issue and the errors seen in this widget were related.

fossil sand
#

Well, it's difficult to know since there have been desync issues all around, also the patch was merged around a week before the desyncs started happening, anyways, I had the same feeling tbh.

#

The new patch was done just to fix the ecostats flicker, the fact it's somehow related to the missing backgrounds is something of a red flag, it could be because of the very fast toggling surfacing some other problem somewhere, like some kind of race condition in flowui, or even deeper in the engine

#

What the original patch does, is call RemoveWidget/InsertWidget instead of DisableWidget/EnableWidget, thing is its doing it in init() and deInit(), that does get called quickly in succession on different situations, like when a player camera is selected.

#

The new patch makes sure to call it just on Initialize and Shutdown directly, that way it won't get triggered in unintended situations. Initially I overlooked the fact deInit and init get called from other places than Initialize and Shutdown.

#

For sure this should be investigated, at least to see why the backgrounds dissapear when that happens, since that totally should not happen, specially a few seconds after the fact.

brave stream
#

is there a way to hover and get detailed stats of a specific statistic? like a list of the exact numbers for each person on a team

#

think i've seen someone do this on a cast

minor apex
#

I assume your referring to the popup that existed in the old version?

#

It's a very long and confusing story, but basically the implementation was bad so it was cut out. It could be reimplemented properly with lots of effort. However, it would be best to reimplement the whole UI with rmlui.

crisp ermine
#

i would love that version done properly someday in the future, it was amazing being able to tell people military power in a list to quickly see whos strong or not when speccing

#

the dream would be 1 for army value and 1 for current metal income(minus reclaim and smoothed out over x seconds to not make it jump around too much)

minor apex
#

Now that we have rmlui in the engine, it would make most sense to rewrite the graphics part from scratch using rmlui instead of vanilla opengl4.

#

I have moved on to work on other stuff in BAR.

#

I'm always happy to fix clear bugs that are found in spectator hud, but I will not be working on any major improvements or rework.

versed valve
#

Anyone else having any issues regarding top right buttons interfering with the hud elements when toggled to be hidden?

last shoal
#

my thought was that you could separate metal produced by mexes and passive commander income from reclaim income

umbral hull
last shoal
#

looking at the lua file now it seems like there's already code to support this?

cinder perch
#

Are we still discussing the spectator hud here? I made a PR related to it. https://github.com/beyond-all-reason/Beyond-All-Reason/pull/5220

I wanted utility value to be bigger. Right now I rarely see utility values larger than about 2k metal. It's such a small category it barely matters and is just noise IMHO.

GitHub

Utility value in the Spectator HUD widget is not very useful. It only includes things like radars and jammers. These rarely exceed 2k metal in value, even for a full 8 player team, and being such a...

#

I didn't want to change things up too much, but my person preference is to see army value and then "everything else value". From a high level those are the most useful metrics for me personally. Army value measures a teams ability to attack, and then "everything else value" just measures all the other "stuff", and from a high level the game is all about building "stuff" and keeping it alive.

#

I can customize my own widget easily enough, but as far as upstreaming goes. Does anyone think having fewer categories would be useful?

slate pilot
umbral hull
slate pilot
#

It depends.
If done with brute force, it is crazy expensive.
I did something like that with the BP top bar for the calculation of the actual resource demand of low priority builders. And it was quite expensive. Other methods are used now and that helps a lot.

Regarding the reclaiming.
Calculating the current reclaim should be similarly expensive as the previous idle builder icons widget. A bit less, I guess, if done correctly.

Calculating the total reclaim is a bit of a different beast, if we want to be very precise. Since resource update rates are not every frame. As such we can't just add up currently shown reclaim per sec/30 game frames and add them up. This would end up in false total values most likely. We would need to keep track of every single feature on the map and make sure that their full value would be split correctly between the players that were reclaiming it. And that would be a significant pain. Guestimating the rough reclaim could be feasible on the other hand.

last shoal
#

we can at the very least remove commander from army value tracker right?

#

just AV - (Commander metal * number of Commanders)

#

cause seeing a reported 10% AV lead with the first 5 minutes is not accurate to the actual standing army counts

thorny hill
#

no need to put in useless collumns

umbral hull
cinder perch
desert elk
#

Curious if it is feasible to have a spectator like Hud with stats that runs for players during games (when fog of war is off).

#

There's a custom game mode called battle blitz that I'd like to use it with.

umbral hull
#

I don't believe so.