Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: [request] Pirate/merc odds and other difficult-to-modify values  (Read 1287 times)

Okim

  • Admiral
  • *****
  • Posts: 2161
    • View Profile
    • Okim`s Modelling stuff
[request] Pirate/merc odds and other difficult-to-modify values
« on: November 26, 2014, 12:56:48 AM »

Hi.

It would be great to have the following values being put into a separate and easy to access/replace json file (or probably even settings):

- odds for a merc fleet to be spawned instead of pirates
- number of pirate fleets per market size
- a list of possible lootable commodities that you can get by destroying ships (like the current metals we get) with an ability to perform faction checks (allowing/not allowing certain loot to be dropped by some factions)
- a list of commodities that you get for scrapping your own ships (now there is just a few tons of supplies and fuel)
- odds for different boarding resolutions (the one that we have in fleet encounter for different boarding actions (with an ability to perform faction check and disallow boarding for certain factions at all)

Why asking? It is simple - currently to modify a single value from the list above you need to rewrite a huge amount of scripts and recompile it in a huge jar (like replacing the original fleet interaction with a modified version where you call a modified version of fleet encounter script where you put all the resources you wish to get for salvage just for blowing up the ship and etc.). Having the list of salvageable commodities somewhere in data.scripts where you can easily replace this file is much-much easier to mod.

We have now an external list of market condition values that is easy to mod. Something like that for the things listed above would be awesome to have.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: [request] Pirate/merc odds and other difficult-to-modify values
« Reply #1 on: November 26, 2014, 12:29:11 PM »

I see what you're saying. The issue with this is that unlike market conditions, which are part of the core game, these scripts are implemented in a way a mod would do it - that is, they're an implementation of an interface provided by the core. If I were to make them extensible/configurable in this way, I'd basically be saying that this implementation is now part of the interface, and would have to code it to a different standard, in terms of the amount of thought given to its structure and design.

Put another way, it'd be like making the code that generates the Corvus star system extensible - it's pretty simple now, but it would get a lot more complicated.

... for all that, I might have to do that at some point.



I do have a couple of items on my list that should make life a bit easier, though.

1) Going to look at making most of the private methods in FleetEncounterContext/FleetInteractionDialogPluginImpl protected rather than private, so that mods can extend those classes and override a few methods, rather than having to copy-paste the whole thing.

2) Good point about salvage; I'll see if I can add a callback after loot as generated, to give mods a chance to adjust it if needed.

3) Looking at moving out some checks for the pirate faction into properties in the .faction file (not directly related to anything you asked about, but in the same general vein).


As far as merc/pirate fleets, I think it's relatively simple to do what you want by doing the fleet generation yourself... yeah, it's probably a cut-and-paste job of the MercAndPirateFleetManager, but that class isn't super-complicated, or even that lengthy, and it'd be a self-contained change.

You'd need to do SharedData.getData().getMarketsWithoutPatrolSpawn().add(marketId) at game initialization to stop the market from spawning the default fleets, or to manually remove the script from the market's primary entity.
Logged