Skip to content

Commit 3c824d9

Browse files
committed
chore: reword contribution formula, update xp formula, increase detour threshold
1 parent 9bc1e35 commit 3c824d9

File tree

2 files changed

+29
-28
lines changed

2 files changed

+29
-28
lines changed

docs/formulae.md

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -125,19 +125,10 @@ API: [utils.route.AircraftRoute.contribution][]
125125

126126
??? warning "SPOILERS: Click to reveal"
127127

128-
Let $C_{base} = \min\left(k_\text{gm}kd\left(3 - \frac{\text{CI}}{100}\right),152 \right) \pm 16\%$.
129-
130-
This base contribution can randomly "drop":
131-
132128
$$
133-
C = \begin{cases}
134-
C_{base} & \text{with probability } 0.75 \\
135-
0.5 C_{base} & \text{with probability } 0.25
136-
\end{cases}
129+
\$_\text{C} = k_\text{drop} \min\left(k_\text{gm}kd\left(3 - \frac{\text{CI}}{100}\right),152 \right) \pm 16\%
137130
$$
138131

139-
The expected contribution is thus $E[C] = 0.875 C_{base}$.
140-
141132
where:
142133

143134
- $d$ is the **direct** distance[^2] of the route
@@ -161,6 +152,14 @@ API: [utils.route.AircraftRoute.contribution][]
161152
$$
162153

163154
- $\text{CI}$: between 0 and 200
155+
- $k_\text{drop}$ is a factor accounting for random drops in contribution, with an expected value of $\mathbb{E}[k_\text{drop}] = 0.875$:
156+
157+
$$
158+
k_\text{drop} = \begin{cases}
159+
1 & p = 0.75 \\
160+
0.5 & p = 0.25
161+
\end{cases}
162+
$$
164163

165164
Contribution is reduced when the flight distance is less than 1000km. ([REDUCED_CONTRIBUTION warning][utils.route.AircraftRoute.Warning.REDUCED_CONTRIBUTION]
166165
in [utils.route.AircraftRoute.warnings][])
@@ -177,9 +176,9 @@ API: [utils.route.AircraftRoute.contribution][]
177176
Confidence: <span class="c-moderate">80%</span>
178177

179178
!!! note
180-
The 12.5% drop is observed sometime in 2025.
179+
The 12.5% drop ($k_\text{drop}$) is observed sometime in 2025.
181180

182-
Updated: 15 Sep 2025 (data contributed by Burianto and other contributors)
181+
Updated: 15 Sep 2025 (data contributed by NeVia and other contributors from Alliance *Ariving GER*)
183182

184183
<!-- #### Optimal pure-contribution strategy
185184
@@ -526,7 +525,7 @@ where:
526525

527526
### Creation cost
528527

529-
Found: 2024 (Alliance *Ariving Germany*)
528+
Found: 2024 (Alliance *Ariving GER*)
530529

531530
Confidence: <span class="c-good">100%</span>
532531

@@ -786,17 +785,19 @@ ___
786785

787786
**Note**: Prior to May 2025, the XP awarded is fixed for every single departure, regardless of the route distance. This mechanic was superseded by a more complex formula intended to counter against TP farming.
788787

789-
Found: July 11 2025 (Cathay Express, data contributed by Burianto)
788+
Found: July 11 2025 (Cathay Express, data contributed by NeVia)
789+
790+
Updated: December 28 2025
790791

791-
Confidence: <span class="c-good">90%</span>
792+
Confidence: <span class="c-good">95%</span>
792793

793794
$$
794795
\begin{align*}
795-
\text{load factor} &= \frac{\begin{cases}
796+
\text{LF} &= \frac{\begin{cases}
796797
y_l + 2 j_l + 3 f_l &\text{if pax} \\
797798
\frac{1}{0.7}l_l + h_l &\text{if cargo}
798799
\end{cases}}{\text{capacity}} \\
799-
\mathrm{xp} &= \frac{\mathrm{round}(a + \text{load factor} + b d + c, 5)}{2l + 1}
800+
\mathrm{xp} &= \frac{\mathrm{round}(a + \text{LF} + b d \text{LF}, 5)}{2l + 1}
800801
\end{align*}
801802
$$
802803

@@ -806,14 +807,15 @@ where:
806807
- $l_l$, $h_l$: actual load of large and heavy cargo (lbs)
807808
- $d$: total distance[^1] of the flight.
808809
- $l$: current level number
809-
- $a$, $b$, $c$: coefficients
810-
811-
| | $a$ | $b$ | $c$ |
812-
| ---------- | ----- | ------ | --- |
813-
| global7500 | 59.5 | 0.0114 | -46 |
814-
| mc214 | 52.5 | 0.0089 | -38 |
815-
| a388 | 120.8 | 0.0123 | -82 |
816-
| b748 | 122.7 | 0.0110 | -80 |
810+
- $a$, $b$: coefficients
811+
812+
| Aircraft Type | $a$ | $b$ | RMSE |
813+
| :------------ | :--------- | :----------- | :---- |
814+
| mc214 | 7.58± 7.7% | 0.0107± 0.9% | 1.738 |
815+
| b773ersf | 33.3± 3.6% | 0.0193± 0.5% | 1.56 |
816+
| b748 | 25.2± 2.9% | 0.0132± 0.8% | 3.599 |
817+
| b748f | 35.6± 1.5% | 0.019± 0.3% | 1.642 |
818+
| a388 | 26.5± 0.7% | 0.0141± 0.2% | 2.672 |
817819

818820
!!! note
819821
these values are approximate (fitted from data) and will expand as more data comes in.

src/am4/bot/cogs/routes.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@
1010
import discord
1111
import orjson
1212
import polars as pl
13-
from discord.ext import commands
14-
1513
from am4.utils.aircraft import Aircraft
1614
from am4.utils.airport import Airport
1715
from am4.utils.game import User
1816
from am4.utils.route import AircraftRoute, Destination, RoutesSearch
17+
from discord.ext import commands
1918

2019
from ...config import cfg
2120
from ..base import BaseCog
@@ -72,7 +71,7 @@ def add_data(is_multi_hub: bool, o: Airport, d: Destination, is_cargo: bool, emb
7271
added_dist = acr.stopover.full_distance - acr.route.direct_distance
7372
added_pct = added_dist / acr.route.direct_distance * 100
7473
distance_f = f"{acr.stopover.full_distance:.0f} km"
75-
detour_str = f", +{added_pct:.1f}%" if added_pct >= 0.001 else ""
74+
detour_str = f", +{added_pct:.1f}%" if added_pct >= 0.002 else ""
7675
else:
7776
distance_f, detour_str = f"{acr.route.direct_distance:.0f} km", ""
7877
flight_time_f = format_flight_time(acr.flight_time)

0 commit comments

Comments
 (0)