Rounding Question When Calculating
Tabris
Join Date: 2002-11-02 Member: 4273Members
<div class="IPBDescription">The Alien res model</div> As most of us know, well to be honest most don't know, the alien res model is as follows.
Per Tick : 1 + (.23 * Number of Players on your team * Number of res nodes your team controls)
I am leaving off a part of the formula that deals with unfair teams as we will assume for these calculations that the teams are 8v8, and for the moment only one gorge.
So in the midst of calculations it seems that numbers with a .5 are rounded up, yet I cannot seem to understand when the rounding happens.
If you calculate it out. If the resources are rounded before distribution an alien team will get .25 per skulk and .75 for the one gorge. Yet if you do not round the original number after distribution you get the following .237 per skulk and .71 for the gorge.
My questions are as follows:
1. Is there a minimum for each alien per tick? Say that .25 is 1 no matter what?
2. Are the numbers rounded before or after distribution... or even at all?
3. Is the res indicator always a whole number? Say it says 5 res which in reality is 5.49? In that case does the .49 stay and added onto the next income then if above .5 is rounded up?
Minor irregularities I know... but in math minor irregularities make wrong answers.
Note: This is for a chart I will be doing to show the income for alien teams with varying amounts of gorges and its effect on the res pool and flow. To prove or disprove the advantages of having a second gorge.
Edit: Rounding also has an effect on marine res counts... as rounding would give 30 res per minute.... the 2.84 per tick would yeild 28.4 res a minute.
Per Tick : 1 + (.23 * Number of Players on your team * Number of res nodes your team controls)
I am leaving off a part of the formula that deals with unfair teams as we will assume for these calculations that the teams are 8v8, and for the moment only one gorge.
So in the midst of calculations it seems that numbers with a .5 are rounded up, yet I cannot seem to understand when the rounding happens.
If you calculate it out. If the resources are rounded before distribution an alien team will get .25 per skulk and .75 for the one gorge. Yet if you do not round the original number after distribution you get the following .237 per skulk and .71 for the gorge.
My questions are as follows:
1. Is there a minimum for each alien per tick? Say that .25 is 1 no matter what?
2. Are the numbers rounded before or after distribution... or even at all?
3. Is the res indicator always a whole number? Say it says 5 res which in reality is 5.49? In that case does the .49 stay and added onto the next income then if above .5 is rounded up?
Minor irregularities I know... but in math minor irregularities make wrong answers.
Note: This is for a chart I will be doing to show the income for alien teams with varying amounts of gorges and its effect on the res pool and flow. To prove or disprove the advantages of having a second gorge.
Edit: Rounding also has an effect on marine res counts... as rounding would give 30 res per minute.... the 2.84 per tick would yeild 28.4 res a minute.
Comments
Yeah... but it bugs me when I have a mathmatical problem that I cannot answer. So until 1.1 I think ill keep on it <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html/emoticons/biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif'><!--endemo--> and ill make a table for 1.1 as well.
<!--QuoteBegin--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->
// How much a resource tower gives, and how often. This is multiplied by the number of upgrades for a tower.
// Used for both marine and alien resource towers.
// The numbers should work out such that it doesn't always pay off to build a tower whenever you have the points. It should pay for itself only after a minute or a little more.
ns_towertime "6"
ns_toweramount "1"
ns_alienresourcescalar "1.0"
ns_marineresourcescalar "1.0"
ns_playerresourcescalar ".23<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->that is from a file in the ns folder. srry ns =( not trying to hurt u by sharing some code :'( that might help u out a bit more.. or something.
2. Are the numbers rounded before or after distribution... or even at all?
3. Is the res indicator always a whole number? Say it says 5 res which in reality is 5.49? In that case does the .49 stay and added onto the next income then if above .5 is rounded up?
<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
1. Experience tells me that many times (when res are low) you have to wait more than 1 tick to see changes in your res bar, so no minimum for each alien per tick. There is a minimum to global res pool of 1 as formula says, but no minimum for alien.
2. I think numbers are not rounded at any stage of formula. Only rounded for presentation. I mean you have 64.23 res so you have 64 res. For rounding you take the integer part. 65.86 res are 65 res.
3. Answered yet, Numbers not rounded.
Please, correct me if I'm wrong <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo-->