Is personal res overflow supposed to be in the game?

lwflwf Join Date: 2006-11-03 Member: 58311Members, Constellation
<!--QuoteBegin-http://www.unknownworlds.com/ns2/news/2012/1/ns2_build_192_released+--><div class='quotetop'>QUOTE (http://www.unknownworlds.com/ns2/news/2012/1/ns2_build_192_released)</div><div class='quotemain'><!--QuoteEBegin-->Balance:
<ul><li>Personal resources have now a limit of 100 per player. Any overflow will be split amongst the other players on the team.</li></ul><!--QuoteEnd--></div><!--QuoteEEnd-->
PRes overflow was added in build 192 but isn't working anymore. I can't find PRes overflow being mentioned again in later changelogs so I don't know if this is a bug or bad documentation.
Is personal res overflow supposed to be in the game?
«1

Comments

  • CorpseyCorpsey Join Date: 2011-07-02 Member: 107538Members
    Can anyone confirm it's not in the game anymore? I think I remember something about it being taken out when the khammander was able to drop eggs but I'm not 100% sure. I also thought it was still in the game though because I don't remember seeing an official patch note about it.. now I'm also curious.
  • PaajtorPaajtor Join Date: 2012-11-09 Member: 168634Members
    I also would like to know this.
  • lwflwf Join Date: 2006-11-03 Member: 58311Members, Constellation
    edited December 2012
    This is the relevant code from build 235 (hope it's OK for me to post this, it's from the Lua directory, copyright belongs to UWE of course).


    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->function PlayingTeam:UpdateResourceTowers()

        if self.timeSinceLastRTUpdate + kResourceTowerResourceInterval < Shared.GetTime() then
        
            self.timeSinceLastRTUpdate = Shared.GetTime()
            
            local numRTs = 0
            local numSupportedHarvesters = kMinSupportedRTs + self:GetNumCapturedTechPoints() * kRTsPerTechpoint
            
            // update resource towers        
            for index, resourceTower in ipairs(GetEntitiesForTeam("ResourceTower", self:GetTeamNumber())) do
            
                /*
                if numRTs >= numSupportedHarvesters then
                    break
                end
                */
            
                if resourceTower:GetIsCollecting() then
                
                    resourceTower:CollectResources()
                    
                    numRTs = numRTs + 1
                    
                end
                
            end
            
            // update resources
            local pResGained = numRTs * kPlayerResPerInterval * self:GetPresRecipientCount()
            local tResGained = numRTs * kTeamResourcePerTick
            
            self:SplitPres(pResGained)
            self:AddTeamResources(tResGained)
        
        end

    end<!--c2--></div><!--ec2-->

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->function PlayingTeam:GetPresRecipientCount()

        local recipientCount = 0
        for i, playerId in ipairs(self.playerIds) do
            
            local player = Shared.GetEntity(playerId)
            if player and player:GetResources() < kMaxPersonalResources and player:GetIsAlive() and not player:isa("Commander") then
                recipientCount = recipientCount + 1
            end

        end
        
        return recipientCount

    end<!--c2--></div><!--ec2-->

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->// split resources to all players until their they either have all reached the maximum or the rewarded res was splitted evenly
    function PlayingTeam:SplitPres(resAwarded)

        local recipientCount = self:GetPresRecipientCount()

        for i = 1, recipientCount do
        
            if resAwarded <= 0.001 or recipientCount <= 0 then
                break;
            end    
        
            local resPerPlayer = resAwarded / recipientCount
            
            for i, playerId in ipairs(self.playerIds) do
                local player = Shared.GetEntity(playerId)
                if player and player:GetIsAlive() and not player:isa("Commander") then
                    resAwarded = resAwarded - player:AddResources(resPerPlayer)
                end
            end
            
            recipientCount = self:GetPresRecipientCount()

        end

    end<!--c2--></div><!--ec2-->

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->function Player:AddResources(amount)

        local resReward = math.min(amount, kMaxPersonalResources - self:GetResources())
        local oldRes = self.resources
        self:SetResources(self:GetResources() + resReward)
        
        if oldRes ~= self.resources then
            self:SetScoreboardChanged(true)
        end
        
        return resReward
        
    end<!--c2--></div><!--ec2-->


    The total PRes to be distributed every 6 seconds is calculated using "pResGained = numRTs * kPlayerResPerInterval (which is 0.125) * GetPresRecipientCount()".

    GetPresRecipientCount returns the amount of players in the team that are alive, not commanding and has less than 100 res.

    SplitRes is then called from UpdateResourceTowers with the total amount of PRes (pResGained, but now called resAwarded) to distribute to all the players in the team, which SplitRes will proceed to do. The requirements for receiving res is the same which was used to allocate the total PRes to be distributed. You must be alive, you must not be the commander and players with 100 res will not take anything from the total amount.


    It all comes down to the first calculation I mentioned, from UpdateResourceTowers. All this means that each player will always receive the same amount of PRes per RTs no matter what (there's an exception but it's small enough not to even be worth mentioning) since the total comes from "0.125 * owned RTs * players that can receive res", which is then split evenly between the very same players that can receive res. For res overflow to work it could be "0.125 * owned RTs * players that are alive, not counting the commander (unless you would want the commanders PRes to go to players as well)" and then distribute that in the same fashion. Hope I got that right.
  • MestaritonttuMestaritonttu Join Date: 2004-07-29 Member: 30229Members, Reinforced - Shadow, WC 2013 - Gold
    Thanks for the clarification lwf.

    So, no res overflow, no resources split. Just plain raw x restowers is x res for you. As suspected.
  • DavilDavil Florida, USA Join Date: 2012-08-14 Member: 155602Members, Constellation
    edited December 2012
    <!--quoteo(post=2050392:date=Dec 23 2012, 03:55 PM:name=Mestaritonttu)--><div class='quotetop'>QUOTE (Mestaritonttu @ Dec 23 2012, 03:55 PM) <a href="index.php?act=findpost&pid=2050392"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Thanks for the clarification lwf.

    So, no res overflow, no resources split. Just plain raw x restowers is x res for you. As suspected.<!--QuoteEnd--></div><!--QuoteEEnd-->

    That's actually not what he said, nor what the code reflects. And after a theory to practice is does work, but as noticed it's not a huge amount. If one player is maxed out you won't really get much more than normal but you will see your res ticks go up by about .1 or .2 depending on how big the game is. It also works the same for team res as well which is actually a larger boost I believe.
  • m0rdm0rd Join Date: 2012-11-26 Member: 173223Members
    edited December 2012
    This is actually good to know, but at that point if you're sitting on 100 pRes as a Marine something's likely gone wrong.

    Assuming this applies for Aliens as well? This is probably more handy for a team with a dominating Onos to give the rest of lifeforms a bit of catchup to end the game quicker.
  • Ghosthree3Ghosthree3 Join Date: 2010-02-13 Member: 70557Members, Reinforced - Supporter
    Quite interested in knowing if res overflow is intended to be working still as well. I myself don't buy any weapons, using only the rifle all game, and the only upgrade I buy for myself at all is a Jetpack. I do buy mines, but often stop mid game when the higher life forms come out and just trip the mines for free. Late game with a JP I often find myself flying around on 100 res for long periods of time, before eventually getting killed and just buying another JP. I would very much like it if my team mates could benefit from my lack of res spending, I know I could buy and drop weapons for them personally, but that's quite the hassle.
  • DavilDavil Florida, USA Join Date: 2012-08-14 Member: 155602Members, Constellation
    <!--quoteo(post=2050441:date=Dec 23 2012, 06:08 PM:name=m0rd)--><div class='quotetop'>QUOTE (m0rd @ Dec 23 2012, 06:08 PM) <a href="index.php?act=findpost&pid=2050441"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->This is actually good to know, but at that point if you're sitting on 100 pRes as a Marine something's likely gone wrong.

    Assuming this applies for Aliens as well? This is probably more handy for a team with a dominating Onos to give the rest of lifeforms a bit of catchup to end the game quicker.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Yes it does work for aliens also. This is why a gorge with 100 res isn't really that bad all in all.
  • piratedavepiratedave Join Date: 2012-03-10 Member: 148561Members
    <!--quoteo(post=2050480:date=Dec 23 2012, 07:53 PM:name=Davil)--><div class='quotetop'>QUOTE (Davil @ Dec 23 2012, 07:53 PM) <a href="index.php?act=findpost&pid=2050480"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Yes it does work for aliens also. This is why a gorge with 100 res isn't really that bad all in all.<!--QuoteEnd--></div><!--QuoteEEnd-->

    <!--quoteo(post=2050247:date=Dec 23 2012, 08:20 AM:name=lwf)--><div class='quotetop'>QUOTE (lwf @ Dec 23 2012, 08:20 AM) <a href="index.php?act=findpost&pid=2050247"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->PRes overflow was added in build 192 <!--sizeo:3--><span style="font-size:12pt;line-height:100%"><!--/sizeo--><b>but isn't working anymore</b><!--sizec--></span><!--/sizec-->. I can't find PRes overflow being mentioned again in later changelogs so I don't know if this is a bug or bad documentation.
    Is personal res overflow supposed to be in the game?<!--QuoteEnd--></div><!--QuoteEEnd-->

    a gorge with 100 res isnt really that bad all in all ... IF RES OVERFLOW WAS WORKING ... i take it ?
  • DavilDavil Florida, USA Join Date: 2012-08-14 Member: 155602Members, Constellation
    <!--quoteo(post=2050486:date=Dec 23 2012, 08:16 PM:name=piratedave)--><div class='quotetop'>QUOTE (piratedave @ Dec 23 2012, 08:16 PM) <a href="index.php?act=findpost&pid=2050486"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->a gorge with 100 res isnt really that bad all in all ... IF RES OVERFLOW WAS WORKING ... i take it ?<!--QuoteEnd--></div><!--QuoteEEnd-->

    You just quoted 1 guy who was wrong, and 2 people who just showed you the code and told you after testing that it does work... WTF are you talking about?
  • piratedavepiratedave Join Date: 2012-03-10 Member: 148561Members
    <!--quoteo(post=2050488:date=Dec 23 2012, 08:18 PM:name=Davil)--><div class='quotetop'>QUOTE (Davil @ Dec 23 2012, 08:18 PM) <a href="index.php?act=findpost&pid=2050488"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->You just quoted 1 guy who was wrong, and 2 people who just showed you the code and told you after testing that it does work... WTF are you talking about?<!--QuoteEnd--></div><!--QuoteEEnd-->

    the guy who showed the code was the op ... WTF are you smoking ?
  • GORGEousGORGEous Join Date: 2012-02-19 Member: 146762Members, NS2 Map Tester
    I just retested this empirically in game.

    100% confirmed that pres overflow IS NOT IN THE GAME. If you have 100 pres, your pres income is wasted.
  • DavilDavil Florida, USA Join Date: 2012-08-14 Member: 155602Members, Constellation
    edited December 2012
    <!--quoteo(post=2050490:date=Dec 23 2012, 08:20 PM:name=piratedave)--><div class='quotetop'>QUOTE (piratedave @ Dec 23 2012, 08:20 PM) <a href="index.php?act=findpost&pid=2050490"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->the guy who showed the code was the op ... WTF are you smoking ?<!--QuoteEnd--></div><!--QuoteEEnd-->

    Well since it was two different things and it's late, i assumed it was a different guy. Why would someone post something then post the contrary? Then I realized he was saying something that was incorrect.

    <!--quoteo(post=2050500:date=Dec 23 2012, 08:45 PM:name=GORGEous)--><div class='quotetop'>QUOTE (GORGEous @ Dec 23 2012, 08:45 PM) <a href="index.php?act=findpost&pid=2050500"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I just retested this empirically in game.

    100% confirmed that pres overflow IS NOT IN THE GAME. If you have 100 pres, your pres income is wasted.<!--QuoteEnd--></div><!--QuoteEEnd-->

    We got 2 very different results then, how did you test? It would be easy to test just by checking your res count when people die because they won't be part of the count and therefor not figured into the split.

    But if you're interested here is a break down of the split res code

    // split resources to all players until they either have all reached the maximum or the rewarded res was splitted evenly
    function PlayingTeam:SplitPres(resAwarded)

    local recipientCount = self:GetPresRecipientCount() // <b>This loads the number of people that are allowed to get resources</b>

    for i = 1, recipientCount do // <b>This is the beginning of a for loop that starts at 1 and goes up to the number of people who can receive res</b>

    if resAwarded <= 0.001 or recipientCount <= 0 then // <b>This condition checks if the amount of res is less than or = to .001 or if the count is less than = to 0 and stops the procedure if it is</b>
    break;
    end

    local resPerPlayer = resAwarded / recipientCount // <b>this is where it decides how much to split by dividing the res to be given by the number of players available</b>

    for i, playerId in ipairs(self.playerIds) do // <b>This loop actually gives the res to each player based on their playerid #</b>
    local player = Shared.GetEntity(playerId) // <b>This selects player based on playerid #</b>
    if player and player:GetIsAlive() and not player:isa("Commander") then // <b>This checks to make sure the player is not a commander and is alive</b>
    resAwarded = resAwarded - player:AddResources(resPerPlayer) // <b>This part gets pretty tricky, the short version is that if resPerPlayer which is resAwarded divided by number of players is less than current player res and max res that much will be subtracted from res awarded. Basically it's just a check to make sure you're not getting more than the usual number of resources per tick cause if it's greater than 1 you'll get 0 or close to it.</b>
    end
    end

    recipientCount = self:GetPresRecipientCount()

    end

    end

    What does it all mean? Well basically as the recipient count goes down, the amount that the res is being split up is lessened. So if your team has 2 towers and 5 players active, you should get about .25 per tick (assuming the res interval is .125). Now if you have 4 players active you'll get .31, 3 players .42, and so on. The code seems correct to me. Now from my test which was basically putting 2 players on marine team with a bunch of towers and then checking if the pres gained changed once we got to 100, I'd say it works.
  • lwflwf Join Date: 2006-11-03 Member: 58311Members, Constellation
    Davil, you're forgetting something important. Read the code from which SplitPres is called from as well.
  • PaajtorPaajtor Join Date: 2012-11-09 Member: 168634Members
    <!--quoteo(post=2050480:date=Dec 24 2012, 03:53 AM:name=Davil)--><div class='quotetop'>QUOTE (Davil @ Dec 24 2012, 03:53 AM) <a href="index.php?act=findpost&pid=2050480"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->This is why a gorge with 100 res isn't really that bad all in all.<!--QuoteEnd--></div><!--QuoteEEnd-->
    Not if it's a good gorge, I think...like in the range of 120pts/ k3/d4 when the round ends (pub play).
    To bad he may have 100 PRes not being spend, but appearantly, bit by bit the overflow is being spread over the team, which is sortof comforting.
    An Alien commander needs such a gorge more, than a 4th or 5th Onos.
  • piratedavepiratedave Join Date: 2012-03-10 Member: 148561Members
    <!--quoteo(post=2050676:date=Dec 24 2012, 07:50 AM:name=Paajtor)--><div class='quotetop'>QUOTE (Paajtor @ Dec 24 2012, 07:50 AM) <a href="index.php?act=findpost&pid=2050676"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Not if it's a good gorge, I think...like in the range of 120pts/ k3/d4 when the round ends (pub play).
    To bad he may have 100 PRes not being spend, but appearantly, bit by bit the overflow is being spread over the team, which is sortof comforting.
    An Alien commander needs such a gorge more, than a 4th or 5th Onos.<!--QuoteEnd--></div><!--QuoteEEnd-->

    thats a terrible gorge

    and res overflow is broken according to 2 people. The only person that has tried to say that it isnt ... seems too derpy to take seriously
  • jeffcojeffco Join Date: 2011-02-14 Member: 81785Members
    edited December 2012
    I'm bored, Marry X-Mas, lets try to fix the code:

    I guess we should remove the "player:GetResources() < kMaxPersonalResources" condition in GetPresRecipientCount, to ensure that pResGained in UpdateResourceTowers is not affected by resource capped players.

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->function PlayingTeam:GetPresRecipientCount()

        local recipientCount = 0
        for i, playerId in ipairs(self.playerIds) do
            
            local player = Shared.GetEntity(playerId)
            if player and player:GetResources() < kMaxPersonalResources and player:GetIsAlive() and not player:isa("Commander") then
                recipientCount = recipientCount + 1
            end

        end
        
        return recipientCount

    end<!--c2--></div><!--ec2-->

    Now, res overflow is supposed to work, but SplitPres got quite inefficient. In case some reached the resource cap, the code in the inner loop will be executed playerCount^2 times. We should do something to prevent this from happening:

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->// split resources to all players until their they either have all reached the maximum or the rewarded res was splitted evenly
    function PlayingTeam:SplitPres(resAwarded)

        local recipientCount = self:GetPresRecipientCount()

        for i = 1, recipientCount do

            local resPerPlayer = resAwarded / recipientCount
            local awardedCount = 0

            for i, playerId in ipairs(self.playerIds) do
                local player = Shared.GetEntity(playerId)
                if player and player:GetIsAlive() and not player:isa("Commander") and player:GetResources() < kMaxPersonalResources then
                    resAwarded = resAwarded - player:AddResources(resPerPlayer)
                    awardedCount = awardedCount + 1
                end
            end

            if resAwarded <= 0.001 or awardedCount <= 0 then
                break;
            end  

            recipientCount = awardedCount

        end

    end<!--c2--></div><!--ec2-->

    (The code is untested and it may contain/cause issues.)
  • piratedavepiratedave Join Date: 2012-03-10 Member: 148561Members
    <!--quoteo(post=2050710:date=Dec 24 2012, 09:46 AM:name=jeffco)--><div class='quotetop'>QUOTE (jeffco @ Dec 24 2012, 09:46 AM) <a href="index.php?act=findpost&pid=2050710"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->...<!--QuoteEnd--></div><!--QuoteEEnd-->

    is that you SANTA ? :D
  • GORGEousGORGEous Join Date: 2012-02-19 Member: 146762Members, NS2 Map Tester
    <!--quoteo(post=2050550:date=Dec 24 2012, 01:16 AM:name=Davil)--><div class='quotetop'>QUOTE (Davil @ Dec 24 2012, 01:16 AM) <a href="index.php?act=findpost&pid=2050550"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->We got 2 very different results then, how did you test? It would be easy to test just by checking your res count when people die because they won't be part of the count and therefor not figured into the split.<!--QuoteEnd--></div><!--QuoteEEnd-->

    I tested it in game in a controlled setting.

    Two players. 8 RTs to provide exactly 1 pres per tick. First player joins and caps pres. Second player joins and watches their pres ticks. It went up by 1 every time, never more than one. And the actual timing matched up exactly. IE they had 40 pres after 20 ticks (started with 20). Thus, I concluded that pres overflow does not work.


    (there are some discrepencies in real game situations where when you first cap it seems like your pres will overflow, but it will only do it once... i think)
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    The code pretty clearly states in the beginning that it multiplies the rt amount (say 5) times the pres amount (0.125) times the amount of players that can receive (<100 pres already, not dead and not the comm). If you only are starting out with the correct amount of pres for each player that can receive it who has less than 100, how do you expect there to ever be overflow?
  • RyneRyne Join Date: 2012-02-25 Member: 147408Members, NS2 Map Tester
    <!--quoteo(post=2050757:date=Dec 24 2012, 11:50 AM:name=xDragon)--><div class='quotetop'>QUOTE (xDragon @ Dec 24 2012, 11:50 AM) <a href="index.php?act=findpost&pid=2050757"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->The code pretty clearly states in the beginning that it multiplies the rt amount (say 5) times the pres amount (0.125) times the amount of players that can receive (<100 pres already, not dead and not the comm). If you only are starting out with the correct amount of pres for each player that can receive it who has less than 100, how do you expect there to ever be overflow?<!--QuoteEnd--></div><!--QuoteEEnd-->


    <img src="http://tdotcomics.ca/wordpress/wp-content/uploads/2012/10/aliens-meme.jpg" border="0" class="linked-image" />
  • DavilDavil Florida, USA Join Date: 2012-08-14 Member: 155602Members, Constellation
    <!--quoteo(post=2050757:date=Dec 24 2012, 11:50 AM:name=xDragon)--><div class='quotetop'>QUOTE (xDragon @ Dec 24 2012, 11:50 AM) <a href="index.php?act=findpost&pid=2050757"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->The code pretty clearly states in the beginning that it multiplies the rt amount (say 5) times the pres amount (0.125) times the amount of players that can receive (<100 pres already, not dead and not the comm). If you only are starting out with the correct amount of pres for each player that can receive it who has less than 100, how do you expect there to ever be overflow?<!--QuoteEnd--></div><!--QuoteEEnd-->

    Because in the split pres section it takes the total res awarded and divides it by the number of players able to get it. Refer back to a few pages ago. But it's pretty clear mathematically that if you split something by 5 it will be less than if you split it by 4.

    There does seem to be an issue with the way that the splitres function is called. I'm not sure exactly why it's called by self, i'm sure max could explain that. Personally I'm not sure why that is since I haven't read the code for self.
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    .... First off max does the engine, its more Brian/Andi for lua.. Second, if theres 5 people that can receive res that is the same number used when calculating the total amount to split between players... Look at the lines before the call to split the pres

    local pResGained = numRTs * kPlayerResPerInterval * self:GetPresRecipientCount()
    self:SplitPres(pResGained)
  • lwflwf Join Date: 2006-11-03 Member: 58311Members, Constellation
    I've added PRes overflow to Better NS2 since I can't find anything pointing at it no longer working being intended.

    <a href="http://www.unknownworlds.com/ns2/forums/index.php?showtopic=125969#entry2051113" target="_blank">http://www.unknownworlds.com/ns2/forums/in...69#entry2051113</a>
  • flyjumflyjum Join Date: 2012-01-07 Member: 139849Members
    Why not make it so if you are Pres capped(100) just have the extra res go to Tres?
    This will help the comm who is short on res an increase in res flow for quicker upgrades.

    Not sure if this is possible but coding it should be pretty easy I would imagine
  • umphreyumphrey Join Date: 2012-10-31 Member: 165280Members
    So does PRes overflow work or not? I've read so many posts that say conflicting things. I don't really care what the code says, I want to hear from people who have tested it. Just because a snippet of code looks valid to multiple people doesn't necessarily mean it's working.
  • Ghosthree3Ghosthree3 Join Date: 2010-02-13 Member: 70557Members, Reinforced - Supporter
    It appears it doesn't, is the general consensus I've gathered.
  • GORGEousGORGEous Join Date: 2012-02-19 Member: 146762Members, NS2 Map Tester
    <!--quoteo(post=2051145:date=Dec 25 2012, 07:54 PM:name=umphrey)--><div class='quotetop'>QUOTE (umphrey @ Dec 25 2012, 07:54 PM) <a href="index.php?act=findpost&pid=2051145"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->So does PRes overflow work or not? I've read so many posts that say conflicting things. I don't really care what the code says, I want to hear from people who have tested it. Just because a snippet of code looks valid to multiple people doesn't necessarily mean it's working.<!--QuoteEnd--></div><!--QuoteEEnd-->


    100% confirmed via controlled testing in game w/ 2 players. Pres overflow DOES NOT work.
  • MMZ_TorakMMZ_Torak Join Date: 2002-11-02 Member: 3770Members
    <!--quoteo(post=2051130:date=Dec 25 2012, 05:47 PM:name=flyjum)--><div class='quotetop'>QUOTE (flyjum @ Dec 25 2012, 05:47 PM) <a href="index.php?act=findpost&pid=2051130"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Why not make it so if you are Pres capped(100) just have the extra res go to Tres?
    This will help the comm who is short on res an increase in res flow for quicker upgrades.

    Not sure if this is possible but coding it should be pretty easy I would imagine<!--QuoteEnd--></div><!--QuoteEEnd-->

    I like this.
  • DavilDavil Florida, USA Join Date: 2012-08-14 Member: 155602Members, Constellation
    edited December 2012
    <!--quoteo(post=2051073:date=Dec 25 2012, 12:19 PM:name=xDragon)--><div class='quotetop'>QUOTE (xDragon @ Dec 25 2012, 12:19 PM) <a href="index.php?act=findpost&pid=2051073"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->.... First off max does the engine, its more Brian/Andi for lua.. Second, if theres 5 people that can receive res that is the same number used when calculating the total amount to split between players... Look at the lines before the call to split the pres

    local pResGained = numRTs * kPlayerResPerInterval * self:GetPresRecipientCount()
    self:SplitPres(pResGained)<!--QuoteEnd--></div><!--QuoteEEnd-->

    /Facepalm... Did you not notice that pResGained is used right there in the SplitPres function? And then if you actually LOOK in that function rather than assume that pResGained is the variable that actually assigns the res vice the variable it becomes in that function which is resAwarded you might actually understand rather than pretend to, thank you very much for giving me a headache through sheer ignorance.

    Just to make it a little easier for you, here's the appropriate line in the SplitPres function: "local resPerPlayer = resAwarded / recipientCount"

    *Edit: Found the actual fix down below.
Sign In or Register to comment.