Customizable mega mod pack. Tweak your gameplay how you want.

Please post here for questions and discussion about data, event, art and sound modding and the game editor for Distant Worlds.

Moderator: MOD_DW2

User avatar
iancmtaylor
Posts: 181
Joined: Wed May 09, 2012 6:38 pm

Customizable mega mod pack. Tweak your gameplay how you want.

Post by iancmtaylor »

Start by going here-
https://github.com/DW2MC/DW2ModLoader/releases

Download DistantWorlds2.ModLoader.zip

Extract those files to the main game directory for example with steam-
D:\SteamLibrary\steamapps\common\Distant Worlds 2\

This will automatically run when you start the game, you don't have to do anything except install the mods. Which is done thusly- The .zip has an empty folder called Mods. This will now be in your game directory. You will take a mod, which should come as another .zip, and extract it into this Mods folder. So you will now have Distant Worlds 2\Mods\ModYouJustInstalled. Inside of this ModYouJustInstalled folder, will be a mod.json file and another folder with the contents of the mod inside. The mod.json tells the modloader where to find the contents of the mod -> the folder next to it.

In order to deactivate a mod, simply rename the folder next to the json. In the case of this mod pack, just move the mod files you don't want to use up a level, so they sit next to the mod.json file. The mod loader can't see them there and won't use them, but they won't get lost there so you can swap them out as you wish.
example.png
example.png (21.15 KiB) Viewed 7178 times
^^^^Example of files I'm not using for a playthrough, cut and pasted to the higher directory.

Then when you start the game a console will open and load the mods into the game. The loader currently does not work on saved games, however that feature is coming soon. So in the meantime, you must start a new game everytime you change what mods are loaded, or if you are switching back and forth between vanilla and modded for some reason. This does mean that you will be able to play an old vanilla save, or a deprecated mod save without any issue, side by side on the same play session.

----

