User Tools

Site Tools


gamemanual:gm_sales

Sales Game Mechanics

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.

Buyer Pools

Variables

Name Description Name Description
Adjusted_Years Current Year - 1899 Buying_Percentage Monthly Percentage of people buying any vehicle.
Global_Buy_Rate Global buyer rate as defined in the TurnEvents.xml file Global_Interest_Rates Global interest rate as defined in the TurnEvents.xml file
City_ECOGROWTH Economic Growth value for a specific city. City_POPULATION Population of a specific city
City_INF Infrastructure rating for a specific city City_CAP Per Capita income for a specific city
City_GOVERN Government stability rating for selected city. 1 = stable, 0 = limited war, -1 or less, full war/halted. Consumer_Fluctuation_Rate Variable defined by new game starting options.
Vehicle_Type_Popularity This is the popularity value of the specific vehicle type Vehicle_Type_Fuel_Rating This is the fuel rating of the specific vehicle type
Vehicle_Type_People This is the number of people interested in buying this type of vehicle in the specific city Vehicle_Type_WealthIndex This is the wealth index of the specific vehicle type, see Vehicle Type Importance Ratings for details
Vehicle_Unit_Costs This is the Material Unit Costs of the specific car. moneyBoost Consumer Purchasing Power as defined by starting new game options.
Car_Sales_Price Sales price of the specific car Car_Quality_Rating Quality rating of the specific car
Car_Top_Speed Top speed of the specific car Minimum_Top_Speed Minimum top speed required for this car type before penalties are applied
indexMove Marketing Efficiency's effect on wealth demographics Dealerships Number of dealerships the company selling the specific car has
Company_Racing_Image Racing image of the company selling the specific car Global_Gas Global Fuel costs as defined in the TurnEvents.xml file
Branch_Staff_Value Staff slider, number of employees, and morale values of the branch Branch_Sales_Resources Sales resources slider for the branch
Sum_Of_BuyerRatings Sum of all buyer ratings in the specific city for the vehicle type, including the specific car's. Used_Cars_BuyerRating Buyer rate for the used vehicles of this type in the specific city.
Car_BuyerRating The specific car's buyer rating Max_Rating_For_Type_In_City The highest buyer rating for this vehicle type in this specific city.
Collective_Age The age of the chassis, engine, gearbox, and vehicle design Top_Speed_Mod Top speed penalty
overPriced Over priced penalty Hard_Difficulty_Sales_Mod Sales boost for AI on hard and nightmare difficulties
Not_A_Player_Company Not you boycottPlayer If your company is being protested for whatever reason.

City/Type Buying Population

if(Adjusted_Years <= 25)
{
    Buying_Percentage = (((0.00155*Adjusted_Years) 
        +0.003)*City_ECOGROWTH)*Global_Buy_Rate*Global_Interest_Rates
}
else if(Adjusted_Years <= 105)
{
    Buying_Percentage = (((0.00025*Adjusted_Years)+0.035)*City_ECOGROWTH) *
        Global_Buy_Rate * Global_Interest_Rates
}
else if(Adjusted_Years <= 130)
{
    Buying_Percentage = (((-0.002*Adjusted_Years)+0.27125)*City_ECOGROWTH) * 
        (Global_Buy_Rate)*Global_Interest_Rates
}
else
{
    Buying_Percentage = (0.011 *City_ECOGROWTH) * Global_Buy_Rate * Global_Interest_Rates
}
 
 
if(City_GOVERN >= 1)
{
    govEffect = 0.5;
}
else if(City_GOVERN == 0)
{
    govEffect = 0.25;
}
else
{
    govEffect = 0;
}
 
RandomNumber = Random Number Between 0 AND ((City_INF/400.0)*
    (Consumer_Fluctuation_Rate))
 
//Total City Buying Pool
City_Buying_Population = (((((City_POPULATION)) * Buying_Percentage) *
    popBooster)*( RandomNumber + 0.85)) * City_BuyerRate* govEffect
 
//Vehicle Type Buying Pool
Vehicle_Type_Buyers = City_Buying_Population * Vehicle_Type_Popularity

Buyer Ratings

Sales Calculation

