Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Planet Search Overhaul (07/13/24)

Pages: [1] 2 3 ... 23

Author Topic: [0.97a] Progressive S-Mods (1.0.0) — gain XP for ships, spend it on S-mods  (Read 224145 times)

float

  • Captain
  • ****
  • Posts: 277
    • View Profile

Changes how hull mods are built in.
 Progressive S-Mods
 

This mod, in short, makes it so you no longer have to spend story points in order to build hull mods into your ships. NPC fleets can have built-in hull mods, so they aren't really as exceptional as, say, being able to disengage freely or "making improvements" to colonies.

Features:

Ships in your fleet gain XP in combat
  • Combat ships gain XP by dealing damage, taking damage, or supporting allied ships during an encounter.
  • Civilian ships gain a percentage of the total XP gained from each engagement.
  • XP gain can be adjusted in the settings -- adjust XP gain or the fraction of total XP that civilian ships get by a multiplicative scalar.
[close]

Spend a ship's XP to build in hull mods
  • Higher OP cost mods cost more XP to build in. Hull mods also cost more to build in on ships with higher base DP cost for their class.
    • By default, this is mostly linear, but can be configured to be any polynomial function of the hull mod's OP cost.
  • Built-in hull mods can be removed. Removing built-in mods refunds a portion of the XP spent.
    • By default, this is 80%, but it can be configured. This feature can also be disabled entirely.
[close]

Use story points to increase the number of S-mods a ship can have
  • Cost depends on ship class (1/1/2/2 by default).
  • Also costs some XP (1000/2000/4000/8000 default for 5/10/20/40 DP cost ships), doubling for each increase.
    • These numbers can be changed independently of the SP settings.
  • This feature can be disabled entirely in the settings.
[close]

Combat XP gain breakdown:

Show
Each enemy ship has a quota of XP that it can give to participating player ships. This number is based on the enemy ship's deployment cost, D-mods, and the amount of hull damage it took during the encounter. The XP is then divided evenly into three categories: attack, defense, and support.

Player ships earn contribution points for each type of contribution. Raw damage values are collected and processed every combat interval -- roughly 2 seconds -- whereby they are turned into contribution points.
  • Attack contribution: A player ship gains attack contribution towards an enemy ship if it dealt the most combined hull and armor damage during a combat interval to that ship. The amount of contribution points gained is just the raw hull and armor damage dealt.
  • Defense contribution: A player ship gains defense contribution towards an enemy ship if it took the most combined shields, armor, and hull damage during a combat interval from that ship. The amount of contribution points gained is the square root of the damage taken.
  • Support contribution: During a combat interval, a player ship gains support contribution towards an enemy ship if it didn't qualify for either attack or defense contribution but still dealt or took damage to or from that ship, as long as the enemy ship took hull or armor damage from a different player ship. The amount of contribution points gained is the log of the total damage dealt and taken.
For each enemy ship and contribution type, the XP that a player ship gains is proportional to its contribution points in that category divided by the total amount of contribution points in that category earned across all player ships.
[close]

Screenshots:

Show





[close]

Notes/Disclaimers:

Show

  • Safe to add to an existing game, not safe to remove once added. However the features can be disabled in the settings.
[close]

Credits:
Show

chdcl: For writing the 0.11.0 revamped UI and some additional code snippets
[close]

Version history:

Show

1.0.0 Here
0.11.3: Here
0.11.2: Here
0.11.1: Here
0.11.0: Here
0.10.2: Here
0.10.1: Here
0.10.0:
Major features:
- Ships that exceed the default build-in limit now incur a flat stacking DP cost penalty. Default is 8% of base DP per additional S-mod. Doesn't affect maintenance or recovery costs. Also applies to NPC fleets that exceed their limit.
- Add support for enhancing existing built-ins