Okay, now that the technical stuff is out of the way, here's some mods-
CustomizableModPack1.1.0_ML(1.2.1).rar
(11.52 KiB) Downloaded 334 times
description.txt
(5.27 KiB) Downloaded 544 times
Check description.txt file for more information. (it's included in the .zip, but if you just want to see the description, here it is)

----

Check this thread for updates, will be adding more little mods like this to the pack over the coming days/ weeks.

Comments, suggestions for new mods/ balancing issues with current ones, or questions about how to use the mod loader are welcome.

Previous Build (1.0.2 for ML 1.07 downloaded 106 times, thanks guys)
Last edited by iancmtaylor on Fri Apr 08, 2022 7:18 am, edited 7 times in total.
I am /u/SharkMolester, moderator of /r/DistantWorlds and BFHKitteh, admin of https://dw2.fandom.com/wiki/Distant_Worlds_2_Wiki.
User avatar
frankycl
Posts: 401
Joined: Mon Mar 01, 2021 5:16 pm

Re: Customizable mega mod pack. Tweak your gamplay how you want.

Post by frankycl »

Hey that really sounds unbelievable good (if it really works it's the thing we all where waiting for, I guess) ! :mrgreen: - Thanks a million for sharing this. :D

But what I haven't understood so far: How does the mod-manager check if the simultaneously activated mods are compatible with one another ? - Or in other words: What does he do when two (or more) mods use the same entries in the same files, but with different context ??

EDIT: What's that additional "DW2Net6Win"-thing ?
User avatar
iancmtaylor
Posts: 181
Joined: Wed May 09, 2012 6:38 pm

Re: Customizable mega mod pack. Tweak your gamplay how you want.

Post by iancmtaylor »

The mod loader will simple add whatever changes are made together. In cases where a value was replaced instead of having math done to it, the last mod in the list gets final say on those values. Where math is involved, like value() * 2, the math will be incremented per mod on a top to bottom method. Hence why having a halved and a doubled mod will cancel eachother out.

So if you have a mod that makes hyperdrives slower- by replacing vanilla values with modded values- followed by another mod that makes hyperdrives slower using / 2, then the values in the first mod will be halved by the second mod.
I am /u/SharkMolester, moderator of /r/DistantWorlds and BFHKitteh, admin of https://dw2.fandom.com/wiki/Distant_Worlds_2_Wiki.
User avatar
frankycl
Posts: 401
Joined: Mon Mar 01, 2021 5:16 pm

Re: Customizable mega mod pack. Tweak your gamplay how you want.

Post by frankycl »

iancmtaylor wrote: Fri Mar 25, 2022 6:35 pm (...)
So if you have a mod that makes hyperdrives slower- by replacing vanilla values with modded values- followed by another mod that makes hyperdrives slower using / 2, then the values in the first mod will be halved by the second mod.
What ?? - That's crap for most of the users (and I guess you know this) :( - If you use a mod you don't want it to be altered from another mod (or to have to do serious math beforehand :roll: ) !
What would your mod-loader do if one mod makes hyperdrives slower (among other things) and another hyperdrives faster (among other things) ? Change all the values back to vanilla ?? :?

I think you really need to change/improve this. :!: - If anything, your mod-loader should warn the users that some mods aren't compatible (and then let you choose which one you want to activate, and which one you don't) - or (better) give access to the parts that don't match and let the user decide which variant they want to use in this mod or the other. ;)
User avatar
Miletkir
Posts: 654
Joined: Tue Jul 07, 2020 4:15 am
Location: Eastern Nebula

Re: Customizable mega mod pack. Tweak your gamplay how you want.

Post by Miletkir »

Fantastic, this is opening huge prospects. As someone who is unfamiliar with C# though, I think it would be fair to explain how the code works compared to modifying the XML files directly. For instance, the ship speed mod. If we do this via the XML, we have to locate all engine entries and change the subentries with speed values. How does this method proceed to affect speed for all engines?
Image
Mercbeast
Posts: 16
Joined: Mon Mar 21, 2022 7:06 am

Re: Customizable mega mod pack. Tweak your gamplay how you want.

Post by Mercbeast »

Might I suggest for ultimate try-hard resource scarcity mode, once this works on save games, you add +1% colony development to all the construction resources and possibly even caslon? This would be a terrible idea to start a fresh game with on anything but an advanced start. However, toggling this on in say 30 or so years into a game would add a significant drain on construction resources since they will be consumed by colonies like a luxury good.

I tested this out, and it isn't ideal for a pre-warp or the other minimal starts because you run out of construction goods before you can build enough stations to cover your base resource needs. Then your economy spirals into death as you have 3 or 4 mining ships manually trying to meet the needs of your faction, but they just can't do it :)
Redgate
Posts: 5
Joined: Thu Feb 25, 2021 4:39 pm

Re: Customizable mega mod pack. Tweak your gamplay how you want.

Post by Redgate »

Mercbeast wrote: Fri Mar 25, 2022 8:50 pm Might I suggest for ultimate try-hard resource scarcity mode, once this works on save games, you add +1% colony development to all the construction resources and possibly even caslon? This would be a terrible idea to start a fresh game with on anything but an advanced start. However, toggling this on in say 30 or so years into a game would add a significant drain on construction resources since they will be consumed by colonies like a luxury good.

I tested this out, and it isn't ideal for a pre-warp or the other minimal starts because you run out of construction goods before you can build enough stations to cover your base resource needs. Then your economy spirals into death as you have 3 or 4 mining ships manually trying to meet the needs of your faction, but they just can't do it :)
well thats how it already is on harsh or trying if u do prewarp start
User avatar
Iunnrais
Posts: 28
Joined: Sat Mar 12, 2022 3:00 am

Re: Customizable mega mod pack. Tweak your gamplay how you want.

Post by Iunnrais »

I'd love to convert the mods I'm using right now into this format so they won't get overwritten if the dev updates those files, and also for organizational and better distribution purposes.

For example: I'm replacing the human character names (see other thread). If I wanted to convert it to yml, would it work to do this?

Code: Select all

