Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  


Starsector 0.95.1a is out! (12/10/21); Blog post: Hostile Activity (09/01/22)

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Bhdeale

Pages: [1] 2
Modding / Re: [0.9.1a] Red Legion
« on: June 04, 2020, 07:14:31 AM »
COVID-19 has impacted my life baddly and it will still be weeks before I can sit down to work on modding. I intend to finish MoWeaponsMoShips first as it is near completion and I can have it posted to the main index and return my attention to Red Legion.

Thanks for your patience.

Modding / Re: [0.9.1a] Mo' Weapons Mo' Ships
« 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.

Modding / [0.9.1a] Mo' Weapons Mo' Ships
« on: April 13, 2020, 02:44:04 PM »
Mo' Weapons Mo' Ships

Vanilla Download:
Nexerelin compatible Download:

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.



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.

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.


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

start with all open markets (there may be a lot of these)
and replace it with

then do the same for military markets
and replace it with

finally do it for black markets
and replace it with

start with all open markets (there may be a lot of these)
and replace it with

then do the same for military markets
and replace it with

finally do it for black markets
and replace it with

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 "

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 :)

1.0.1van is for vanilla game and 1.0.1nex is for nexerelin modded game
1.0.1 adds version checker compatibility

I'm no windows genius or anything, but you may be running into a permissions problem or file lock problem.

You could try running the ship editor program with elevated privileges (you might want to make a backup of your ship data file just in case)
Right click on the executable -> Run As Administrator

You could see if another program has locked the file (programs do this when they want to exclusively use a file sometimes) by closing other programs or just restarting your computer.

You may also need to check the file is editable, go to your ship_data and right click -> Properties -> Uncheck the "Read-only" box

Hope any of this helps :)

Modding / Re: [0.9.1a] Red Legion
« on: April 10, 2020, 08:36:33 AM »
Here you are @Nick XR, may it fuel your nightmares :D

In all seriousness I'm working on the third star system and reskins of my own ships and a couple vanilla ones which will use the Red Legion Engineering hull mod. I'm also working on the Legends integration which again, the mod mostly already does on its own because it's awesome :)

Modding / Re: [0.9.1a] Red Legion
« on: April 08, 2020, 03:09:06 PM »
1.1.3 is released!
First two ships are in the game, each with 4 variants. Cleaned up my artwork on both ships, still want to revisit once I've had more practice
Save game compatible, it may take up to 30 in game days before new ships show up
Note however the changed to Tradewind won't show up unless you start a new game

Modding / Re: [0.9.1a] Red Legion
« on: April 03, 2020, 01:45:41 PM »
Neat. It could use more marketing material...
I'm open to suggestions, I'm not very good at marketing  ;D

So I'm not a very good artist but I did finally iterate enough times trying to follow some actual artists and made the Blood Seeker. I'll try to cut a release once I do some more work on vanilla, blueprints, variants, and re-iterate on cleaning up the Antagonist I made.

Spent a lot of time iterating from a basic outline, into sections, then adding some shading, highlighting, and then darkening and lightening different portions consistently across sections to get them to appear to have lighting & depth. It is a far cry from the Wolf I've spent hours staring at now, but I'm finally proud enough to move on to make another ship :)

Mods / Re: [0.9.1a] Iron Shell 0
« on: April 01, 2020, 06:40:42 PM »
This sounds fun :)
Also a fun expansion of the timeline - it is good to know what/why a faction is fighting for

Modding / Re: [0.9.1a] Red Legion
« on: April 01, 2020, 06:37:19 PM »
I did it! I made ruined hacked together my first ship!

I'm way too proud mostly because it and its 4 variants spawn in the game, and like work and mostly look decent while they do it :D

I discovered that Krita is a step up from my experience but not as complex and alien to me as GIMP was. Worked pretty well! There are by far the most examples and tutorials about ship-building and ship design.
David Baumgart, the artist who made the existing Starsector ship sprites has a bunch of cool you tube videos and blogs on their official site for example Was very helpful and I'm still working through these many guides!

