Skip to content

feat(gui): Implement money per minute display for local player#1481

Merged
xezon merged 2 commits into
TheSuperHackers:mainfrom
L3-M:money-per-min
Nov 1, 2025
Merged

feat(gui): Implement money per minute display for local player#1481
xezon merged 2 commits into
TheSuperHackers:mainfrom
L3-M:money-per-min

Conversation

@L3-M

@L3-M L3-M commented Aug 21, 2025

Copy link
Copy Markdown

This change implements player money per minute in Generals and Zero Hour.
Tracks income over the last 60 seconds. By default, it is disabled by "no" and can be enabled by the value "yes" in Options.ini.
By being disabled, it will fall back to the original current money only.

ShowMoneyPerMinute = yes

For example:

shot

Note: Money per minute will not track income from canceling constructing buildings, canceling unit or upgrade production, or from surrendered player transfers, as these are not really "earned" by the player.

TODO

  • Replicate in Generals

Comment thread GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp Outdated
Comment thread GeneralsMD/Code/GameEngine/Source/Common/RTS/Money.cpp Outdated
Comment thread GeneralsMD/Code/GameEngine/Source/Common/RTS/Money.cpp Outdated
Comment thread GeneralsMD/Code/GameEngine/Source/Common/RTS/Money.cpp Outdated
Comment thread GeneralsMD/Code/GameEngine/Source/Common/RTS/Money.cpp Outdated
Comment thread GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp Outdated
Comment thread GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp Outdated
Comment thread GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h Outdated
Comment thread GeneralsMD/Code/GameEngine/Source/Common/RTS/Money.cpp Outdated
Comment thread GeneralsMD/Code/GameEngine/Source/Common/RTS/Money.cpp Outdated
@xezon xezon added Enhancement Is new feature or request GUI For graphical user interface Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour labels Aug 21, 2025
@Stubbjax

Copy link
Copy Markdown

What pain points does this feature solve? Is it not something skilled players can already intuit? Are the benefits worth the added complexity / cost to readability?

@ang1990

ang1990 commented Aug 22, 2025

Copy link
Copy Markdown

Only game I know of that inlines the resource per min data point similar to this is Supreme Commander. But that game is a supply chain simulator compared to ZH.

Starcraft 2 has an income tab in replay mode only, so you can't see it while you're playing. income/min is useful if you're studying your replays and helps spectators understand the economy game, but I reckon not so much for the player himself.

@Mauller

Mauller commented Aug 22, 2025

Copy link
Copy Markdown

What pain points does this feature solve? Is it not something skilled players can already intuit? Are the benefits worth the added complexity / cost to readability?

A lot of people who watch Legis stream are often interested in his money, income, KD overlay and ask how to get it ingame.

@helmutbuhler

Copy link
Copy Markdown

I think this is a nice addition. I'd append the unit "/min" though to make it clearer what it means.

@L3-M

L3-M commented Aug 22, 2025

Copy link
Copy Markdown
Author

I think this is a nice addition. I'd append the unit "/min" though to make it clearer what it means.

I don't think this is possible while remaining ControlBarPro addon compatibility as It has much less space in the money texture compared to the original game's ControlBar

@helmutbuhler

Copy link
Copy Markdown

I think this is a nice addition. I'd append the unit "/min" though to make it clearer what it means.

I don't think this is possible while remaining ControlBarPro addon compatibility as It has much less space in the money texture compared to the original game's ControlBar

Even if it overflows, it's fine. Someone will make an updated ControlBarPro addon soon that fixes the texture. And until then, you can still disable it.

Comment thread GeneralsMD/Code/GameEngine/Include/Common/Money.h Outdated
Comment thread GeneralsMD/Code/GameEngine/Include/Common/Money.h Outdated
Comment thread GeneralsMD/Code/GameEngine/Source/Common/RTS/Money.cpp Outdated
Comment thread GeneralsMD/Code/GameEngine/Source/Common/RTS/Money.cpp Outdated
Comment thread GeneralsMD/Code/GameEngine/Include/Common/Money.h Outdated
Comment thread GeneralsMD/Code/GameEngine/Include/Common/Money.h Outdated
Comment thread GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp Outdated
Comment thread GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp Outdated
@Faithfinder

Copy link
Copy Markdown

I'd leave the money display alone, and put this data into top-left corner together with other GenTool things. I'd be interested in seeing this data, but putting it next to current money might hinder comprehension speed

@xezon

xezon commented Aug 24, 2025

Copy link
Copy Markdown

Perhaps it would be better suited for an Observer specific display.

@Eikosa

Eikosa commented Aug 25, 2025

Copy link
Copy Markdown

Perhaps it would be better suited for an Observer specific display.

Frankly, it would be great fun to see this while playing singleplayer

@L3-M

L3-M commented Aug 25, 2025

Copy link
Copy Markdown
Author

I'd leave the money display alone, and put this data into top-left corner together with other GenTool things. I'd be interested in seeing this data, but putting it next to current money might hinder comprehension speed

The money display is left alone. This feature is disabled by default now. I think it makes more sense this way.
Also I would not find myself looking at the top-left/right corner to see my current Money Per Minute, it looks better on the ControlBar GUI.

