[WIP][Mod] Classical Economy

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

emitbreaker
Posts: 2
Joined: Mon, 3. Dec 18, 13:35
x4

[WIP][Mod] Classical Economy

Post by emitbreaker »

Link: https://www.nexusmods.com/x4foundations/mods/135


Since 1.3 I have tried to solve inactiveness in economies after mid- or late game time. As you may well know, current economy depends on Shipyard, or ship building activities too heavily , so if somehow the activity had broken - and unfortunately it often happens - entire economy also has broken. As a part of the try and error, I have modified some libraries to bring more dynamicity into the economy as below;

1. Adding secondary resources into all non-shipyards

One among Space Fuel, Space Weed or Maja dust is added to each station as a secondary resources which provides additional efficiencies to the production.

2. Adding additional factories for shipbuilding into the galaxy

Quota for Engine Parts, Smartchips, Drone / Turret / Shield Components factories for each faction has been changed from 2 to 8.

3. Adding new traders to each factions

Although the baskets has specific trader type called "construction_ship", there was no traders in the Jobs. So, I have added key shipbuilding parts (hull / engine parts, drone / turret / shield components) to the basket and added 15 L-class traders and 30 M-class traders to each faction.

4. Adding Nividium as a primary resource

As you may know, there is no items but Nividium Gems is using Nividium as a primary resources. I added it to Smartchip and Superfluid Coolant as a primary resources. I'm not sure whether this is a positive change or not as of now.


How to install:

Unzip the file into your extensions folder. You can use it with your existing save files, but a clean start is recommended.

How to uninstall:

Simple delete above folder from your extensions folder. It will not affect to the save file.
Kadatherion
Posts: 1021
Joined: Fri, 25. Nov 05, 16:05
x4

Re: [WIP][Mod] Classical Economy

Post by Kadatherion »

I honestly think it's not going to do much, as at least a good chunk of the issue comes from traders... not actually trading. So even if you add more, you just put more cpu load on the game, and they'll still sit in space, trade only 2 sectors away, trade with 5% of the actual cargo hold and so on.

As for nividium as main resource... that could even make things worse. I'm pretty sure npc ships do not mine nor trade with nividium.
emitbreaker
Posts: 2
Joined: Mon, 3. Dec 18, 13:35
x4

Re: [WIP][Mod] Classical Economy

Post by emitbreaker »

Kadatherion wrote: Sat, 15. Dec 18, 16:59 I honestly think it's not going to do much, as at least a good chunk of the issue comes from traders... not actually trading. So even if you add more, you just put more cpu load on the game, and they'll still sit in space, trade only 2 sectors away, trade with 5% of the actual cargo hold and so on.

As for nividium as main resource... that could even make things worse. I'm pretty sure npc ships do not mine nor trade with nividium.
Thanks for your tip. So that means, current issue probably comes from AI Scripts, not only # of traders in the galaxy. I guess,
<param name="minbuy" default="0" type="number" advanced="true" text="{1041, 10066}" comment="Min gate distance to buy. Buy range supported if $minbuy and $maxbuy are provided">
<input_param name="startvalue" value="0"/>
<input_param name="min" value="0"/>
<input_param name="max" value="[@this.ship.commander.tradenpc.skill.management, @this.ship.pilot.skill.piloting].max * 2"/>
<input_param name="step" value="1"/>
</param>
<param name="maxbuy" default="0" type="number" text="{1041, 10054}" comment="Max gate distance to buy. Buy range supported if $minbuy and $maxbuy are provided">
<input_param name="startvalue" value="0"/>
<input_param name="min" value="0"/>
<input_param name="max" value="[@this.ship.commander.tradenpc.skill.management, @this.ship.pilot.skill.piloting].max * 2"/>
<input_param name="step" value="1"/>
</param>
above part from order.trade.routine.xml is already broken. With current low experiencing system, I think no matter put how many maxbuy to the Jobs, the AI may not moving because of the Commander / Pilot's skill level.
Kadatherion
Posts: 1021
Joined: Fri, 25. Nov 05, 16:05
x4

Re: [WIP][Mod] Classical Economy

Post by Kadatherion »

emitbreaker wrote: Sun, 16. Dec 18, 01:31 above part from order.trade.routine.xml is already broken. With current low experiencing system, I think no matter put how many maxbuy to the Jobs, the AI may not moving because of the Commander / Pilot's skill level.
Hmmm, this may apply to player owned ships: as we couldn't currently have highly skilled pilots through normal methods, some of the reports of them being wonky and refusing to trade far enough could be because of this (and the fact you weren't supposed to be able to "cheat" with right click and set them to galaxy trade with less than 3 - now 4 in 1.5 - stars). But I've seen this being reported with 5 star pilots as well (got to 5 stars with mods). And npc pilots are supposed to have a more varied range of skills (you could see that before they fixed the ability to hire crew from npc ships). Also they like to derp doing things like only loading 40 medical components when they could carry a thousand or ignoring much more profitable routes, and so on. Npc traders are also often found idling in space, with or without cargo, eternally "looking for trades".