There is also an unofficial discord I just discovered (I'm slow, okay!)

Also you can (obviously only those included so far) check ship names to try and be more unique and avoid name collisions/confusions with other mods via

Anyhow the Antagonist is an edited original Kite (has the same blues as many high-tech ships) and so I moved the ...intakes? up towards the front, removed the outer most pair of engines, and then cut out the wings to make a smaller hull (as many high-tech are vs low-tech) and then edited the area around the engines and some of the brighter spots to have the orange/rust/brown of low-tech where integration has occurred or other downgrades. Then I literally slapped on some large low-tech looking braces for missile hard-points so it can be used as a strike-craft! This captures really well what many of the Red Legion Auxiliary ships will be - a sleek hull with big blocky chunks added on.

I've got a bunch of partially made sprites but I need to iterate a lot more on them before I'm going to be happy. I did really enjoy spawning 20 antagonists and flying them in the simulation against a single hammerhead :D I felt proud enough to share the antagonist since its mostly a sprite-edit with a little recoloring but now I know how to make ships, variants, and include them in the campaign

Modding / Re: [0.9.1a] Red Legion
« on: April 01, 2020, 12:26:51 PM »
Downloading this mod now. Adding this mod to support Hyperion Systems with Nexrelin, and possibly help you on making ships or market/encounter music.
Hey cool! I certainly wouldn't mind getting some help with music. Once I've made some ships and establish a theme I could accept some assistance with making more :)

Modding / Re: [0.9.1a] Red Legion
« on: March 31, 2020, 06:57:32 AM »
Found some bugs I'm working on for 1.1.2
  • Tariffs are coming out to 5% because I was trying to modify vanilla tariffs but Nexerelin is already doing this (its why 30->18) so I need to play nice when modded
  • I don't think the Tri-Tachyon music fits so I'll be switching to something else
  • Integration with Starship Legends works but I need to tweak values some more after playing with them. Such a good mod :D
  • I need to switch player start from White citadel to Argon Prime as it is slightly more convenient and a little less confusing. I was worried people might miss the station but was a little less ideal (free storage, smaller market, not regional capital, etc)
  • Size adjustment some more, looked at more vanilla systems and will be trimming down Argon a little more to be less taxing to traverse
  • Special Forces names for Nexerelin integration
  • I was going to release Tradewind system but it is ... lacking so I'll make another pass on it

I also wanted to find a way to make a "gun runner" market condition which increased weapon spawns. This lead me down a merry chase but ended up with me finding a small bug (or me looking at old code, not sure which yet) in Nexerelin which also overrides vanilla markets to increase weapon spawns for the player. With so many mods it seems like there should be a configurable multiplier on the amount of weapons and fighter chips spawned, but because of the way the actual code works there isn't, it requires some custom logic. Nex already had logic to add ~50% more stuff but it wasn't working when I extended and changed it myself.

The post on Nexerelin page about the logic bug

I'm hoping to either make a separate utility mod which extends Nex, or perhaps Histidine will add it to Nex directly, but I was playing with how weapon market logic works and figured I'd write it here for the curious.

First go look at starsector-core included src ... \campaign\submarkets\ and you'll see it actually does ship and weapon spawns only when the player opens a market and looks at it. If you wander over to commodities elsewhere in the core, you'll see there is a "meta" item called Hulls and Weapons which is what markets make and trade in the economy. They are an abstraction which is part of determining things like Fleet size and money, but not part of spawning weapons and ships. Some of these commodities inform spawns, like fuel in the market means more tankers (weighted 20 to 40 based on amount).

float tankers = 20f;
CommodityOnMarketAPI com = market.getCommodityData(Commodities.FUEL);
tankers += com.getMaxSupply() * 3f;
if (tankers > 40) tankers = 40;

But you'll see weapons and ships actually just get added (to the "cargo" which is what is for sale in the market itself). You'll also note that, let's say a large military market of size 10 would have a lot of weapons? You're right, but look at how the distribution works by checking out "addWeapons" in (same campaign\submarkets folder) and you'll see what I mean.

int num = min + itemGenRandom.nextInt(max - min + 1);

