Modern M7 long runs: per-season balance report and results

modern_season_sim MODERN_BALANCE=1 prints strength, squad size, age,
injuries, market value and salary per league at every season end. Five
12-season runs on data revision 1.5 against three Classic runs show the
same trends and no drift; documented in balance.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-25 12:37:23 +01:00
1 parent 7ed048d935
commit aadc50cb75
3 files changed
+65 -2

No files matched your search

+36
View File
@@ -636,6 +636,42 @@ int main(int argc, char** argv) {
std::printf(" %d:%d/%d", l, int(g.league_rounds.at(size_t(l))), league_matchdays(l));
std::printf("\n");
}
// MODERN_BALANCE=1: per league at every season end (the M7 long runs, balance.md):
// mean club strength (technique + condition of the best 14, halved), squad size,
// mean age, injured players (w364 bits 16-20), market value and salary.
if (std::getenv("MODERN_BALANCE")) {
WatcomRandom scratch(1); // market_value may draw; a copy keeps the game's streams
for (int league = 0; league < kLeagueCount; ++league) {
double strength = 0, age = 0, fee = 0, salary = 0;
int clubs = 0, players = 0, injured = 0;
const int first = league_first_team(league);
for (int t = first; t < first + int(kLeagueSizes[league]); ++t) {
std::vector<int> v;
const auto r = squad_range(t);
for (size_t s = r.first; s < r.first + r.count; ++s) {
const int id = g.squad_slots[s] & 0xfff;
if (id == 0xfff) continue;
const auto& p = g.players[size_t(id)];
v.push_back(p.technique() + p.condition());
age += p.age();
if ((p.w364 >> 16 & 0x1f) != 0) ++injured;
uint32_t f = 0, w = 0;
modern::market_value(g, int(s), 0, 100, f, w, 0, 0, scratch);
fee += f, salary += w;
++players;
}
std::sort(v.rbegin(), v.rend());
double sum = 0;
const size_t n = std::min<size_t>(14, v.size());
for (size_t i = 0; i < n; ++i) sum += v[i] / 2.0;
if (n) strength += sum / double(n), ++clubs;
}
if (!players) continue;
std::printf("balance season %d league %d: strength %.1f, squad %.1f, age %.1f, injured %d, fee %.0f, salary %.0f\n",
seasons + 1, league, clubs ? strength / clubs : 0.0, double(players) / kLeagueSizes[league],
age / players, injured, fee / players, salary / players);
}
}
++seasons;
} // (the next kickoff runs the season change)
// MODERN_SAVE_CHECK=<turn>: save at that desk, load the save into a second session and