The variables tied to the pilot skill I believe are adding on top of the broken logic making it even worse, plus the UI lacks a way to clearly let you know at a glance how the skills precisely affect their efficiency, so the player can't distinguish a bug from a "feature". It's a bit of a mess, really, as it makes it hard to try and find a solution unless you work completely around the game's own trade logic and build an alternative one from scratch (which is, of course, a massive endeavour).
ApoxNM
Posts: 783
Joined: Wed, 5. Dec 18, 06:17
x4

Re: [WIP][Mod] Classical Economy

Post by ApoxNM »

Kadatherion wrote: Sun, 16. Dec 18, 04:55 It's a bit of a mess, really, as it makes it hard to try and find a solution unless you work completely around the game's own trade logic and build an alternative one from scratch (which is, of course, a massive endeavour).
Which is actually not the job of modders, to create a working economy, rather extend it.
They have some serious fixing to do with this game and I suspect it will take quite a while.
Kalantris
Posts: 137
Joined: Mon, 10. Dec 18, 10:56

Re: [WIP][Mod] Classical Economy

Post by Kalantris »

Kadatherion wrote: Sat, 15. Dec 18, 16:59 As for nividium as main resource... that could even make things worse. I'm pretty sure npc ships do not mine nor trade with nividium.
Actually I don't think it's going to be that much of a problem, since providing factories with minable resources isn't complicated at all and requires only miners. It depends on the needs obviously, but Nividium mining is actually an early-game cheat provided by the devs, which pulls players away from more important routes, which sustain the economy, but are not as profitable.

I have two trading fleets - Auto Traders and Economy Traders. The second fleet, which is actually larger than the first, traders exclusively problematic components like engine parts, smartchips and the like. I don't intend to make money on them, I want to keep the economy going. It did help me in a way, because I can now build ships in almost all shipyards and all wharfs after supplying them for 5 or 6 hours non stop. It was however not a business decision, because there are always more profitable routes than that.

Making Nividium a primary resource makes sense in general and since nobody trades any raw materials it shouldn't be that much of a problem. I haven't seen traders move ore around, it's just miners providing it to stations directly. I'm not even sure if traders can take base resources, since they're solid storage and traders have container storage.
Kadatherion
Posts: 1021
Joined: Fri, 25. Nov 05, 16:05
x4

Re: [WIP][Mod] Classical Economy

Post by Kadatherion »

ApoxNM wrote: Sun, 16. Dec 18, 11:41
Kadatherion wrote: Sun, 16. Dec 18, 04:55 It's a bit of a mess, really, as it makes it hard to try and find a solution unless you work completely around the game's own trade logic and build an alternative one from scratch (which is, of course, a massive endeavour).
Which is actually not the job of modders, to create a working economy, rather extend it.
They have some serious fixing to do with this game and I suspect it will take quite a while.
Yet it is what modders have done time and time again in previous titles. The only difference is, this time Egosoft HAS to have a very well working economy in vanilla, because everything depends on it. Broken economy ----> no ships in the universe ----> nothing to do. In previous titles the issues with the economy at most hindered trade/production or made it harder to find certain race specific equipment, but you could still fight and do a plethora of missions and cool things. Not here. And yep, it will take a while... it took forever - and it wasn't enough - before, one can only imagine what will take this time.

Kalantris wrote: Sun, 16. Dec 18, 12:35
Kadatherion wrote: Sat, 15. Dec 18, 16:59 As for nividium as main resource... that could even make things worse. I'm pretty sure npc ships do not mine nor trade with nividium.
Actually I don't think it's going to be that much of a problem, since providing factories with minable resources isn't complicated at all and requires only miners. It depends on the needs obviously, but Nividium mining is actually an early-game cheat provided by the devs, which pulls players away from more important routes, which sustain the economy, but are not as profitable.

I have two trading fleets - Auto Traders and Economy Traders. The second fleet, which is actually larger than the first, traders exclusively problematic components like engine parts, smartchips and the like. I don't intend to make money on them, I want to keep the economy going. It did help me in a way, because I can now build ships in almost all shipyards and all wharfs after supplying them for 5 or 6 hours non stop. It was however not a business decision, because there are always more profitable routes than that.

