Accept data revision 1.4: real ages for all players (M5)

Revision 1.4 of the Modern data set brings birth dates for every
player, the camp catalogue with its maps and 100 referees. The
expansion now takes the age from a birth date for the original players
as well (WorldPlayer::born); before, only the added players kept their
data age. The yearly aging stops at 47, the most the age bits hold, so
real ages (a goalkeeper of 40) cannot run into the bits above. The
season sim counts second referee assignments per day.

Two seasons and ten seasons run through; the save round trip is
identical; second referee assignments drop to about 7 a season.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-25 08:54:21 +01:00
1 parent 7de6f644f2
commit 44a7a77915
8 files changed
+35 -4

No files matched your search

+10
View File
@@ -295,6 +295,16 @@ ExpandReport expand_to_world(ModernState& g, const World& world) {
g.player_name_offsets.resize(size_t(next_player), 0);
g.player_cards.resize(size_t(next_player), 0);
if (g.player_bonus.size() < size_t(next_player) + 0x36) g.player_bonus.resize(size_t(next_player) + 0x36, 0);
// Original players with a birth date in the world take that age (bits 21-25: age - 16); the
// career start keeps it instead of drawing one (balance.md). Data set 1.3 had only a
// placeholder age for them, 1.4 gives birth dates.
g.world_age_known.assign(size_t(next_player), false);
for (size_t i = 0; i < original_players; ++i)
if (const WorldPlayer* p = player_at[i]; p && p->born) {
const int age = std::clamp(p->age, 16, 47);
g.players[i].w364 = (g.players[i].w364 & ~(0x1fu << 21)) | uint32_t(age - 16) << 21;
g.world_age_known[i] = true;
}
for (size_t i = original_players; i < size_t(next_player); ++i) {
const WorldPlayer& p = *player_at[i];
const auto clamp7 = [](int v) { return uint32_t(std::clamp(v, 0, 127)); };