Skip to content

Make MP configs optional in single-player#2045

Open
TmLev wants to merge 1 commit intoOpenXRay:devfrom
TmLev:tmlev/1302-untie-configs-mp-from-singleplayer
Open

Make MP configs optional in single-player#2045
TmLev wants to merge 1 commit intoOpenXRay:devfrom
TmLev:tmlev/1302-untie-configs-mp-from-singleplayer

Conversation

@TmLev
Copy link
Contributor

@TmLev TmLev commented Feb 8, 2026

Single-player should not hard-require multiplayer configuration under gamedata/configs/mp/.

Previously, CMapListHelper always loaded $game_config$/mp/map_list.ltx and asserted that maps/weathers were present. For SP-only installs or story mods that remove MP configs, that made startup/save-load fail and also forced expensive archive scanning.

Changes:

  • Treat mp/map_list.ltx (and its [weather] section) as optional: if missing, log and keep MP map/weather lists empty.
  • Remove R_ASSERTs and avoid dereferencing null map list entries; return an empty "unknown" map list when queried.

Notes:

  • The LTX/INI loader remains strict and generic (missing #include targets still fail).
  • mp_ranks.ltx is still expected for NPC weapon ranking; it is not MP-only.

Resolves #1302.

Copy link
Member

@Xottab-DUTY Xottab-DUTY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I'm strictly against adding feature/game-specific information to CInifile. In other words, LTX loader should not know what it is loading. It's task is just load or report failure.
    1. Optionally not loading an include is very wrong and can cause more problems than fixing something. It should be handled on the gamedata side, i.e. modder must provide the file being included or remove the #include invocation.
  2. The correct approach is to remove R_ASSERTs from the game code and make sure it works. This is what you did with UIGameCustom.cpp and it's the correct path!
  3. Just FYI: mp_ranks is a file, not a folder. Modders wrongly assume it's MP-only, but it was always used in single player too. To be precise, NPCs use weapon ranks from mp_ranks.ltx to determine which weapon is better.
  4. Almost forgot to say thanks for handling this. Thanks!

Single-player should not hard-require multiplayer configuration under
`gamedata/configs/mp/`.

Previously, `CMapListHelper` always loaded
`$game_config$/mp/map_list.ltx` and asserted that maps/weathers were
present. For SP-only installs or story mods that remove MP configs, that
made startup/save-load fail and also forced expensive archive scanning.

Changes:
- Treat `mp/map_list.ltx` (and its `[weather]` section) as optional: if
missing, log and keep MP map/weather lists empty.
- Remove `R_ASSERT`s and avoid dereferencing null map list entries;
return an empty "unknown" map list when queried.

Notes:
- The LTX/INI loader remains strict and generic (missing `#include`
targets still fail).
- `mp_ranks.ltx` is still expected for NPC weapon ranking; it is not
MP-only.
@TmLev TmLev force-pushed the tmlev/1302-untie-configs-mp-from-singleplayer branch from 44cec84 to 7e2b6a4 Compare February 8, 2026 17:46
@TmLev
Copy link
Contributor Author

TmLev commented Feb 8, 2026

@Xottab-DUTY thanks for the feedback! Amended; could you please review again?

@TmLev TmLev requested a review from Xottab-DUTY February 8, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Untie the engine from mandatory use of configs/mp/ even in singleplayer mode.

2 participants