Making Nividium a primary resource makes sense in general and since nobody trades any raw materials it shouldn't be that much of a problem. I haven't seen traders move ore around, it's just miners providing it to stations directly. I'm not even sure if traders can take base resources, since they're solid storage and traders have container storage.
Nividium wasn't even sellable until one or two patches ago. There's no economy for it except for a resource sink - indeed, a player early game "cheat" - but you can't make nividium a main resource for anything unless you also make new jobs for npcs to mine it. Perfectly doable, of course, but it's a bigger, more involved endeavour. As this mod was published, it put nividium as primary resources for end products, with nobody to supply it (unless the player does it, but then you are FORCED to do it yourself or you have yet again what we already experience: broken economy because the npc traders fail at delivering the required goods).
SlovenlyAlligator
Posts: 2
Joined: Mon, 17. Dec 18, 11:21

Re: [WIP][Mod] Classical Economy

Post by SlovenlyAlligator »

After playing the game for a while i've discovered a few things which are really jamming up the Econ and probably need fixing to get it to run more smoothly.

1. The traders have difficulty finding their own arse with both hands, a map and a team of native guides. This isn't your job to fix and should be patched at some point but it's worth mention because no matter what you do as long as the other traders are shit then there's not much you can do to get the economy moving. if they can't trade there's nothing to get the econ moving.

2. Ware and station pricing isn't good. This is a bit of a more complex subject but in RL the price of a good is typically the Cost+Margin where cost includes everything which goes into making the ware and Margin is a markup on top of that. this would be very difficult to implement in X but instead you can have the price set as a part of price equilibrium.
At the moment wares aren't priced by cost, they all have fixed pricing which is not functional in a working economy and is something which is really pulling it down when there's a supply glut so the first step is to unshackle the max and Min ware prices so they can be sold and bought for any price which is a particular problem since Ecells, ore and Silicon are all free if you have the right equipment so why does Silicon cost more than twice as much as ore?
This breaks station pricing. the current algorithm makes the price proportional to the degree that storage is full in the station rather than trying to find the actual value of the materials they're producing. The simplest way around this is to price goods using a simple tracking algorithm:

At the end of every minute (or 2 mins or whatever) if the amount of wares in a station is higher than a setpoint (say equivalent to 15mins of production) then it drops it's buy price by x (depends on the ware), if below it raises the price instead.

likewise sell price is calculated the same way, if the amount of wares at a station is greater than a setpoint (a L freighter load seems a nice round number) then it drops the price by x, if below it raises the price.

The aim of this is instead of having the station price raise and fall rapidly with individual transactions it instead tries to find that sweet spot where it's paying just enough to have traders find and supply the station/sell the wares in sufficient quantities.

3. There is no competitive advantage thus no reason not to build single ungodly huge superstitions. Competitive advantage is a term which means that a certain location or group has an advantage in producing a particular type of good over another and it is the driving force of trade. Simply put each ware needs conditions where it may be produced more efficiently than others, this is already there for Ore, Silicon and Water which may be produced more cheaply in asteroid fields. it is also available for solar cells which are effected by an efficiency modifier (which as yet does nothing) if Solar cells do eventually get a required resource then the efficiency of the sector that they're located in will determine the cost of producing solar cells in that sector. Other wares could really do with competitive advantages in certain conditions which could then be used to drive the reasons for trade in the game and make the economy workable.

4. there is no resource sink, hyperinflation is rampant. this is the hard one, every ware feeds into making things which will eventually fill all of the storage and drive the cost of everything to zero as things are so plentiful that nothing costs anything anymore. the only resource sinks at the moment are station building and Shipbuilding which one needs a thriving war economy to delete goods from the universe while the other just makes goods faster to create and thus makes the problem worse.

even if everything else is fixed hyperinflation is gonna get you.
Kalantris
Posts: 137
Joined: Mon, 10. Dec 18, 10:56

Re: [WIP][Mod] Classical Economy

Post by Kalantris »

SlovenlyAlligator wrote: Mon, 17. Dec 18, 11:57 /snip
If we're talking about problems with the economy, here's another one:

Once the station drops its price it offers EVERYTHING it has at that price, there are no price levels. So let's say a station holds 10.000 spacefuel and offers it for 202 (2.02mil credits in total). Now the station goes to 12.000 and starts dropping the price, eventually getting to 95 around 15.000. The 95creds/unit offer doesn't expire on any level, it's just there. So if you send a small transport and take 4100 units, the price goes back to 202. If you send a large transport you can basically take the whole place with you for 95 - not just the surplus. So the station goes from 2.02mil creds in wares at 10k units to 1.425mil at 15k units.

Return to “X4: Foundations - Scripts and Modding”