Author Topic: How is ENY calculated  (Read 1242 times)

Offline RedAgony

  • Zinc Member
  • *
  • Posts: 38
Re: How is ENY calculated
« Reply #15 on: May 06, 2015, 09:36:54 AM »
If I remember correctly, when programing in C a semicolon is used to tell the computer that anything after said semicolon on that line is a comment and not code. Looks like HT may have edited his notes out of the equation, probably for protection. I did however go through and manage to decipher it. I've re-inserted the comments as they most likely read.

Not sure if serious, or joking...

/*
this is a comment in C
*/

// This is also a comment (though some compilers don't support)

; completes a line of code.

Is this game coded in C?  If so, I need a job!
This song came on, and I was invincible:

https://youtu.be/T3yPyc5ZdNs

Offline SilverZ06

  • Silver Member
  • ****
  • Posts: 1727
Re: How is ENY calculated
« Reply #16 on: May 06, 2015, 10:28:10 AM »
I believe it is coded in C++. What compiler doesn't support // as a comment?

// is a single line comment

/* This is a block comment
 * everything  between
 * the /* and the */ are comments
 * and are ignored by the compiler
 */

; is the execution statement for a line of code.

Offline RedAgony

  • Zinc Member
  • *
  • Posts: 38
Re: How is ENY calculated
« Reply #17 on: May 06, 2015, 10:40:02 AM »
sorry that is a holdover from OLD C compilers using the C90 standard.
This song came on, and I was invincible:

https://youtu.be/T3yPyc5ZdNs

Offline SilverZ06

  • Silver Member
  • ****
  • Posts: 1727
Re: How is ENY calculated
« Reply #18 on: May 06, 2015, 10:46:50 AM »
Quote
           if(Balance->TotalPlayerCnt > 0 ) //If TotalPlayerCnt is greater than 0 do the code in the brackets
           {
              if(Settings->MinBalanceTotal != 0)//If MinBalanceTotal is Not equal to  0 do the code in the brackets
              {
                 BalanceGain = (double)Balance->TotalPlayerCnt / (double)Settings->MinBalanceTotal;//cast TotalPlayerCnt and MinBalanceTotal to doubles and divide TotalPlayerCnt by MinBalanceTotal
              }
              else//If MinBalanceTotal is equal to 0
              {
                 BalanceGain = 1;//set BalanceGain to 1
              }
              if(BalanceGain > 1)//If BalanceGain is greater than 1 then set it back to 1
              {
                 BalanceGain = 1;
              }

              Least = 2.0; //set Least to 2.0
              for(Country=0;Country<pcMAX_COUNTRY;++Country)//This is a for loop and will execute as long as the statement Country<pcMax_COUNTRY is true
              {
                 //The following code uses 'Country' as the index number so the first time through the loop 'Country' is equal to 0, the next loop 'Country will be equal to 1 and so on and so forth until Country is greater than or equal to pcMAX_COUNTRY. My guess is pcMAX_COUNTRY's value is 2 since we have 3 countries (0,1,2).
                 Balance->CountryPer[Country] = (double)Balance->PlayerCnt[Country] / (double)Balance->TotalPlayerCnt;//This sets CountryPer[Country] equal to PlayerCnt[Country] divided by TotalPlayerCnt.
                 if(Balance->CountryPer[Country] < Least)//If the result of the previous calculation is less than Least do the code in the brackets
                 {
                    Least = Balance->CountryPer[Country];//Set the value of Least equal to CountryPer[Country] (remember Country is the index number and the loop control variable)
                 }

              }//End of the for loop

              if(Least != 0)//If Least does NOT equal 0 do the code in the brackets
              {
                 for(Country=0;Country<pcMAX_COUNTRY;++Country)//Another for loop using Country as the loop control variable and the index value
                 {
                    //This block of code looks to be where the ENY value is set. 
                    Balance->MinEnyValue[Country] =
                       (Balance->CountryPer[Country] - (Least + Settings->BaseCountryPer)) * Settings->CountryBalanceScale * BalanceGain * 100;
                    //Set MinEnyValue[Country] equal to (CountryPer[Country] minus (Least + BaseCountryPer)) then multiply by CountryBalanceScale times BalanceGain times 100
                    if(Balance->MinEnyValue[Country] < 0)//If MinEnyValue[Country] is less than 0, set MinEnyValue[Country] to 0
                    {
                       Balance->MinEnyValue[Country] = 0;
                    }
                    if(Balance->MinEnyValue[Country] > Settings->MinEnyValue)//If balance MinEnyValue[Country] is greater than MinEnyValue in settings, then set balance MinEnyValue[Country] equal to settings MinEnyValue
                    {
                       Balance->MinEnyValue[Country] = Settings->MinEnyValue;
                    }
                 }
              }
           }
           else//this is hard to tell not being in a compilier but I believe this else statement belongs to the very top If statement. If it does it means If TotalPlayerCount is less than or equal to 0 do the following code in the brackets
           {
              for(Country=0;Country<pcMAX_COUNTRY;++Country)//Another for loop
              {
                 Balance->MinEnyValue[Country] = 0;//set balance MinEnyValue[Country] to zero
              }
           }

           if(Balance->TotalPlayerCnt < 6)//If TotalPlayerCnt is less than 6 do the following code in the brackets
           {
              for(Country=0;Country<pcMAX_COUNTRY;++Country)//Another for loop setting each country's MinEnyValue to zero
              {
                 Balance->MinEnyValue[Country] = 0;
              }
           }

