Rounding Question When Calculating

TabrisTabris Join Date: 2002-11-02 Member: 4273Members
edited March 2003 in NS General Discussion
<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.

Comments

  • coilcoil Amateur pirate. Professional monkey. All pance. Join Date: 2002-04-12 Member: 424Members, NS1 Playtester, Contributor
    There's not much point in creating this kind of table now; with 1.1, the whole thing will need recalculation anyway. /: That said, I think there has already been a pretty exhaustive analysis of timing for multiple gorges... not sure where it is, though.
  • TabrisTabris Join Date: 2002-11-02 Member: 4273Members
    <!--QuoteBegin--coil+Mar 3 2003, 07:01 AM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (coil @ Mar 3 2003, 07:01 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> There's not much point in creating this kind of table now; with 1.1, the whole thing will need recalculation anyway. /: That said, I think there has already been a pretty exhaustive analysis of timing for multiple gorges... not sure where it is, though. <!--QuoteEnd--> </td></tr></table><span class='postcolor'> <!--QuoteEEnd-->
    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.
  • GrkmangaGrkmanga Join Date: 2002-12-15 Member: 10867Members
    how do u know all this?! uhh i tried looking in some server files to help u out. but no luck =/ alls i found was
    <!--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.
  • LoboLealLoboLeal Join Date: 2002-12-24 Member: 11466Members
    edited March 2003
    <!--QuoteBegin--Tabris+Mar 3 2003, 07:58 AM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Tabris @ Mar 3 2003, 07:58 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> 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?
    <!--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-->
  • ViPrViPr Resident naysayer Join Date: 2002-10-17 Member: 1515Members
    in order to do everything correctly everything should be stored and calculated as high precision decimal numbers and rounded integer copies of the numbers should be used for presentation to the player only, otherwise things get really messy.
Sign In or Register to comment.