Load Modern worlds and add Modern training camps (M3, M4)
M3 - Modern world loader: - modern/content/world: typed view of the world tables (leagues, clubs, players, nations, league dates, training camp catalogue). - modern/content/world_package: opens a Modern world (runtime:modern-v1, or editor:world-v1 until data revision 1.4), reads only the engine entries and decodes the Classic payload (import: load_classic_payload). - modern/content/world_expand: turns the Classic start into the world: club ids in the order of the world's leagues, per-club tables remapped (added clubs copy an original club of their league), added players from their attributes, 24 squad slots per league club, pools kept, layout, league sizes and league dates installed; UTF-8 names and OBW ids in ModernState. - Fixes found by playing the Modern data set: referee pool exhausted on days with German and larger international leagues (Modern deviation), card table per league club grown, slot-to-team lookup via WorldLayout, form history stride from the layout, remaining slot literals. - Classic UI projections used by the session read the layout instead of executable constants (Classic values unchanged). - modern_season_sim opens .obw worlds; MODERN_DEBUG / MODERN_WATCH tracing. M4 - training camps: - Catalogue in ModernState (built-in 18 fictional camps on three maps, or the world's extended catalogue); price, booking and effect use it. - Six-star grades: step index capped, limit +1 from pitch 5 and +1 with pitch and fitness 6, catering 6 one more point of condition, lodging 6 one week less injury. Classic data behaves as before. modern_camp_tests. Verified: 190 tests pass; Classic replay regression identical to the M0 baseline; season_sim and modern_season_sim identical with Classic data; the Modern data set plays full seasons (leagues 34/38/34 rounds). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
13bdc56f04
commit
6f55622307
53 files changed
+1392
-87
No files matched your search
@@ -177,10 +177,16 @@ void match_weather(MatchGroup& grp, int m, const MatchdayContext& ctx, GameRando
|
||||
if (int16_t(home) < no_team() && uint16_t(away) < no_team() && !(grp.desc.at(1) & 0x80)) {
|
||||
// Range(1): a referee not yet chosen today
|
||||
std::vector<uint8_t>& refs = *ctx.referees;
|
||||
// OpenBMH deviates from the original: in Modern worlds a referee may take a second match on a day with more matches than referees.
|
||||
// Modern: a day can have more matches than the 49 referees (larger international
|
||||
// leagues on the dates of the German leagues). Once every referee has a match, one
|
||||
// may referee a second match that day (DIFFERENCES.md); Classic draws until a free one.
|
||||
bool free_referee = false;
|
||||
for (int k = 1; k <= 0x31 && !free_referee; ++k) free_referee = !(refs.at(size_t(k)) & 0x80);
|
||||
int r;
|
||||
do {
|
||||
r = game.range(1, 0x31);
|
||||
} while (refs.at(size_t(r)) & 0x80);
|
||||
} while (free_referee && (refs.at(size_t(r)) & 0x80));
|
||||
refs.at(size_t(r)) |= 0x80;
|
||||
grp.desc.at(0x10 + size_t(m)) = uint8_t(r);
|
||||
}
|
||||
@@ -601,8 +607,11 @@ std::vector<MatchGroup> setup_matchday(ModernState& g, uint32_t competitions, co
|
||||
for (int i = 0; i < grp.matches() * 2; i++) {
|
||||
if (i < grp.matches()) modern::match_weather(grp, i, ctx, game, rand);
|
||||
const int team = grp.fixtures.at(size_t(i));
|
||||
turn_team = team;
|
||||
turn_step = "setup: prepare team";
|
||||
modern::prepare_team(g, team, cls, i);
|
||||
try {
|
||||
turn_step = "setup: line-up";
|
||||
auto_lineup(g, team, 100);
|
||||
} catch (const std::invalid_argument& e) {
|
||||
report.fail(e.what());
|
||||
|
||||
Reference in new issue
Block a user