Skip to main content
Topic: [patch] calculate Margin correctly (Read 3028 times) previous topic - next topic

[patch] calculate Margin correctly

Margin is currently calculated as:
Code: [Select]
Operational Profit / (Maintenance + Operation Costs)
It should be:
Code: [Select]
(Proceeds + Maintenance + Operation Costs) / Proceeds
or, more simply:
Code: [Select]
Operational Profit / Proceeds
The Finance window Help already says:
Margin - is the ratio of Operational Profit to Proceeds.

This is the same as Gross Profit Margin, according to Wikipedia.  If calculated, Net Profit Margin would include the cost of New Vehicles and Construction Costs as well.

Since Margin is a separate field in saved games, this patch will correctly convert an older saved game upon loading.  However, in order to do that, the correct current version must be supplied at the time the patch is applied.  It uses 0.102.3, since the patch was developed against r2830.

The patch also encapsulates the calculation into a function, since it is used multiple times.

Ben