Other:
- "no_build_in" is no longer ignored by default in the mod settings
- Change XP costs to be based on default deployment point values rather than modified ones
- Add support for ships that start with more s-mods than usually allowed, setting the initial limit accordingly
- Replace "show all" with "show recent" that shows the last 10 recently built-in hull mods (on any ship)
- Show s-mod bonuses and penalties in the build-in and remove screens
- Reduce default base XP cost to increase S-mod limit by 20%, but increase the scaling by 25%
- Fix issue with "Maximum of 2 non-built-in 'logistics' hullmods" preventing build-in
- Fix issue where default fleet inflater would ignore average s-mods parameter due to no_build_in rule being added to every hull mod
0.9.0:
- Change Starsector version to 0.96a-RC6, make sure nothing broke
- Change hull mod selection interface to use the new buttonPressed callback rather than binary searching on every list item every frame.
- Change temp ship name for hull mod compatibility checking to backing fleet member name
0.8.7:
- Now sets every hull mod to NO_BUILD_IN on game start rather than setting max-built-in-mods to -999. This should fix issues with i.e. extreme modifications (but note that it no longer grays out the build in button on the refit screen).
- Fix: no longer ignores the no_build_in field in the mod settings
- Small fix for Sutopia's Concord mod
- Changed the ship-spawning method AGAIN
0.8.6:
- Fix: bug where ship-spawning method couldn't be found on Linux versions of the game. Reverts to the previous spawnShipOrWing in this case.
0.8.5:
- Fix: A bug where post-battle XP gain text wasn't being displayed properly, specifically when the player had no civilian ships in their fleet.
0.8.4:
-Added console commands
    -PSM_AddShipXP, PSM_AddShipXPAll, PSM_ClearShipData, PSM_ClearShipDataAll

-Rewrite the build-in selection interface (again)
    -Now checks for canBeAddedOrRemovedNow
    -The hull mod applicability checks are now tested on a ship that is spawned using a different method -- should in theory be more accurate

-All combat ships now gain 0.025 of the total XP gain after an engagement. Civilian ships still gain 0.05 of the total amount, as before.
    -This XP is also given for auto-resolve pursuits. In this case the combat ship XP gain is boosted to 0.1 of the total XP that would have been gained had the player pursued manually
    -Individual ship XP is not given for auto-resolve pursuits.

-Removed the legacy engagement listener that counted contribution based only on hull damage.

-Fix: ships with the civ-grade hull mod and without militarized subsystems now count as civilian ships even if they have weapons or fighters fitted.

0.8.3: Here
0.8.2: Here
0.8.1: Here
0.8.0: Here
0.7.1: Here
0.7.0: Here
0.6.4: fix author name in mod_info.json, add version files for Nexerelin compatibility
0.6.3: initial release
[close]
« Last Edit: April 04, 2024, 11:25:01 AM by float »
Logged

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: [0.95a] Progressive S-Mods (0.6.4)
« Reply #1 on: November 21, 2021, 12:06:30 AM »

Looked at the code and really liked what I saw. Also this idea feels like the most elegant solution to smod power creep other than straight up disabling smods.

Quote
By default, cost increases by 2 for each build-in slot, but it can be configured to either increase by or be mulitplied by a specified number.

Could you make default to match vanilla? When you use story points to increase industry it doubles the next upgrade. So 1, 2, 4, 8,..., (smods-1)^2.

Also a screenshot of your picker delegate in action would be great.
« Last Edit: November 21, 2021, 12:08:38 AM by Jaghaimo »
Logged

float

  • Captain
  • ****
  • Posts: 277
    • View Profile
Re: [0.95a] Progressive S-Mods (0.6.4)
« Reply #2 on: November 21, 2021, 11:07:46 AM »

Could you make default to match vanilla? When you use story points to increase industry it doubles the next upgrade. So 1, 2, 4, 8,..., (smods-1)^2.

Also a screenshot of your picker delegate in action would be great.

Thanks for the feedback, I actually had the SP point cost set to grow exponentially for a long time, then changed it to linear just to test it and never bothered to change it back. I'll go back to doubling it, but since it's literally changing one character in mod_settings.json, I'll wait for more substantial modifications before pushing out a new version.

And good call on the screenshots, I'll add those.
Logged

