Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: [1] 2

Author Topic: Regarding fleet creation and weapon/ship abundance  (Read 5700 times)

Okim

  • Admiral
  • *****
  • Posts: 2161
    • View Profile
    • Okim`s Modelling stuff
Regarding fleet creation and weapon/ship abundance
« on: October 24, 2014, 01:01:33 AM »

Hi.

Was harassing Alex with some modding questions regarding fleets and weapon/ship availability. Decided to share the answers with the community and continue asking questions here rather than in PM.

So, here are the answers I`ve got from Alex (my questions are quoted):

Quote
1. I can`t find a file that contains fleet compositions. I looked in factions, but there are only ship types per faction and fleet type names. Where can I find that file and if faction-specific fleet composition possible?


The old-style fleet compositions should still work (using the same json format/java methods to spawn them), but they're no longer used anywhere by vanilla, and not exactly supported - i.e. if something breaks them later on down the line, I won't be fixing them.

The new way involves using code and "shipRoles" to spawn ships. Basically, you define - per faction, with defaults in default_ship_roles.json - what ships the faction uses for which roles. For example, what's a light combat ship? Etc. Then you spawn ships using a "quality factor" based on the market's stability (which makes higher or lower "quality" variants more or less likely to be picked), so the fleets end up being dynamic, both based on the faction and the market that spawned them.

For an example of how this works, take a look at com.fs.starfarer.api.impl.campaign.fleetsPatrolFleetManager.


Quote
2. Is there any way to set up faction-specific ship/weapon choices for markets? I.e. - specific factnion only sells guns/ships restricted to it. I can force some supply fleets to carry specific weapons, but I wish it to remain as much market-dependable as it is now in vanilla.



If you're using the default implementations of OpenMarketPlugin/MilitarySubmarketPlugin/etc, what'll happen is the ships/weapons available will be based on the ships the faction has configured in its shipRoles, and the weapons those ships carry. So, it sort of automatically "fits" the faction, even including higher-quality stuff being available on stable markets. It does also throw in a few totally random weapons for variety.

(Also, note: old-style "weapon delivery" doesn't work anymore. You could make it work by adding stuff directly to submarket cargo if you really wanted to, though.)
 
 
Quote
I actually feared that things will get nasty code-wise regarding faction-specific weapons/ships, but what you did with markets picking up the weapons based on preffered ship variants... you surely didn`t forget us modders while thinking this system out.


Saved me a lot of content-work, too Smiley


Quote
Is there any way to mark weapons/hulls as non-available for sell at all (rather than not including them on ship hulls)? Not speaking of built-in guns here - more of alien-based weapons and some high-tech stuff.


Add a "SYSTEM" tag for weapons, this should work 100% in the next release. You can also provide custom implementations of submarket plugins which can filter out whatever you want, it'll get callbacks pre player interaction.
 
 

Okim

  • Admiral
  • *****
  • Posts: 2161
    • View Profile
    • Okim`s Modelling stuff
Re: Regarding fleet creation and weapon/ship abundance
« Reply #1 on: October 24, 2014, 01:12:02 AM »

Checked the patrol file only to find out that there are no fleet divisions in it - just the overall number of patrol fleets per market. Looked further and detected a fleetfactory file that governs the whole process of fleet creation. The code is huge, but quite easy to understand.

The question is - it seems that this is a universal file that covers  all fleet creation for all factions. I assume that it can be expanded to include faction checks (like ISA in Ironclads preferring carrier-based fleets, while RSF - more firepower-oriented fleets and etc.)?

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Regarding fleet creation and weapon/ship abundance
« Reply #2 on: October 25, 2014, 10:44:42 AM »

The question is - it seems that this is a universal file that covers  all fleet creation for all factions. I assume that it can be expanded to include faction checks (like ISA in Ironclads preferring carrier-based fleets, while RSF - more firepower-oriented fleets and etc.)?

The way to manage that would be to either 1) set the shipRoles in your faction how you want them (i.e. RSF's variants have more firepower) or code up custom patrol fleet spawning etc. Depending on how deep you want to go with it, you can remove all the core scripts from the engine and do everything yourself.

Or you can say that certain markets don't do automatic patrol spawns (and then add your own script to do it).
SharedData.getInstance().getMarketsWithoutPatrolSpawn().add(marketId)

This also works for trade fleets (getMarketsWithoutTradeFleetSpawn()).


There's nothing special about FleetFactory - it's just an implementation class where vanilla creates a bunch of fleets. You can't mod it directly, but you can create your own that has methods that create your own types of fleets, and then add scripts to spawn them (and, possibly, remove any vanilla scripts that spawn conflicting fleets).
Logged

PCCL

  • Admiral
  • *****
  • Posts: 2016
  • still gunnyfreak
    • View Profile
Re: Regarding fleet creation and weapon/ship abundance
« Reply #3 on: October 25, 2014, 11:13:08 PM »

can't you just put fighter wings into ISA's combatsmall and combatmedium (is that right? don't have game with me atm) categories along with/instead of ships and give their carriers higher priority on spawning?
Logged
mmm.... tartiflette

Okim

  • Admiral
  • *****
  • Posts: 2161
    • View Profile
    • Okim`s Modelling stuff
