Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New top bar using priority gadget #3666

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

roberthartmann
Copy link
Contributor

@roberthartmann roberthartmann commented Sep 2, 2024

Work done

A running version of the New Top Bar.
It shows an additional bar for BP.
It shows the % of BP that is actually used and spending resources and it shows how much of your BP has orders that are related to use BP like guard and repair.
This bar includes indicators that show you how much of your BP can be supplied with your energy income and metal income. This is indicated by moving sliders.
Additionally there is a possibility to actually see the wind risk. This is indicated by a yellow line next to the BP bar. It will all make sense when you see it :)

ToDo

It still has unused variables in the gadget.
Still needs work if in game scaling is needed
Improve addWeightedValue
Use getwind instead of Energy from s random windgen.
Use minWind for windrisk
Use maxwind instead of Spring.WindMax
Seperate stalling['lowPrioEnergy'] and n %6
Local usedBP_instant = BP['usedBP_instant']
Try to use old slider pos and delete 20 lines

luaui/Widgets/gui_top_bar.lua Outdated Show resolved Hide resolved
luaui/Widgets/gui_top_bar.lua Outdated Show resolved Hide resolved
luaui/Widgets/gui_top_bar.lua Show resolved Hide resolved
luaui/Widgets/gui_top_bar.lua Show resolved Hide resolved
luaui/Widgets/gui_top_bar.lua Outdated Show resolved Hide resolved
break
end
end
cacheDataBase['realWindStrength'] = realWindStrength
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Id love if this data tracking could be extracted into an API widget and made available to other widgets! Not just this value, but any others. (Even the values that arent kept 100% up-to-date every frame they could be useful.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which values would you like to extract?

It would be nice to have less code in this lua. So I am very open for proposals how to manage this.

@WatchTheFort
Copy link
Member

What functionality is this introducing, and why is it needed?

@roberthartmann
Copy link
Contributor Author

It's the new version of the top bar.
IceXuick and Scoopa want it in the base game.

This updated version of the top bar includes build power. It has a separate BAR. It also includes the possibility to show the correct metal and energy request of low priority builders.

After this version I will work on the newer, more modern look of the top bar, designed by Scoopa

… nowChecking, trackedPosBase; improved gameframe a bit
substituded: 
local _, _, _, metalIncome, metalExpense, _, _ = spGetTeamResources(myTeamID, "metal")
BP['metalExpense'] = metalExpense
local _, _, _, energyIncome, energyExpense, _, _ = spGetTeamResources(myTeamID, "energy")
BP['energyIncome'] = energyIncome
BP['energyExpense'] = energyExpense

local metalExpense = r['metal'][4]
local metalIncome = r['metal'][4]
local metalExpense = r['metal'][5]
local energyIncome = r['energy'][4]
local energyExpense = r['energy'][5]

-----------------------
deleted:
cacheDataBase['usedBPIfNoStall'] = cacheDataBase['usedBPIfNoStall'] + buildingBP
because this value isn't calculated correctly, and it isn't used...

mayBeBuilding, guardedUnitID
because they where just nonsene


local unitDefsBeingBuilt = {}
local builderStates = {}
local unitsReservedBP = {}
no real benefit in having so many tables, when a simple variable is enough
@icexuick
Copy link
Collaborator

I can't remember saying that that I want this in as a 'must-have'.
Curious about the performance, since I saw some screenshots with this topbar using a lot of resources/performance.

image

BP is a valuable resource - but I'm only partially convinced that this bar/meter must get in asap.
We've had similar bars in the past and up until now all got introduced but then removed again because they didn't offer enough insight.

The percentage number falls outside of the Block:
image

The labels are vertical and cannot be read by players using a top-down camera:
image

Also I like to look closer into showing High/Low priority - f.e. why does low prio need a number? (and what is this number?)
image

@icexuick
Copy link
Collaborator

If you change camera-angle - the labels don't rotate:
image

@WatchTheFort
Copy link
Member

Can we please not have the labels above the units? They are very cluttering and cryptic.

@WatchTheFort
Copy link
Member

@icexuick Is this something that is going to be merged after making changes, or closed entirely? What is our path forward with this?

@roberthartmann
Copy link
Contributor Author

Thx for having a look at the widget.

The performance is far away of where it needs to be. I am painfully aware of this fact.

The labels have nothing to do with the widget. They are part of the gadget implemented by Beherith I turned them off.

@roberthartmann
Copy link
Contributor Author

are you aware that you can simply turn of the BP bar and the new top bar is basically the same as the current one?
And I haven't looked a single second into optimizing that, propperly.

image

@icexuick
Copy link
Collaborator

@Ruwetuin would/should know the most about the current Topbar.
I did see it show up high in usage as well, indeed maybe this can/should be optimized a lot.

Regarding Buildpower from a (new) player perspective - I'm unsure if the current design of the buildpower BAR helps explain them what BP is/does. For them I'd like to fully align with Scopa on the design/usability first. And with that I'd for now would leave this as a separate gadget that pro-players can enable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants