Record every match in a football almanac (Modern, M8)

Modern careers keep every match they play: season, date, competition
type, league or cup stage, matchday, both clubs by world id with their
human managers, result with extra time and shoot-out, referee,
attendance, weather, both line-ups and all events (goals with assists
and kind, misses, cards, injuries, substitutions, shoot-out kicks).
Events come from the group event log the engine keeps for every match,
substitutions from the players on the pitch after each minute; nothing
draws random numbers (a 60-turn Modern run is unchanged).

Player indices reused for a new person get a new stable id. Saves hold
finished seasons as immutable history/season-<year>.bin files plus the
running season; modern-state@1.1 adds league names and the id counter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-23 23:49:13 +02:00
1 parent 57d75ab2f5
commit 201eef88e4
14 files changed
+935 -8

No files matched your search

+2
View File
@@ -681,6 +681,7 @@ bool youth_academy_player(ModernState& g, int m, GameRandom& game, WatcomRandom&
const int band = league == 0 ? 0 : league == 1 ? 1 : league < 4 ? 2 : 3;
const int level = game.range(kLevel[band][0], kLevel[band][1]);
modern::generate_player(g, player, level | 0x3000, game, rand);
modern::new_player_identity(g, player); // the youth player is a new person (almanac)
// PendingOfferAnswer(manager, player | 0xf000, -1, squad start)
int slot = -1;
for (size_t q = own.first; q < own.first + 24 && slot < 0; q++)
@@ -1089,6 +1090,7 @@ bool release_player(ModernState& g, int slot, GameRandom& game, WatcomRandom& ra
if (g.squad_slots.at(size_t(s)) == 0x0FFF) free = s;
const uint32_t skills = g.players.at(size_t(player)).w35c; // RegeneratePlayer
regenerate_player(g, player, 0x32, game, rand);
modern::new_player_identity(g, player); // a new person for the almanac
Player& p = g.players.at(size_t(player));
p.w35c = skills;
g.player_bonus.at(size_t(player)) &= 0x80;