Skip to content

Mod Relationships do not allow for user to select 1 hard dependency from a list of possible hard dependencies #2522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Poodmund opened this issue Sep 16, 2018 · 12 comments · Fixed by #2660
Labels
Core (ckan.dll) Issues affecting the core part of CKAN Enhancement New features or functionality Relationships Issues affecting depends, recommends, etc.

Comments

@Poodmund
Copy link

Background

CKAN Version: 1.25.3

KSP Version: 1.4.5

Operating System: Windows 10

Have you made any manual changes to your GameData folder (i.e., not via CKAN)? No... although all of this and the above it kind of unnecessary in this situation.

Problem

The issue I have pertains to how CKAN cannot intelligently handle dependencies when there are multiple plugins that can offer a solution for a mod but the the mod developer cannot provide a list to a player to select just 1 from that list to provide the dependency.

For example (and specific to my situation), I provide a Skybox mod to the player base which requires 1 of a few mods as a dependency in order for it to function: Drop-in Replacement Textures, Sigma Replacements: Skybox, TextureReplacer OR TextureReplacerReplaced. All 4 of these mods provide functionality for my mod to work but I cannot list them all as hard dependencies as there may be conflicts between the mods providing this functionality, a mod may not update to the latest version of KSP and therefore hold back my mod being offered to the player base and installing all 4 does not provide the player with an intelligent solution to this. Only choosing 1 as a hard dependency limits the scope of my mod and may not fit in with the desired mod of choice of the player. Listing all 4 mods as Recommends of Suggests is not a good solution as the player may inadvertently untick all the mods and not install the dependent plugin causing my mod to not function.

What I would suggest is that a procedure to be put into the scope of the relationship handling to allow for mod developers to state a list of dependent mods from within a list/group of mods and that they are only able to pick one from that list. If one of the mods is already installed, then bypass this action as normal.

I have mentioned it previously on the CKAN forum thread and HebaruSan has confirmed that this behavior is not handled at this time by CKAN and discussed options here: https://forum.kerbalspaceprogram.com/index.php?/topic/154922-ckan-the-comprehensive-kerbal-archive-network-v1253-woomera/&do=findComment&comment=3440100

I appreciate that this would be a fair amount of new logic for the relationships system but may give the system a lot more intelligence with regards to dependency handling.

@Poodmund Poodmund changed the title Mod Relationships do not allow for get user to select 1 dependency from a list of possible dependencies Mod Relationships do not allow for user to select 1 hard dependency from a list of possible hard dependencies Sep 16, 2018
@HebaruSan HebaruSan added Enhancement New features or functionality Core (ckan.dll) Issues affecting the core part of CKAN Relationships Issues affecting depends, recommends, etc. labels Sep 16, 2018
@HebaruSan
Copy link
Member

I would picture something like:

    "depends": [
        { "any-of": [
            { "name": "TextureReplacer"          },
            { "name": "TextureReplacerReplaced"  },
            { "name": "SigmaReplacements-SkyBox" },
            { "name": "DiRT"                     }
        ] }
    ],

The provides functionality is similar, but is only really applicable to situations where the mods are truly interchangeable, e.g. texture packs of different resolutions, or backwards-compatible continuations of mods. When instead the depending mod has implemented support for multiple different mutually incompatible mods (all of the ones listed above have different config formats), attempting to define a usable set of provides identifiers becomes impractical. We would not want to put something like this in TextureReplacer's netkan (with similar entries in the other 3 mods):

    "provides": [
        "TextureReplacer-OR-TextureReplacerReplaced",
        "TextureReplacer-OR-SigmaReplacements-SkyBox",
        "TextureReplacer-OR-DiRT",
        "TextureReplacer-OR-TextureReplacerReplaced-OR-SigmaReplacements-SkyBox",
        "TextureReplacer-OR-TextureReplacerReplaced-OR-DiRT",
        "TextureReplacer-OR-SigmaReplacements-SkyBox-OR-DiRT",
        "TextureReplacer-OR-TextureReplacerReplaced-OR-SigmaReplacements-SkyBox-OR-DiRT"
    ],

@Poodmund
Copy link
Author

