Skip to content

Make MP configs optional in single-player#2045

Merged
Xottab-DUTY merged 1 commit intoOpenXRay:devfrom
TmLev:tmlev/1302-untie-configs-mp-from-singleplayer
Mar 30, 2026
Merged

Make MP configs optional in single-player#2045
Xottab-DUTY merged 1 commit intoOpenXRay:devfrom
TmLev:tmlev/1302-untie-configs-mp-from-singleplayer

Conversation

@TmLev
Copy link
Copy Markdown
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
Copy Markdown
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!

Comment thread src/xrGame/UIGameCustom.cpp Outdated
@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
Copy Markdown
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
@TmLev TmLev force-pushed the tmlev/1302-untie-configs-mp-from-singleplayer branch from 7e2b6a4 to c738554 Compare February 11, 2026 11:26
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 c738554 to 8164264 Compare February 11, 2026 22:19
@Xottab-DUTY Xottab-DUTY merged commit c2b9a28 into OpenXRay:dev Mar 30, 2026
60 of 61 checks passed
@github-project-automation github-project-automation Bot moved this to Done in Roadmap Mar 30, 2026
@Xottab-DUTY Xottab-DUTY removed this from Roadmap Mar 30, 2026
@Xottab-DUTY Xottab-DUTY added Enhancement Modmaker Experience Modmaker experience with OpenXRay good first issue Good start for beginners that want to contribute. labels Mar 30, 2026
@Xottab-DUTY
Copy link
Copy Markdown
Member

Thank you!

@Xottab-DUTY
Copy link
Copy Markdown
Member

I reopened #1302 because there are few more cases where engine requires MP configs, and we also need to test it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement good first issue Good start for beginners that want to contribute. Modmaker Experience Modmaker experience with OpenXRay

Projects

None yet

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