Draw player skills like the original when the data set has none (M7)

The data set gives no skills (all 0, x-legacy skill words included): the
original draws them at the career start. Keeping them left every player
without skills and cost 0.1-0.5 goals per match in every competition.
Data set players keep their age; their skills are drawn unless a data
set provides some. Goals per competition now match Classic data.

MODERN_VALUES=1 prints form, skills and market values per league; the
almanac summary shows goals per match per competition. Market values,
the added players' values and the human club's finances are measured
in balance.md (no change needed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-24 10:34:48 +02:00
1 parent 2114598fba
commit 3d6dfc61e0
3 files changed
+96 -6

No files matched your search

+27 -3
View File
@@ -30,7 +30,31 @@ Messwerkzeug: `MODERN_SPREAD=1 modern_season_sim <welt.obw> 1 0 1` zeigt die Ver
### Alter und Fähigkeiten
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`).
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, Passspiel, Zweikampf, Freistoß, Ecke; je 0–3) neu.
- **Alter:** Datensatzspieler behalten ihr Alter (`new_career_players`, `career_add_manager`).
- **Fähigkeiten:** Der Datensatz 1.3 hat keine (alle 0, auch `x-legacy.skill_word`). Sie werden daher wie im Original gewürfelt (Mittel 1,5); nur Fähigkeiten, die ein Datensatz liefert (nicht alle 0), bleiben. Ein erster Versuch, sie zu „behalten“, ließ alle Spieler ohne Fähigkeiten spielen: 0,1–0,5 Tore pro Spiel weniger in jedem Wettbewerb.
Tore pro Spiel je Wettbewerb (zwei Saisons, Seed 1):
| | Classic-Daten | Modern |
|---|---|---|
| Bundesliga | 2,33 | 2,40 |
| 2. Liga | 2,86 | 2,97 |
| 3. Ligen | 3,12–3,30 | 3,23–3,28 |
| Regionalliga | 3,28 | 3,28 |
| Auslandsligen | 2,08–2,33 | 2,26–2,90 |
| DFB-Pokal | 4,13 | 4,37 |
Messwerkzeug: `MODERN_VALUES=1` (Form, Fähigkeiten, Marktwerte je Liga beim Start); die Almanach-Auswertung zeigt Tore pro Spiel je Wettbewerb.
### Marktwerte
Beim Start (Mittel je Liga): Bundesliga 1,4 Mio. €, 2. Liga 0,7 Mio., 3. Ligen 0,36 Mio., Regionalliga 0,17 Mio., Auslandsligen 1,4–2,1 Mio. Die vom Datensatz hinzugefügten Spieler der Auslandsligen sind 2–23 % weniger wert als die Originalspieler derselben Ligen (jüngere, schwächere Kaderergänzungen). Erfahrung und Positionswert sind beim Start für alle Spieler 0, wie im Original. Keine Änderung.
### Finanzen
Der Verein des Menschen (Sim-Manager ohne Transfers, mit Werbung) bleibt über 10 Saisons im Plus (von etwa 8 Mio. auf etwa 0); mit Classic-Daten fällt er auf −7 Mio. Keine Änderung.
## Trainingslager
@@ -55,12 +79,12 @@ Messwerkzeug: `SIM_CAMP=<Lager> SIM_CONTRACTS=1 SIM_ADVERTISING=1 modern_season_
| | Modern (Seeds 1–3) | Classic-Daten (Seeds 1, 3) |
|---|---|---|
| Tore pro Spiel | 2,70–2,77 | 3,06–3,10 |
| Tore pro Spiel | 2,70–2,77 (noch ohne Fähigkeiten, siehe oben) | 3,06–3,10 |
| Bundesliga-Meister | 60–92 Pkt. | 65–92 Pkt. |
| Bundesliga-Letzter | 9–27 Pkt. | 13–31 Pkt. |
| Serienmeister | Köln 4×, Frankfurt 4× | Leipzig 5× |
Die Ligen driften in beiden Fällen über die Jahre auseinander (Serienmeister, Meister bis über 90 Punkte): Verhalten des Originals, keine Modern-Abweichung. Modern ist etwas torärmer als Classic (Kandidat für eine spätere Feinjustierung; real hat die Bundesliga etwa 3,1 Tore pro Spiel).
Die Ligen driften in beiden Fällen über die Jahre auseinander (Serienmeister, Meister bis über 90 Punkte): Verhalten des Originals, keine Modern-Abweichung. Die geringere Torquote von Modern lag an den fehlenden Fähigkeiten (siehe oben) und ist behoben.
`MODERN_ALMANAC_SUMMARY=1` zeigt die Almanach-Auswertung auch mit Classic-Daten.
+6 -3
View File
@@ -275,10 +275,13 @@ 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));
const uint32_t age = uint32_t(rand.range(4, 0x10)), skills = uint32_t(rand.range(0, 0x3fff));
// Modern (balance.md): a player of the data set keeps his age; his seven skills are drawn
// as in the original unless the data set gives him some (data sets have none so far).
const bool world = keeps_world_values(g, id);
if (!world) p.w364 |= age << 21;
if (!world || (p.w368 & 0x3fff) == 0) p.w368 = (p.w368 & 0xffffc000u) + skills;
}
for (int slot = int(pool_end_slot() + 24); slot < int(pool_end_slot() + 24) + 0x36; slot++)
if (!modern::release_player(g, slot, game, rand, report)) return false;
+63
View File
@@ -130,6 +130,19 @@ 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);
{
// goals per match by competition (league index, or cup id + 100), over all seasons
std::map<int, std::pair<long, long>> by; // matches, goals
for (const auto& s : seasons)
for (const auto& m : s.matches) {
auto& e = by[m.type == 0 ? int(m.league) : 100 + m.type - 1];
++e.first, e.second += m.home_goals + m.away_goals;
}
std::printf("almanac goals per match:");
for (const auto& [k, e] : by)
std::printf(" %s%d %.2f (%ld)", k >= 100 ? "cup " : "L", k >= 100 ? k - 100 : k, double(e.second) / double(e.first), e.first);
std::printf("\n");
}
// 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).
@@ -307,6 +320,56 @@ int main(int argc, char** argv) {
*std::min_element(clubs.begin(), clubs.end()), *std::max_element(clubs.begin(), clubs.end()));
}
}
// MODERN_VALUES=1: market value and its factors per league at the start, original players
// (index below 2574) against the players the data set added (balance.md)
if (std::getenv("MODERN_VALUES")) {
const auto& st = session.state();
{
// form and the seven skills (0-3: teamplay, speed, shooting, passing, tackling,
// free kick, corner) of the league players
double form = 0, skill[7] = {};
int n = 0;
for (int t = 0; t < modern::league_clubs(); ++t) {
const auto r = squad_range(t);
for (size_t s = r.first; s < r.first + r.count; ++s) {
const int id = st.squad_slots[s] & 0xfff;
if (id == 0xfff) continue;
const auto& p = st.players[size_t(id)];
form += p.form();
for (int k = 0; k < 7; ++k) skill[k] += double(p.w368 >> (2 * k) & 3);
++n;
}
}
std::printf("values all league players: %d, form %.1f, skills", n, form / n);
for (double v : skill) std::printf(" %.2f", v / n);
std::printf("\n");
}
WatcomRandom scratch(1); // market_value may draw for small fees; a copy keeps the game's
for (int league = 0; league < 9; ++league) {
double sum[2][4] = {};
int n[2] = {0, 0};
const int first = league_first_team(league);
for (int t = first; t < first + int(kLeagueSizes[league]); ++t) {
const auto r = squad_range(t);
for (size_t s = r.first; s < r.first + r.count; ++s) {
const int id = st.squad_slots[s] & 0xfff;
if (id == 0xfff) continue;
const int added = id >= 2574 ? 1 : 0;
uint32_t fee = 0, salary = 0;
modern::market_value(st, int(s), 0, 100, fee, salary, 0, 0, scratch);
const auto& p = st.players[size_t(id)];
sum[added][0] += fee, sum[added][1] += salary;
sum[added][2] += double(p.w364 >> 26 & 0x3f), sum[added][3] += double(p.w364 >> 10 & 0x3f);
++n[added];
}
}
std::printf("values league %d:", league);
for (int a = 0; a < 2; ++a)
if (n[a]) std::printf(" %s %d players fee %.0f salary %.0f experience %.1f position %.1f;", a ? "added" : "original", n[a],
sum[a][0] / n[a], sum[a][1] / n[a], sum[a][2] / n[a], sum[a][3] / n[a]);
std::printf("\n");
}
}
if (!session.confirm_manager(options, choice, error)) throw std::runtime_error("manager: " + error);
ui::CareerInitializationResult init;
if (!session.finish(init, error)) throw std::runtime_error("career start: " + error);