[SUGESTION] mod presets

This forum is the ideal place for all discussion relating to X4. You will also find additional information from developers here.

Moderator: Moderators for English X Forum

User avatar
chew-ie
Posts: 5605
Joined: Mon, 5. May 08, 00:05
x4

Re: [SUGESTION] mod presets

Post by chew-ie » Mon, 31. May 21, 18:58

That's excactly what I had in mind. Just switch the branches to jump between mod "profiles". Pity there is no branch switch hook [that I'm aware of] which could be used to manage the savegames as well. That'll need some additional cli scripts.

Image

Spoiler
Show
BurnIt: Boron and leaks don't go well together...
Königinnenreich von Boron: Sprich mit deinem Flossenführer
Nila Ti: Folgt mir, ihr Kavalkade von neugierigen Kreaturen!

:idea: Pick your poison seed [for custom gamestarts]
:idea: Feature request: paint jobs on custom starts

jlehtone
Posts: 21811
Joined: Sat, 23. Apr 05, 21:42
x4

Re: [SUGESTION] mod presets

Post by jlehtone » Mon, 31. May 21, 19:57

chew-ie wrote:
Mon, 31. May 21, 14:51
There is git! :)
I was thinking robocopy/rsync -- version control of binary blobs is not very comfy.
Goner Pancake Protector X
Insanity included at no extra charge.
There is no Box. I am the sand.

bogate
Posts: 81
Joined: Sat, 29. Dec 18, 23:08
x4

Re: [SUGESTION] mod presets

Post by bogate » Mon, 31. May 21, 23:34

chew-ie wrote:
Mon, 31. May 21, 18:58
That's excactly what I had in mind. Just switch the branches to jump between mod "profiles". Pity there is no branch switch hook [that I'm aware of] which could be used to manage the savegames as well. That'll need some additional cli scripts.
trying to initialize git on the x4 foundations folder has been ongoing for 2 hours and took upwards of +20GB, i just killed, deleted it and scratched the idea. Having a separate install seems like the way to go. I will try to make steam pick up both games to do this i copy the x4 folder to "X4 Foundations1" and get a new install of X4, in order to switch the game just go to the steam library folder, rename X4 to "X4 Foundations2" and rename "X4 Foundations1" to "X4 Foundations". It is still a pain, but could posssibly be automated by a batch script on the desktop. Just need to close steam before changing game session



Anyone knows how to have 2 different savegames folders for each instance of the game? Can i edit or mod somewhere the destination of savegames? Found out how, edited batch files

edit:
batch files:

play modded
cd C:\Users\USER\Documents\Egosoft\X4\ID
ren save save_unmodded
ren save_modded save
cd C:\Program Files (x86)\Steam\steamapps\common
ren "X4 Foundations" "X4 Foundations_unmodded"
ren "X4 Foundations_modded" "X4 Foundations"
start steam://rungameid/392160
play unmodded
cd C:\Users\USER\Documents\Egosoft\X4\ID
ren save save_modded
ren save_unmodded save
cd C:\Program Files (x86)\Steam\steamapps\common
ren "X4 Foundations" "X4 Foundations_modded"
ren "X4 Foundations_unmodded" "X4 Foundations"
start steam://rungameid/392160

michi_oss
Posts: 600
Joined: Sat, 14. Oct 06, 15:02
x4

Re: [SUGESTION] mod presets

Post by michi_oss » Tue, 1. Jun 21, 08:53

CBJ wrote:
Sat, 29. May 21, 22:40
I know what you're suggesting, but when I asked the relevant person about it they told me we couldn't do that because it's Steam Workshop that determines what mods are loaded and we can't override that with locally-defined mod collections.
Why is it possible to de-/activate mods manually in X4 via several buttons, but not via a Button "activate all" or "deactivate all" or activate a defined set of mods?

I agree that it would be difficult to load automatically some mods related to a savegame, but it should be possible to make more buttons in the extension menu of X4?!

Not sure if there is a misunderstanding about the request. Thats why I'm asking... :) and to understand the background.
I think I have another game in Steam were I can activate or deactivate all mods via one button in the game, but not sure at the moment. Transport Fever.
I even think you can define the mods for each savegame and have not to restart the game after chaning it.
But perhaps both games are not comparable regarding mods.
Die Kraft einer Kerze ist die Flamme, aber sie brennt nur so lange wie der Docht.

User avatar
Val Comdriver
Posts: 73
Joined: Sat, 7. Apr 12, 10:25
x4

Re: [SUGESTION] mod presets

Post by Val Comdriver » Fri, 4. Jun 21, 17:37