I have to run and pick up my son. I'll pick up where I left off and add more comments when I get a chance later today. Hope this helps some of you attempt to understand what is going on.
« Last Edit: May 06, 2015, 12:18:23 PM by SilverZ06 »

Offline SilverZ06

  • Silver Member
  • ****
  • Posts: 1727
Re: How is ENY calculated
« Reply #19 on: May 06, 2015, 12:22:10 PM »
Okay I've added all my comments and some may be wrong as I was trying to read the code quickly while feeding my sons their lunches. So basically ENY is calculated from this line of code: (Balance->CountryPer[Country] - (Least + Settings->BaseCountryPer)) * Settings->CountryBalanceScale * BalanceGain * 100; However with out knowing the values of CountryBalanceScale or BalanceGain I can't be more precise in explaining it just from the code. I hope this helped.  :cheers:

How'd I do Hitech?
« Last Edit: May 06, 2015, 12:23:56 PM by SilverZ06 »

Offline hitech

  • Administrator
  • Administrator
  • *****
  • Posts: 12314
      • http://www.hitechcreations.com
Re: How is ENY calculated
« Reply #20 on: May 06, 2015, 12:54:58 PM »
Okay I've added all my comments and some may be wrong as I was trying to read the code quickly while feeding my sons their lunches. So basically ENY is calculated from this line of code: (Balance->CountryPer[Country] - (Least + Settings->BaseCountryPer)) * Settings->CountryBalanceScale * BalanceGain * 100; However with out knowing the values of CountryBalanceScale or BalanceGain I can't be more precise in explaining it just from the code. I hope this helped.  :cheers:

How'd I do Hitech?

You can look up those values in the arena settings on line.
Also It is always difficult to get the BBS to display tabs correctly.

HiTech

Offline FBKampfer

  • Nickel Member
  • ***
  • Posts: 642
Re: How is ENY calculated
« Reply #21 on: May 06, 2015, 12:55:17 PM »
Used to be max 60  :old:

Why in God's name did we lower max ENY? Especially if we were to change the limitation system, a more precise scale would be extremely useful.
AvA Development Group
Freebird SAC member

Great men are forged in fire; it is the privilege of lesser men to light the flames.

Offline 38ruk

  • Gold Member
  • *****
  • Posts: 2121
      • @pump_upp - best crypto pumps on telegram !