Caymon Joestar

  • Commander
  • ***
  • Posts: 158
    • View Profile
Re: [0.95a] Progressive S-Mods (0.6.4)
« Reply #3 on: November 22, 2021, 03:03:55 AM »

I added this mod because it seems a interesting take on building in smods. But the xp gains are slow as hell.

Now it could be because I chose a pirate run this time around and been stuck with bad ships but around the start, the xp gain is so slow it's not even funny. I haven't been able to smod even 1 hullmod in because the xp gain is so damn slow.

My recommendation is that:

1. Double the xp gains
2. Give all ships a percentage of xp gains in a battle not just civilian ships, you can give civilian ships a even bigger percentage

Also I believe the xp cost for hullmods be the same for all ships of a class.
Logged

float

  • Captain
  • ****
  • Posts: 277
    • View Profile
Re: [0.95a] Progressive S-Mods (0.6.4)
« Reply #4 on: November 22, 2021, 12:15:23 PM »

I added this mod because it seems a interesting take on building in smods. But the xp gains are slow as hell.

Now it could be because I chose a pirate run this time around and been stuck with bad ships but around the start, the xp gain is so slow it's not even funny. I haven't been able to smod even 1 hullmod in because the xp gain is so damn slow.

My recommendation is that:

1. Double the xp gains
2. Give all ships a percentage of xp gains in a battle not just civilian ships, you can give civilian ships a even bigger percentage

Also I believe the xp cost for hullmods be the same for all ships of a class.

Thanks for the feedback! I'm a bit concerned about the "so slow it's not even funny" comment since my experience wasn't the same at all -- I actually thought the XP gain rate might be a bit too fast, at least for larger ships. My flagship in my current playthrough is floating 150k or so XP with nothing to spend it on, though granted it is a SO modded ship that has temporal shell so it's probably a bit OP. My other AI piloted ships (besides Radiant) have 2 or 3 S-mods each, which they were able to obtain after several battles. Some things to consider:

  • Are your ships dealing hull damage to the enemy ship? The combat results API only tracks hull damage, so hitting shields and armor doesn't count.
  • Are you fighting heavily D-modded ships? The XP gain is based on the supply recovery cost of the enemy ship, so for example a 5 D-modded ship will only give ~30% of the XP of a pristine one.

I like your second suggestion, since I do find that a lot of ships like to play the support role where they don't really do a lot of hull damage. But I think being able to have a combat ship idle in your fleet gaining XP without even being deployed is a bit much.

Right now it's 36 XP per DP worth of damage, so for example you would be able to build in a ~1k cost hull mod (cost of flux distributor on a wolf) after dealing about 30 DP worth of damage. Hmm... 30 DP may be a bit much for a frigate. Ok, I think I'll make the following changes:

  • I'll substantially lower the XP costs for frigates and less substantially lower the costs for destroyers.
  • I'll add a minimum contribution fraction -- if a ship even scratches the hull of an enemy ship, it will gain XP as if it had done 15% of that ship's hull as damage.
  • I'll make it so enemy ships will give at least 60% of their base deployment cost's worth of XP regardless of how many D-mods they have.

As for your last point, I'm not sure if it's meant to be a suggestion or bug report? The reason the XP costs are scaled by DP cost is mainly for smaller ships. A kite, for example, shouldn't need the same amount of XP to build in a hull mod as a hyperion, even though they are technically both frigates. This is why flux distributor costs 400 XP on a kite but 3000 XP on a hyperion.
« Last Edit: November 22, 2021, 12:18:43 PM by this_is_a_username »
Logged

Caymon Joestar

  • Commander
  • ***
  • Posts: 158
    • View Profile
Re: [0.95a] Progressive S-Mods (0.6.4)
« Reply #5 on: November 23, 2021, 01:50:52 AM »

I added this mod because it seems a interesting take on building in smods. But the xp gains are slow as hell.

Now it could be because I chose a pirate run this time around and been stuck with bad ships but around the start, the xp gain is so slow it's not even funny. I haven't been able to smod even 1 hullmod in because the xp gain is so damn slow.

