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: Simulator Enhancements (03/13/24)

Pages: [1] 2

Author Topic: MutableShipStatsAPI Missing Something?  (Read 4039 times)

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
MutableShipStatsAPI Missing Something?
« on: May 06, 2014, 01:43:28 PM »

I am trying to make a skill that sets the deployment/logistics cost of the player flagship but I can't seem to find anything in the MutableShipStatsAPI that can modify logistics cost.

I see almost everything else modifiable in the data spreadsheet though and plenty of things that aren't. Was this overlooked or am I missing it?

I want it to look something like this:
Code
	public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
stats.getFleetPoints().set(id, SkillData.HELMSMANSHIP_LOGISTICS_COST);

Where HELMSMANSHIP_LOGISTICS_COST = 12 in skilldata

This should make it so that the logistics/deployment cost of the player flagship is always 12 no matter the hull-size correct?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: MutableShipStatsAPI Missing Something?
« Reply #1 on: May 06, 2014, 05:33:57 PM »

The deployment points value isn't modifiable, yeah. There are... reasons. I don't fully recall what, but not being able to assume this was fixed was problematic.

The logistics cost is getBaseSupplyUsePerDay().
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: MutableShipStatsAPI Missing Something?
« Reply #2 on: May 06, 2014, 07:23:22 PM »

 :-[ yeah I need deployment points not supply use.

The point was to make it able to reduce the deployment cost of capital ships. The reason being was that I am modifying the skills to be mutually exclusive in some ways but have greater rewards. The combat tree was supposed to support single ship play while leadership supports a large fleet.

Any chance that could be added in in the future?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: MutableShipStatsAPI Missing Something?
« Reply #3 on: May 06, 2014, 08:05:36 PM »

In a word, no. It's a mechanic that's in large part intended to manage game performance. Balance is a secondary role, if it weren't for performance it likely wouldn't exist in the first place.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: MutableShipStatsAPI Missing Something?
« Reply #4 on: May 06, 2014, 08:06:58 PM »

You probably *do* want to adjust the supply use or CR deployment cost. Conceptually, I think that's what you're looking for.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: MutableShipStatsAPI Missing Something?
« Reply #5 on: May 06, 2014, 08:48:45 PM »

You probably *do* want to adjust the supply use or CR deployment cost. Conceptually, I think that's what you're looking for.

Not quite. I'll explain why. The base logistics of the game is 20. The skill line you choose for your "primary" in my mod determines your game-play choice. Combat allows you to use roughly one ship (but a very powerful one) and an assortment of fighters (modified for a different role in my mod), but due to the varying deployment costs of differing hullsizes, or more importantly their logistics cost (not in supplies per day but on the logistics score itself), prevents this from being applicable since you could say, field 4 frigates at 5 deployment points/logistics or a single battlecruiser for 20.

The way it works is for your primary skill line to start at 10. The bonus for combat level 10 homogenizes the logistics cost of your flagship only(on your logistics score out of 20) to always equal 12.. leaving you 8 points no matter what ship or hull-size you pick for support ships or fighters.

Leadership on the other hand, reduces the base credits cost of all ships by 50% (ships cost way more in my mod) and gives you a large percentage of logistics (40 instead of 20) upfront to account for fleet style play. So for this skill choice varying deployment costs is essential. It was just easier to modify the flagship cost in combat rather than modify "all" ships costs under leadership

The point is to make skill choice determined on the a new game start to be very impactful on the playstyle with the option to hybridize slightly starting at level 20 with the addition of 5 more attribute points.


I could go into the reasons for this choice but it wouldn't be relevant to the thread and would take too long haha. I know this is not how vanilla was envisioned, but I am experimenting with an rpg style skill system that specializes a bit more strictly.



Allowing only the flagships deployment/logistic score cost to be modified would not impact performance at all since it at the most would be the addition of a single ship. Balance would of course be implemented in other ways through the skill system.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: MutableShipStatsAPI Missing Something?
« Reply #6 on: May 06, 2014, 09:00:16 PM »

I'm sorry, perhaps I'm being dense today, but all of this makes sense except for the part where the "deployment points" value for the ship comes into play. Deployment points and logistics are separate things, and it seems like you're conflating them.

I mean, adjusting deployment points will literally do nothing most of the time, since they only come into play in larger battles, and maybe not even then if the player increased the battle size in their gameplay settings.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: MutableShipStatsAPI Missing Something?
« Reply #7 on: May 06, 2014, 09:15:54 PM »

I'm sorry, perhaps I'm being dense today, but all of this makes sense except for the part where the "deployment points" value for the ship comes into play. Deployment points and logistics are separate things, and it seems like you're conflating them.

I mean, adjusting deployment points will literally do nothing most of the time, since they only come into play in larger battles, and maybe not even then if the player increased the battle size in their gameplay settings.

Hmm no maybe I am the one being dense. I thought that deployment points and the logistics cost (as far as logistics rating goes) of the ship were one the same. It would appear to be so but maybe that is one heck of a coincidence. Is there a separate value that determines the logistics cost of the ship on your logistics score?

I am not talking about logistics in the supply per day cost sense or the cr per deployment sense, only in the number out of total logistics on the fleet screen. So a lasher's deployment cost is 5, but its logistics score is also 5 out of 20. Can I modify it to be 12 out of 20?

Idk maybe I am being confusing  ???
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: MutableShipStatsAPI Missing Something?
« Reply #8 on: May 06, 2014, 09:40:57 PM »

I am not talking about logistics in the supply per day cost sense or the cr per deployment sense, only in the number out of total logistics on the fleet screen. So a lasher's deployment cost is 5, but its logistics score is also 5 out of 20. Can I modify it to be 12 out of 20?

The Lasher's logistics cost is 1.5. If you're seeing a score of 5 out of 20, other stuff is using it up - crew or being over capacity, perhaps. You can see the breakdown in the tooltip, just press F1 to expand it.


You could modify it to be 12 by doing something like stat.modifyFlat(id, 12f - stat.getBaseValue()). That assumes nothing else modifies it, though, but you're mostly in control of that if you're revamping the skills.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: MutableShipStatsAPI Missing Something?
« Reply #9 on: May 06, 2014, 09:59:12 PM »

I am not talking about logistics in the supply per day cost sense or the cr per deployment sense, only in the number out of total logistics on the fleet screen. So a lasher's deployment cost is 5, but its logistics score is also 5 out of 20. Can I modify it to be 12 out of 20?

The Lasher's logistics cost is 1.5. If you're seeing a score of 5 out of 20, other stuff is using it up - crew or being over capacity, perhaps. You can see the breakdown in the tooltip, just press F1 to expand it.


You could modify it to be 12 by doing something like stat.modifyFlat(id, 12f - stat.getBaseValue()). That assumes nothing else modifies it, though, but you're mostly in control of that if you're revamping the skills.

Wait so you're saying... hold on let me test something...
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: MutableShipStatsAPI Missing Something?
« Reply #10 on: May 06, 2014, 10:14:51 PM »

Wow yup it actually was a huge coincidence. I had no idea base supply usage per day actually had an effect on the logistics score. It always seemed to coincide with the deployment cost and I never really delved deeper into it. The supply per day cost of all my ships literally happened to also be their deployment cost  ::)

