Give added players their nation index 32-61 (sixth nationality bit)
The engine's nationality is six bits: w368 bits 27-31 plus bit 7 of the player bonus (0-63). The expansion wrote only the five low bits and sent every nation from index 32 on (Brazil, Argentina, USA, Japan, ...) to 31, Wales. Added players now get their index with the high bit; nations without an original index get 63, a code no nation or national team uses. Data set 1.4: 80 players without an original index (223 before). Data format F11 lists two duplicate nations for revision 1.5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0cace5a984
commit
ec1d804d08
2 files changed
+19
-4
No files matched your search
@@ -22,6 +22,7 @@ Status: *geplant* (noch nicht in der Engine), *umgesetzt* (Engine liest/prüft e
|
||||
| F8 | Spielstand | `save_profile: modern-career-v1` | M6 | Engine erledigt: Spielstand nennt seine Welt (ID, Revision), enthält nur die Karriere |
|
||||
| F9 | Schiedsrichter | eigener Schiedsrichter-Pool der Welt, mehr als 49 | M5 | Engine erledigt (Pool aus `staff`, neu: `perception`); Daten folgen mit 1.4 |
|
||||
| F10 | Almanach | alle gespielten Spiele im Spielstand (`history/…`) | M8 | Engine erledigt (Aufzeichnung, Spielstand); UI offen |
|
||||
| F11 | Nationen | jede Spielernation mit eindeutiger ID und, wo vorhanden, Original-Index | 1.5 | Engine erledigt (Index 0–63); Daten: zwei doppelte Nationen zusammenführen |
|
||||
|
||||
## F1 · Manifest
|
||||
|
||||
@@ -138,6 +139,17 @@ Die bestehende Regel `rule:training-camps` (Typ `training_camps`) bleibt und wir
|
||||
- Die Integritätsprüfung deckt `history/` mit ab.
|
||||
- **Editor:** keine Änderung (öffnet keine Spielstände). Eine Welt muss nichts liefern; sinnvoll sind stabile Vereins- und Spieler-IDs, die sich zwischen Datenrevisionen nicht ändern.
|
||||
|
||||
## F11 · Nationen
|
||||
|
||||
- Die Nationalität eines Spielers hat in der Engine sechs Bit (Original: `w368` Bits 27–31 plus Bit 7 von `PlayerBonuses`, also 0–63); die Original-Nationen haben die Indizes 0–61 (`x-legacy.nationality_index`). Die Engine vergleicht Nationalitäten nur (deutsch oder ausländisch, gleiche Nation, Regionen bei Transfers), sie nutzt sie nicht als Tabellenindex.
|
||||
- **Engine erledigt (25.10.2026):** Spieler aus Nationen mit Index 32–61 (Brasilien, Argentinien, USA, Japan …) bekamen bisher die Ausweich-Nationalität 31 (Wales); jetzt den richtigen Index samt Bit 7. Nationen ohne Original-Index erhalten 63 (keine Nation, keine Nationalmannschaft). Datensatz 1.4: 80 Spieler ohne Original-Index (vorher 223).
|
||||
- **Daten (für Revision 1.5):** zwei Länder stehen doppelt in `world/nations.json` und müssen zusammengeführt werden (die Spieler auf die Nation mit Index umhängen oder der ISO-Nation den Index geben):
|
||||
- Türkei: `nation:x-legacy-8` (Index 8) und `nation:tr` (ohne Index, 2 Spieler);
|
||||
- Elfenbeinküste: `nation:x-legacy-59` (Index 59) und `nation:ci` (ohne Index, 13 Spieler).
|
||||
Außerdem sollten die Platzhalter-IDs `nation:x-legacy-8/-59/-60` (Südkorea) zu ISO-IDs werden (`nation:tr`, `nation:ci`, `nation:kr`); IDs bleiben dabei stabil, wenn die Platzhalter als Alias erhalten bleiben.
|
||||
- Die übrigen 65 Spieler kommen aus Nationen, die das Original nicht kennt (Mali, Georgien, Island …); für sie ist 63 richtig, solange die Engine keine eigenen Nationalmannschaften dafür hat.
|
||||
- **Editor:** Prüfung auf doppelte Nationen (gleicher Name oder gleicher Index), auf Spielernationen ohne Eintrag in `nations.json` und auf Indizes außerhalb 0–63.
|
||||
|
||||
## Modern-Prüfung (Engine und Editor)
|
||||
|
||||
Eine Welt ist als Modern-Welt spielbar, wenn:
|
||||
|
||||
@@ -309,8 +309,11 @@ ExpandReport expand_to_world(ModernState& g, const World& world) {
|
||||
const WorldPlayer& p = *player_at[i];
|
||||
const auto clamp7 = [](int v) { return uint32_t(std::clamp(v, 0, 127)); };
|
||||
const auto skill = [](int v) { return uint32_t(std::clamp(v, 0, 3)); };
|
||||
int nationality = 31;
|
||||
if (const auto it = world.nationality.find(p.nation); it != world.nationality.end() && it->second < 32)
|
||||
// The nationality is six bits: w368 bits 27-31 and bit 7 of player_bonus (+32), the
|
||||
// original nations 0-61. A nation without an original index gets 63, a code no nation
|
||||
// and no national team uses (the engine only compares nationalities).
|
||||
int nationality = 63;
|
||||
if (const auto it = world.nationality.find(p.nation); it != world.nationality.end() && it->second >= 0 && it->second < 64)
|
||||
nationality = it->second;
|
||||
else
|
||||
++report.fallback_nationalities;
|
||||
@@ -322,9 +325,9 @@ ExpandReport expand_to_world(ModernState& g, const World& world) {
|
||||
Player& pl = g.players[i];
|
||||
pl.w35c = clamp7(p.form) | clamp7(p.technique) << 7 | clamp7(p.condition) << 14;
|
||||
pl.w368 = skill(p.teamplay) | skill(p.speed) << 2 | skill(p.shooting) << 4 | skill(p.passing) << 6 |
|
||||
skill(p.tackling) << 8 | skill(p.free_kick) << 10 | skill(p.corner) << 12 | uint32_t(nationality) << 27;
|
||||
skill(p.tackling) << 8 | skill(p.free_kick) << 10 | skill(p.corner) << 12 | uint32_t(nationality & 31) << 27;
|
||||
pl.w364 = uint32_t(p.position & 3) | uint32_t(age - 16) << 21;
|
||||
g.player_bonus[i] = uint8_t(std::clamp(p.bonus, 0, 50));
|
||||
g.player_bonus[i] = uint8_t(std::clamp(p.bonus, 0, 50) | (nationality >= 32 ? 0x80 : 0));
|
||||
g.player_name_offsets[i] = append_name(g.player_names, upper(legacy_encoding(p.last)));
|
||||
++report.added_players;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user