User Tools

Site Tools


gamemanual:gm_popularity

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
gamemanual:gm_popularity [2022/10/25 15:22] – [Vehicle Popularity] admingamemanual:gm_popularity [2022/10/25 15:40] (current) – [Variables] admin
Line 1: Line 1:
 +======= Vehicle/Fuel Popularity, Ratings, and Growth =======
  
 +
 +The Game Mechanics section of the manual details the internal formula used in the game's calculations.  This section of the manual uses pseudo-code and may not be 100% the same as the code in the game. 
 +
 +The Game Mechanics part of the manual is mainly designed to be a reference for the frequently asked question, "Why do I get this rating when I do X, Y, Z?!" Usually, this answer involves many different variables, which this section of the manual demonstrates. 
 +
 +**The game mechanics section of the manual shows [[https://idioms.thefreedictionary.com/seeing+how+the+sausage+gets+made|how the sausage gets made]]. So you really may want to avoid this portion of the manual if you enjoy the game.** 
 +
 +
 +===== Variables =====
 +
 +
 +^ Name ^ Description ^ ^ Name ^ Description ^
 +| **GasRate** | The gas rate is a variable that adjusts the fuel prices via the turn events.xml files. | | **Vehicle Type Sales in Region** | These are the total sales of the vehicle type in a region as defined by the city.xml files. In the default maps, these regions are the continents. | 
 +| **Total Region Sales** | These are the total sales of ALL vehicle types in a region as defined by the city.xml files. In the default maps, these regions are the continents. | | **Current Popularity** | This is the current popularity of the vehicle type in the region. | 
 +| **VehiclesOfFuelSoldLastYear** | This is the number of vehicles sold last year using this fuel type. | | **TotalVehicleSales** | This is the total number of vehicles sold last year of all fuel types. | 
 +
 +
 +===== Global Fuel Price =====
 +
 +Used in conjunction with city fuel rates to calculate the importance of fuel economy and shipping costs.
 +
 +<code cpp>
 +gasPrice =  0.0165 * (Year-1900)+ .15;
 +gasPrice = gasPrice * GasRate;
 +</code>
 +
 +
 +===== Vehicle Popularity =====
 +
 +<code cpp>
 +
 +Vehicle Type Regional Share = Vehicle Type Sales in Region / Total Region Sales
 +
 +
 +if(Car Type Sale Share < Current Popularity * 0.85)
 +    Car Type Regional Popularity = Car Type Regional Popularity * 0.998;
 +else if(Car Type Sale Share > Current Popularity * 1.15)
 +    Car Type Regional Popularity = Car Type Regional Popularity * 1.002;
 +</code>
 +
 +===== Fuel Popularity =====
 +
 +<code cpp>
 +fuelShare = VehiclesOfFuelSoldLastYear / TotalVehicleSales
 +
 +
 +if(fuelShare > 0.35 AND FuelPopularity < 0.35 AND FuelPopularity+0.05 < fuelShare )
 +{                    
 +    FuelPopularity = FuelPopularity + 0.05
 +}
 +
 +if(FuelPopularity+0.005 < fuelShare )
 +{                    
 +    FuelPopularity = FuelPopularity + 0.005
 +}
 +else if(FuelPopularity-0.005 > fuelShare )
 +{                    
 +    FuelPopularity = FuelPopularity - 0.005
 +}
 +</code>