Mass income display bug

Talk about general things concerning Forged Alliance Forever.

Moderators: FtXCommando, Ze Dogfather

Mass income display bug

Postby ZLO_RD » 17 Dec 2019, 21:52

https://www.youtube.com/watch?v=hOYfXPunKMQ

mass income number shows +0 when stalling mass for some reason witch is simply impossible cause you at least have ACU that always produce +1 mass
http://www.youtube.com/user/dimatularus
http://www.twitch.tv/zlo_rd
TA4Life: "At the very least we are not slaves to the UI"
User avatar
ZLO_RD
Supreme Commander
 
Posts: 2265
Joined: 27 Oct 2011, 13:57
Location: Russia, Tula
Has liked: 303 times
Been liked: 400 times
FAF User Name: ZLO

Re: Mass income display bug

Postby Uveso » 18 Dec 2019, 02:39

This is how the line is calculated:

Code: Select all
            local reclaimRate = thisTick * simFrequency

            local incomeSec = math.max(0, incomeVal * simFrequency)
            local generatedIncome = incomeSec - lastReclaimRate
            incomeTxt:SetText(string.format("+%d", fmtnum(generatedIncome)))

            lastReclaimRate = reclaimRate


So if incomeSec is lower then lastReclaimRate then you will get a zero because of math.max(0, xyz) (Zero or negative will generate a 0 )
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: Mass income display bug

Postby Rikai » 19 Dec 2019, 11:31

Seems like a wonky way to calculate that. Can we not simply leave reclaim out of the equation completely?
When you look at that number, you are interested in what your mexes produce, not in what you mexes plus reclaim produces.
Could we just remove that reclaim?
We already have an extra number for "mass reclaimed so far", so imo calculating reclaim into income per second is obsolete.
Rikai
Avatar-of-War
 
Posts: 113
Joined: 19 Oct 2014, 22:21
Has liked: 138 times
Been liked: 28 times
FAF User Name: Rikai


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 1 guest