User Tools

Site Tools


gamemanual:gm_branches

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_branches [2022/04/04 13:52] – [Costs] admingamemanual:gm_branches [2022/04/15 22:10] (current) – [Variables] admin
Line 1: Line 1:
 +====== Branch 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 [[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 =====
 +
 +This is a table of variables and their descriptions used in the formulas.
 +
 +^ Variable ^ Description ^  ^ Variable ^ Description ^
 +| **Focus** | The former focus slider, now ( (Slider_Sales_Resources × 2) + Slider_Dealership_Resources) ÷ 3  | | **Personal** | The former personal slider, now ( (Slider_Dealership_Resources × 2) + Slider_Sales_Resources)÷3 |
 +| **year** | Current game year | | **Build_Year** | The year that the branch was built or redesigned. |
 +| **City_Infrastructure** | Infrastructure Rating for the selected city | | **City_Labor_Skill** | Labor skills of the selected city. |
 +| **City_Population** | Population of the selected city. | | **City_PerCapita** | Per Capita income of the selected city. |
 +| **Branch_Map_Adjustment** | This is the branch adjustment value found in the map's MapFileForGame.xml file | | **DynamicBranchCosts** | This is the "Increased Branch Costs" starting game option. |
 +| **Wear_Level** | Branch wear value between 0 and 100. With 100 being maximum wear. | | **Distance_Between** | This is the distance in KM between branch and factory. |
 +| **Branch_City_Infrastructure_Rate** | This is the branch city's infrastructure rate. | | **Branch_City_Gas_Rate** | This is the branch city's gas rate. |
 +| **Factory_City_Infrastructure_Rate** | This is the factory city's infrastructure rate. | | **Factory_City_Gas_Rate** | This is the factory city's gas rate. |
 +| **Global_Gas** | This is the global fuel rate as defined in the TurnEvents.xml file | | **Dealer_Count** | This is the number of dealerships the branch services. |
 +| **Admin_Skill** | This is the administrative skills of your company | | **Add_Dealership_Attempts** | This number increments up 0.5 each time you subsidize dealerships at this location. | 
 +| **Max_Supported_Dealers** | This is the maximum possible dealerships the branch can service. | | **ex_1d01p_year99** | 1.01%%^%%(year-1899) |
 +| **ex_1d012p_year99** | 1.012%%^%%(year-1899) | | **ex_1d025p_year99** | 1.025%%^%%(year-1899) |
 +| **ex_1d03p_year99** | 1.03%%^%%(year-1899) | | **ex_1d035p_year99** | 1.035%%^%%(year-1899) |
 +| **ex_1d04p_year99** | 1.04%%^%%(year-1899) | | **ex_1d05p_year99** | 1.05%%^%%(year-1899) |
 +
 +
 +==== Sliders ====
 +
 +^ Variable ^ Description ^  ^ Variable ^ Description ^
 +| **Slider_Dealership_Resources** | The Dealer Resources Slider | | **Slider_Sales_Resources** | The Sales Resources Slider |
 +
 +
 +
 +===== Branch Ratings =====
 +
 +==== Dealership Growth Rate ====
 +
 +<code cpp>
 +Dealer_Growth = (Slider_Dealership_Resources*30000 + (City_Infrastructure*City_Labor_Skill))/40000
 +</code>
 +
 +==== Sales Efficiency ====
 +
 +<code cpp>
 +Sales_Efficiency = (200*Slider_Sales_Resources+100*Personal+City_Labor_Skill)/400
 +</code>
 +
 +==== Maximum Dealers ====
 +
 +<code cpp>
 +
 +Maximum_Dealers = ((City_Infrastructure/3.5+22)*
 +    (City_Population/(1000000*1.004^year-1899*Branch_Map_Adjustment)))+10
 +
 +if(Branch_Map_Adjustment > 3)
 +    Maximum_Dealers = Maximum_Dealers * 3
 +else
 +    Maximum_Dealers = Maximum_Dealers * Branch_Map_Adjustment
 +
 +</code>
 +
 +==== Construction Costs ====
 +
 +
 +<code cpp>
 +
 +if(Year < 2021)
 +{
 +   Costs = ((15000*ex_1d05p_year99 * 50) + (City_PerCapita*50*(year-1899)))/11;    
 +}
 +else
 +{
 +   Costs = ((15000*ex_1d05p_year99*50) + (City_PerCapita*50*121))/11;
 +}
 +
 +if(DynamicBranchCosts)
 +{
 +   Costs = Costs * (City_Population / (1000000 * ex_1d012p_year99) + 0.9)
 +}
 +
 +Costs = Costs * Branch_Map_Adjustment
 +
 +
 +</code>
 +
 +
 +==== Monthly Costs ====
 +
 +<code cpp>
 +Monthly_Costs = ((3000*(ex_1d04p_year99)* Dealer_Growth+
 +    2500*(ex_1d03p_year99)*Sales_Efficiency+10000*
 +    (ex_1d035p_year99)*Personal)) + (5000*(ex_1d025p_year99) *
 +    ((100-City_Infrastructure)/100))
 +    
 +if(DynamicBranchCosts)
 +{
 +    Monthly_Costs = Monthly_Costs * (City_Population / (5000000*ex_1d01p_year99) + 0.9)
 +}    
 +
 +Monthly_Costs = Monthly_Costs * Branch_Map_Adjustment
 +
 +</code>
 +
 +
 +==== Employees ====
 +
 +<code cpp>
 +if(Year < 2021)
 +{    
 +  Max_Employees = 5 + ((year-1899)/1.2) +
 +    (3*(year-1899)*Slider_Dealership_Resources)+
 +    (2*(year-1899)*Slider_Sales_Resources)
 +}
 +else
 +{   
 +  Max_Employees = 5 + (100.833)+ (3*(year-1899)*Slider_Dealership_Resources)+
 +    (2*121*Slider_Sales_Resources)
 +}
 +
 +Max_Employees = Max_Employees * Branch_Map_Adjustment
 +
 +Max_Employees = Max_Employees + Monthly_Costs/5000
 +
 +</code>
 +
 +
 +===== Reconditioning =====
 +
 +==== Costs ====
 +
 +<code cpp>
 +Recondition_Costs = Wear_Level * (5 * (year - (Build_Year-1)) +100  )
 +
 +</code>
 +
 +===== Shipping =====
 +
 +
 +==== Costs ====
 +
 +<code cpp>
 +costs = (Distance_Between^1.03/((7.0+(Branch_City_Infrastructure_Rate/85.0)+
 +  (Factory_City_Infrastructure_Rate/85.0)) * ex_1d004p_year99)) *
 +  ((0.7 / (7.0+(Branch_City_Infrastructure_Rate/85.0)+
 +  (Factory_City_Infrastructure_Rate/85.0))) +1) * Global_Gas * 
 +  ((Branch_City_Gas_Rate+Factory_City_Gas_Rate)/2.0)
 +
 +</code>
 +
 +
 +===== Dealerships =====
 +
 +
 +==== New Dealers ====
 +
 +<code cpp>
 +
 +
 +Dealer_Percent = Dealer_Count/Max_Supported_Dealers
 +
 +if((0.1+Slider_Dealership_Resources) > Random_Number Between 0 and (1.2+Dealer_Percent) )
 +    Dealer_Count = Dealer_Count + 1 + (5 * Slider_Dealership_Resources)
 +else if(Dealer_Percent > 0.5 AND (0.1+Dealer_Percent) > Random_Number Between 0 and 5 )
 +    Dealer_Count = Dealer_Count - (1 + (3*Dealer_Percent))
 +
 +
 +
 +if(Slider_Dealership_Resources * 100 > Random_Number Between 0 and 200)
 +{
 +   Max_Supported_Dealers = Random_Number Between 0 and 4 + 1
 +}
 +
 +</code>
 +
 +
 +==== Subsidizing Dealerships ====
 +
 +<code cpp>
 + Add_New_Dealerships = ((Admin_Skill/4.0)/(Add_Dealership_Attempts + 1)) + 1
 +
 + Costs =  5000 * ex_1d035p_year99 * Add_New_Dealerships * (Add_Dealership_Attempts+1);
 +</code>
 +