Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Decouple Commodity Legality from Demand  (Read 694 times)

Hague

  • Ensign
  • *
  • Posts: 36
    • View Profile
Decouple Commodity Legality from Demand
« on: March 12, 2022, 04:23:51 AM »

Currently, it appears that the legality of goods based on faction is tied directly to the demand id of a commodity. This means that mods that add goods that share the same demand category cannot have legal or illegal variants. What I'd hope to see is changing legality to be based directly on the commodity's item id. This would allow mods like Shadowyards to have their legal cloned organ variant of harvested organs work properly. It could also be used to create dynamically embargoed categories of goods. For instance, imagine Tri-Tachyon-branded consumer goods that are illegal in Luddic Church or Pather areas for being too high-tech; warring factions make their opponents specialty commodities illegal; or less-profitable legal recreational drug variants that can be sold legitimately. It would take some dithering to get the economy balance right with more variants and the factions files for each would need to be updated but I think it would open some doors for a more lively economy.
Logged

Goumindong

  • Admiral
  • *****
  • Posts: 1896
    • View Profile
Re: Decouple Commodity Legality from Demand
« Reply #1 on: March 13, 2022, 12:32:01 PM »


I don’t think it would work to do what you’re suggesting anyway.

If legal supply was less than demand then there would be a shortage anyway. If legal supply was less than illegal supply then there would be the exact same shortage as before.

If legal supply was over demand then there would be no smuggling demand.

Anyway. There is a workaround for this.

Give planets an industry that convert the legal good into reduced demand for the illegal good. (Or supply of the legal good though this is less ideal). IE if cloned organ supply is met then harvested organ demand is zero and if cloned organ supply is not met by 1 then harvested organ demand is -1 and if otherwise not met then harvested organ demand is unchanged
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4693
    • View Profile
    • GitHub profile
Re: Decouple Commodity Legality from Demand
« Reply #2 on: March 13, 2022, 05:36:41 PM »

Multiple participating-in-economy goods sharing the same demand class are not supported by the game in a bunch of ways, and I don't think Alex plans to change this. RIP us.
Logged

Hague

  • Ensign
  • *
  • Posts: 36
    • View Profile
Re: Decouple Commodity Legality from Demand
« Reply #3 on: March 14, 2022, 06:14:29 PM »

By participating-in-economy, you mean things that show up in  the colony's resource outputs on the overview? Do you mean to say that no matter how much lobster I send to a planet that has a deficit of luxury goods the lobster can affect the price curve but never solve a luxury goods shortage? So even if cloned organs were made legal selling them could never solve a harvested organs shortage?

This is an aside, but would it be possible to make a script so that cloned organs are like lobster but their value is pegged to the distance from the nearest Medical Clinic? Because that's really what I have in mind here: more sub-categories of goods that can have differing legality placed on them and that exist as opportunities for the player and not necessarily a cog in the greater economy.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4693
    • View Profile
    • GitHub profile
Re: Decouple Commodity Legality from Demand
« Reply #4 on: March 14, 2022, 09:19:30 PM »

By participating-in-economy, you mean things that show up in  the colony's resource outputs on the overview? Do you mean to say that no matter how much lobster I send to a planet that has a deficit of luxury goods the lobster can affect the price curve but never solve a luxury goods shortage? So even if cloned organs were made legal selling them could never solve a harvested organs shortage?
AFAIK this is indeed the case for both lobster and cloned organs.
Albeit the two cases are somewhat different, as lobsters are non-econ commodities and don't show up in the colony commodity list, while cloned organs are econ commodities and shown in the panel, which causes weird bugs as shown here.

(random fun fact: cloned organs actually use the luxury good demand class, not harvested organs)

Quote
This is an aside, but would it be possible to make a script so that cloned organs are like lobster but their value is pegged to the distance from the nearest Medical Clinic? Because that's really what I have in mind here: more sub-categories of goods that can have differing legality placed on them and that exist as opportunities for the player and not necessarily a cog in the greater economy.
You can manipulate player-facing prices for specific goods (code snippet from Nexerelin's rebellions below). I don't know if it's possible to change their 'market value' for monthly colony exports.
Code: java
market.getCommodityData(Commodities.MARINES).getPlayerSupplyPriceMod().modifyMult(modId, priceMult, desc);
Logged

Hague

  • Ensign
  • *
  • Posts: 36
    • View Profile
Re: Decouple Commodity Legality from Demand
« Reply #5 on: March 15, 2022, 08:59:14 PM »



(random fun fact: cloned organs actually use the luxury good demand class, not harvested organs)


I actually knew that already. I've been messing with trying to fix the way the cloned organs worked and changing commodities.csv was the first thing I did. That's when I noticed that cloned organs became illegal when they were associated with the organs demand. Something I haven't tried is making a meta demand category for organs that are legal and then seeing if shared demand items can be made illegal separately or if it's truly tied to demand id. The confusion stemming from the shared names between demand class and item id. Is the demand class a separate thing or is it just creating a demand class from a base item id?

Logged