Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Author Topic: Launcher displays and applies different versions of mod_info.json  (Read 238 times)

Zsar

  • Captain
  • ****
  • Posts: 279
    • View Profile

Steps to reproduce:

1) use
Code
"requiredMemoryMB": 4096,
2) select the mod, activate, save
=> you receive a warning that the mod expects more memory than can be allocated
3) deactivate the mod, save
4) open mod_info.json, change line to
Code
"requiredMemoryMB": 3072,
5) select the mod
=> still reads 4096 MB
6) activate, save
=> no warning

Expected: Data displayed should be the same as data applied.

(There are many events where it might be sensible for the launcher to read mod data, e.g. on selection, on start, etc. But when it does read it, it should discard the old version completely, not keep using the old version for some purposes, and use the new one for others.)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Launcher displays and applies different versions of mod_info.json
« Reply #1 on: February 02, 2023, 03:08:22 PM »

Ah - the "requiredMemoryMB" setting, and anything related, is not supported.
Logged

Zsar

  • Captain
  • ****
  • Posts: 279
    • View Profile
Re: Launcher displays and applies different versions of mod_info.json
« Reply #2 on: February 03, 2023, 11:29:06 PM »

Tried to reproduce with "dependencies" tag instead - cannot reproduce. Bug may be closed.

Please deprecate/remove "requiredMemoryMB" in the documentation, if it is not supposed to be used.

It might also be sensible to check for the zombie code that loads just this field out-of-line with the rest of the file and remove it.
Loading the (well, any) file should be an atomic operation - all or nothing - to prevent hard-to-understand behaviour like this and, if nothing else, the resulting false-positive bug reports.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Launcher displays and applies different versions of mod_info.json
« Reply #3 on: February 04, 2023, 09:53:16 AM »

Ahhh! My apologies, yeah, that's totally confusing, isn't it. The automatic memory allocation is turned off because unfortunately the code to restart the JVM (and apply the new memory parameter) doesn't work on a small but large-enough number of systems.

It might also be sensible to check for the zombie code that loads just this field out-of-line with the rest of the file and remove it.
Loading the (well, any) file should be an atomic operation - all or nothing - to prevent hard-to-understand behaviour like this and, if nothing else, the resulting false-positive bug reports.

I'll make a note; that is odd - at a quick look, I'm not sure how what you're seeing is even possible.
Logged