My recommendation is that:

1. Double the xp gains
2. Give all ships a percentage of xp gains in a battle not just civilian ships, you can give civilian ships a even bigger percentage

Also I believe the xp cost for hullmods be the same for all ships of a class.

Thanks for the feedback! I'm a bit concerned about the "so slow it's not even funny" comment since my experience wasn't the same at all -- I actually thought the XP gain rate might be a bit too fast, at least for larger ships. My flagship in my current playthrough is floating 150k or so XP with nothing to spend it on, though granted it is a SO modded ship that has temporal shell so it's probably a bit OP. My other AI piloted ships (besides Radiant) have 2 or 3 S-mods each, which they were able to obtain after several battles. Some things to consider:

  • Are your ships dealing hull damage to the enemy ship? The combat results API only tracks hull damage, so hitting shields and armor doesn't count.
  • Are you fighting heavily D-modded ships? The XP gain is based on the supply recovery cost of the enemy ship, so for example a 5 D-modded ship will only give ~30% of the XP of a pristine one.

I like your second suggestion, since I do find that a lot of ships like to play the support role where they don't really do a lot of hull damage. But I think being able to have a combat ship idle in your fleet gaining XP without even being deployed is a bit much.

Right now it's 36 XP per DP worth of damage, so for example you would be able to build in a ~1k cost hull mod (cost of flux distributor on a wolf) after dealing about 30 DP worth of damage. Hmm... 30 DP may be a bit much for a frigate. Ok, I think I'll make the following changes:

  • I'll substantially lower the XP costs for frigates and less substantially lower the costs for destroyers.
  • I'll add a minimum contribution fraction -- if a ship even scratches the hull of an enemy ship, it will gain XP as if it had done 15% of that ship's hull as damage.
  • I'll make it so enemy ships will give at least 60% of their base deployment cost's worth of XP regardless of how many D-mods they have.

As for your last point, I'm not sure if it's meant to be a suggestion or bug report? The reason the XP costs are scaled by DP cost is mainly for smaller ships. A kite, for example, shouldn't need the same amount of XP to build in a hull mod as a hyperion, even though they are technically both frigates. This is why flux distributor costs 400 XP on a kite but 3000 XP on a hyperion.

Yes, Ships that can get kills will have a way easier time getting the xp (Especially a SO temporal shell ship/Radiant) However, since you explained how it tracks hull dmg for xp. That explains a whole lot and honestly, a glaring flaw.

If it only counts hull dmg, that means only the ships that can reliably secure the kills will get most of the xp, Meaning more supporter fitted ships or ships that cant get the kills as often will have a much harder time getting the xp needed to even get 1 smod. Meanwhile those who can get the xp will be stuck with more xp than they know what to do with If you dont want to put so many story points into expanding the number of smods a ship can have beyond 3 (With the skill)

I wasn't fighting too many heavily dmodded fleets, if anything, most of the fleets I was fighting maybe had between 0-3 dmods on average.

It really isn't, depending on the combat ship, it might be the only way for the ship to get xp needed to smod the hullmods needed for them to become good enough to use in actual combat. Like, Have you tried using some of the Junker/ Shieldless ships? Maybe a extreme example but I tried using the mongrel from underworld and it could not secure a single kill even with makeshift shield gen installed so it couldn't get anywhere near enough xp for it to get even 1 smod. I imagine frigates/ some destroyers going into the endgame would also struggle to get the xp needed also.

That said, The changes you made might help alleviate this to some degree.

It was a suggestion since it made more sense for it to be the same all around rather than some needing way more than others. Sure it would make adding a smod onto ships like the kite cost slightly more but it would help every other frigate.


Also another suggestion, since you mentioned that some of your ships had more xp than you knew what to do with, would it be possible to add a one or 2 time xp option way of expanding the smod limit?
Logged

Amoebka

  • Admiral
  • *****
  • Posts: 1421
    • View Profile
Re: [0.95a] Progressive S-Mods (0.6.4)
« Reply #6 on: November 23, 2021, 04:54:19 AM »