michi_oss wrote:
Tue, 1. Jun 21, 08:53
CBJ wrote:
Sat, 29. May 21, 22:40
I know what you're suggesting, but when I asked the relevant person about it they told me we couldn't do that because it's Steam Workshop that determines what mods are loaded and we can't override that with locally-defined mod collections.
Why is it possible to de-/activate mods manually in X4 via several buttons, but not via a Button "activate all" or "deactivate all" or activate a defined set of mods?
This. there is in game menu to enable/disable mods which are already loaded trough Steam. I have like 10 mods in my subscription list but since I have them disabled in game my saves are not modified.
I think the problem is devs are possibly thinking we want to be able enable/disable mods without game restart. but actual solution would be to have a small window asking if we want to start the game with mods enabled or disabled right after we press the "play" button in Steam or somewhere else. with an option to remember selection and resetting it from in game setting of course.
My PC specs for bug reports
Show
  • AMD Ryzen 9 3900
  • GIGABYTE X570 AORUS ELITE
  • NVIDIA GeForce RTX 2070 Super
  • 32 GB DDR4 3600 (CMW16GX4M1Z3600C18)
  • Windows 7 Pro SP1

kmunoz
Posts: 444
Joined: Sun, 25. Feb 07, 19:59
x4

Re: [SUGESTION] mod presets

Post by kmunoz » Sun, 6. Jun 21, 05:46

CBJ wrote:
Sat, 29. May 21, 22:40
I know what you're suggesting, but when I asked the relevant person about it they told me we couldn't do that because it's Steam Workshop that determines what mods are loaded and we can't override that with locally-defined mod collections.
All of the Paradox games seem to be able to manage this just fine. They use a launcher that lets you select from your subscribed mods before loading the game proper (and as a result they are able to offer mod set functionality). So, to put it bluntly, what you've been told is demonstrably false.

A related problem with X4 is that if you turn off a Workshop-based mod in Extensions, then that mod shows up as not subscribed in Steam. That is counterintuitive: I still want to be subscribed to the mod (to get updates, etc), I just don't want it to be loaded right now. And again, this is a problem that Paradox and other developers have already solved.
Let's Play Poorly! - Suboptimal X4 Playthroughs

jlehtone
Posts: 21811
Joined: Sat, 23. Apr 05, 21:42
x4

Re: [SUGESTION] mod presets

Post by jlehtone » Sun, 6. Jun 21, 11:38

You mention "Steam Workshop". I have no idea what that is. Do players with GOG version know?
I presume that all mods are not via "Workshop".

Do you want a solution for all mods, or just for the Workshop? Does the Workshop even have anything to do with the game, or is it completely "external"?
Goner Pancake Protector X
Insanity included at no extra charge.
There is no Box. I am the sand.

michi_oss
Posts: 600
Joined: Sat, 14. Oct 06, 15:02
x4

Re: [SUGESTION] mod presets

Post by michi_oss » Sun, 6. Jun 21, 12:05

kmunoz wrote:
Sun, 6. Jun 21, 05:46

A related problem with X4 is that if you turn off a Workshop-based mod in Extensions, then that mod shows up as not subscribed in Steam. That is counterintuitive: I still want to be subscribed to the mod (to get updates, etc), I just don't want it to be loaded right now. And again, this is a problem that Paradox and other developers have already solved.
Really? The mod itself is unsubscribed? What is that for a strange implementation? :o

The developers from Egosoft should ask developers from Paradox games or Urban Games how to implement mods correctly. :D ;)
Die Kraft einer Kerze ist die Flamme, aber sie brennt nur so lange wie der Docht.

bogate
Posts: 81
Joined: Sat, 29. Dec 18, 23:08
x4

Re: [SUGESTION] mod presets

Post by bogate » Sun, 6. Jun 21, 14:20

jlehtone wrote:
Sun, 6. Jun 21, 11:38
Do you want a solution for all mods, or just for the Workshop? Does the Workshop even have anything to do with the game, or is it completely "external"?
A solution should work for all mods in the extensions folder. I also dont understand why workshop and non-workshop mods are treated differently, i have both kinds of mods installed in my game and i can deal with both at the same time in the ingame extensions menu. Making a mod preset in the ingame extensions menu shouldnt be that difficult, just ignore the workshop and treat all mods in the extension folder the same or something. Nobody is saying that switching mods on the fly without restarting the game is needed, but having a presets in the ingame extensions menu and getting a restart game prompt after changing it shouldnt be that complicated.

If workshop mods are treated differently because of the update then just differentiate between both, make a subscribed list ingame (which already exist as you can go to the inagme extensions folder, click the desired mod and tell it to update or not) and then make a second list of mods to load. Workshop and non-workshop mods coexist perfectly, it shouldnt be that difficult

My method of switching game folders works but needing a second installation is pretty bad.

kmunoz
Posts: 444
Joined: Sun, 25. Feb 07, 19:59
x4

Re: [SUGESTION] mod presets

Post by kmunoz » Mon, 7. Jun 21, 00:01