Thank you for clearing that up Alex. That actually made my job 100x easier because now I can balance the fighters around supply usage rather than deployment cost. That is something I have wanted to do all along but I didn't think it was possible.

And obviously the original problem is solved too.  ;D
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: MutableShipStatsAPI Missing Something?
« Reply #11 on: May 06, 2014, 11:06:40 PM »

Excellent :)

It is a bit confusing, yeah.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: MutableShipStatsAPI Missing Something?
« Reply #12 on: May 07, 2014, 03:38:34 PM »

Ok so moving this to the thread so others can see.

Story so far:

Trying to modify the cost of a ship using skills:

This is what I have:

Code
import com.fs.starfarer.api.characters.ShipSkillEffect;
import com.fs.starfarer.api.combat.MutableShipStatsAPI;
import com.fs.starfarer.api.combat.ShipAPI.HullSize;

public class CommandExperiencePerk3 implements ShipSkillEffect {

public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
stats.getBaseValue().modifyPercent(id, -SkillData.COMMAND_EXPERIENCE_SHIP_COST);
}

public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
stats.getBaseValue().unmodify(id);
}

public String getEffectDescription(float level) {
return "Reduces the cost of ships by " + (int)(SkillData.COMMAND_EXPERIENCE_SHIP_COST) + "%";
}

public String getEffectPerLevelDescription() {
return null;
}

public ScopeDescription getScopeDescription() {
return ScopeDescription.ALL_SHIPS;
}
}

So definitely an amateur coder here. So I assume from what you said that I am trying to use the MutableShipStats class to get the credit value of the ship when it can't actually do that.. because BaseValue isn't defined in that class?

When you said:
Quote
You could modify it to be 12 by doing something like stat.modifyFlat(id, 12f - stat.getBaseValue()).

I think I understand what that is doing as far as getBaseSupplyUsePerDay.

But how would it recognize the credit cost of the ship since that isn't defined in any class?

Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile
Re: MutableShipStatsAPI Missing Something?
« Reply #13 on: May 07, 2014, 03:44:48 PM »

I thought you were trying to change the supply cost/day, not the credit cost :) There's no way to change the credit cost at the moment. Edit: didn't see that you were going for that from your PM, just said "cost", which could mean different things...
« Last Edit: May 07, 2014, 03:47:16 PM by Alex »
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: MutableShipStatsAPI Missing Something?
« Reply #14 on: May 07, 2014, 03:53:37 PM »

Oh haha yeah I should have been clearer there. The supply/cost per day one works just fine. Trying to find out how to only let it affect certain hullsizes atm.

So should I formally do an API request for MutableShipStats.getBaseCreditValue in the proper thread?

Logged
Pages: [1] 2