For Every Car In Every Type Sold In City
{
 
	People = Vehicle_Type_People + ((Vehicle_Type_People*0.2) * indexMove^2) +
		((Vehicle_Type_People*0.01+3) * (0.1*(10-Vehicle_Type_WealthIndex))) * Dealerships
 
	People = People + ((Vehicle_Type_People *0.05) * 
        (Company_Racing_Image/100.0)) +
		((Vehicle_Type_People *0.15) * indexMove)
 
	People = People + ((Vehicle_Type_People *0.05) * 
        (Vehicle_Type_Fuel_Rating * Global_Gas))
 
	Branch_Effect = 0.5+(0.25*((Branch_Staff_Value*0.0125) + (Branch_Sales_Resources*0.0125)))
 
	if(Vehicle_Unit_Costs != 0)
	{	Quality_To_Price_Ratio = (0.9 + 
            (Car_Sales_Price/(Vehicle_Unit_Costs*(3.0+3*(Car_Quality_Rating/5.0)))))
	}
	else
		Quality_To_Price_Ratio = 1
 
 
	if(Car_Top_Speed < Minimum_Top_Speed && Minimum_Top_Speed != 0 )
		Top_Speed_Mod = Car_Top_Speed / Minimum_Top_Speed
	else
		Top_Speed_Mod = 1
 
 
        Vehicle_Type_Max_Money = City_CAP*moneyBoost*((Vehicle_Type_WealthIndex/50.0)+1)
 
 
        priceIndex = Car_Sales_Price/(1+Vehicle_Type_Max_Money)
 
        if(Vehicle_Type_WealthIndex > 6 AND priceIndex < 5)
        {
            priceIndex = priceIndex + (5-priceIndex)
        }
        else
        {
            priceIndex = priceIndex - (0.001 * priceIndex)
        }
 
        if(year > 1945 AND Vehicle_Type_WealthIndex != 0)
        {
            priceIndex = priceIndex + ( ( priceIndex / Vehicle_Type_WealthIndex ) / 2.0)
        }
 
 
	Wealth_Demographic =  (0.005 - ((priceIndex-4.0-(0.1*Vehicle_Type_WealthIndex)) * 0.00002))
 
	if(Vehicle_Type_WealthIndex > 5 &&  priceIndex < 25)
	     Ultrawealthy_VehicleType_Quality = Random Number Between 0 and (Car_Quality_Rating/20)
	else
	     Ultrawealthy_VehicleType_Quality = 0
 
	if( Sales Price is signicantly lower than material costs )
	  Sold_At_Branch = 1000000
	else
	{
        if(Sum_Of_BuyerRatings+Used_Cars_BuyerRating != 0)
        {
            Sold_At_Branch = 0.5 + 
                (((People * ((Car_BuyerRating)/((Sum_Of_BuyerRatings+Used_Cars_BuyerRating)))) *
         		( (Random Number Between 0 and 0.2) + 0.9)) * Branch_Effect)
        }
        else
        {
            Sold_At_Branch = 0.5 + People * 
                ((Random Number Between 0 and 0.2) + 0.9) * Branch_Effect
        }
 
        Sold_At_Branch = Sold_At_Branch *  Wealth_Demographic
 
        if(year > 1995)
            Sold_At_Branch = Sold_At_Branch + People * 0.003
        else if(year > 1945 && year < 1995)
            Sold_At_Branch = Sold_At_Branch + People * (0.001 + (0.00004*(year-1945)))
        else
            Sold_At_Branch = Sold_At_Branch + People * 0.001
 
        if(Sold_At_Branch < 3 && People > 50 &&  Wealth_Demographic > 0.01)
        {
            if(Car_BuyerRating > Max_Rating_For_Type_In_City * 0.6)
            {
                if( (Car_BuyerRating / Max_Rating_For_Type_In_City) > 0.98)
                    Sold_At_Branch = Sold_At_Branch + 3
                else if( (Car_BuyerRating / Max_Rating_For_Type_In_City) > 0.8)
                    Sold_At_Branch = Sold_At_Branch + 2
                else
                    Sold_At_Branch = Sold_At_Branch + 1
            }
 
        }
 
 
        if(Collective_Age > 10)
        Sold_At_Branch = Sold_At_Branch / ((Collective_Age/6.0)+1)
 
 
        Sold_At_Branch = Sold_At_Branch / Quality_To_Price_Ratio
 
        if(Car_BuyerRating/Sum_Of_BuyerRatings > 0.1)
        {
                if(Random number between 0 and 2 = 0)
                    Sold_At_Branch = Sold_At_Branch + 1
        }
 
 
        Sold_At_Branch = Sold_At_Branch * Top_Speed_Mod
 
        Sold_At_Branch = Sold_At_Branch * overPriced
 
        if(Hard_Difficulty_Sales_Mod > 0 AND Not_A_Player_Company)
                Sold_At_Branch = Sold_At_Branch * hardDifficultySalesMod
 
        if(Sold_At_Branch <0)
                Sold_At_Branch = 0
 
        if(boycottPlayer)
            Sold_At_Branch = Sold_At_Branch * (0.75 + Random Number Between 0 and 0.10)
 
 
 
 
 
	}
}
gamemanual/gm_sales.txt · Last modified: 2022/04/18 20:16 by admin