Re: How is ENY calculated
« Reply #22 on: May 06, 2015, 01:03:14 PM »
I think that ENY kicks in when a team has >40% of the total population and reach its maximum of 20 when a team has 50% or more of the total population.

Knights had a 28 eny last night so i'm not sure what the max eny is , but it's over 20. Just an observation 8)

Offline Lusche

  • Radioactive Member
  • *******
  • Posts: 23860
      • Last.FM Profile
Re: How is ENY calculated
« Reply #23 on: May 06, 2015, 01:04:47 PM »
Max ENY limit is 29.
Steam: DrKalv
E:D Snailman

Offline Skyyr

  • Silver Member
  • ****
  • Posts: 1749
Re: How is ENY calculated
« Reply #24 on: May 06, 2015, 01:57:26 PM »
Imo, it should be:

((largest country pop. / smallest country pop.) x 100) - 100 = ENY limit.

You do realize that, using your suggestion, once one team has a 50% numbers advantage over the smallest team (as has happened for 3 of the last 4 nights), nothing can be flown by that team, right?
« Last Edit: May 06, 2015, 02:19:50 PM by Skyyr »
Skyyr

Tours:
166 - 190
198 - 204
218 - 220
286 - 287
190 - ---

nrshida: "I almost beat Skyyr after he took a 6 year break!"
A few moments later...

vs Shane: 29-6

"Some men just want to watch the world burn."

Offline Randy1

  • Platinum Member
  • ******
  • Posts: 4216
Re: How is ENY calculated
« Reply #25 on: May 06, 2015, 02:27:13 PM »
Last weekend the eny bit hard.  For a time there I could not get a P38J.  You see this at map change briefly but for some reason a couple of times the rook nation dominated the other countries in numbers online.

At first I disliked the eny system but now, like the three country system, it is the best compromise during an imbalance.  My only suggestion has been to control perk planes by numbers in use in conjunction with population.  Every time a 262 goes out in a country as an example, the next cost slightly more than the population set cost.  No 262s in use price drops.

Offline SilverZ06

  • Silver Member
  • ****
  • Posts: 1727
Re: How is ENY calculated
« Reply #26 on: May 06, 2015, 02:33:50 PM »
Last weekend the eny bit hard.  For a time there I could not get a P38J. 

Perfect time to try the wildly underestimated P38G.  :rock
It is quite the perk farmer.

Offline FBKampfer

  • Nickel Member
  • ***
  • Posts: 642
Re: How is ENY calculated
« Reply #27 on: May 06, 2015, 06:12:14 PM »
You do realize that, using your suggestion, once one team has a 50% numbers advantage over the smallest team (as has happened for 3 of the last 4 nights), nothing can be flown by that team, right?

I think it would be obvious that the cap is whatever max ENY is. Right now it's 40, though 60 sounds even better.
AvA Development Group
Freebird SAC member

Great men are forged in fire; it is the privilege of lesser men to light the flames.

Offline 38ruk

  • Gold Member
  • *****
  • Posts: 2121
      • @pump_upp - best crypto pumps on telegram !
Re: How is ENY calculated
« Reply #28 on: May 06, 2015, 08:01:09 PM »
Perfect time to try the wildly underestimated P38G.  :rock
It is quite the perk farmer.

Take that armored glass out of her and she'd go from perk farmer to perked lol!

Offline Lusche

  • Radioactive Member
  • *******
  • Posts: 23860
      • Last.FM Profile
Re: How is ENY calculated
« Reply #29 on: May 07, 2015, 08:34:53 AM »
This screenshot taken in LW arena a few minutes you can see the ENY limit maxing out at 29




It also starts to make me more sympathetic to any kind of involuntary auto balancer..... (not to mention a certain 12 hour rule....  :noid)

It's just a matter of time we will have a country with population 0. I'm sure the base capture stats will skyrocket then  :old:
Steam: DrKalv
E:D Snailman