mbleichner / x4-warehouse-fleets

X4 Foundations Mod - Warehouse Fleets
2 stars 3 forks source link

X4 Foundations - Warehouse Fleets Mod

This mod was inspired by the popular Mules and Warehouses Mod and aims to combine the different mule types into one.

It introduces the WarehouseFleet behaviour, which serves the following purposes:

Releases will be published on Nexus Mods: https://www.nexusmods.com/x4foundations/mods/939

Installation

Just take the whole source folder and put it into your X4 extensions folder.

Intended Use

The mod allows to create a network of warehouses across the galaxy, which will ultimately behave like a single giant shared storage. Arbitrary refineries and factories can be built along this network and will feed from its resources and provide their own products back into the network.

Warehouse Setup

To make this work, every warehouse gets assigned a "WarehouseFleet", composed of a commander ship that uses the WarehouseFleet behaviour and a set of subordinates set to mimic the commander behavior.

WarehouseFleet Parameters

Parameter Description
Home Warehouse The home warehouse of this fleet.
Targets A list of sectors or stations. This should include all connected warehouses, as well as any sectors/stations to trade with.
Targets (L) Targets that are only allowed for L-sized freighters. Useful for routes through dangerous territory.
Targets (M) Targets that are only allowed for M-sized cargo ships.
Supply Targets Target stations that should always get filled to the max, regardless of fair resource distribution. Useful especially for shipyards. Please note: supply targets also have to be entered in one of the above target settings!
Min. Cargo Usage (%) Avoids scheduling inefficient trips. No ship will be scheduled that uses less than the specified cargo space. Setting this value too high might prevent/delay balancing of low volume wares though.
Prio: Distribute Set to high values to generally favor ware distribution over other tasks.
Prio: Supply Build Storage Set to high values to generally favor supplying build storages over other tasks.
Prio: Trade Set to high values to generally favor trading over other tasks.
Trades: Gate Penalty (%) Reduces the attractivity of trades in other sectors to keep travel distances short.
Account Threshold Buying wares from NPC stations will only be allowed if it leaves the player account with more money than this setting. This setting will be synchronized between all WarehouseFleets!

Warehouses, Trade Wares and Restrictions

The mod uses the normal trade mechanics of the game. So the ships will only be able to transport wares if there are corresponding trade offers set up and their restriction settings are set up appropriately.

The WarehouseFleet ships will also respect buy/sell restrictions to other factions (which is usually not the case in the base game). This is used to control which wares to trade with other factions.

The general setup works like this:

Be cautious with unrestricted buy offers. Those can drain your account. Use the account threshold setting to control it if necessary.

Budgets and Money

The player-owned stations don't need any budgets for this mod to work. All trades with NPC factions use the global player account. (I tried to make it work with station accounts, but unfortunately this isn't possible without commander-assignment and this in turn locks the fleet settings so they cannot be changed afterwards - which would be a huge drawback).

If a warehouse has unrestricted sell offers, NPC traders can also buy directly from your warehouse. If this happens, the money goes to the station account. If the station account reaches 200k, it will be transferred to the player account. If needed, this could be made configurable in a future version.

Notes

Recommendations

Some Implementation Details

Known Problems