Re: Regarding fleet creation and weapon/ship abundance
« Reply #4 on: October 26, 2014, 01:39:01 AM »

Yeah, that what Alex proposes and this is what seems to be a much easier (less painful?) way to add diversity to faction fleet compositions.

Thanks for advice :)

Okim

  • Admiral
  • *****
  • Posts: 2161
    • View Profile
    • Okim`s Modelling stuff
Re: Regarding fleet creation and weapon/ship abundance
« Reply #5 on: October 27, 2014, 07:16:04 AM »

Question another have I.

Are those D-type variants for ships just a bit cheaper (and redundant) alternatives? Or do they also have some influence on market availability? Like non-D ship is a rare sight, but D ship is readily generated at markets for sale.

Do these D-ships also have less relationship tiers to unlock? Like non-D destroyer requires some good relations with the seller, but D version can be bought without the need for any (or high enough) reputation?

Also is there any way to specify directly which ship does not require any particular standings and which one is only available at specific relationship level. As I recall current system just takes ship size into account whether or not it is available for a player to buy.
« Last Edit: October 27, 2014, 07:18:43 AM by Okim »
Logged

Okim

  • Admiral
  • *****
  • Posts: 2161
    • View Profile
    • Okim`s Modelling stuff
Re: Regarding fleet creation and weapon/ship abundance
« Reply #6 on: October 27, 2014, 07:31:12 AM »

Annnd another question regarding skins.

As I understand correctly any new specific skin is based on the original ship file and does not allow to change mount types or add them or drives. The question is - can I create a ship hull file and force this ship file not to be present in the game (by never using it in any possible faction variant).

The idea is simple - I have a gunship with 2 energy mounts and 2 ballistic mounts right on top of them and a large missile mount somewhere on the sprite. Plus it has quite a bunch of differently placed drives on it. This ship does not even have any drawn sprite - just a placeholder art piece.
By manipulating the skins (where i just switch off some mounts and drives) I can create a core faction ship with 2 ballistic mounts with say 3 drives or an advanced merc gunship with two energy mounts instead or a pirate-customized ship with 1 ballistic and 1 large missile mount and some extra drives.

Hope you get the point. All i need to know if i can hide that core abomination somehow.