Race:
  - update: 
      RaceId: 0 #hum
      CharacterFirstNames:
            - Name1
            - Name2
            - Name3
            - etc...
      CharacterLastNames:
            - Lastname1
            - Lastname2
            - etc...
And would this append the names, or replace them?

If I wanted to append, or if I wanted to replace, how would I do whichever is not the default?

If I only want to remove a specific element, how would I do that?

Google suggests that YML files are for "YAML" format, but documentation/tutorials I'm finding on it seem to assume all data is being created from scratch in YAML, not being altered or updated like we're doing in these mods.
Mercbeast
Posts: 16
Joined: Mon Mar 21, 2022 7:06 am

Re: Customizable mega mod pack. Tweak your gamplay how you want.

Post by Mercbeast »

Redgate wrote: Sat Mar 26, 2022 4:54 am
Mercbeast wrote: Fri Mar 25, 2022 8:50 pm Might I suggest for ultimate try-hard resource scarcity mode, once this works on save games, you add +1% colony development to all the construction resources and possibly even caslon? This would be a terrible idea to start a fresh game with on anything but an advanced start. However, toggling this on in say 30 or so years into a game would add a significant drain on construction resources since they will be consumed by colonies like a luxury good.

I tested this out, and it isn't ideal for a pre-warp or the other minimal starts because you run out of construction goods before you can build enough stations to cover your base resource needs. Then your economy spirals into death as you have 3 or 4 mining ships manually trying to meet the needs of your faction, but they just can't do it :)
well thats how it already is on harsh or trying if u do prewarp start
By adding development to construction resources, it actively drains the resource like its a luxury good. Harsh and Trying as far as I know, don't passively drain your construction resources. That's why it's different. You can't actually hit a black hole of resource consumption. You may need to wait awhile for your mining ships to make deliveries. However, the resource they just brought in, doesn't deplete to 0 before they return with their next load.

When you add colony development to construction resources, every tick it subtracts resources for your colony to use as a luxury good for colony development. So, while your mining ships go out and bring back a load of polymer, by the time they go out and bring back a load of steel, the polymer they brought back has drained back to 0.

This is why I don't recommend you attempt to do this on a fresh game, unless you're starting with an advanced (3-4 colony type) start. You simply can't dig yourself out of the resource hole unless MAYBE you play as a mercantile guild which I think can micro miners.
User avatar
Pocus
Posts: 1319
Joined: Wed Sep 22, 2004 8:17 pm

Re: Customizable mega mod pack. Tweak your gamplay how you want.

Post by Pocus »

I'm interested in knowing in more details what it does practically, i.e. the XML editing operations it supports and down to which granularity?

Edit: Congrats in any case!
I'm intrigued also by your remark on saved game support, can you rephrase? Do you mean at some points you'll have the means to edit a saved game and inject game data modifications into it?
AGEOD Team
Dampfnudel
Posts: 175
Joined: Wed Feb 27, 2019 7:49 pm

Re: Customizable mega mod pack. Tweak your gamplay how you want.

Post by Dampfnudel »

Thank you!

I made some own mods using you as a template and it worked!

Can u make a template where you change race planet suitability and preferred weapons?
User avatar
iancmtaylor
Posts: 181
Joined: Wed May 09, 2012 6:38 pm

Re: Customizable mega mod pack. Tweak your gamplay how you want.

Post by iancmtaylor »

1.0.2 - 3/37/21 https://www.matrixgames.com/forums/view ... 9&t=381784
added-
adm_build_income- adds a progressive income bonus to administration buildings to help offset borked colony revenue formula-
see: https://www.matrixgames.com/forums/view ... 1&t=381813 intended for higher than normal difficulties
col_mod_less_energy- reduces static energy consumption of colonization modules, so autobuild colony ships can actually be used in early game-
should help AI colonize even more than usual
construction_yards- vanilla yards have 1 construction bay and 1 docking bay, increased to 2, hopefully helps with private ship crunches
resources_get_eaten- added colony development +1 to construction resources, which causes them to be consumed by planets, thanks to forum user Mercbeast
scarcity- intended to help offset a possible imbalance of decreased mining rates- doubles the abundance of hexodorium and dyrillium when they are found on a planet-
does not increase the chances of a spawn, but doubles the amount when they do spawn
vector_engine_rebalance_mod- my original mod that rebalanced vector engines. the devs included minor buffs to them in the vanilla game, but this increases them even more

