User Tools

Site Tools


gamemanual:gm_popularity

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 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.

gasPrice =  0.0165 * (Year-1900)+ .15;
gasPrice = gasPrice * GasRate;

Vehicle Popularity

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;

Fuel Popularity

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
}
gamemanual/gm_popularity.txt · Last modified: 2022/10/25 15:40 by admin