Table of Contents
Contracts 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.
Variables
Name | Description | Name | Description | |
---|---|---|---|---|
govPopulation | This is the population of the contracting city or country. | govCalc | The war status for the country, 1=Normal, 0=Limited, -1 War, -2 Total War. | |
year | This is the game year. | Year_Built | This is the year of the design. | |
Minimum_Bid_Score | Minimum required bid score to be selected. | ContractPeriod | How long the contract lasts. | |
Wealth_Index | Wealth Index of the design. See this page. | Wealth | See Wealth Index | |
Lobbying_Budget | The weighted lobbying budget for your company | Max_Lobbying_Budget | The maximum amount of lobbying budget that can be spent | |
contractUnitPriceMod | Price mod for this type of contract as defined in the EngineContracts.xml file. | |||
Engine_Type_EngineSize | Engine Size variable as defined in the EngineContracts.xml file. | Engine_Type_UnitNumbers | This is a modifier variable for the number of units ordered for this type of contract as defined in the EngineContracts.xml file. | |
Engine_Type_FuelMOD | Engine Fuel Economy variable as defined in the EngineContracts.xml file. | Engine_Type_HPMOD | Engine horsepower variable as defined in the EngineContracts.xml file. | |
Engine_Type_torqueMOD | Engine torque variable as defined in the EngineContracts.xml file. | Engine_Type_WidthMOD | Engine width variable as defined in the EngineContracts.xml file. | |
Engine_Type_LengthMOD | Engine length variable as defined in the EngineContracts.xml file. | Engine_Type_WeightMOD | Engine weight variable as defined in the EngineContracts.xml file. | |
Engine_Type_unitPrice | This modifier variable affects the unit price of this type of engine contract as defined in the EngineContracts.xml file. | |||
Type_Popularity | This is the popularity value of this type of vehicle. | CarContractType_unitNumbers | This is a modifier value for the number of units for this type of car contract as defined in the EngineContracts.xml file. | |
CarContractType_HPMOD | Horsepower modifier value for this type of car contract as defined in the EngineContracts.xml file. | CarContractType_FuelMOD | Fuel Economy modifier value for this type of car contract as defined in the EngineContracts.xml file. | |
cargoType | This is the cargo importance rating for this vehicle type. | CarContractType_CargoMOD | Cargo modifier value for this type of car contract as defined in the EngineContracts.xml file. | |
CarContractType_torqueMOD | Torque modifier value for this type of car contract as defined in the EngineContracts.xml file. | CarContractType_WeightMOD | Weight modifier value for this type of car contract as defined in the EngineContracts.xml file. | |
CarContractType_TopSpeedMOD | Topspeed modifier value for this type of car contract as defined in the EngineContracts.xml file. | CarContractType_unitPrice | Unit price modifier value for this type of car contract as defined in the EngineContracts.xml file. | |
RacingSeries_Funding_Value | This is the racing funds variable for racing series as defined in the RacingSeries.xml file. | RacingSeries_Races | This is the number of races a series runs in a season. | |
ex_1d002p_year99 | 1.002^(year-1899) | ex_1d005p_year99 | 1.005^(year-1899) | |
ex_1d008p_year99 | 1.008^(year-1899) | ex_1d01p_year99 | 1.01^(year-1899) | |
ex_1d015p_year99 | 1.015^(year-1899) | ex_1d02p_year99 | 1.02^(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_1d06p_year99 | 1.06^(year-1899) |
Fleet Contracts Specs
Engine
Displacement
//Land/Army EngineCC = (Random Number Between 0 And 5000) + 10000) * Engine_Type_EngineSize //Maritime/Navy EngineCC = (Random Number Between 0 And 10000) + 25000) * Engine_Type_EngineSize //Aero EngineCC = (Random Number Between 0 And 18000 + 12000) * Engine_Type_EngineSize
Unit Demand
if(EngineCC > 20000) EngineSizeUnitMod = 1000000 / EngineCC else EngineSizeUnitMod = (-0.123 * EngineCC) + 2500 if Land/Army Units = ((govPopulation/100000) + EngineSizeUnitMod*0.2 + Random Number Between 0 And EngineSizeUnitMod*0.8)) * govCalc + 1 else if Navy Units = ((govPopulation/1000000) + EngineSizeUnitMod*0.2 + Random Number Between 0 And EngineSizeUnitMod*0.8)) * govCalc + 1 else if Military Aero Units = ((govPopulation/250000) + EngineSizeUnitMod*0.2 + Random Number Between 0 And EngineSizeUnitMod*0.8)) * govCalc + 1 else if Civil Aero Units = ((govPopulation/200000) + EngineSizeUnitMod*0.2 + Random Number Between 0 And EngineSizeUnitMod*0.8)) + 1 else if Civil Maritime Units = ((govPopulation/750000) + EngineSizeUnitMod*0.2 + Random Number Between 0 And EngineSizeUnitMod*0.8)) + 1 Units = Units * Engine_Type_UnitNumbers UnitsPerMonth = Units / ContractPeriod if(UnitsPerMonth < 1) UnitsPerMonth = 1
Fuel Consumption
fuelRand = Random Number Between 0 And 3 if Land/Army MPG = ((10 - (EngineCC/4000)) - fuelRand) * Engine_Type_FuelMOD * ex_1d002p_year99+3; else if Navy MPG =(( 10 - (EngineCC/12000)) - fuelRand)*Engine_Type_FuelMOD * ex_1d002p_year99+3; else if Aero MPG = ((10 - (EngineCC/3500)) - fuelRand) * Engine_Type_FuelMOD * ex_1d002p_year99+3; if(MPG < 4 || MPG > 200) MPG = -1;
Horse Power
if Land/Army HP = (Random Number Between 0 And (EngineCC/250)+((EngineCC/100)*ex_1d01p_year99)) * Engine_Type_HPMOD else if Navy HP = (Random Number Between 0 And (EngineCC/600)+EngineCC/200) *ex_1d015p_year99 * Engine_Type_HPMOD else if Aero HP = ((Random Number Between 0 And (EngineCC/250)+((EngineCC/70)*ex_1d005p_year99))) * Engine_Type_HPMOD else if Civil Ships HP = (Random Number Between 0 And (EngineCC/500)+EngineCC/200) *ex_1d005p_year99 * Engine_Type_HPMOD
Torque
if Land/Army torque = (15 + Random Number Between 0 And EngineCC/450)+(EngineCC/300) ) * ex_1d008p_year99 * Engine_Type_torqueMOD; else if Navy torque = (15 + Random Number Between 0 And EngineCC/370)+(EngineCC/500) ) * ex_1d008p_year99 * Engine_Type_torqueMOD; else if Aero torque = (20 + Random Number Between 0 And EngineCC/300)+(EngineCC/200) ) * ex_1d008p_year99 * Engine_Type_torqueMOD;
Torque
if Land/Army torque = (15 + Random Number Between 0 And EngineCC/450)+(EngineCC/300) ) * ex_1d008p_year99 * Engine_Type_torqueMOD; else if Navy torque = (15 + Random Number Between 0 And EngineCC/370)+(EngineCC/500) ) * ex_1d008p_year99 * Engine_Type_torqueMOD; else if Aero torque = (20 + Random Number Between 0 And EngineCC/300)+(EngineCC/200) ) * ex_1d008p_year99 * Engine_Type_torqueMOD;
Width
if Land/Army EngineWidth = (EngineCC/300 + 10) * Engine_Type_WidthMOD; else if Navy EngineWidth = (EngineCC/150 + 10)*Engine_Type_WidthMOD; else if Aero EngineWidth = (EngineCC/350 + 10)*Engine_Type_WidthMOD;
Length
if Land/Army EngineLength = (EngineCC / 300 + 12) * Engine_Type_LengthMOD; else if Navy EngineLength = (EngineCC / 150 + 12)*Engine_Type_LengthMOD; else if Aero EngineLength = (EngineCC / 200 + 12)*Engine_Type_LengthMOD;
Weight
if Land/Army Weight = (EngineCC / 11.5 + 100) * ex_1d008p_year99 * Engine_Type_WeightMOD; else if Navy Weight = (EngineCC / 5.5 + 500) * ex_1d008p_year99 * Engine_Type_WeightMOD; else if Aero Weight = (EngineCC / 10.0 + 50) * Engine_Type_WeightMOD;
Penalty, Unit Price, Signing Bonus
if Units < 50 bonusPenality = (ex_1d025p_year99 *30000) * (50.0/(Units)) if Land/Army Penalty = (ex_1d025p_year99 * EngineCC/50) * Units + 1 + bonusPenality; else if Military Navy Penalty = (ex_1d025p_year99 * EngineCC/10) * Units + 1 + bonusPenality; else if Military Aero Penalty = (ex_1d025p_year99 * EngineCC/30) * Units + 1 + bonusPenality; else if Civilian Aero Penalty = (ex_1d025p_year99 * EngineCC/80) * Units + 1 + bonusPenality; else if Civilian Ships Penalty = (ex_1d025p_year99 * EngineCC/80) * Units + 1+bonusPenality; if(Random Number Between 0 And 1 = 1 ) { basePrice = 0 if Easy Difficulty basePrice = 175; else if Normal Difficulty basePrice = 75 if Land/Army { UnitCosts = ((((105 +basePrice) * ex_1d025p_year99) + Random Number Between 0 And (130 + basePrice/1.25) * ex_1d02p_year99)) + EngineCC/200 + 1 + (bonusPenality/10)) Penalty = ((UnitCosts + EngineCC/200) /2.0) * Units + 1 + bonusPenality } else if Military Navy { UnitCosts = ((((305 + basePrice) * ex_1d025p_year99) + Random Number Between 0 And (200 +basePrice/1.25) * ex_1d02p_year99)) + EngineCC/50 + 1+(bonusPenality/10)) Penalty = ((UnitCosts + EngineCC/50)/0.5) * Units + 1 + bonusPenality } else if Military Aero { UnitCosts = ((((205 + basePrice) * ex_1d025p_year99) + Random Number Between 0 And (230 +basePrice/1.25) * ex_1d02p_year99)) + EngineCC/100 + 1 + (bonusPenality/10)) Penalty = ((UnitCosts+EngineCC/100)/1.5) * Units + 1 + bonusPenality } else if Civilian Aero { UnitCosts = ((((130 + basePrice) * ex_1d025p_year99) + Random Number Between 0 And (155 +basePrice/1.25) * ex_1d02p_year99)) + EngineCC/150 + 1 + (bonusPenality/10)) Penalty = ((UnitCosts+EngineCC/150)/2.0) * Units + 1 + bonusPenality } else if Civilian Ships { UnitCosts = ((((255 + basePrice) * ex_1d025p_year99) + Random Number Between 0 And (200 + basePrice/1.25) * ex_1d02p_year99)) + EngineCC/100 + 1+(bonusPenality/10)) Penalty = ((UnitCosts + EngineCC/100)/2.0) * Units + 1 + bonusPenality } if(Units > 1000) UnitCosts = (UnitCosts * 0.75) + (UnitCosts * 0.25 * (1000.0/(1000.0 + Units))) else UnitCosts = (UnitCosts * 0.875) UnitCosts = UnitCosts * contractUnitPriceMod; UnitCosts = UnitCosts * Engine_Type_unitPrice; SigningBonus = UnitCosts / (Random Number Between 0 And 10) + 10) * Units SigningBonus = SigningBonus * contractUnitPriceMod SigningBonus = SigningBonus * Engine_Type_unitPrice Penalty = Penalty + SigningBonus * Random Number Between 0 and 1.0 + 3.0 }
Vehicles
Units
Units = (govPopulation * (0.002 + (0.0025 * Absolute Value of(govStatus*3) ))) * Type_Popularity + 1 Units = Units * CarContractType_unitNumbers if(warContract) Units = Units * 5
Displacement
EngineCC = (Random Number Between 0 And (500) + 1000) * Wealth
Horse Power
if Military Contract HP = (Random Number Between 0 And (10)+(5 * ex_1d008p_year99)) * wealth * CarContractType_HPMOD else if Civilian Contract HP = (Random Number Between 0 And (15)+10) * ex_1d008p_year99 * wealth * CarContractType_HPMOD
Fuel Consumption
if(Military Contract) MPG = (14 - (wealth * 2)+ Random Number Between 0 And (4)) * CarContractType_FuelMOD + 3; else if(Civilian Contract) MPG = (20 - (wealth *1.75)+ Random Number Between 0 And (4)) * CarContractType_FuelMOD + 3; if(MPG < 4 OR MPG > 200) No fuel economy limit
Cargo
if(Military Contract) CargoReq = 200 + (Random Number Between 0 And (200) + 200) * (cargoType * 1.2) * CarContractType_CargoMOD else if(Civilian Contract) CargoReq = 200 + (Random Number Between 0 And (200) + 150) * (cargoType * 1.2) * CarContractType_CargoMOD
Torque
torque = (25 + (EngineCC/100)) * ex_1d005p_year99 * CarContractType_torqueMOD
Weight
Weight = (500 + (CargoReq / 50) + Random Number Between 0 And (300)) * ex_1d008p_year99 * CarContractType_WeightMOD
Top Speed
if( Year < 2021 ) topSpeed = ( (20 + ((year-1899)/3.5)) + Random Number Between 0 And (15 + ((year-1899)/2)) )* ex_1d005p_year99 * CarContractType_TopSpeedMOD else topSpeed = (40 + Random Number Between 0 And (80)) * ex_1d005p_year99 * CarContractType_TopSpeedMOD
Unit Price, Penalty, Signing Bonus
basePrice = 0 if Difficulty is Easy basePrice = 175 else if Difficulty Normal basePrice = 75 if(Military Contract) { UnitCosts = (((350 + basePrice) * ex_1d02p_year99) + Random Number Between 0 And ((50 + basePrice/1.25) * ex_1d02p_year99)) * (Wealth * 0.8 + 1) } else if(Civilian Contract) { UnitCosts = (((250 + basePrice) * ex_1d02p_year99) + Random Number Between 0 And ((100 + basePrice/1.25) * ex_1d02p_year99)) * (Wealth * 0.7 + 1) } if(UnitCosts > 1000) UnitCosts = (UnitCosts * 0.75) + (UnitCosts * 0.25 * (1000.0/(1000.0 + Units))) else UnitCosts = (UnitCosts * 0.875) UnitCosts = UnitCosts * contractUnitPriceMod UnitCosts = UnitCosts * CarContractType_unitPrice if(UnitCosts < 450) UnitCosts = 450 SigningBonus = UnitCosts/(Random Number Between 0 And (10) + 10) * Units Penalty = Penalty + SigningBonus * RandomNumber->randDblExc(1.0) + 0.5 Penalty = Penalty + ((ex_1d02p_year99 * EngineCC/50) * Units) + 1 SigningBonus = SigningBonus * contractUnitPriceMod SigningBonus = SigningBonus * CarContractType_unitPrice
Generate Racing Contracts
Vehicles
Racing series restrictions define displacement, fuel, induction, cylinder, vehicle types, etc.
Signing Bonus, Penalties, Unit Costs
SigningBonus = ((2000*ex_1d03p_year99)+(5000*RacingSeries_Funding_Value*ex_1d06p_year99)) * (Random Number Between (0 And 1.0)+0.5) Penalty = SigningBonus * (Random Number Between (0 And 3.0)+2.0) if Difficulty = Easy UnitCosts = (3000*ex_1d025p_year99) * (RacingSeries_Funding_Value/5.0 +1) else if Difficulty = Normal UnitCosts = (2000*ex_1d025p_year99) * (RacingSeries_Funding_Value/6.0 +1) else if Difficulty = Hard or Nightmare UnitCosts = (1000*ex_1d025p_year99) * (RacingSeries_Funding_Value/7.0 +1)
Units
Units = ((RacingSeries_Races) * RacingSeries_Funding_Value) + 10;
Minimum HP
MinHP = (100+(2*(year-1900)))
Lateral G
Lateral_G = 1 + (0.0005 * (year-1900))
Top Speed
Top_Speed = 100 + (2 * (year-1900))
Engines
Displacement, fuel, induction, and cylinder types defined by racing series restrictions.
Signing Bonus, Penalties, Unit Costs
SigningBonus = ((1000*ex_1d03p_year99)+(2500*RacingSeries_Funding_Value*ex_1d06p_year99)) * (Random Number Between (0 And 1.0)+0.5) Penalty = SigningBonus * (Random Number Between (0 And 3.0)+2.0) if Difficulty = Easy UnitCosts = (3000*ex_1d02p_year99) * (RacingSeries_Funding_Value/5.0 + 1) else if Difficulty = Normal UnitCosts = (2500*ex_1d02p_year99) * (RacingSeries_Funding_Value/6.0 + 1) else if Difficulty = Hard or Nightmare UnitCosts = (1500*ex_1d02p_year99) * (RacingSeries_Funding_Value/7.0 + 1)
Units
Units = ((RacingSeries_Races * 3.0) * RacingSeries_Funding_Value) + 5;
Minimum HP
Min_HP = (100+(2*(year-1900)));
Contract Winner Selection
Max Bid Price
if Vehicle Contract maxBid = ((500 * ex_1d03p_year99) + Random Number Between 0 and (250 * ex_1d03p_year99)) * (Wealth_Index * .75) else if( Engine Contract ) maxBid = (((550 * ex_1d03p_year99) + Random Number Between 0 And (550 * ex_1d04p_year99)) + ( HP/(20 * ex_1d02p_year99) ) + 1) else maxBid = (((550 * ex_1d035p_year99) + RandomNumber Between 0 And (550 * ex_1d04p_year99)) + 1) }
Minimum Bid Score
If Only One Bid Min_Bid_Mod = 1.6 If Only Two Bids Min_Bid_Mod = 1.3 If Only Three Bids Min_Bid_Mod = 1.1 If More Than Three Bids Min_Bid_Mod = 0 Minimum_Bid_Score = Minimum_Bid_Score * Min_Bid_Mod;
Vehicle Bid
if(Lobbying Effectiveness > 60) { lobbyMod = (Lobbying Budget / Max_Lobbying_Budget } else { lobbyMod = 0 } if(lobbyMod >= 1.5) { lobbyMod = 1.499; } if Vehicle Contract { if( (Year - Year Built)> 6) { ageMod = 7 / (Year - Year Built); } else { ageMod = 1; } if Racing Contract { BuyerRating = (((Spec_HP - ContractRequirements_HP)*2.5) + (Spec_Fuel - ContractRequirements_FuelConsumption) + ((ContractRequirements_Weight - Spec_Weight)/50.0) + ((Spec_Cargo - ContractRequirements_CargoSpace/10.0)) + (Rating_Overall * 10) + (Rating_Cargo) + ((Spec_Torque - ContractRequirements_Torque)*2.5) + ((Spec_TopSpeed - ContractRequirements_TopSpeed)*3.5) + (Spec_LateralG - ContractRequirements_LateralG)*3 + (Rating_Quality*1) + (Rating_Dependability*10))/((Unit_Bid_Price^0.25)+1)*(1.5-lobbyMod)) } else { BuyerRating = (((Spec_HP - ContractRequirements_HP)/2.0) + (Spec_Fuel - ContractRequirements_FuelConsumption) + ((ContractRequirements_Weight - Spec_Weight)/100.0) + ((Spec_Cargo - ContractRequirements_CargoSpace/1.5)) + (Rating_Overall * 20) + (Rating_Cargo*15) + ((Spec_Torque - ContractRequirements_Torque)/2.0) + ((Spec_TopSpeed - ContractRequirements_TopSpeed)/3.5) + (Spec_LateralG - ContractRequirements_LateralG) + (Rating_Quality*25) + (Rating_Dependability*30))/((Unit_Bid_Price^0.81)+1)*(1.5-lobbyMod) } BuyerRating = BuyerRating * ageMod; Whoever has the highest buyer rating wins the contract.
Engine Bid
if(Lobbying Effectiveness > 60) { lobbyMod = (Lobbying Budget / Max_Lobbying_Budget } else { lobbyMod = 0 } if(lobbyMod >= 1.5) { lobbyMod = 1.499; } if( (Year - Year Built) > 6) { ageMod = 7 / (Year - Year Built); } else { ageMod = 1; } if(lobbyMod == 1.5) { lobbyMod = 1.499; } if Racing Contract { BuyerRating = (((HP - ContractRequirements_HP)*2) + ((ContractRequirements_EngineWeight - Weight)/2.0) +((Torque - ContractRequirements_Torque)*2) + (FuelConsumption - ContractRequirements_FuelConsumption) + (Overall_Rating * 5) + (EngineReliability_Rating * 5) + (Fuel_Rating * 5) + (Power_Rating * 5) ) /((UnitBid^0.25)+1)*(1.5-lobbyMod) } else { BuyerRating = (((HP - ContractRequirements_HP)/2.0) + ((ContractRequirements_EngineWeight - Weight)/10.0) +((Torque - ContractRequirements_Torque)/2.0) + (FuelConsumption - ContractRequirements_FuelConsumption) + (Overall_Rating * 15) + (EngineReliability_Rating * 15) + (Fuel_Rating * 10) + (Power_Rating * 10) + (Smoothness_Rating * 10)) /((UnitBid^0.81)+1)*(1.5-lobbyMod) } BuyerRating = BuyerRating * ageMod; Whoever has the highest buyer rating wins the contract.
Chassis Bid
if(Lobbying Effectiveness > 60) lobbyMod = (Lobbying Budget / Max_Lobbying_Budget else lobbyMod = 0 if(lobbyMod >= 1.5) lobbyMod = 1.499; if( (Year - Year Built) > 6) { ageMod = 7 / (Year - Year Built) } else { ageMod = 1 } if Racing Contract { BuyerRating = (((ChassisMaxEngineLength+ChassisMaxEngineWidth)-ChassisWeightKG) + Strength_Rating*1.25 + Comfort_Rating + (Performance_Rating * 25) + Dependability_Rating*2)/((UnitBid^0.25)+1)*(1.5-lobbyMod) } else { BuyerRating = ((((ChassisMaxEngineLength*2)+(ChassisMaxEngineWidth*2))) + Strength_Rating + Comfort_Rating*2 + Performance_Rating*2 + (Dependability_Rating*4)+Overall_Rating*3)//((UnitBid^0.81)+1)*(1.5-lobbyMod) } BuyerRating = BuyerRating * ageMod Whoever has the highest buyer rating wins the contract.
Gearbox Bid
if(Lobbying Effectiveness > 60) lobbyMod = (Lobbying Budget / Max_Lobbying_Budget else lobbyMod = 0 if(lobbyMod >= 1.5) lobbyMod = 1.499; if( (Year - Year Built) > 6) { ageMod = 7 / (Year - Year Built) } else { ageMod = 1 } if Racing Contract { BuyerRating = (((Overall_Rating*1.5+(Comfort_Rating*0.25))-Weight) + Reliability_Rating*2 + (Performance_Rating*15) + (FuelConsumption_Rating*2) + Power_Rating*5+(MaxTorqueInput*2.25))/((UnitBid^0.25)+1)*(1.5-lobbyMod) } else { BuyerRating = (((Overall_Rating*2.5+(Comfort_Rating*2.25))-Weight*2.5) + Reliability_Rating*1.5 + (Performance_Rating) + (FuelConsumption_Rating*2) + Power_Rating+(MaxTorqueInput*0.05))/((UnitBid^0.81)+1)*(1.5-lobbyMod) } BuyerRating = BuyerRating * ageMod Whoever has the highest buyer rating wins the contract.