PassPower is the core computation module of the mod. Every time PES6 calculates pass power and stores it in theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/angelballay/pes6_game_physics_mod/llms.txt
Use this file to discover all available pages before exploring further.
EDI register at pes6.exe+1A637B, Hook B intercepts the value before it is committed to the ball. CalculateModifiedEDI then takes the raw ediOriginal, classifies the game situation across multiple dimensions (mod state, pass strength, ball inertia, context freshness, grid distance, and spatial geometry), selects an appropriate boost path, and returns a corrected value. The hook applies that value as EDI for the original call_78020 invocation, so the ball receives the rescaled power rather than the vanilla one.
ediOriginal. Every code path in CalculateModifiedEDI either returns ediOriginal unchanged or adds a positive amount. The final global cap (ediMaxCap = 0x6800) is the only ceiling.CalculateModifiedEDI — step-by-step
Increment counter and reset diagnostics
g_powerCount is incremented so the monitor thread can detect a new power event. All diagnostic globals (g_lastBoostMode, g_lastDistSimple, geometry bits, etc.) are reset to zero to avoid stale data appearing in the log.Detect context freshness
g_ctxCount (written by Hook A) has advanced since the last power event, the power hit is considered to have a fresh context — the saved passer/receiver pointers correspond to this specific pass. If the context count has not changed, the power hook is firing for a pass that did not trigger Hook A (e.g., a repeated or synthetic power calculation), and a different boost path is used.Early exit — mod disabled
CalculateModifiedEDI returns ediOriginal immediately without any modification. boostMode 0xFE signals this in the log.Read ball inertia (ball+0x50 before call_78020)
ball+0x50 holds the ball’s current power/inertia state before the original call_78020 overwrites it. This value is classified into an inertia band that shifts all subsequent boost amounts.Classify ball inertia band
BALL_ZERO, BALL_VERY_LOW, BALL_LOW_MID, BALL_CARRY, BALL_HIGH) are used as array indices into the DistanceBoostTable lookup tables and the noContextLowBaseBoost array.Early exit — strong pass threshold
0x6400 are already strong; boosting them further would make long passes unrealistically powerful. These are returned unchanged with boostMode 0x00.No-context path — ApplyNoContextBoost
g_lastPowerHadNewCtx == 0, there is no passer/receiver information available. The boost is a flat, band-indexed amount rather than a distance-aware one:noContextEdiCap = 0x6000) is lower than the main ediMaxCap to keep no-context boosts conservative. The function also guards against accidentally reducing an ediOriginal that already exceeds the cap.Read distance and geometry (new-context path)
ReadPassContextDistance provides distSimple (Manhattan grid distance), and ReadPassGeometryDot provides geomDot, geomBallDist, geomPassDist, and the raw player-ball proximity values. Both calls are guarded — if either fails, the corresponding data is treated as zero/unavailable.Evaluate awkward-angle candidates
Apply LOW path (edi < ediThresholdLow = 0x5800)
- Long rescue (
rescueLowEdiThreshold,rescueLowDistThreshold): ifediOriginalis very low anddistSimpleis large, addsrescueLowExtraHighInertiaorrescueLowExtraOtherInertiadepending on band. - Short rescue (
shortRescueLowEdiThreshold,shortRescueLowDistMin–shortRescueLowDistMax): similar pattern for medium-short distances. - Soft floors are applied after the extra:
softFloorLowDist7_plus,softFloorLowDist5_6,softFloorLowDist3_4. - Awkward long rescue: if
awkwardLongCandidate, addsawkwardLongExtraand appliesApplySoftFloor(edi, awkwardLongSoftFloor). - Awkward short rescue: if
awkwardShortCandidate, addsawkwardShortExtra, applies soft floor, and caps atawkwardShortPostEdiMax(orawkwardShortRealLongPostEdiMaxifgeomPassDist >= awkwardShortRealLongPassDistMin).
Apply MID path (edi >= ediThresholdLow)
Apply distance 3–6 fine-tune (+5%)
Re-apply awkwardShort cap after fine-tune
ApplyDistance3To6FineTune can push the result above the awkwardShortPostEdiMax (or awkwardShortRealLongPostEdiMax) ceiling that was set inside the LOW path. This guard re-enforces that cap so the awkward-short rescue does not inadvertently overshoot its own limit.Apply real-distance underestimate rescue
distSimple 3–5, if geomPassDist exceeds a configured threshold (indicating the discrete grid distance underestimated how far the pass actually is), the function applies a small fixed extra plus a soft-floor push, capped at a per-range postEdiMax. This path is skipped if the result is already strong enough (edi >= postCap), if geometry is unavailable, or if ediOriginal is above ediThresholdIgnore. Sets boostMode 0x1C when applied.ApplySoftFloor
target without hard-setting it. This means repeated applications would converge to target asymptotically, but since it is applied once per pass, it acts as a gentle push: if edi is far below target the boost is substantial; if it is already close to target the boost is small. It never overshoots target, and it never reduces edi (the edi >= target guard ensures that).
Boost mode reference (g_lastBoostMode)
| Value | Meaning |
|---|---|
0x00 | No change applied — pass at or above ediThresholdIgnore (0x6400) |
0x10 | LOW path, dist 0–2, standard |
0x12 | LOW path, dist 3–4 |
0x13 | LOW path, dist 7+ |
0x15 | LOW path, dist 5–6 |
0x17 | LOW path, short rescue applied |
0x18 | LOW path, long rescue applied |
0x19 | LOW path, soft floor applied |
0x1A | LOW path, awkward long rescue applied |
0x1B | LOW path, awkward short rescue applied |
0x1C | Real-distance underestimate rescue applied |
0x20 | MID path, dist 0–4 |
0x23 | MID path, dist 7+ |
0x25 | MID path, dist 5–6 |
0x41 | No-context, LOW range |
0x42 | No-context, MID range |
0x99 | Final ediMaxCap (0x6800) hit |
0xFE | Mod disabled — vanilla pass |
Awkward-angle rescue summary
Two rescue paths handle passes where the ball is on the wrong side of the passer relative to the intended direction.| Candidate | distSimple | ediOriginal | geomDot | Action |
|---|---|---|---|---|
awkwardLongCandidate | >= awkwardLongDistMin (6) | < 0x4600 | <= -0.35f | Adds awkwardLongExtra, applies soft floor toward awkwardLongSoftFloor |
awkwardShortCandidate | 3–4 | < 0x4000 | <= -0.75f | Adds awkwardShortExtra, applies soft floor, caps at awkwardShortPostEdiMax (or awkwardShortRealLongPostEdiMax when geomPassDist >= awkwardShortRealLongPassDistMin) |
hasGeom == true — if ReadPassGeometryDot failed (e.g., ball pointer invalid), neither rescue fires and the standard boost path is used.