I'm not familiar with how combat analytics works, but would it be possible to split hull damage XP between all friendly ships within a certain range, regardless of who made the shot? This would allow support ships to level at about the same speed as damage dealers, while still discouraging deploying ships to soak up xp (as they would both need to be close to danger to level and take xp away from other ships). Flagships would also still level faster than the rest because they are usually somewhat isolated.
« Last Edit: November 23, 2021, 04:58:03 AM by Amoebka »
Logged

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: [0.95a] Progressive S-Mods (0.6.4)
« Reply #7 on: November 23, 2021, 05:30:03 AM »

It registers its own combat listeners and tracks damage (dealt and received) that way.
Logged

float

  • Captain
  • ****
  • Posts: 277
    • View Profile
Re: [0.95a] Progressive S-Mods (0.6.4)
« Reply #8 on: November 23, 2021, 10:44:17 AM »

I'm not familiar with how combat analytics works, but would it be possible to split hull damage XP between all friendly ships within a certain range, regardless of who made the shot? This would allow support ships to level at about the same speed as damage dealers, while still discouraging deploying ships to soak up xp (as they would both need to be close to danger to level and take xp away from other ships). Flagships would also still level faster than the rest because they are usually somewhat isolated.

I think this would in theory be possible, just not using the CombatDamageData API. I would have to create an EveryFrameCombatPlugin and collect the damage data manually. The benefit of this is of course much more versatility, but other than being a lot of extra work, there is another major drawback.

Right now since I’m using an engagement result listener there is no additional computation being done during combat — only after the end of an engagement. Now suppose I were to change this to an EveryFrameCombatPlugin. There are mods that already use EveryFrameCombatPlugins to collect damage data, i.e Starship Legends, Detailed Combat Results, and possibly Fleet Action History. If you add all of them, including this mod and the base game combat tracker you’d end up with 4 or 5 combat analytics plugins, each one doing some variant of the same thing. That’s a lot of unnecessary computation in the part of the game that most desperately needs to be optimized.

Then again it’s possible this additional computation is negligible compared to all the stuff the base game is already doing during combat. Perhaps someone who’s profiled their own EveryFrameCombatPlugin damage tracker can let me know exactly how much extra computation it adds.
Logged

Jaghaimo

  • Admiral
  • *****
  • Posts: 661
    • View Profile
Re: [0.95a] Progressive S-Mods (0.6.4)
« Reply #9 on: November 23, 2021, 11:03:01 AM »

1. One way to do it would be: check if mod A is present, if yes get its listener and take info from it. If not present, try another mod that provides a listener. If none are present, register and use the own listener.

Now, to make your mod not dependent on all of those mods, I'd abstract out data fetching in the form of an interface, and build a tiny jar that implements said interface using one of the listeners from the mods you've mentioned.

This complicates the mod distribution as you'd be distributing main mod + data fetching submods and the player would need to pick the correct jars (or you could bundle and default to your in-house implementation and let implementation swapping be optional).


There is probably a better way, which is to all those mods as dependencies at compile time only. On application load check which mods are load, and instantiate appropriate wrapper class (each implementing same interface) or register your own listener. JRE will load classes as they are demanded, so unused implementations that depends on not-loaded mods will not crash the game.

2. The other way is to just bundle your own listener. Performance of your listener shouldn't be an issue as you will be only incrementing values in some small, transient map (ship, stats).
« Last Edit: November 24, 2021, 04:30:07 AM by Jaghaimo »
Logged

float

  • Captain
  • ****
  • Posts: 277
    • View Profile
Re: [0.95a] Progressive S-Mods (0.6.4)
« Reply #10 on: November 25, 2021, 01:25:50 PM »

1. One way to do it would be: check if mod A is present, if yes get its listener and take info from it. If not present, try another mod that provides a listener. If none are present, register and use the own listener.

Now, to make your mod not dependent on all of those mods, I'd abstract out data fetching in the form of an interface, and build a tiny jar that implements said interface using one of the listeners from the mods you've mentioned.