It's also unfortunate that the saved game information doesn't tell you which mods were in use the last time you saved, or better yet provide you with a button that reconfigures the on/off switches to match the save. So if I have multiple save games using different sets of Extensions, I have to write down the list manually in order to keep everything correct.

And the more I think of it, the more it seems that the inability to do mod presets within the game itself makes no sense. If *I* can manually switch extensions on and off, there's no reason I can think of why the game couldn't have a way to read my current pattern of on and off, save that pattern, then reload it when I choose. Functionally it would be identical to the way a saved game works: capture the state of the extensions list, save it to a named file, then reload that named file at the player's request. You'd still have to restart the game to actually load the set correctly, but that's a negligible obstacle in comparison to the absolutely massive value of having mod sets.

In fact... a question: is the pattern of on/off extensions saved in a readable config file? It must be stored somewhere, because an extension can be "off" and still in the Extensions folder (which means that the game isn't merely reading the extensions folder and treating everything it finds there as "on").

If it is stored in a readable config file, some enterprising modder could make a command line batch file of some sort that would let you insert/replace mod sets into that config file.

Edit: it's in Documents/Egosoft/X4/<profileID?>/content.xml

Completely human readable. A game launcher could read it, modify it based on a selection from a list of presets (or save a preset based on the current state), then save the file and launch the game. I'm fairly sure that's exactly what Paradox does with their launcher. No reason X4 couldn't have something similar (either made by EGO or put together by a modder).
Let's Play Poorly! - Suboptimal X4 Playthroughs

bogate
Posts: 81
Joined: Sat, 29. Dec 18, 23:08
x4

Re: [SUGESTION] mod presets

Post by bogate » Mon, 7. Jun 21, 12:13

kmunoz wrote:
Mon, 7. Jun 21, 00:01
If it is stored in a readable config file, some enterprising modder could make a command line batch file of some sort that would let you insert/replace mod sets into that config file.

Edit: it's in Documents/Egosoft/X4/<profileID?>/content.xml

Completely human readable. A game launcher could read it, modify it based on a selection from a list of presets (or save a preset based on the current state), then save the file and launch the game. I'm fairly sure that's exactly what Paradox does with their launcher. No reason X4 couldn't have something similar (either made by EGO or put together by a modder).
That is a really nice find. It should be no problem to make a simply gui to edit that file based on stored presets and even change the save directory to match the preset automatically. And everything could be done prior to game startup. Sadly coding such a thing is well beyond my ability

kmunoz
Posts: 444
Joined: Sun, 25. Feb 07, 19:59
x4

Re: [SUGESTION] mod presets

Post by kmunoz » Mon, 7. Jun 21, 19:34

bogate wrote:
Mon, 7. Jun 21, 12:13
Sadly coding such a thing is well beyond my ability
Same - but it looks like the sort of task that would be absolutely trivial for someone with a modicum of programming knowledge. If I knew even just a little bit more Python I could probably pull it off. (It might also erase your hard drive and burn down your house, but it would work.)

It would just need to mimic the Extensions menu in the game - give you on/off switches for each mod that it finds in the content.xml file. (This alone would be a boon - you could set your mods before launching the game, rather than having to launch, set mods, quit and launch again.) And then allow you to either save that setup directly into context.xml or save it as a separate (preset) file.

And then from there, someone could add a pulldown menu that lets you pick one of the preset files, which then copies that file over as content.xml, replacing the one that's currently there. (You would presumably want to have a "default" preset that is either all on or all off, as well as a "revert" option that would restore the last content.xml in the event of a disaster.)

Alternatively, the mod launcher could ignore content.xml (on first run) and simply generate the mod list from what's in the extensions folder. The way content.xml works currently, if you remove an extension from the folder it DOES NOT remove that extension from content.xml. (This is not a problem normally, but it might get weird if the mod launcher reads an extension in context.xml that you don't actually have installed anymore - you might expect it to be there, but it's not. The game still runs just fine, it's just that the extension is missing.)

In game, X4 is doing some comparison between the content.xml file and the extensions folder. It's reading the on/off state from the xml file but reading the exists/doesn't exist state from the extensions folder. So if you remove an extension from the folder it doesn't show up in the game's list, either as on or off, but if you then put it back it will restore whatever on/off state was in effect the last time you had it - because it's still in content.xml.

I know way more about this than I should, for someone who can't program his way into a paper bag, let alone out of it.

