Fractal Softworks Forum

Starsector => Mods => Modding => Topic started by: Bhdeale on April 13, 2020, 02:44:04 PM

Title: [0.9.1a] Mo' Weapons Mo' Ships
Post by: Bhdeale on April 13, 2020, 02:44:04 PM
Mo' Weapons Mo' Ships
(https://i.ibb.co/tcbVGNs/manyweps.png) (https://ibb.co/FJBRrfw)

Vanilla Download: https://github.com/KelvallRogers/moweaponsmoships/releases/download/1.0.1van/MoWeaponsMoShipsv1.0.1van.zip
Nexerelin compatible Download: https://github.com/KelvallRogers/moweaponsmoships/releases/download/1.0.1nex/MoWeaponsMoShipsv1.0.1nex.zip

This mod doubles the number of weapons, fighter LPCs, and ships available in all vanilla markets (submarkets)
It is configurable, so you can multiply by however many you want, say 10x weapons, 2x fighters, 200x ships whatever will make you happy. In the above screenshot I set it to 200 :)
You can modify how many hullmods are available, by default this is unchanged.

Screenshots
Spoiler
(https://i.ibb.co/NLK0r9b/screenshot031.png) (https://ibb.co/gDJ0dSh)
(https://i.ibb.co/F74dLD5/screenshot032.png) (https://ibb.co/ysFxcQ6)
(https://i.ibb.co/cL27Rqs/screenshot033.png) (https://ibb.co/QdY1h0x)
(https://i.ibb.co/8g15WhC/screenshot034.png) (https://ibb.co/v40P7tF)
[close]

This mod is a bit complex under the hood in that is is replacing all vanilla submarkets with my MWMS markets which allows me to increase the number of items in them. Note that these are only available to the player and could take up to 30 days to appear in an existing save file (and 30 days to go away when removing this mod).

To remove this mod (maybe you don't like it or an update to Star Sector is causing this mod to fail) please follow the comprehensive uninstall steps below. I have tried to make this as safe as possible, but any mod introduces some risk.
If this seems too scary for your save file - don't use the mod. You have been warned.

Compatibility
If you use Nexerelin you must use the Nex compatible version.
I do not know how to optionally load classes based on mods available so there are two versions.

Any mod with its own submarkets are unaffected - that is they will not benefit from the extra weapon/ship/hull/fighter in market - but they will work.
Other modders will either need to take on adding my logic into their code, or reach out to me so I can override their mod's market to apply the benefits.
I wish there was an easier way but so far it would require losing the ability to easily uninstall this mod.

Uninstall

You need to go to your save file, make a copy of it (put it somewhere safe)
Now if you make a mistake you can re-copy your good save. This is the campaign.xml file
Now open it in an editor (NotePad++, nano, vim, whatever)
You need to find and replace all of this mods market classes with the games
vanilla ones, or with Nexerelin markets. Below are the specific ones

Vanilla
start with all open markets (there may be a lot of these)
find
data.scripts.campaign.submarkets.MWMS_OpenMarketPlugin
and replace it with
com.fs.starfarer.api.impl.campaign.submarkets.OpenMarketPlugin

then do the same for military markets
find
data.scripts.campaign.submarkets.MWMS_MilitarySubmarketPlugin
and replace it with
com.fs.starfarer.api.impl.campaign.submarkets.MilitarySubmarketPlugin

finally do it for black markets
find
data.scripts.campaign.submarkets.MWMS_BlackMarketPlugin
and replace it with
com.fs.starfarer.api.impl.campaign.submarkets.BlackMarketPlugin

Nexerelin
start with all open markets (there may be a lot of these)
find
data.scripts.campaign.submarkets.MWMS_OpenMarketPlugin
and replace it with
exerelin.campaign.submarkets.Nex_OpenMarketPlugin

then do the same for military markets
find
data.scripts.campaign.submarkets.MWMS_MilitarySubmarketPlugin
and replace it with
exerelin.campaign.submarkets.Nex_MilitarySubmarketPlugin

finally do it for black markets
find
data.scripts.campaign.submarkets.MWMS_BlackMarketPlugin
and replace it with
exerelin.campaign.submarkets.Nex_BlackMarketPlugin

So what do all the config options do?
In the mod you'll see: data/config/settings.json

Most of the options are about if you are using "mult" (mwms_many_pick false) or "picks" (mwms_many_pick true) -- if this is too complicated, just don't touch it and only change variables ending in _mult

Here are some more details on the more complicated/error-prone options

mwms_ship_mult -- this defaults to 2, like the weapons and fighters. Unlike weapons and fighters, 2 is exactly twice as many. But anything more does not scale linearly. So 3 isn't actually 3 times as many because of how the market code for ships is written and I didn't want to overwrite anything inside the base game logic. So as an example, setting this to 1000 will not make there be 1000 more ships, it will actually be around 5 times the number of ships but the game will select many more capital and cruiser class ships. I know this isn't intuitive, it is how the game is written - they didn't design it so I could just come in and slap in a multiplier :)

mwms_many_pick -- this is false by default because conceptually it is complicated and most people won't want to mess with it. If this is false, I try to apply a multiplier to all "picking" numbers when the game engine "picks" what will be in the market. This works mostly linearly for weapons and fighters and hullmods but not for ships. If you set this to true, you can use the "_picks" variables and they will cause the game to iterate through the entire selection process that many times. This does apply a true linear increase but is somewhat more computationally complex. On my super computer it isn't noticeable when picks < 100, but on many lower-end systems it is somewhat heavy when opening the market and especially fleet (ship) screens.

The only reason mwms_many_pick is false is because it makes things run faster and more intuitively for non-modders.

When would I want to set this to true? If you want an absolutely huge amount of ships. Or if you want the selection of weapons to better reflect basic uses (like including more PD weapons and core "strike" weapons etc)

mwms_extra_tankers --this literally means should we spawn extra tankers (fuel tankers) for sale. It doesn't count against the number of ships otherwise available, they are added as 'extra'  -- use this if you never see enough tankers or want a lot of them for some reason. Defaults to false because I've never noticed not being able to find tankers.

Why is there no mwms_hullmods_picks ? Because it honestly doesn't make sense in the context of the code inside the game engine. There is not a prioritized or weighted list for hullmods the way weapons and ships work so I figured I would just use mwms_hullmods_mult in either case (mult vs picks)

After hours inside the game's market generation code, I hope any of that was helpful :) I'm definitely still sane.

As always, please be careful when editing .json files, they need those commas and watch out if you accidentally add spaces or delete a "

License
See the LICENSE in the mod or repo, its the MIT License. I make no promises nor grant warranties.
You can totally use/recreate my mod in part of whole for any non-profit work so long as I am credited. Go wild - make the game better and bring joy to the community :)

Changelog
Spoiler
1.0.1van is for vanilla game and 1.0.1nex is for nexerelin modded game
1.0.1 adds version checker compatibility
[close]
Title: Re: [0.9.1a] Mo' Weapons Mo' Ships
Post by: pedro1_1 on April 13, 2020, 06:47:26 PM
Interesting mod, would be great if we could set the multipliers to a number betwen 0 and 1, since that would help make harder chalange runs...
Title: Re: [0.9.1a] Mo' Weapons Mo' Ships
Post by: Bhdeale on April 14, 2020, 05:52:14 AM
Interesting mod, would be great if we could set the multipliers to a number betwen 0 and 1, since that would help make harder chalange runs...

Yeah unfortunately what I perform is additive only - I didn't want to override the core logic, but that would be the way to do it. I'll definitely consider it as I get better at modding.
Title: Re: [0.9.1a] Mo' Weapons Mo' Ships
Post by: ctuncks on May 07, 2020, 02:48:55 PM
Seems like an interesting mod, especially as you pile up factions and ship selection can become an issue. Quick question though, does the weapon modifier only multiply the number of available weapons or the number of available lines?

For example would it increase the number of light machine guns from 10->20, or add another weapon alongside the LMG 1->2 product lines?
Title: Re: [0.9.1a] Mo' Weapons Mo' Ships
Post by: Chairman Suryasari on October 04, 2020, 01:08:38 PM
Must have for people who already play for hours and wanna to skip the grinding for ships, weapons, hullmods, etc.

10/10
Title: Re: [0.9.1a] Mo' Weapons Mo' Ships
Post by: JustThatGoo on January 01, 2021, 09:59:32 PM
+1 This mod is fantastic when you have 4+ faction mods and/or 4+ content mods!
Title: Re: [0.9.1a] Mo' Weapons Mo' Ships
Post by: Pet_Mudstone on June 22, 2021, 10:51:15 PM
From what I've tested the vanilla version of this mod works fine with 0.95a. However, the Nexerelin version crashes on 0.95a.

[attachment deleted by admin]