====== Factory 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 ^
| **Factory_Map_Adjustment** | This is the factory adjustment value found in the map's MapFileForGame.xml file | | **Lobbying_Maximum** | The maximum amount of money you can spend on lobbying. |
| **Manufacturing_Skills** | Parent company's Manufacturing skills divided by 100 | | **Equipment_Wear** | For new factories, this value is set to 1. |
| **City_Resources** | Resource Rating for the selected city | | **Max_City_Resources** | Highest resource rating for all cities in the game. |
| **City_Infrastructure** | Infrastructure Rating for the selected city | | **City_Manufacturing** | Manufacturing Rating for the selected city |
| **Difficulty** | Difficulty level the player selected at the start of the game | | **Lobbying_Funds** | Player's current spending effect on lobbying. (Spending effect slowly trails monthly lobbying spending amount until it catches up to the spending amount.) |
| **Car_Manufacturing_Requirements** | Selected Vehicle's Manufacturing Requirements Rating | | **Car_Chassis_Outsourced** | True if the select car uses an outsourced chassis. |
| **Car_Engine_Outsourced** | True if the select car uses an outsourced engine. | | **Car_Gearbox_Outsourced** | True if the select car uses an outsourced gearbox. |
| **Factory_Tooling_Year** | The last year that the factory was retooled, recondition, built, or redesigned | | **Factory_Built_Year** | The year that the factory was built or redesigned. |
| **Lines_Used** | The number of factory lines being used. | | **Current_Production_Lines** | The number of factory lines being used. |
| **Upgrade_Amount** | Values are 0 for "Minor", 1 for "Medium", and 2 for "Max." | | **Upgrade_Attempt** | The number of times you have upgraded this factory since you built or redesigned it. |
| **Employee_Difficulty** | Value is based on the player's difficulty level. Easy: 30, Normal: 20, Hard/Nightmare: 10 | | **Wear** | Factory wear value between 0 and 1. |
| **year** | Current game year | | **** | |
| **ex_1d002p_year99** | 1.002%%^%%(year-1899) | | **ex_1d005p_year99** | 1.005%%^%%(year-1899) |
| **ex_1d012p_year99** | 1.012%%^%%(year-1899) | | **ex_1d015p_year99** | 1.015%%^%%(year-1899) |
| **ex_1d01p_year99** | 1.01%%^%%(year-1899) | | **ex_1d018p_year99** | 1.018%%^%%(year-1899) |
| **ex_1d03p_year99** | 1.03%%^%%(year-1899) | | **ex_1d04p_year99** | 1.04%%^%%(year-1899) |
==== Sliders ====
^ Variable ^ Description ^ ^ Variable ^ Description ^
| **Slider_Production_Capacity** | This is the production line slider. | | **Slider_Factory_Tech** | This is the factory tech slider. |
| **Slider_Factory_ProductionSpeed** | The production quality or quantity slider when assigning production lines. | | **** | |
===== Factory Ratings =====
==== Production Technologies ====
Production_Tech = (((Slider_Factory_Tech*1900+City_Infrastructure*5+(City_Manufacturing *
(City_Resources/Max_City_Resources)))/2500*Equipment_Wear)) * 100
if(Production_Tech > 100)
Production_Tech = 100
==== Factory Overall Rating ====
Factory_Overall = 1 + ((Slider_Production_Capacity * 200 + (Production_Tech*3))/ 5.0)
==== Maximum Build ====
Maximum_Build = ((3*Factory_Map_Adjustment +
((17*(Slider_Production_Capacity*100))/100.0)) * (ex_1d015p_year99) +
((3*ex_1d005p_year99)*Manufacturing_Skills))
Maximum_Build = Maximum_Build * Factory_Map_Adjustment
Maximum_Build = 1 + Maximum_Build * Slider_Production_Capacity
==== Build Turns ====
MaxLine_Percent = ((3*Factory_Map_Adjustment + 17) * (ex_1d015p_year99) +
((3 * ex_1d005p_year99) * Manufacturing_Skills))
MaxLine_Percent = MaxLine_Percent * Factory_Map_Adjustment
MaxLine_Percent = Maximum_Build / MaxLine_Percent
Build_Turns = 5^(1+Slider_Factory_Tech/1.3) *
((Factory_Overall/100)*(50/City_Infrastructure)+City_Resources) +
(12*ex_1d01p_year99*MaxLine_Percent)
==== Construction Costs ====
if(2021 > year)
{
Construction_Costs = ((175000 * ex_1d04p_year99) + (40000 * ex_1d03p_year99) +
(50000 * 0.985^Maximum_Build) + ((1000 * ex_1d018p_year99) *
(60/(City_Infrastructure+1.0))^((year-1899)/24.0))) +
((City_PerCapita / (City_Infrastructure/30)) *
City_Resources*(City_PerCapita/10)) * (Maximum_Build * 1.25)
}
else
{
Construction_Costs = ((175000 * ex_1d04p_year99) + ((40000) * ex_1d03p_year99) +
(50000 * (0.985^Maximum_Build))+ ((1000 * ex_1d018p_year99) *
(60/(City_Infrastructure+1.0))^(121/24.0))) +
((City_PerCapita / (City_Infrastructure/30)) *
City_Resources*(City_PerCapita/10)) * (Maximum_Build * 1.25)
}
Construction_Costs = Construction_Costs + (Construction_Costs * 0.5 * Slider_Factory_Tech)
if(Difficulty = 0)
Construction_Costs = (Construction_Costs / 1.35) + 1
else if(Difficulty = 2)
Construction_Costs = (Construction_Costs * 1.1) + 1
==== Lobbying Savings ====
Lobbying_Savings = (Construction_Costs * (0.1 * (Lobbying_Funds/Lobbying_Maximum)))
Construction_Costs = Construction_Costs - Lobbying_Savings
==== Monthly Full Production Costs ====
Full_Monthly_Costs = Construction_Costs * 0.01 * ex_1d002p_year99 * (Slider_Factory_Tech + 1)^1.01
if(Difficulty = 0)
Full_Monthly_Costs = (Full_Monthly_Costs / 1.25) + 1
else if(Difficulty = 2)
Full_Monthly_Costs = (Full_Monthly_Costs * 1.1) + 1
Full_Monthly_Costs = Full_Monthly_Costs + (Full_Monthly_Costs*0.18);
===== Factory Upgrade =====
==== Production Lines ====
Production_Lines = Current_Production_Lines + (1*Factory_Map_Adjustment +
(0.05*(year-1899)+1*Factory_Map_Adjustment)*Upgrade_Amount)
==== Upgrade Costs ====
NewLines = Production_Lines - Current_Production_Lines
Upgrade_Cost = (((175000 * ex_1d04p_year99) + (40000 * ex_1d03p_year99) +
(40000 * 0.985^ Production_Lines)+ ((1000 * ex_1d018p_year99) *
(60/(City_Infrastructure+1.0))^((year-1899)/24.0)) +
((City_PerCapita / (City_Infrastructure/30.0)) *
City_Resources*(City_PerCapita/10))) * (NewLines*1.25))*((Upgrade_Attempt+1)^1.5)
Upgrade_Cost = Upgrade_Cost + (Upgrade_Cost * 0.5 * Slider_Factory_Tech)
if(Difficulty = 0)
Upgrade_Cost = (Upgrade_Cost / 1.35) + 1
else if(Difficulty = 2)
Upgrade_Cost = (Upgrade_Cost * 1.25) + 1
===== Factory Recondition =====
==== Costs ====
Recondition_Costs = Wear * (5000 *1.05^(year - (Factory_Built_Year-1))) + (15000*ex_1d012p_year99)
===== Production =====
==== Maximum Production Amount ====
Manufacturing_Difference = Production_Tech / Car_Manufacturing_Requirements
if(Manufacturing_Difference<0.33)
Manufacturing_Difference = 0.33
else if(Manufacturing_Difference>1.67)
Manufacturing_Difference = 1.67
if(Factory_Tooling_Year > 1949)
Tooling_Year_Change = 5
else
Tooling_Year_Change = -0.0016*(((Factory_Tooling_Year-1899)-50)*
((Factory_Tooling_Year-1899)-50)) + 5
if(Car_Chassis_Outsourced)
{
Outsource_Output_Boost += 0.1;
Outsource_Employee_Reduction -= -0.1;
}
if(Car_Engine_Outsourced)
{
Outsource_Output_Boost += 0.1;
Outsource_Employee_Reduction -= -0.1;
}
if(Car_Gearbox_Outsourced)
{
Outsource_Output_Boost += 0.1;
Outsource_Employee_Reduction -= -0.1;
}
if(year < 2021)
{
Production_Amount = ((1+ ((25 * (Manufacturing_Difference) *
Outsource_Output_Boost * Tooling_Year_Change * 1.01^(Factory_Tooling_Year-1899)) +
((( (Production_Tech^2)/(2026 - Factory_Tooling_Year))) ) +
((Factory_Tooling_Year-1899)*2)) * Slider_Factory_ProductionSpeed)*Lines_Used)
}
else
{
Production_Amount = ((1+ ((25 * (Manufacturing_Difference) *
Outsource_Output_Boost * Tooling_Year_Change * (1.01^121)) +
((Production_Tech^2)/6) + ((121)*2)) * Slider_Factory_ProductionSpeed)*Lines_Used)
}
==== Component Production ====
Production_Amount = (((10 * Production_Tech) * 2) - (10 * Equipment_Wear) +
(10 * (Factory_Tooling_Year - 1899)) ) *
((Production_Tech)/(Manufacturing_Requirement+1))
if(Production_Amount < 0)
Production_Amount = 0
Production_Amount = Production_Amount + 50
==== Employee ====
if(year < 2021)
Employees = (Production_Amount/Employee_Difficulty * (15*((Factory_Tooling_Year-1898.5)^-0.8))) +
((Slider_Factory_ProductionSpeed+0.1)*Lines_Used) * (20.0 + (1.339 * (2021-Factory_Tooling_Year)) -
(.014 * ((2021-Factory_Tooling_Year)*(2021-Factory_Tooling_Year))) +
(.0000787 * ((2021-Factory_Tooling_Year)*(2021-Factory_Tooling_Year)*(2021-Factory_Tooling_Year))))
else
Employees = (Production_Amount/Employee_Difficulty * (15*((121.5),-0.8))) +
((Slider_Factory_ProductionSpeed+0.1)*Lines_Used) * (20.0 + (1.339 *(1)) -
(.014 * ((1)*(1))) + (.0000787 * ((1)*(1)*(1))))
Employees = Employees * Outsource_Employee_Reduction
if(Employees <1)
Employees = 0