changes-
reproduction_halved- changed to formula instead of value, so you can edit the rate more easily

____

To be clear, I am not the author of the mod loader, I just use it.
Dampfnudel wrote: Sun Mar 27, 2022 11:17 am Thank you!

I made some own mods using you as a template and it worked!

Can u make a template where you change race planet suitability and preferred weapons?
Policy files will be supported in the next version, some time this week.
Pocus wrote: Sun Mar 27, 2022 5:47 am I'm interested in knowing in more details what it does practically, i.e. the XML editing operations it supports and down to which granularity?

Edit: Congrats in any case!
I'm intrigued also by your remark on saved game support, can you rephrase? Do you mean at some points you'll have the means to edit a saved game and inject game data modifications into it?
I have no idea on the technical side of things, he has been working on a method to apply new values to savegame data, to load mods/ update mods in a savegame.
Mercbeast wrote: Sat Mar 26, 2022 8:39 am This is why I don't recommend you attempt to do this on a fresh game, unless you're starting with an advanced (3-4 colony type)
Thanks for the tip about adding colonydevelopment, Mercbeast. Yes, playing with that setting you definitely need to start on "Young"- "Starting" is not going to work.
Iunnrais wrote: Sat Mar 26, 2022 7:18 am And would this append the names, or replace them?

If I wanted to append, or if I wanted to replace, how would I do whichever is not the default?

If I only want to remove a specific element, how would I do that?

Google suggests that YML files are for "YAML" format, but documentation/tutorials I'm finding on it seem to assume all data is being created from scratch in YAML, not being altered or updated like we're doing in these mods.
The Policy files will be supported in the next version of the modloader, but I will answer your questions.
The -update command adds things, or changes a value to a new value, so adding names to a list. There is an -add command which will replace a whole set of values, I believe that's how it operates at least. I never tried using it for replacing part of something already existent, I've only used it to add a whole new 'object'. So for example I have done the equivalent of rewriting the entire Human.xml file, with every value in it, copied over in new format with some changes.

To remove something, just don't put it in the .yml file, the loader builds on top of vanilla, so if a line is not in the .yml, it will just use the underlying .xml.

I have added quite a few new files in the new release, you might find more answers there. My only advice is- yaml is super strict and finicky when it comes to formatting. Use a real text editor that will show you your tabs and spaces- no tabs in front of line allowed, spaces take the place of () and must be precise. Look at my files for guidance. If you have more questions let me know.
Miletkir wrote: Fri Mar 25, 2022 8:50 pm Fantastic, this is opening huge prospects. As someone who is unfamiliar with C# though, I think it would be fair to explain how the code works compared to modifying the XML files directly. For instance, the ship speed mod. If we do this via the XML, we have to locate all engine entries and change the subentries with speed values. How does this method proceed to affect speed for all engines?
For changing vanilla components what you want to do is leave the game open, download the official DW2 editor. Find the name of the component in the research screen, go to the editor, edit components, open componentdefinitions, search for exact name of component. This will give you the ID#- make sure you are looking at the correct one, the fighter only ones get brought up as results in the search and you have to search again if you're looking for ship only components.

Then use my templates to do your modifications.

