#Spectator HUD v1.0
1 messages ยท Page 2 of 1
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.
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
Would it be possible to post the statistics as WG globals for other widgets to use?
Yes, EE is Energy Excess and ME is Metal Excess. I like them myself so I use those with the custom widget and therefore (most of) my screenshots will include them. Note however that displaying ME and EE is not a popular choice based on streams etc what I've seen and therefore they are excluded from the widget in the PR that adds the widget to base game unless "expert" mode is used.
If people have ideas how the settings should work I would love to hear your ideas.
Yes. Although the statistics are mostly directly polled from the engine. The main exception are the army, defense, utility and economy values. If these are useful elsewhere, maybe they could be provided by the game rather than the widget?
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
Spectator HUD has always used UnitFinished() callin ever since it started using unit cache.
There must be something else going on ๐ค
interesting...
this did not happen with my widget sofar...
but perhaps something changed. I was lazy the last few month.
Would you mind sending the replay?
In this cast, Blodir takes on Autopilot in a 1v1 match that goes beyond all reason!
If you have a replay you would like me to cast, post it in the comments, email me, or contact me on Discord.
For those that don't know, Beyond All Reason is a free-to-play, open-source RTS game based on the legendary Total Annihilation. It uses a variant of th...
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 
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.
rezunits have canassist = false, which you can use to filter out things which cant actually build but have BP
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.
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)
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)
I broke it โค๏ธ
is the font meant to look this weird?
No, it looks like you have it scaled weirdly for some reason
This is how mine looks
at 1440p
what resolution you on?
2560โรโ1440
If you mess with the scaling on the widget what happens?
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
No, it's not meant to look like that and I have not seen it look like that.
I have 4k display myself.
Thanks for the feedback, I will have to try and see how it looks like with 1080p on my screen.
This is what it looks like on my screen with 1080p
The font is, unsurprisingly, same quality as it is for other elements.
ah glad u can repro it anyway
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 
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?
probably a small difference in font sizes, idk what tool is actually doing our font rendering under the hood, but small fonts are famously really hard to render, I would not be surprised if that's just the lower bound of what will be readable with our text renderer
Congratz @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.
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
All good ideas. The widget uses the default font. AFAIK it's configurable by each user separately so we just use what we get. We draw with O which is "white outline". On dark background I think it's the most distinguishable (other options would be o for black outline and s for shadow).
This is the current version
here I have increased the bar heights by around 10% and fontsize by over 33%
both rendered in 1080p
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
Thanks for the feedback, Joe ๐โโ๏ธ
I will open PR.
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
Use F11 or /widgetselectorto enable old Spectator HUD.
Care to elaborate why you are unhappy with the new Specator HUD?
im not unhappy w/ it i jsut got use to the old one
whats the name in the widgetselector?
The old base game one was ecostats
thanks appreciate it
oooooh if you disable Spectator HUD in settings, it doesn't re-enable ecostats?
it should
yea i was curious since its part of the base game now. So I tried to turn it on and when i turned it off it didnt turn the old hud on.
thanks for reporting, I have to look into it tomorrow ๐
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
woah never said that. Just asking how to revert xD
Using old one as well, cause of player view
As in you mod'ed it to be seen while your playing and display just your teams stats?
Thatโs whatโs missing!
He's also using the none-merged Commander highlight with personally modified light pillars to be super visible
IN MY DEFENSE
I have to keep two entirely different sets of configs for player/streamer
So shit gets all fucked when I swap back and forth
I didn't know there was a new one ok
Also, what is all of this judgement around my widgets over here!?
i switch to this new hud finally getting use to it nice widget
It was not a dig at all ๐ I actually prefer the stronger pillars ๐
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 
Would be interesting to hear what is the reason you need to do this?
Is it something that can and should be fixed?
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
Just realized I never responsed to this. I swap bettern full configs because I have a settings/widgets that are different between both. Minimap size, smoothing, scroll speed. etc are all different
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
ld
Hi, I opened a ticket for the issue where enabling spectator HUD disables ecostats and then it's tricky to enable it back
$text f11
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||.
to enable ecostats again you'll need to use widget selector and toggle it on manually
yep but initially it's on when first starting the game isnt it?
or how did I enable it initially XD
yes, but spectator hud replaces it; so its on by default until you installed spec hud
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
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 ๐
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 ๐
ah, ty for the bug report in that case ๐
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)
Yeah, that's why widgetselector got more hidden; people kept turning stuff off and getting stuck
Diff/patch file with better handling of ecostats hide/show
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
New version, forgot to return at Initialize when spectator HUD is not going to be used because of wrong number of ally teams
[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
I made the following change https://github.com/saurtron/Beyond-All-Reason/commit/624efd8a8acc87358658b2febfbdb0142feded83 I think it will fix the issue, but can't reproduce it myself maybe because of different platform (linux)
see here for full version: https://github.com/saurtron/Beyond-All-Reason/blob/fix-spectator-hud-resolution-change-crash/luaui/Widgets/gui_spectator_hud.lua
Legendary, I can test this ๐ will do so now
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 ๐
great, should be the same fix for the other widget you mentioned, or very similar
thx for testing so fast ๐
Very welcome, thank you for fixing!
Have you seen this? https://github.com/beyond-all-reason/Beyond-All-Reason/pull/3506
isn't that one merged already?
yeah, it means i must have accidentally been running an old version ๐ฆ
and reported a bug Zod already fixed in this widget
๐ฆ really sorry
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)
also did a pull request at https://github.com/beyond-all-reason/Beyond-All-Reason/pull/3799 to the spectator hud to see if I can get feedback and get the issues with bad interaction with ecostats resolved
Sure. Just remember that Spectator HUD / ecostats need to be enabled / disabled dynamically based on amount of AllyTeams.
@minor apex yes, it should be respecting that
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
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...
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.
one note:
buildpower stats don't take into account the labs even though imo it should
Are you sure it doesn't? I can't test right now, I'll try to remember testing later.
Note that BP isn't added until unit (in this case lab) is fully complete.
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.
in that last screenshot the second stat background (E/s) is missing as well
@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.
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)
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.
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.
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
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.
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)
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.
Anyone else having any issues regarding top right buttons interfering with the hud elements when toggled to be hidden?
how trivial would it be to rewrite the metal produced counter to separate reclaim?
my thought was that you could separate metal produced by mexes and passive commander income from reclaim income
Requires engine changes and is super difficult
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.
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?
Are you sure?
Couldn't we "just" track units that are capable of reclaiming and define their metal production as reclaim (and make sure the constant 2m/s aren't added)?
What's what Zod said when I asked previously. To try to do it in widget becomes crazy expensive
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.
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
utility value seems useless right?
no need to put in useless collumns
You can pick what you want, so I don't see that as an issue
What do you mean? Isn't it already "put in"?
I proposed a change that would make it useful (IMHO). I don't understand what you're trying to say.
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.
I don't believe so.