Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Weapon range reworks and weapon MutableStatsAPI implementation  (Read 877 times)

tomatopaste

  • Captain
  • ****
  • Posts: 306
    • View Profile

One of the problems with modded ship design is that energy weapons require a lot of intelligent design to be viable when compared to ballistics, which are generally accepted to be baseline stronger weapons because vanilla only has to balance them around the three ship design archetypes and their mounting options. My suggestion is to rebalance vanilla ballistic weapon ranges until they are as strong as energy weapons as a baseline.

The kicker is to create a MutableStatsAPI attached to the weapons on mounts baked into a ship. If vanilla ballistic mounts had an e.g. +25% range bonus on attached weapons by default then the present balance would be conserved, but it would create more options for modded ship designs that utilise many more hybrid/synergy mounts than vanilla and want to offer a more balanced choice between mounting viable energy and ballistic weapons, based on the unique characteristics of a particular weapon mount. This could include modifiers from the vanilla ship mutable stats like energy/ballistic weapon flux, RoF, recoil etc. etc.

There are a number of solutions to managing multiple mount types with different stat modifications.

Number one is creating a mount_archetypes format file, like hull_styles.
{
   "MYMODPREFIX_STANDARD_BALLISTIC_RANGE":{
      "script":"data.scripts.weapons.mounts.MYMODPREFIX_StandardBallisticRangeMod,
   },
}

Then, a *.ship file might look like this
{
    "bounds": [
        ...
    ],
    ... #and so on

    "weaponSlots": [
        {
            "angle": 30,
            "arc": 180,
            "id": "WS 001",
            "locations": [
                59,
                23
            ],
            "mount": "TURRET",
            "size": "SMALL",
            "type": "BALLISTIC"
            "archetype": "MYMODPREFIX_STANDARD_BALLISTIC_RANGE",
        },
        {
            "angle": -30,
            "arc": 180,
            "id": "WS 002",
            "locations": [
                59,
                -23
            ],
            "mount": "TURRET",
            "size": "SMALL",
            "type": "BALLISTIC"
            "archetype": "MYMODPREFIX_STANDARD_BALLISTIC_RANGE",
        },
        ... #etc etc
    ],
}

Finally, the script MYMODPREFIX_StandardBallisticRangeMod might be something like

public class MYMODPREFIX_StandardBallisticRangeMod extends BaseMountArchetypeMod {
    protected static final float BALLISTIC_MAX_RANGE_PERCENT = 25f;
     
    public void advanceInCombat(float amount, ShipAPI ship, WeaponAPI weapon, String id) {
        float mod = BALLISTIC_MAX_RANGE_PERCENT * ship.getFluxTracker().getFluxLevel();

        weapon.getMutableStatsAPI().getBallisticWeaponRangeMod().modifyPercent(id, mod); //unique mount weapon range goes from +0% to +25% as ship flux level increases
    }
}

This would also open many opportunities for modders that wish to modify weapon abilities individually, especially for unique built-in weapons, that are currently impossible. Weapon mutablestat effects like range could stack additively with ship mutablestat effects from hullmods and the like.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24105
    • View Profile
Re: Weapon range reworks and weapon MutableStatsAPI implementation
« Reply #1 on: May 23, 2021, 08:51:02 AM »

You can do range modification per-weapon, including based on what mount it's in, by having a built-in hullmod (which gives you an opportunity to explain what's going on, in its description!) that does:

ship.addListener(new WeaponRangeModifier() ...);

I don't think ballistic slots giving a blanket increase to range is a workable idea - ballistic weapons are too diverse for that to work out, as are the ships/slots you can mount ballistic weapons in. I think these kinds of things - range increases/decreases for certain slots - necessarily have to be done on a per-ship (and/or perhaps per-weapon) basis.
Logged

Pratapon51

  • Lieutenant
  • **
  • Posts: 96
    • View Profile
Re: Weapon range reworks and weapon MutableStatsAPI implementation
« Reply #2 on: May 23, 2021, 06:22:22 PM »

Been puzzled on trying to figure this one out - how would I specifically, say, buff the range or flux efficiency of only all large ballistic mounts?
Logged

tomatopaste

  • Captain
  • ****
  • Posts: 306
    • View Profile
Re: Weapon range reworks and weapon MutableStatsAPI implementation
« Reply #3 on: May 23, 2021, 08:56:07 PM »

You can do range modification per-weapon, including based on what mount it's in, by having a built-in hullmod (which gives you an opportunity to explain what's going on, in its description!) that does:

ship.addListener(new WeaponRangeModifier() ...);

I missed that, good to know!

I don't think ballistic slots giving a blanket increase to range is a workable idea - ballistic weapons are too diverse for that to work out, as are the ships/slots you can mount ballistic weapons in. I think these kinds of things - range increases/decreases for certain slots - necessarily have to be done on a per-ship (and/or perhaps per-weapon) basis.

The modularity of the suggestion was completely designed for a per-ship and per-mount basis, it was just an example. I think the root issue of ballistic weapons being stronger than energy weapons for equal mounting opportunity still stands though. I think this stems from energy weapons lacking options for anti-shield weapons that can be used in the place of ballistic kinetics. While it works for high tech ships, which are designed with flux reserves and speed in mind, only a couple of specific weapons such as the autopulse or ion pulser can be used as reliable anti-shield to win flux wars.
« Last Edit: May 23, 2021, 08:58:20 PM by tomatopaste »
Logged

SCC

  • Admiral
  • *****
  • Posts: 4141
    • View Profile
Re: Weapon range reworks and weapon MutableStatsAPI implementation
« Reply #4 on: May 23, 2021, 11:12:43 PM »

High-tech has no anti-shield weapons and isn't doing half bad at all in the current update...

ElPresidente

  • Commander
  • ***
  • Posts: 152
    • View Profile
Re: Weapon range reworks and weapon MutableStatsAPI implementation
« Reply #5 on: May 24, 2021, 02:25:58 AM »

Been puzzled on trying to figure this one out - how would I specifically, say, buff the range or flux efficiency of only all large ballistic mounts?

A hullmod. Take a look at large ballistics integration. Only instead of changing OP cost, change flux cost.
Logged