Compared to modifying the base .xml, I don't have to worry about having to mod a file that's over 100k lines and containing millions of extraneous characters. That's how this whole pack can change so much with so little- it just adds on top of the .xml instead of editing it.
frankycl wrote: Fri Mar 25, 2022 8:14 pm
iancmtaylor wrote: Fri Mar 25, 2022 6:35 pm (...)
So if you have a mod that makes hyperdrives slower- by replacing vanilla values with modded values- followed by another mod that makes hyperdrives slower using / 2, then the values in the first mod will be halved by the second mod.
What ?? - That's crap for most of the users (and I guess you know this) :( - If you use a mod you don't want it to be altered from another mod (or to have to do serious math beforehand :roll: ) !
What would your mod-loader do if one mod makes hyperdrives slower (among other things) and another hyperdrives faster (among other things) ? Change all the values back to vanilla ?? :?

I think you really need to change/improve this. :!: - If anything, your mod-loader should warn the users that some mods aren't compatible (and then let you choose which one you want to activate, and which one you don't) - or (better) give access to the parts that don't match and let the user decide which variant they want to use in this mod or the other. ;)
That's just standard video game mods... Things aren't compatible usually, and it's up to modders and users to do their due diligence.
I am /u/SharkMolester, moderator of /r/DistantWorlds and BFHKitteh, admin of https://dw2.fandom.com/wiki/Distant_Worlds_2_Wiki.
User avatar
Miletkir
Posts: 654
Joined: Tue Jul 07, 2020 4:15 am
Location: Eastern Nebula

Re: Customizable mega mod pack. Tweak your gamplay how you want.

Post by Miletkir »

For changing vanilla components what you want to do is leave the game open, download the official DW2 editor. Find the name of the component in the research screen, go to the editor, edit components, open componentdefinitions, search for exact name of component. This will give you the ID#- make sure you are looking at the correct one, the fighter only ones get brought up as results in the search and you have to search again if you're looking for ship only components.

Then use my templates to do your modifications.

Compared to modifying the base .xml, I don't have to worry about having to mod a file that's over 100k lines and containing millions of extraneous characters. That's how this whole pack can change so much with so little- it just adds on top of the .xml instead of editing it.
Yet if you want to change speed for all engines, you still have to individually change the values for all engine IDs... which is the same that you would do with the XML. Still a better method overall of course for mod management.
Image
Dampfnudel
Posts: 175
Joined: Wed Feb 27, 2019 7:49 pm

Re: Customizable mega mod pack. Tweak your gameplay how you want.

Post by Dampfnudel »

I noticed an "issue".

Some components have no bonuses. And it seems you can only change bonuses of components who had on in the first place.

Is there a workaround?

Context. I tried to add weapon range bonus to sensors.
Attachments
5.PNG
5.PNG (34.78 KiB) Viewed 7009 times
User avatar
frankycl
Posts: 401
Joined: Mon Mar 01, 2021 5:16 pm

Re: Customizable mega mod pack. Tweak your gameplay how you want.

Post by frankycl »

Dampfnudel wrote: Mon Mar 28, 2022 6:08 pm I noticed an "issue".
(...)
I tried to add weapon range bonus to sensors.
Why do you want to add a "weapon range"-bonus to "sensors" ? - Shouldn't it be more logical that they should have >sensor range<- bonuses ? ;-)
Dampfnudel
Posts: 175
Joined: Wed Feb 27, 2019 7:49 pm

Re: Customizable mega mod pack. Tweak your gameplay how you want.

Post by Dampfnudel »

frankycl wrote: Mon Mar 28, 2022 6:49 pm
Dampfnudel wrote: Mon Mar 28, 2022 6:08 pm I noticed an "issue".
(...)
I tried to add weapon range bonus to sensors.
Why do you want to add a "weapon range"-bonus to "sensors" ? - Shouldn't it be more logical that they should have >sensor range<- bonuses ? ;-)
What do you think is a sensor? And how do you think do modern ships target enemy ships? :lol:

Sensors are tools to detect and locate a target. Without sensors you can only target things visible by your natural sensor called "eye", a technical sensor increase your detection range, and hence the range you can aim at.

No modern ship uses eye visuals to aim at range anymore. They all rely on sensors. Mostly radar.
User avatar
iancmtaylor
Posts: 181
Joined: Wed May 09, 2012 6:38 pm