Comment thread GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h Outdated
Comment thread GeneralsMD/Code/GameEngine/Include/Common/UserPreferences.h Outdated
Comment thread GeneralsMD/Code/GameEngine/Source/Common/RTS/PlayerTemplate.cpp
Comment thread GeneralsMD/Code/GameEngine/Source/Common/RTS/Money.cpp Outdated
Comment thread GeneralsMD/Code/GameEngine/Include/Common/Money.h Outdated
Comment thread GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp Outdated
Comment thread GeneralsMD/Code/GameEngine/Source/Common/RTS/Money.cpp
Comment thread GeneralsMD/Code/GameEngine/Source/Common/RTS/Money.cpp Outdated
Comment thread GeneralsMD/Code/GameEngine/Source/Common/RTS/Money.cpp Outdated
Comment thread GeneralsMD/Code/GameEngine/Source/Common/RTS/Money.cpp Outdated
@L3-M

L3-M commented Oct 7, 2025

Copy link
Copy Markdown
Author

Rebased onto main and addressed all comments

Comment thread GeneralsMD/Code/GameEngine/Source/Common/RTS/Money.cpp Outdated
Comment thread GeneralsMD/Code/GameEngine/Source/Common/RTS/Money.cpp
Comment thread GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp Outdated
Comment thread GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp Outdated
Comment thread GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp Outdated
Comment thread GeneralsMD/Code/GameEngine/Source/Common/RTS/Money.cpp Outdated
Comment thread GeneralsMD/Code/GameEngine/Source/Common/RTS/Money.cpp Outdated
Comment thread GeneralsMD/Code/GameEngine/Source/Common/RTS/Money.cpp
Comment thread GeneralsMD/Code/GameEngine/Source/Common/RTS/Money.cpp
Comment thread GeneralsMD/Code/GameEngine/Include/Common/Money.h

@xezon xezon left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code looks pretty solid. Just a few more questions left to tackle.

Comment thread GeneralsMD/Code/GameEngine/Source/Common/RTS/Money.cpp
@L3-M

L3-M commented Oct 19, 2025

Copy link
Copy Markdown
Author

Updated.

@xezon xezon changed the title feat(display): Implement player money per minute feat(display): Implement money per minute display for local player Nov 1, 2025
Comment thread GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp Outdated
@L3-M

L3-M commented Nov 1, 2025

Copy link
Copy Markdown
Author

Updated and rebased on main.

@xezon xezon left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Needs to be replicated to Generals

@xezon xezon changed the title feat(display): Implement money per minute display for local player feat(gui): Implement money per minute display for local player Nov 1, 2025
@xezon xezon merged commit 217b582 into TheSuperHackers:main Nov 1, 2025
19 checks passed
@L3-M L3-M deleted the money-per-min branch November 1, 2025 13:26
@Simon-code87

Copy link
Copy Markdown
  1. Would it be possible to update the cash‑per‑minute display only every five seconds? Otherwise, the numbers keep jumping around with every cash change.
  2. Could cash‑per‑minute also be shown for supplies — for example, when the player clicks or hovers the mouse over them? That way, the player could better evaluate how well and efficiently their supply depots are positioned.

@L3-M

L3-M commented Nov 8, 2025

Copy link
Copy Markdown
Author
  1. Would it be possible to update the cash‑per‑minute display only every five seconds? Otherwise, the numbers keep jumping around with every cash change.

Yeah I can make a follow up change to make the money per minute update interval configurable, while keeping the current behavior as the default.

  1. Could cash‑per‑minute also be shown for supplies — for example, when the player clicks or hovers the mouse over them? That way, the player could better evaluate how well and efficiently their supply depots are positioned.

That is outside the scope of this change.

@hussam-qaissy

Copy link
Copy Markdown

@L3-M , can you please let me know which control bar you are using, im using genpatcher and both exile and xezons control bars arent displaying the income per min correctly, the box width is small and the text is wrapped so not readable.

the original control bar wirks perfectly though, but i dont use it

@L3-M

L3-M commented Nov 8, 2025

Copy link
Copy Markdown
Author

@L3-M , can you please let me know which control bar you are using, im using genpatcher and both exile and xezons control bars arent displaying the income per min correctly, the box width is small and the text is wrapped so not readable.

the original control bar wirks perfectly though, but i dont use it

I am using a custom version. You can check my fork for the changes required to adjust the money texture size:

L3-M/GeneralsControlBar@4646736

I have also published a release for anyone who wants to use this change with the money feature:

https://github.com/L3-M/GeneralsControlBar/releases

fbraz3 pushed a commit to fbraz3/GeneralsX that referenced this pull request Nov 10, 2025
…perHackers#1481)

Is disabled by default and can be enabled by setting ShowMoneyPerMinute=yes in Options.ini
fbraz3 pushed a commit to fbraz3/GeneralsX that referenced this pull request Feb 23, 2026
…perHackers#1481)

Is disabled by default and can be enabled by setting ShowMoneyPerMinute=yes in Options.ini
@Aliihuss99

Copy link
Copy Markdown

so does this add cash per minute in game or just in the replays ??

@hussam-qaissy

Copy link
Copy Markdown

@L3-M, has this feature been removed?

its no longer working for me, i also tried Gamedata.ini mentioned by @xezon but game crashes as soon as i start the game.

i hope you can do me favour on how to re-enable. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Is new feature or request Gen Relates to Generals GUI For graphical user interface Minor Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.