Edit: Final thought: having a mod preset launcher would be an absolute boon for modders and mod testers. It would make A/B testing (see? I know some things... I just can't use them) so much easier. (Maybe modders already edit their own content.xml files?) It would also make playing multiple saves with different extensions much easier. Honestly half the reason I don't routinely switch between my vanilla save and my Star Wars Interworlds save is because it's a multi-minute hassle to launch, switch on/off the extensions, quit and relaunch. And I used to play with over 50 mods installed (non-Star Wars) but once I started a vanilla save so I can help test 4.1 beta, I just gave up on it because the effort required to go through and turn all of my extensions off and on again is just too annoying.
Let's Play Poorly! - Suboptimal X4 Playthroughs

Eyeklops
Posts: 331
Joined: Tue, 23. Mar 21, 17:58
x4

Re: [SUGESTION] mod presets

Post by Eyeklops » Tue, 8. Jun 21, 19:00

kmunoz wrote:
Mon, 7. Jun 21, 00:01
It's also unfortunate that the saved game information doesn't tell you which mods were in use the last time you saved, or better yet provide you with a button that reconfigures the on/off switches to match the save. So if I have multiple save games using different sets of Extensions, I have to write down the list manually in order to keep everything correct.
As a new(er) player what is frustrating for me is that I cannot tell what save games are vanilla vs modified. Maybe I'm missing that indicator somewhere on the savegame info screen. I'm certain the game knows when it's using a save from a modified game session but it just doesn't seem to make it very obvious. Because of this I stopped using all mods, restarted a new savegame, and just play vanilla now.

kmunoz
Posts: 444
Joined: Sun, 25. Feb 07, 19:59
x4

Re: [SUGESTION] mod presets

Post by kmunoz » Tue, 8. Jun 21, 19:58

Eyeklops wrote:
Tue, 8. Jun 21, 19:00
As a new(er) player what is frustrating for me is that I cannot tell what save games are vanilla vs modified. Maybe I'm missing that indicator somewhere on the savegame info screen. I'm certain the game knows when it's using a save from a modified game session but it just doesn't seem to make it very obvious. Because of this I stopped using all mods, restarted a new savegame, and just play vanilla now.
I don't think there is an indicator on the saves themselves, only on X4 as a whole (on the main menu screen it shows "modified" under the version number if you have mods loaded). The only time you'd know if a save is modded is if one of the mods it uses is required for it to run, and you don't have that mod loaded (the game will not load the save).
Let's Play Poorly! - Suboptimal X4 Playthroughs

Eyeklops
Posts: 331
Joined: Tue, 23. Mar 21, 17:58
x4

Re: [SUGESTION] mod presets

Post by Eyeklops » Tue, 8. Jun 21, 20:31

kmunoz wrote:
Tue, 8. Jun 21, 19:58
Eyeklops wrote:
Tue, 8. Jun 21, 19:00
As a new(er) player what is frustrating for me is that I cannot tell what save games are vanilla vs modified. Maybe I'm missing that indicator somewhere on the savegame info screen. I'm certain the game knows when it's using a save from a modified game session but it just doesn't seem to make it very obvious. Because of this I stopped using all mods, restarted a new savegame, and just play vanilla now.
I don't think there is an indicator on the saves themselves, only on X4 as a whole (on the main menu screen it shows "modified" under the version number if you have mods loaded). The only time you'd know if a save is modded is if one of the mods it uses is required for it to run, and you don't have that mod loaded (the game will not load the save).
I was under the impression a savegame gets internally marked "modded" if saved during a modded session and could not be used for ventures even if the mod was no longer active. The only mod I used is DeadAir AI Tweaks and if I could turn that back on without jeopardy of disqualifying my savegame for Ventures that would be great.

kmunoz
Posts: 444
Joined: Sun, 25. Feb 07, 19:59
x4

Re: [SUGESTION] mod presets

Post by kmunoz » Wed, 9. Jun 21, 03:48

Eyeklops wrote:
Tue, 8. Jun 21, 20:31
I was under the impression a savegame gets internally marked "modded" if saved during a modded session and could not be used for ventures even if the mod was no longer active. The only mod I used is DeadAir AI Tweaks and if I could turn that back on without jeopardy of disqualifying my savegame for Ventures that would be great.
That's correct - the "modded" flag is permanent, even after removing the mods, since the save would still bear the effects of the mod.
Let's Play Poorly! - Suboptimal X4 Playthroughs

Falcrack
Posts: 4998
Joined: Wed, 29. Jul 09, 00:46
x4

Mod profiles please!

Post by Falcrack » Sat, 14. Aug 21, 16:59

I find myself switching between modded and unmodded games quite frequently. It is a tedious chore sometime to remember all the mods I had previously activated. This is all the functionality I would want it to have:

1. When I save a mod profile (with a custom name), all the extensions which are "on" at the time are saved with this profile
2. When I load a profile, all the mods which are "on" for this profile are turned on, and all the mods which are not part of this profile are turned off.
3. I restart the game, the mods I want are now active, and I load up the game.

No messing with Steam Workshop, no automatic saving of mod profiles for specific save games. Just a simple profile I can load up so I don't have to remember all the different mods I want to be active.

Post Reply

Return to “X4: Foundations”