Re: Customizable mega mod pack. Tweak your gameplay how you want.

Post by iancmtaylor »

Unless your sensor is a weapon, adding weapon range isn't going to do anything.
I am /u/SharkMolester, moderator of /r/DistantWorlds and BFHKitteh, admin of https://dw2.fandom.com/wiki/Distant_Worlds_2_Wiki.
Dampfnudel
Posts: 175
Joined: Wed Feb 27, 2019 7:49 pm

Re: Customizable mega mod pack. Tweak your gameplay how you want.

Post by Dampfnudel »

iancmtaylor wrote: Mon Mar 28, 2022 7:10 pm Unless your sensor is a weapon, adding weapon range isn't going to do anything.
Not weapon range, but weapon range bonus. Items can have bonuses.

Like the scanning, component gives a weapon damage bonus or the battleship hull gives a weapon range bonus.
User avatar
iancmtaylor
Posts: 181
Joined: Wed May 09, 2012 6:38 pm

Re: Customizable mega mod pack. Tweak your gameplay how you want.

Post by iancmtaylor »

The value <WeaponRange> is strictly for setting the range of a weapon, it is not a bonus, or a multiplier or anything. All it does is set how far the weapon shoots.
I am /u/SharkMolester, moderator of /r/DistantWorlds and BFHKitteh, admin of https://dw2.fandom.com/wiki/Distant_Worlds_2_Wiki.
User avatar
iancmtaylor
Posts: 181
Joined: Wed May 09, 2012 6:38 pm

Re: Customizable mega mod pack. Tweak your gameplay how you want.

Post by iancmtaylor »

moar_ships_mod_coming_soon.png
moar_ships_mod_coming_soon.png (334.71 KiB) Viewed 6953 times
Coming soon to modpack- unlock all basic ship types on game start.
mod_loader_shmd_override.png
mod_loader_shmd_override.png (2.16 MiB) Viewed 6940 times
Also supports editing ShipHulls.xml, and automatically overriding .shmd files. (a sort of persistent version of ShipHulls.xml that overrides ShipHulls.xml- requiring the .shmd file to be deleted and remade by the game using the new .xml data)

Code: Select all

ShipHull:
  - update:
      ShipHullId: 0 # Haakonish/escort 0/16/17
      ComponentBays:
        - ComponentBayId: 0
          MaximumComponentSize: 50
        - ComponentBayId: 18
          Type: Weapon
          MaximumComponentSize: 50
          MeshName: #weapon1
          RotationHalfArcRange: 1
          DisplayEffectRescaleFactor:
            X: 0
            Y: 0
            Z: 0
          DisplayEffectOffset:
            X: 0
            Y: 0
            Z: 0
          Meshes:
            - BayType: Weapon
              BayTypeIndex: 0
              MeshName:
              ModelComponentViewHierarchyNodeId: 0
              MeshIndex: 0
              SupportStructureMeshName:
              SupportStructureModelComponentViewHierarchyNodeId: 0
              SupportStructureMeshIndex: 0
              WeaponMeshType: ShortTurret
              IsLarge: false
              Position:
                X: 0
                Y: 0
                Z: 0
              Forward:
                X: 0
                Y: 0
                Z: 0
              Up:
                X: 0
                Y: 0
                Z: 0
              ForwardWorld:
                X: 0
                Y: 0
                Z: 0
              UpWorld:
                X: 0
                Y: 0
                Z: 0
              DefaultDirection:
                X: 0
                Y: 0
                Z: 0
              PositionWorld:
                X: 0
                Y: 0
                Z: 0
              ComponentMeshSize:
                X: 0
                Y: 0
                Z: 0
              DefaultMeshSizeWorld:
                X: 0
                Y: 0
                Z: 0
              BackCenter:
                X: 0
                Y: 0
                Z: 0
I am /u/SharkMolester, moderator of /r/DistantWorlds and BFHKitteh, admin of https://dw2.fandom.com/wiki/Distant_Worlds_2_Wiki.
Post Reply

Return to “Design and Modding”