Has there been any further consideration for this issue? I think for my mods in question that needed this requirement (as you've mused above) I think I will just list the dependency options as Recommendations for the time being and hopefully the user will choose one from the list. My question is, if the user already has one of the dependencies installed, will it just not list the other suppliers as Recommendations as CKAN will realise they are incompatible with the currently installed dependency?

I'm just trying to think of the best work-around until this issue is resolved.

@politas
Copy link
Member

politas commented Nov 15, 2018

I think it might list them, but then produce an error when they try to select an incompatible one.

@HebaruSan
Copy link
Member

@Poodmund , what is the name of your mod that needs this? I have some prototype code and I would like to run some tests with some (tweaked) real data.

@Poodmund
Copy link
Author

Poodmund commented Jan 16, 2019

It was basically for any of my skybox mods listed on CKAN... however, the currently listed distribution only has the configs to work with Sigma Replacements for an old version of Sigma Replacements targeted for an older version of KSP.

If you don't mind, I'll polish up the configs required to get the Skybox working with Texture Replacer, Sigma Replacements and DiRT depending on which one is installed, I'll zip it up and then upload it here if you want to test it out...?

EDIT: Just read up on your PR. 😄 Thank you for your efforts with regards to this issue.

@HebaruSan
Copy link
Member

Ah cool, now I see PoodsCalmNebulaSkybox, PoodsDeepStarMap, and PoodsMilkyWaySkybox. I think I didn't have the correct game versions marked as compatible when I looked for them earlier. 👍

Sorry, something went wrong.

@HebaruSan
Copy link
Member

OK, here's a preview with some local modifications...

$ ~/Downloads/KSP/CKAN/_build/ckan.exe install -c PoodsMilkyWaySkybox/PoodsMilkyWaySkybox-v1.2.0.ckan 
Too many mods provide DiRT OR TextureReplacer OR SigmaReplacements-SkyBox. Please pick from the following:

1) DiRT (KSP DiRT)
2) TextureReplacer (TextureReplacer)
3) TextureReplacerReplaced (TextureReplacerReplaced)
4) SigmaReplacements-SkyBox (Sigma Replacements: SkyBox)
Enter a number between 1 and 4 (To cancel press "c" or "n".): 
1
About to install...

 * Pood's Milky Way Skybox v1.2.0 (cached)
 * KSP DiRT 1.6.1.0 (cached)

Continue? [Y/n] 


Installing mod "PoodsMilkyWaySkybox v1.2.0"
Installing mod "DiRT 1.6.1.0"
Updating registry
Committing filesystem changes
Rescanning GameData
Done!

Sorry, something went wrong.

@Poodmund
Copy link
Author

Poodmund commented Jan 17, 2019

I have updated the releases of the 3 skybox mods so that they should work in a plug-n-play situation depending on whichever texture replacement mod is chosen/installed.

https://spacedock.info/mod/925/Pood's%20Deep%20Star%20Map%20Skybox
https://spacedock.info/mod/924/Pood%27s%20Calm%20Nebula%20Skybox
https://spacedock.info/mod/926/Pood's%20Milky%20Way%20Skybox

Dependencies:
Module Manager

And one of the following texture replacement mods of your choice:
Sigma Replacements: SkyBox
DiRT (Drop-in Replacement Textures)
TextureReplacer

The new releases should give you a better indication of whether the new CKAN relationship behaviour system is working as the skybox now functions (shows up) correctly no matter which of the 3 texture replacement mods is installed.

EDIT: I think the Sigma Replacements: Skybox version listed on CKAN is outdated though. The new distribution can be found here: https://github.com/Sigma88/Sigma-Replacements/releases/tag/B_v0.4.0

@HebaruSan
Copy link
Member

Sigma asked to have all of his mods frozen in KSP-CKAN/NetKAN#6527 and KSP-CKAN/NetKAN#6534. New versions aren't supposed to be indexed.

@Poodmund
Copy link
Author

Poodmund commented Jan 17, 2019

If thats the case, then the skybox listings will have to drop 'Sigma Replacements: Skybox' support on CKAN and subsequently only list TR and DiRT as the dependent texture replacement mods.

I was also just thinking, this new relationship functionality should help other listings like visual mods that list multiple versions of texture packages at different resolution sizes.

@HebaruSan
Copy link
Member

Well, if one of the options isn't available on the game version the user has, it just won't show up in the list. So you can still include it if you care about someone installing your skybox mods on KSP 1.3.1.

For texture packages, those are already handled via the "provides" property. The main mod depends on WhateverTextures, and then WhateverTextures-1024 and WhateverTextures-2048 and WhateverTextures-4096 are all tagged with "provides": [ "WhateverTextures" ] to tell CKAN that they should all be shown as options for that dependency. Sharing code with that feature made it significantly easier to implement any-of.

@Poodmund
Copy link
Author

Ah I see. In that case it's probably better to keep the Sigma Replacements dependency option for backwards compatibility and also if the mods become available in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core (ckan.dll) Issues affecting the core part of CKAN Enhancement New features or functionality Relationships Issues affecting depends, recommends, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants