Keep data set ages, fix camp booking, measure camp effect (M7)
- Players of the data set keep their age and seven skills at the career start; the original draws new ones (and OR-ed ages produced players of 46 and a crash once the draws were skipped). - Training camps: the session allowed only resorts 0-7; the manager's club was read as a signed byte (clubs above 127 crashed); at the national coach's desk no camp can be booked. - SIM_CAMP=<resort> in the season sim; the human club's final place is taken from the almanac. Twelve seeds: five stars +1.7 places, six stars +2.5 (about +0.8 over five stars at three times the price), so the six-star rules stay as they are. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4f6ec1e240
commit
2a59d398fb
7 files changed
+96
-10
No files matched your search
@@ -28,9 +28,25 @@ Code: `src/modern/game/career.cpp` (`startup_players`, `set_club_strength`, `pla
|
||||
|
||||
Messwerkzeug: `MODERN_SPREAD=1 modern_season_sim <welt.obw> 1 0 1` zeigt die Vereinsstärken je Liga beim Start.
|
||||
|
||||
## Offen
|
||||
### Alter und Fähigkeiten
|
||||
|
||||
- Trainingslager: Saisonwirkung von 6 Sternen messen (Ziel: höchstens etwa +1 Tabellenplatz).
|
||||
Das Original würfelt beim Start auch das Alter (20–32, der Verein des Menschen 20–25) und die sieben Fähigkeiten (Teamplay, Tempo, Schuss, …) neu. Datensatzspieler behalten in Modern beides (`new_career_players`, `career_add_manager`).
|
||||
|
||||
## Trainingslager
|
||||
|
||||
Messung (Modern-Datensatz, Verein des Menschen in der Bundesliga, 12 Seeds je Variante, erste Saison; der Mensch bucht, sobald erlaubt und bezahlbar; Werbeeinnahmen an):
|
||||
|
||||
| Variante | Aufenthalte | mittlerer Platz | Gewinn |
|
||||
|---|---|---|---|
|
||||
| kein Lager | – | 9,4 | – |
|
||||
| 5 Sterne (Lager 7, 840.000 €) | 3 je Saison | 7,8 | +1,7 Plätze |
|
||||
| 6 Sterne (Lager 14, 2,8 Mio. €) | 3–4 in 2 Saisons (Geld) | 6,9 | +2,5 Plätze |
|
||||
|
||||
6 Sterne bringen gegenüber 5 Sternen etwa +0,8 Plätze bei mehr als dreifachem Preis: Ziel erreicht (nicht übermächtig, höchstens etwa +1 Platz). Keine Änderung der Wirkung. Standardfehler je Mittel rund 1 Platz.
|
||||
|
||||
Messwerkzeug: `SIM_CAMP=<Lager> SIM_CONTRACTS=1 SIM_ADVERTISING=1 modern_season_sim <welt.obw> 100 0 <seed>`; am Ende steht `almanac human club … place`.
|
||||
|
||||
## Offen
|
||||
- Ermüdung und Verletzungen bei 38 Spieltagen, Marktwerte und Gehälter der neuen Spieler, Finanzen des menschlichen Vereins (Langläufe über 10 Saisons).
|
||||
- Spieler in den Pools (vereinslos) aus dem Datensatz behalten ihre Rohwerte; der Datensatz 1.3 hat keine.
|
||||
- Datenpflege: Die Werte im Datensatz könnten auf eine gemeinsame Skala gebracht werden; die Engine braucht das wegen der Rangfolge nicht.
|
||||
@@ -69,7 +69,11 @@ und 3 abgeschwächt. Das Ergebnis wird hier und in [DIFFERENCES](../DIFFERENCES.
|
||||
- Preis, Buchung und Wirkung in `src/modern/game/desk_actions.cpp` (`training_camp_price`, `book_training_camp`, `training_camp_effect`).
|
||||
- Die 6-Sterne-Regeln sind wie oben umgesetzt: Stufenindex auf das Tabellenende gedeckelt, Leistungsdach +1 ab Platz 5 und +1 bei Platz und Fitness 6, Verpflegung 6 bis +1 Kondition, Unterkunft 6 eine Woche weniger Verletzung.
|
||||
- Mit Classic-Daten unverändert: Nur die Original-Lager 6 und 7 haben Platz 5, das alte Kriterium „Index ab 6“ trifft dieselben Lager.
|
||||
- Test: `modern_camp_tests` (Katalog, Deckelung, Verpflegung, Unterkunft).
|
||||
- Test: `modern_camp_tests` (Katalog, Deckelung, Verpflegung, Unterkunft, Vereinsnummer, Bundestrainer-Schreibtisch).
|
||||
- Fehler behoben bei den Balance-Läufen:
|
||||
- `ModernSession::dispatch_training_camp` ließ nur die Lager 0–7 zu (Classic-Konstante); jetzt alle Lager des Katalogs.
|
||||
- Der Verein des Managers wurde wie im Original als vorzeichenbehaftetes Byte gelesen (Vereine über 127 wurden negativ). Modern liest das ganze Wort (`manager_club`).
|
||||
- Am Schreibtisch des Bundestrainers nennt der Managerdatensatz die Nationalmannschaft; dort ist kein Lager buchbar (`invalid_request`).
|
||||
- Offen: Messung der Saisonwirkung (M7) und die Projektion für die UI (M6).
|
||||
|
||||
## Für die Oberfläche
|
||||
|
||||
@@ -8035,7 +8035,7 @@ bool ModernSession::dispatch_training_camp(const ui::TrainingCampRequest& reques
|
||||
return true;
|
||||
}
|
||||
if (request.kind == ui::TrainingCampRequestKind::book) {
|
||||
if (request.resort < 0 || request.resort >= kTrainingCampResorts) {
|
||||
if (request.resort < 0 || size_t(request.resort) >= g_.training_camps.size()) { // the world's catalogue
|
||||
error = "invalid_resort";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -275,6 +275,7 @@ bool new_career_players(ModernState& g, GameRandom& game, WatcomRandom& rand, Mi
|
||||
for (size_t slot = 0; slot < transfer_list_slot(); slot++) {
|
||||
const int id = g.squad_slots.at(slot) & 0x0fff;
|
||||
if (id == 0x0fff) continue;
|
||||
if (keeps_world_values(g, id)) continue; // Modern: age and skills of the data set stay (balance.md)
|
||||
Player& p = g.players.at(size_t(id));
|
||||
p.w364 |= uint32_t(rand.range(4, 0x10)) << 21;
|
||||
p.w368 = (p.w368 & 0xffffc000u) + uint32_t(rand.range(0, 0x3fff));
|
||||
@@ -596,8 +597,10 @@ bool career_add_manager(ModernState& g, const LeImage& exe, int m, const CareerM
|
||||
for (int i = 0; i < players; i++) {
|
||||
const size_t slot = squad.first + size_t(i);
|
||||
Player& p = g.players.at(size_t(g.squad_slots.at(slot) & 0x0fff));
|
||||
p.w364 &= ~(0x1fu << 21);
|
||||
p.w364 |= uint32_t(rand.range(4, 9)) << 21;
|
||||
if (!keeps_world_values(g, g.squad_slots.at(slot) & 0x0fff)) { // Modern: the data set's age stays
|
||||
p.w364 &= ~(0x1fu << 21);
|
||||
p.w364 |= uint32_t(rand.range(4, 9)) << 21;
|
||||
}
|
||||
modern::new_board_entry(g, m, i, int(slot), rand);
|
||||
g.tactics.at(size_t(m) * 0x840 + size_t(i) * 0x58 + 0xd) = 100;
|
||||
}
|
||||
@@ -613,8 +616,10 @@ bool career_add_manager(ModernState& g, const LeImage& exe, int m, const CareerM
|
||||
const int id = g.squad_slots.at(slot) & 0x0fff;
|
||||
if (id == 0x0fff) continue;
|
||||
Player& p = g.players.at(size_t(id));
|
||||
p.w364 &= ~(0x1fu << 21);
|
||||
p.w364 |= uint32_t(rand.range(4, 9)) << 21;
|
||||
if (!keeps_world_values(g, id)) { // Modern: the data set's age stays
|
||||
p.w364 &= ~(0x1fu << 21);
|
||||
p.w364 |= uint32_t(rand.range(4, 9)) << 21;
|
||||
}
|
||||
modern::new_board_entry(g, m, int(i), int(slot), rand);
|
||||
g.tactics.at(size_t(m) * 0x840 + i * 0x58 + 0xd) = 100;
|
||||
}
|
||||
|
||||
@@ -55,6 +55,14 @@ constexpr int8_t kDirection[5] = {1, 1, 1, -1, 1};
|
||||
// Scaled: a * b * 20 / 100 with unsigned byte arguments.
|
||||
int scaled(int a, int b) { return (a & 0xff) * (b & 0xff) * 20 / 100; }
|
||||
|
||||
// The club of a manager (record +0x290). The original reads the low byte as a signed byte,
|
||||
// which holds for its clubs below 128; Modern clubs go beyond (and the national coach's desk
|
||||
// names the national team), so Modern reads the whole word.
|
||||
int manager_club(const ModernState& g, int manager) {
|
||||
const size_t at = size_t(manager) * kRecordSize + kTeam;
|
||||
return int(g.manager_records.at(at) | g.manager_records.at(at + 1) << 8);
|
||||
}
|
||||
|
||||
FriendlyBookingQuote make_friendly_quote(const ModernState& g, int manager, int opponent,
|
||||
bool manager_home) {
|
||||
FriendlyBookingQuote out;
|
||||
@@ -522,7 +530,7 @@ void configure_training_camp_data(ModernState& g, const LeImage& exe) {
|
||||
int32_t training_camp_price(const ModernState& g, int manager, int resort) {
|
||||
if (manager < 0 || size_t(manager) >= g.manager_teams.size() || resort < 0 || size_t(resort) >= g.training_camps.size())
|
||||
throw FormatError("training camp: invalid manager or resort");
|
||||
const int team = int8_t(g.manager_records.at(size_t(manager) * kRecordSize + kTeam));
|
||||
const int team = manager_club(g, manager);
|
||||
return g.training_camps[size_t(resort)].base_price + team_average(g, team, 0xff).players * 5000;
|
||||
}
|
||||
|
||||
@@ -1453,6 +1461,10 @@ TrainingCampBookingBlock training_camp_booking_block(const ModernState& g, int m
|
||||
if (manager < 0 || size_t(manager) >= g.manager_teams.size() ||
|
||||
(size_t(manager) + 1) * kRecordSize > g.manager_records.size())
|
||||
return TrainingCampBookingBlock::invalid_request;
|
||||
// Only for the manager's club: at the national coach's desk the record names the
|
||||
// national team, which has no camp (Modern; Classic offers no camp there either).
|
||||
if (manager_club(g, manager) < 0 || manager_club(g, manager) >= league_clubs())
|
||||
return TrainingCampBookingBlock::invalid_request;
|
||||
const uint8_t stays = g.manager_records.at(size_t(manager) * kRecordSize + kStays);
|
||||
if (stays & 0x80) return TrainingCampBookingBlock::booked_this_week;
|
||||
if ((stays & 0x7f) >= 3) return TrainingCampBookingBlock::visit_limit;
|
||||
@@ -1474,7 +1486,7 @@ bool book_training_camp(ModernState& g, int manager, int resort, WatcomRandom& r
|
||||
|
||||
void training_camp_effect(ModernState& g, int manager, int resort, WatcomRandom& rand) {
|
||||
const size_t rec = size_t(manager) * kRecordSize;
|
||||
const int team = int8_t(g.manager_records.at(rec + kTeam));
|
||||
const int team = manager_club(g, manager);
|
||||
const auto& grade = g.training_camps.at(size_t(resort)).quality;
|
||||
|
||||
// Morale (bits 0-5) + 12 * grade * 20 %, clamped to 0..0x2f (ClampSignedWord with a word
|
||||
|
||||
@@ -97,6 +97,26 @@ int main() {
|
||||
check((after_camp({5, 5, 5, 6}, seed).players[3].w364 >> 16 & 0x1f) == 2, "lodging 6: one week less injury");
|
||||
check((five.players[3].w364 >> 16 & 0x1f) == 3, "lodging 5: injury unchanged");
|
||||
}
|
||||
{
|
||||
// The club is a word: a club beyond 127 (Modern: international clubs, the original read a
|
||||
// signed byte) books like any other; the national coach's desk (record names the
|
||||
// national team, no_team()) books none.
|
||||
ModernState g = squad();
|
||||
g.training_camps = {camp({5, 5, 5, 5})};
|
||||
g.manager_records[0x290] = 131;
|
||||
check(training_camp_booking_block(g, 0) == TrainingCampBookingBlock::none, "club 131 may book");
|
||||
bool thrown = false;
|
||||
try {
|
||||
WatcomRandom rand(1);
|
||||
training_camp_effect(g, 0, 0, rand);
|
||||
} catch (const std::exception&) {
|
||||
thrown = true;
|
||||
}
|
||||
check(!thrown, "camp effect for club 131");
|
||||
g.manager_records[0x290] = uint8_t(no_team() & 0xff), g.manager_records[0x291] = uint8_t(no_team() >> 8);
|
||||
check(training_camp_booking_block(g, 0) == TrainingCampBookingBlock::invalid_request,
|
||||
"no camp at the national coach's desk");
|
||||
}
|
||||
if (failures) return 1;
|
||||
std::puts("modern camp checks passed");
|
||||
return 0;
|
||||
|
||||
@@ -130,6 +130,25 @@ void print_almanac(const modern::ModernState& g) {
|
||||
std::printf("almanac: %zu seasons, %zu matches, %zu events, %zu bytes uncompressed, %u new player identities\n",
|
||||
seasons.size(), matches, events, bytes, g.almanac.generated_players);
|
||||
std::printf("almanac: %zu matches whose goal events differ from the result, %zu without line-ups\n", mismatched, without_lineup);
|
||||
// The human club's final place per season (balance runs compare these).
|
||||
// The club comes from the season's league matches of manager 0 (at the national coach's
|
||||
// desk his record names the national team).
|
||||
for (const auto& s : seasons) {
|
||||
std::string human;
|
||||
for (const auto& m : s.matches) {
|
||||
if (m.type != 0 || !human.empty()) continue;
|
||||
for (int side = 0; side < 2; ++side) {
|
||||
const int8_t idx = side ? m.away_manager : m.home_manager;
|
||||
if (idx >= 0 && size_t(idx) < s.managers.size() && s.managers[size_t(idx)].index == 0)
|
||||
human = s.clubs[side ? m.away : m.home].id;
|
||||
}
|
||||
}
|
||||
for (const auto& t : s.tables)
|
||||
for (const auto& row : t.rows)
|
||||
if (s.clubs[row.club].id == human)
|
||||
std::printf("almanac human club %s season %d: league %d place %d, %d pts\n", s.clubs[row.club].name.c_str(),
|
||||
s.start_year, int(t.league), int(row.rank), int(row.points));
|
||||
}
|
||||
for (const auto& s : seasons) {
|
||||
if (s.tables.empty() && s.winners.empty()) continue;
|
||||
std::printf("almanac season %d: %zu final tables, %zu winners\n", s.start_year, s.tables.size(), s.winners.size());
|
||||
@@ -379,12 +398,21 @@ int main(int argc, char** argv) {
|
||||
check_state(g, "start", checks);
|
||||
bool listed_for_sale = false;
|
||||
int ad_contracts = 0; // SIM_ADVERTISING: contracts accepted
|
||||
int camp_stays = 0; // SIM_CAMP: training camp stays booked
|
||||
for (; played < turns; played++) {
|
||||
// SIM_ADVERTISING=1: the manager keeps his advertising places filled, as every
|
||||
// player does (the largest income besides the gate): an expired contract is renewed
|
||||
// when the sponsor offers it (legacy routine), a free place takes the best acceptable
|
||||
// offer (TV, shirt, then the boards). Without it a long run lives on gate money
|
||||
// alone and its debts grow without bound (issue #95).
|
||||
// SIM_CAMP=<resort>: the manager books this training camp whenever he may (three
|
||||
// stays a season, one a week) and can pay it (the camp's effect, balance.md).
|
||||
if (const char* camp = std::getenv("SIM_CAMP")) {
|
||||
const int resort = std::atoi(camp);
|
||||
if (modern::training_camp_booking_block(g, 0) == TrainingCampBookingBlock::none &&
|
||||
modern::book_training_camp(g, 0, resort, session.rand()))
|
||||
++camp_stays;
|
||||
}
|
||||
if (const char* ads = std::getenv("SIM_ADVERTISING"); ads && std::string(ads) == "1") {
|
||||
for (int slot = 15; slot >= 0; --slot) {
|
||||
AdvertisingOfferList list = modern::advertising_offers(g, 0, slot);
|
||||
@@ -516,6 +544,7 @@ int main(int argc, char** argv) {
|
||||
ask({{"kind", "player_stats"}, {"competition", "x"}, {"sort", "dribbles"}});
|
||||
}
|
||||
if (std::getenv("SIM_ADVERTISING")) std::printf("%d advertising contracts accepted (SIM_ADVERTISING=1)\n", ad_contracts);
|
||||
if (std::getenv("SIM_CAMP")) std::printf("%d training camp stays (SIM_CAMP=%s)\n", camp_stays, std::getenv("SIM_CAMP"));
|
||||
if (std::getenv("SIM_INTERVENE")) std::printf("%d interventions (substitution at minute 30, re-rated)\n", interventions);
|
||||
if (sim_contracts_env && std::string(sim_contracts_env) == "1")
|
||||
std::printf("contract expiry policy: %d decisions, %d renewals, %d rejected offers/releases, %d no-demand releases, %d errors (SIM_CONTRACTS=1)\n",
|
||||
|
||||
Reference in new issue
Block a user