This complicates the mod distribution as you'd be distributing main mod + data fetching submods and the player would need to pick the correct jars (or you could bundle and default to your in-house implementation and let implementation swapping be optional).


There is probably a better way, which is to all those mods as dependencies at compile time only. On application load check which mods are load, and instantiate appropriate wrapper class (each implementing same interface) or register your own listener. JRE will load classes as they are demanded, so unused implementations that depends on not-loaded mods will not crash the game.

2. The other way is to just bundle your own listener. Performance of your listener shouldn't be an issue as you will be only incrementing values in some small, transient map (ship, stats).

Yeah I think that's a bit overkill especially since I would have to write my own listeners anyway. And some of the other mods don't have publicly available code, so I'd still be limited in what I'd be able to do with them. Ideally I'd like to give XP for attack, support, and defensive roles, so it seems like the next step for this mod is to do just that.

Also another suggestion, since you mentioned that some of your ships had more xp than you knew what to do with, would it be possible to add a one or 2 time xp option way of expanding the smod limit?

Ahh I missed this suggestion, my bad. The reason for requiring SP to expand the S-Mod limit is because going over the limit is something that I would consider an "exceptional action" in the context of the game, which is in line with other SP options. Although, I am considering similar ideas, such as starting the build-in limit at 0 (1 with special modifications) and having to pay XP to unlock the first 2 slots. Or having to pay both XP and SP to unlock slots past the limit. Or increasing the XP cost with each subsequent unlock (but reducing the base costs to compensate), but that's functionally identical to paying both XP and SP to unlock additional slots.
« Last Edit: November 25, 2021, 01:31:57 PM by this_is_a_username »
Logged

tantananan

  • Ensign
  • *
  • Posts: 48
    • View Profile
Re: [0.95a] Progressive S-Mods (0.7.0)
« Reply #11 on: November 25, 2021, 10:58:59 PM »

is there a limited number of choices when you choose a smod? like the screen when you choose the officer skill on level up? or can you choose from all of the hullmods you have available?
Logged

float

  • Captain
  • ****
  • Posts: 277
    • View Profile
Re: [0.95a] Progressive S-Mods (0.7.0)
« Reply #12 on: November 25, 2021, 11:40:31 PM »

is there a limited number of choices when you choose a smod? like the screen when you choose the officer skill on level up? or can you choose from all of the hullmods you have available?

You can choose from all of the hull mods you have unlocked (and are applicable to the ship in question). If you're wondering why the selection in the screenshot is so small, it's because by default the build-in interface only shows you the hull mods that are already installed on the ship. In the latest version you can click "show all" to select from all the hull mods you have unlocked, so hopefully that clears up some confusion if there was any.

Edit: I've modified the screenshots to the newest version.
« Last Edit: November 25, 2021, 11:54:50 PM by this_is_a_username »
Logged

5thYL

  • Ensign
  • *
  • Posts: 10
    • View Profile
Re: [0.95a] Progressive S-Mods (0.7.0)
« Reply #13 on: November 26, 2021, 10:02:52 AM »

It'd really help if there's an option to give all ships in fleet exp regardless of involvement in battle

My Ed's shipyard's Dalmatian, Basenji
Diable's Shears
and base game's Phantoms

all are not ships but none of them will ever go into battle.

I mean, unless we really need to commit to some ramming maneuvers with our phantoms...
Logged

hydremajor

  • Captain
  • ****
  • Posts: 461
    • View Profile
Re: [0.95a] Progressive S-Mods (0.7.0)
« Reply #14 on: November 26, 2021, 10:14:33 AM »

Well....THERE'S something I was hoping for but didn't know if it was possible, to me it adds the flavor of a ship slowly taking on a life of its own as its crew repairs maintains and slowly modify the ship throughout its life

reminds me a lot of stuff like Hero Mechs in battletech, nigh legendary mechs slowly but surely customized in such a way the mech took on a life and legend of its own

anyways, will try...
Logged
Pages: [1] 2 3 ... 23