User Tools

Site Tools


gamemanual:gm_penalties

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_penalties [2022/08/23 15:57] – [Variables] admingamemanual:gm_penalties [2022/08/23 20:12] (current) – [Variables] admin
Line 1: Line 1:
 +======= Vehicle Penalties =======
  
 +
 +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 =====
 +
 +
 +^ Name ^ Description ^ ^ Name ^ Description ^
 +| **year** | The current game year | | **Engine_Year** | The year this vehicle's engine was designed | 
 +| **Chassis_Year** | The year this vehicle's chassis was designed | | **Gearbox_Year** | The year this vehicle's gearbox was designed | 
 +| **CarDesignYear** | The year this vehicle was designed | | **BuyersRating** | This is the vehicle's final score used to calculate the number of sales. The higher this number, the more sales the vehicle gets. | 
 +| **baseTopSpeed** | This is the base top speed used to calculate the required top speed for specific vehicle types. | | **CarType_Rating_Performance** | This is the vehicle type's performance rating | 
 +| **Car_Top_Speed** | This is the top speed of the vehicle. | | **soldAtBranch** | This is the number of vehicles sold. | 
 +| **Chassis_Sliders_Suspension_Stability** | Chassis slider position for suspension stability | | **Chassis_Sliders_Suspension_Comfort** | Chassis slider position for suspension comfort | 
 +| **Chassis_Sliders_Suspension_Performance** | Chassis slider position for suspension performance | | **Chassis_Sliders_Suspension_Braking** | Chassis slider position for suspension braking | 
 +| **Chassis_Sliders_Suspension_Durability** | Chassis slider position for suspension durability | | **Chassis_Sliders_Technology_Materials** | Chassis slider position for materials technologies | 
 +| **Chassis_Sliders_Technology_Tech** | Chassis slider position for technology | | **Engine_Sliders_FuelEco** | Engine slider position for fuel economy | 
 +| **Engine_Sliders_Materials** | Engine slider position for materials | | **Engine_Sliders_Technology** | Engine slider position for technologies | 
 +| **Engine_Sliders_Components** | Engine slider position for components quality | | **Gearbox_Sliders_Technology_Material** | Gearbox material technology slider | 
 +| **Gearbox_Sliders_Technology_Parts** | Gearbox parts technology slider | | **Gearbox_Sliders_Technology_Techniques** | Gearbox techniques slider | 
 +| **Gearbox_Sliders_Technology_Tech** | Gearbox technologies slider | | **Car_Sliders_InteriorStyle** | Vehicle interior style slider |
 +| **Car_Sliders_InteriorLuxury** | Vehicle interior luxury slider | | **Car_Sliders_InteriorComfort** | Vehicle interior comfort slider |
 +| **Car_Sliders_InteriorTech** | Vehicle interior technologies slider | | **Car_Sliders_Material_Material_Quality** | Vehicle material quality slider |
 +| **Car_Sliders_Material_Material_InteriorQuality** | Vehicle interior quality slider | | **Car_Sliders_Material_Manufacturing_Tech** | Vehicle manufacturing technique slider | 
 +| **SellPrice** | The sales price of the vehicle | | **UnitCosts** | The material cost of the vehicle | 
 +| **CarType_WealthIndex** | The vehicle type's wealth index value found under [[gamemanual:references_vehicletypeimportance|wealth demo]] 
 +
 +===== Age Penalty =====
 +
 +<code cpp>
 +collectiveAge = 0;
 +
 +if(((year) - Engine_Year) > 12)
 +{
 +    collectiveAge = collectiveAge + (year - (Engine_Year+12)) * 0.05;
 +
 +    if((year - Engine_Year) > 15)
 +        collectiveAge = collectiveAge +  (year - (Engine_Year+15)) * 0.25;
 +
 +}
 +
 +if(((year) - Chassis_Year) > 12)
 +{
 +    collectiveAge = collectiveAge +  (year - (Chassis_Year+12)) * 0.05;
 +
 +    if((year - Chassis_Year) > 15)
 +        collectiveAge = collectiveAge +  (year - (Chassis_Year+15)) * 0.25;
 +}
 +
 +if((year - Gearbox_Year) > 12)
 +{
 +    collectiveAge = collectiveAge +  (year - (Gearbox_Year+12)) * 0.05;
 +
 +    if((year - Gearbox_Year) > 15)
 +        collectiveAge = collectiveAge +  (year - (Gearbox_Year+15)) * 0.25;
 +
 +}
 +
 +if((year - CarDesignYear) + 4 > 9)
 +    collectiveAge = collectiveAge +  (((year - CarDesignYear) + 4)/10.0)^1.6;
 +else
 +    collectiveAge = collectiveAge +  0.8;
 +
 +if(collectiveAge > 1)
 +    collectiveAge = collectiveAge^1.2;
 +
 +if( collectiveAge^1.2 != 0)
 + BuyersRating = BuyersRating / collectiveAge^1.2;
 +
 +</code>
 +===== Top Speed Penalty =====
 +
 +<code cpp>
 +baseTopSpeed = 10;
 +
 +if(year < 2020)
 +{
 +    baseTopSpeed = baseTopSpeed + 1.05 * (year-1899);
 +}
 +else
 +{
 +    baseTopSpeed = baseTopSpeed + 127.5;
 +}
 +
 +adjustedTopSpeed = (baseTopSpeed + (baseTopSpeed*(CarType_Rating_Performance-0.3)));
 +
 +if(adjustedTopSpeed <= 0)
 +    adjustedTopSpeed = 1;
 +
 +
 +if(Car_Top_Speed < adjustedTopSpeed)
 +{
 +    topSpeedMod = Car_Top_Speed / adjustedTopSpeed;
 +}
 +else
 +{
 +    topSpeedMod = 1;
 +}
 +
 +soldAtBranch = soldAtBranch * topSpeedMod;
 +
 +</code>
 +===== Low Slider Penalty =====
 +
 +<code cpp>
 +
 +lowSlidersPenality = 1.0;
 +
 +
 +
 +if( (Chassis_Sliders_Suspension_Stability + Chassis_Sliders_Suspension_Comfort +
 +    Chassis_Sliders_Suspension_Performance + Chassis_Sliders_Suspension_Braking) < 1.0)
 +{
 +    lowSlidersPenality =  lowSlidersPenality - 0.07;
 +}
 +
 +    
 +if((Chassis_Sliders_Suspension_Durability + Chassis_Sliders_Technology_Materials +
 +    Chassis_Sliders_Technology_Tech) < 0.35)
 +{
 +    lowSlidersPenality =  lowSlidersPenality - 0.05;
 +}
 +
 +
 +if( (Engine_Sliders_FuelEco + Engine_Sliders_Materials + 
 +    Engine_Sliders_Technology + Engine_Sliders_Compoenents) < 0.45)
 +{
 +    lowSlidersPenality =  lowSlidersPenality - 0.06;
 +}
 +
 +
 +if( (Gearbox_Sliders_Technology_Material + Gearbox_Sliders_Technology_Parts +
 +    Gearbox_Sliders_Technology_Tech + Gearbox_Sliders_Technology_Techniques) < 0.45)
 +{
 +    lowSlidersPenality =  lowSlidersPenality - 0.08;
 +}
 +
 +
 +if( (Car_Sliders_InteriorStyle + Car_Sliders_InteriorLuxury +
 +    Car_Sliders_InteriorComfort + Car_Sliders_InteriorTech) < 0.45)
 +{
 +    lowSlidersPenality =  lowSlidersPenality - 0.08;
 +}
 +
 +
 +if( (Car_Sliders_Material_Material_Quality + 
 +    Car_Sliders_Material_Material_InteriorQuality +
 +    Car_Sliders_Material_Manufacturing_Tech) < 0.36)
 +{
 +    lowSlidersPenality =  lowSlidersPenality - 0.08;
 +}
 +
 +
 +BuyersRating = BuyersRating * lowSlidersPenality ;
 +
 +</code>
 +===== Price Gouging Penalty =====
 +
 +
 +<code cpp>
 +if(SellPrice > UnitCosts * (3.5 + CarType_WealthIndex / 5.0))
 +{
 +    overPriced = 1.0 - (SellPrice/(UnitCosts * 
 +        (3.5 + CarType_WealthIndex / 5.0))/2.0);
 +
 +    if(overPriced < 0)
 +        overPriced = 0;
 +}
 +
 +soldAtBranch = soldAtBranch * overPriced;
 +</code>