if (num > 0 && !pd.isEmpty()) {
if (num > 0 && !kinetic.isEmpty()) {
if (num > 0 && !missile.isEmpty()) {
if (num > 0 && !nonKinetic.isEmpty()) {
if (num > 0 && !strike.isEmpty()) {

for (int i = 0; i < num && !picker.isEmpty(); i++) {

This means if you have a tiny market and only have 3 "weapons" to "pick" from, it will first pick a PD weapon, then a kinetic, then a missile and stop. If you have 10 "weapons" to "pick" from you will get one of each of the 5 categories, and then 5 picks from your "factions" list, be it the faction you are or say the black market which has random ones in it plus pirates.

This means if all you do to increase the number of weapons for sale is double the "weapons" you'll mostly be getting tons more from the faction list - which is possibly what you want, but I found it was a bit better to run through the "addWeapons" logic a second time. A small market with only 3 picks would end up with more PD, Kintetic, and Missile which makes sense to me - a small market has limited inventory focused on necessary functions and not on other weapons. Now lets say a Huge military market with 14 picks gets doubled, so you are sort of ensuring additional baseline weapons like PD, Kinetic, Strike, etc get made and THEN you add more factions weapons too. This also makes sense to me that a large market needs to add variety+volume to their baseline weapons like PD and such.

My beef with playing with 70 mods is that when I go to market, it will have some random, not generically functional weapons sometimes and then lots of neat, very specific faction weapons people have added. When starting a new game with low resources, it is very hard to outfit your ships. While there is some joy in the challenge of "I have 15 EMP weapons and some 1 OP HMGs, let's pray for success!" this was also frustrating. I figured by "doubling" or "trippling" the number of weapons spawned it would capture a little more variety and be a little more functional, less frustrating.

It was interesting to learn that, for the most part, commodity availability had nothing to do with weapon spawns. Also that the weapons are not traded (since they are not actually consumed by NPC factions) they exist only for the player. IE PD weapons aren't in high demand somewhere they aren't being made. It would be an absolute nightmare to make a simulation of that - imagine what factions would need to do if they didn't have their "needed" weapons for their loadouts? You'd be simulating a player and that's a crazy amount of code and logic for something that is solved much more abstractly here. I was mostly just surprised that there was no scaling factor, but when you're making a game you don't anticipate what a hoard of modders will do to your game :D

Anyhow, TLDR weapons are more and less complicated than I thought, just need to work out what to do. I'm hoping a real modder like Histidine will actually add this instead of what I hacked together lol

As a consequence of trying to override logic in Nex, I had to extend it and then ran into load-order problems. "Red Legion" comes after Nexerelin alphabetically so my mod overwrites were not working at first. Here's a short write up of what I learned :)

Mod load-order its just reverse alphabetical, IE higher ones (A) override anything lower (Z) and with both me and Nexerelin trying to overwrite the same vanilla submarkets the winner was whoever was higher in the alphabet. It is amazing all these mods work together because this means they are not colliding on any IDs in a critical place, which also explains why some libraries have ZZ in their name to load first so other mods can always depend on them (Audio, GraphicsLib).

This is certainly pretty intuitive since most mods add their own content and there are only a few major "change all the stuff" mods. Certainly prevents the user from needing to order mods, or from the code needing to self-analyze. Just surprising coming from NexusModManager and all the Skyrim/Fallout4 modding which does a lot (not perfect or complete) to and auto-detect and auto-sort and present collisions to the user. Obviously that was a much more massive game and community, so props to StarSector and its community for keeping this all organized and working pretty easily :D

Hey, I think I found a small logic bug in Nexerelin.

I was looking for a way to add a multiplier to the number of weapons+fighters offered in markets globally and saw Nexerelin already does this by overriding the vanilla markets. So I tried to play around with the same idea in my own mod and realized there is a logic error.

For example the
Code Snippet:
package exerelin.campaign.submarkets;

import com.fs.starfarer.api.impl.campaign.submarkets.OpenMarketPlugin;
import com.fs.starfarer.api.util.Misc;

public class Nex_OpenMarketPlugin extends OpenMarketPlugin {
   public void updateCargoPrePlayerInteraction() {
      if (okToUpdateShipsAndWeapons()) {
         // this was already done in super method, so what we're doing is doubling weapon/fighter counts
         int weapons = 2 + Math.max(0, market.getSize() - 3) + (Misc.isMilitary(market) ? 5 : 0);
         int fighters = 1 + Math.max(0, (market.getSize() - 3) / 2) + (Misc.isMilitary(market) ? 2 : 0);

         // just kidding, it's only 50% more
         //weapons /= 2;
         //fighters /= 2;

         addWeapons(weapons, weapons + 1, 0, market.getFactionId());
         addFighters(fighters, fighters + 1, 0, market.getFactionId());

The problem is when you call super.updateCargoPrePlayerInteraction() you will cause the vanilla market to set sinceSWUpdate = 0f; which means you will always evaluate if (okToUpdateShipsAndWeapons()) to false

Since you need to accommodate the vanilla stockpile update you still need to call super before you modify the cargo (ie weapons and fighters) so I did this as an example:
public class RL_OpenMarketPlugin extends Nex_OpenMarketPlugin {
    public void updateCargoPrePlayerInteraction() {
        if (okToUpdateShipsAndWeapons()) {
            super.updateCargoPrePlayerInteraction(); //must do this first or anything you add isnt real!
            // this was already done in super method, so what we're doing is doubling weapon/fighter counts
            int weapons = 2 + Math.max(0, market.getSize() - 3) + (Misc.isMilitary(market) ? 5 : 0);
            int fighters = 1 + Math.max(0, (market.getSize() - 3) / 2) + (Misc.isMilitary(market) ? 2 : 0);
            for (int x = 1; x < submarketShared.getMinWepMult(); x++){
                Global.getLogger(this.getClass()).info("flapjack " + x);
                addWeapons(weapons, weapons, 1, market.getFactionId());
                addFighters(fighters, fighters, 1, market.getFactionId());
        else {
            super.updateCargoPrePlayerInteraction(); //this makes sure the normal commodities get worked out

Ignore my flapjack bit - I was working on making a global multiplier that could be loaded from a config.

It also is a bit hacky for me to try to override your markets in Nexerelin because we would both be overiding the vanilla markets and it was load-order dependent on who's mod applied over who's. (I had to change my name to appear higher in the alphabet for load-order). Would you consider taking a config variable as a multiplier for weapons/fighters on a market content like this? I wanted to globally double (or triple) weapon spawns since I've been playing with so many mods I could never find the content I wanted in game with such large pools to draw from randomly.

I also saw you had marked this (and Nex_BlackMarketPlugin) as deprecated. Did you find a better way to override vanilla markets?

Let me know if I can better explain myself, I hope this is helpful! Your mod is awesome and thanks for all the incredible work you've put in over the years!

Modding / Re: [0.9.1a] Red Legion
« on: March 29, 2020, 09:18:19 AM »
Yay 1.1.0 release - it is save-game compatible but you'd do best to start a new one to explore my mod since I've integrated Nexerelin support

It wasn't too hard, fortunately Nexerelin itself makes some good examples and is fairly self-explanatory. It helps that the Red Legion is a mash-up of pirates and high-tech so I have examples to pull from Tri-tachyon faction. Looked at Anvil, HMI, and Interstellar Imperium for some examples of how they integrated with Nexerelin, and II had a custom-start.

The fleets for a nexerelin start are a mix of pirate, high and mid tech with some utility thrown in. Again all vanilla for now.

The nexerelin custom start isn't very special yet (I played with fixed starting levels and such but there isn't a lot for me to add yet) but gives you an AI core and a large fleet to represent your time in the Crimson Guard and being rewarded by the newly formed Red Legion. I'd like to use it to make a special intel mission line and perhaps a more specialized high-level starting scenario.

Anyway, next up I need to integrate with Vayra's Wow that was easy, the mod basically did most of it for me :D I just had to add a little config and wanted to try having the RedLegion work as a raider faction and play with some of those extra options. Also added a unique bounty to see if I did it right. Would like to add more in the future :)

Mods / Re: [0.9.1a] Commissioned Crews 1.73
« on: March 27, 2020, 02:30:18 PM »
This is a really cool and flavorful mod. I was able to get it working in my mod without too much trouble - I did have to work out how to make some effect to apply but that's part of any hullmod, I just hadn't made any before.
Your instructions were pretty good, thanks for all your hard work!

Modding / Re: [0.9.1a] Red Legion
« on: March 27, 2020, 11:28:14 AM »
First Release! Woot woot
In all fairness it is just the faction, a lot of text/descriptions, and one custom star system for now :D But I got it working with version checker and vanilla well enough. Yay!

Next up:
  • Nexerelin Support Done!
  • Commissioned Crews Support Done!
  • Tradewind star system
  • Adding some high-tech vanilla ships to fleet/markets
  • Adding custom market to Argon Prime & White Citadel to include expensive Crimson and Hell ships
  • Add my first ship variants/hulls
  • Resolve feedback and bug fixes

Pages: [1] 2