Okim

  • Admiral
  • *****
  • Posts: 2161
    • View Profile
    • Okim`s Modelling stuff
Re: Regarding fleet creation and weapon/ship abundance
« Reply #7 on: October 27, 2014, 09:33:45 AM »

Question #3. How can i totally disable independants? They seem to be a core faction for the economy system in the game. At least i found what i believe to be a check for spawning either faction fleet or independent. Can it be turned off?

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Regarding fleet creation and weapon/ship abundance
« Reply #8 on: October 28, 2014, 10:30:01 AM »

Question another have I.

Are those D-type variants for ships just a bit cheaper (and redundant) alternatives? Or do they also have some influence on market availability? Like non-D ship is a rare sight, but D ship is readily generated at markets for sale.

Do these D-ships also have less relationship tiers to unlock? Like non-D destroyer requires some good relations with the seller, but D version can be bought without the need for any (or high enough) reputation?

Lower-stability markets have a higher chance of having lower-quality variants. That's governed by the "quality" parameter in the .variant files (defaults to 0.5 when missing, range is 0 to 1 inclusive).

(D) ship variants usually have a low quality, most often 0. So, less stable markets tend to have more (D) variants and less better variants.

They still require the same reputation to unlock, as it's purely based on hull size right now and not variant quality.

Note: I'm talking about variants, not hulls, but what happens is it'll pick a *variant* based on the shipRoles for the faction, and then get the base hull for that variant and then add it to what's available.

Also is there any way to specify directly which ship does not require any particular standings and which one is only available at specific relationship level. As I recall current system just takes ship size into account whether or not it is available for a player to buy.

No. If you want to do that, you should override the SubmarketPlugin for the military market, using submarkets.csv. Then you can completely control what governs availability and how.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Regarding fleet creation and weapon/ship abundance
« Reply #9 on: October 28, 2014, 10:31:56 AM »

Annnd another question regarding skins.

As I understand correctly any new specific skin is based on the original ship file and does not allow to change mount types or add them or drives. The question is - can I create a ship hull file and force this ship file not to be present in the game (by never using it in any possible faction variant).

The idea is simple - I have a gunship with 2 energy mounts and 2 ballistic mounts right on top of them and a large missile mount somewhere on the sprite. Plus it has quite a bunch of differently placed drives on it. This ship does not even have any drawn sprite - just a placeholder art piece.
By manipulating the skins (where i just switch off some mounts and drives) I can create a core faction ship with 2 ballistic mounts with say 3 drives or an advanced merc gunship with two energy mounts instead or a pirate-customized ship with 1 ballistic and 1 large missile mount and some extra drives.

Hope you get the point. All i need to know if i can hide that core abomination somehow.

Right, you can create a base hull that has everything in it and then have a skin cut out pieces and it should work. The hull won't show up anywhere unless its variants are using in shipRoles somewhere.

Also, you CAN edit weapon slot types and sizes with a skin. Just not locations. Look at the buffalo_pirates.skin for an example of that.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Regarding fleet creation and weapon/ship abundance
« Reply #10 on: October 28, 2014, 10:35:40 AM »

Question #3. How can i totally disable independants? They seem to be a core faction for the economy system in the game. At least i found what i believe to be a check for spawning either faction fleet or independent. Can it be turned off?

I don't think you can entirely remove the faction w/o also providing your own implementations for a lot of core functionality (i.e. the economy fleets etc).

The easiest way might be to keep the independents, but then catch any new independent fleets and assign them to a different faction or remove them altogether.
Logged

Okim

  • Admiral
  • *****
  • Posts: 2161
    • View Profile
    • Okim`s Modelling stuff
Re: Regarding fleet creation and weapon/ship abundance
« Reply #11 on: October 28, 2014, 10:48:49 AM »

What will happen if i remove all variants from independents` ship roles? Will the game just move on after failing to create a fleet in this case without casing the crash or some other issues?

Sundog

  • Admiral
  • *****
  • Posts: 1727
    • View Profile
Re: Regarding fleet creation and weapon/ship abundance
« Reply #12 on: October 28, 2014, 02:37:16 PM »

They still require the same reputation to unlock, as it's purely based on hull size right now and not variant quality.
??? but-

Well, as far as i know relationship system just blocks ships by their sizes not by some quality flags or other things. I may be wrong here.
I'm pretty sure Alex said it was that way at some point, but I was happy to find out that's not the case anymore. It seems to lock ships based on FP or something.
Proof:
Spoiler
[close]

Looking forward to seeing where you take Ironclads, Okim  :)

and-

Code
  "hullId": "sun_ice_nightseer",
  "hullName": "Nightseer",
  "hullSize": "FRIGATE",

Sundog

  • Admiral
  • *****
  • Posts: 1727
    • View Profile
Re: Regarding fleet creation and weapon/ship abundance
« Reply #13 on: October 28, 2014, 03:03:45 PM »

Also-
Spoiler
[close]
That's with only LazyLib and Console Commands running. I think you might've accidentally improved your game more than you thought you did  :P

Okim

  • Admiral
  • *****
  • Posts: 2161
    • View Profile
    • Okim`s Modelling stuff
Re: Regarding fleet creation and weapon/ship abundance
« Reply #14 on: October 28, 2014, 11:04:28 PM »

I suspect tech level (high tech in both examples) having impact on the restrictions for these ships. On the other hand Wolf is also a high-tech ship... Odd.

EDITED:
em... where is the post that Alex made about ship resctrictions? )))
« Last Edit: October 28, 2014, 11:06:29 PM by Okim »
Logged
Pages: [1] 2