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: Mod Requirements  (Read 3292 times)

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Mod Requirements
« on: August 13, 2017, 07:45:14 AM »

Simple idea for the mod-loader interface:

If a mod requires another mod to function (check to see if it calls a JAR(s) that aren't in starsector_core and isn't in the mods /jars path) then:

If the JAR(s) aren't loaded by any other mod currently selected then:

If the JAR(s) are available in another mod that isn't currently selected then:

Alert the end-user that the mod requires the JAR(s) via a UI message, and the JAR is present in (other mod).

Else:

Alert the end-user that the mod won't function unless the JAR(s) are present.

This should cut down on the problems we see with people trying to load up a mod that requires another mod, which is likely to get worse over time.


As an alternative, although this is a little more complicated:

Mods could declare a "dependentOn" JSONArray that indicates a mod that they're dependent upon.  Activating the mod will also activate the mod it's dependent upon, if present, or halt, with a UI message indicating that it's not present.

So, for example, a mod that requires LazyLib, LightShow and the FX Core would have a JSON entry in it like:

dependentOn:[
                       "lw_lazylib",
                       "$$$_lightshowVanilla",
                       "xxx_ss_FX_mod",
]

This issue's getting more and more prevalent; while it used to be merely sufficient to presume that "all mods will probably use LazyLib, so therefore LazyLib will be loaded" I think that we'll eventually have growing pains with this issue as more mods intended to support different behaviors but do nothing by themselves become available.

For example, I think that I'd separate the core of the AI Overhaul from the part that forces AI profiles, etc., if this kind of thing wasn't potentially causing confusion, which would probably help people wanting to develop sub-AI behaviors, etc, as they wouldn't need to wrestle with everything in that code, just a few things.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

TJJ

  • Admiral
  • *****
  • Posts: 1905
    • View Profile
Re: Mod Requirements
« Reply #1 on: August 13, 2017, 08:00:46 AM »

In the mean time, (for precompiled mods) you can check whether dependencies are available before the class loader attempts to load a class dependant upon them by querying the class loader (Class.forName) inside a try/catch block.

Then throw a more meaningful error.

Personally I'm hoping for far more; an entire mod ecosystem with automatic dependencies, versioning, updating and installation.
Exactly how modern build systems and IDEs operate.
Though if it doesn't come, it can always be created by an enterprising modder.
« Last Edit: August 13, 2017, 08:32:03 AM by TJJ »
Logged

Midnight Kitsune

  • Admiral
  • *****
  • Posts: 2846
  • Your Friendly Forum Friend
    • View Profile
Re: Mod Requirements
« Reply #2 on: August 13, 2017, 09:36:44 AM »

In the mean time, (for precompiled mods) you can check whether dependencies are available before the class loader attempts to load a class dependant upon them by querying the class loader (Class.forName) inside a try/catch block.

Then throw a more meaningful error.

Personally I'm hoping for far more; an entire mod ecosystem with automatic dependencies, versioning, updating and installation.
Exactly how modern build systems and IDEs operate.
Though if it doesn't come, it can always be created by an enterprising modder.
I doubt we will get auto updates and installs due to how SS works. Remember that you need to make a new game for many of mod changes and updates to kick in, let alone a brand new faction
Logged
Help out MesoTroniK, a modder in need

2021 is 2020 won
2022 is 2020 too

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Mod Requirements
« Reply #3 on: August 13, 2017, 09:45:48 AM »

I can't see a comprehensive way that this can work in a really detailed way unless we have another tag, "requiresNewGame" to alert people that the mod will require a new game; that's another issue, for certain.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

MesoTroniK

  • Admiral
  • *****
  • Posts: 1731
  • I am going to destroy your ships
    • View Profile
Re: Mod Requirements
« Reply #4 on: August 13, 2017, 04:54:00 PM »

Also need a way to spec ram allocation in the launcher, and a pair of lines in the mod info file that specs estimated ram and vram usage. Not letting the game start, if it isn't likely to work. Without such quality of life features, including many of the things stated by others in this thread... SS is going to get *thrashed* in Steam reviews.


Edit: Fixed typos
« Last Edit: August 13, 2017, 05:19:16 PM by MesoTroniK »
Logged

cjuicy

  • Captain
  • ****
  • Posts: 353
  • Figuring out how the hell to wear heels (She/it)
    • View Profile
Re: Mod Requirements
« Reply #5 on: August 13, 2017, 05:25:01 PM »

Also need a way to spec ram allocation in the launcher, and a pair of lines in the mod info file that specs estimated ram and vram usage. Not letting the game start, if it isn't likely to work. Without such quality of life features, including many of the things stated by others in this thread... SS is going to get *thrashed* in Steam reviews.


Edit: Fixed typos
The RAM and VRAM approximations would be quite helpful.
Logged
It's been a long time, but I still love ya!

- Pfp done by Sleepyfish!

Sy

  • Admiral
  • *****
  • Posts: 1225
    • View Profile
Re: Mod Requirements
« Reply #6 on: August 14, 2017, 08:10:08 AM »

another somewhat related little feature i frequently wish we had: a button that exports a list of all currently enabled mods along with version numbers of these mods as well as of the vanilla game, either into an easily accessible text file, or directly to the clipboard.

it happens quite often on discord that we tell people who are looking for help with mod troubles to give us a list of all mods they're using, and they ask "how?". the quickest way is usually to make a screenshot of the contents of the mods folder, but that also shows mods that aren't enabled in the launcher, doesn't show version numbers, and is still not really convenient, particularly for people who are inexperienced with computer stuff in general.

similarly, the mod troubles quite often turn out to be caused simply by outdated mod files, or by using up-to-date mods with an outdated vanilla version. and since we don't want to tell people who come looking for help to just redownload and reinstall everything without first looking for other possible causes of their issues, the simple solution is quite often only found after several people spend some time trying to rule out other common causes.

a quick and easy way to export such a list would be useful both for the people who look for help, and the people who try to provide it.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Mod Requirements
« Reply #7 on: August 14, 2017, 09:16:27 AM »

another somewhat related little feature i frequently wish we had: a button that exports a list of all currently enabled mods along with version numbers of these mods as well as of the vanilla game, either into an easily accessible text file, or directly to the clipboard.

it happens quite often on discord that we tell people who are looking for help with mod troubles to give us a list of all mods they're using, and they ask "how?". the quickest way is usually to make a screenshot of the contents of the mods folder, but that also shows mods that aren't enabled in the launcher, doesn't show version numbers, and is still not really convenient, particularly for people who are inexperienced with computer stuff in general.
That would be quite handy. 
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Mr. Nobody

  • Commander
  • ***
  • Posts: 236
    • View Profile
Re: Mod Requirements
« Reply #8 on: August 14, 2017, 11:36:52 AM »

All i want is a version checker that runs outside of the main game
Logged
On the left half of the Bell curve