[MOD] Station Logistics (v0.02)

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

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

Post Reply
Vectorial1024
Posts: 224
Joined: Mon, 30. Jul 18, 04:16
x4

[MOD] Station Logistics (v0.02)

Post by Vectorial1024 » Thu, 7. Sep 23, 16:48

Another attempt to solve the age-old station logistics problem. Managing your station networks networks has never been easier.

Image

Station Logistics: That's how simple it is!
  • Requires SirNukes Mod Support API
  • Form station logistics links to prioritize delivery of wares between linked stations
  • This is a WIP, but should work reasonably well for stations; more work needed for interacting with buildstorages
  • Nexus/Steam release will be available when the mod is more mature
  • GitHub repository for development stuff at https://github.com/Vectorial1024/v1024_ ... logistics/
Simplified Changelog
  • v0.01: Initial release
  • v0.02: New feature: show linked stations
Last edited by Vectorial1024 on Fri, 15. Mar 24, 20:15, edited 1 time in total.
The future awaits.

X4 Foundations mods:
Civilian Fleets: Managing your civilian ships has never been easier.
Station Logistics: Managing your station networks has never been easier.
Scrap Delivery Coordination: No more starving scrap processors.

rudi_pioneer
Posts: 408
Joined: Fri, 2. Apr 21, 21:06
x4

Re: [MOD] Station Logistics (v0.01)

Post by rudi_pioneer » Thu, 7. Sep 23, 18:13

Yay!

For logic that prioritizes station to station, is there a danger of ships being locked by inefficient transport (like using 1% of cargo only, or 100% of ships doing station to station transfers)? This is me being curious how mod works so I can use it best, and not objection.

rudi_pioneer
Posts: 408
Joined: Fri, 2. Apr 21, 21:06
x4

Re: [MOD] Station Logistics (v0.01)

Post by rudi_pioneer » Thu, 7. Sep 23, 18:20

Update: checked the script out and since it increases trade affinity and doesn’t change anything else, looks like that it’s enough to monitor how stations are doing and see if more ships should be added.

Love the check in code to prefer other stations over trading stations equalizing goods!

Vectorial1024
Posts: 224
Joined: Mon, 30. Jul 18, 04:16
x4

Re: [MOD] Station Logistics (v0.01)

Post by Vectorial1024 » Fri, 8. Sep 23, 17:18

Glad you liked it!

And yes, in essence, this mod only slightly modifies the vanilla AutoTrader script to prefer trading between paired stations, so whatever situation that may happen in this mod, it should have also appeared in vanilla game. When vanilla game tries to utilize all of ship storage, this mod will also do the same, because the same script is being run.

This is something that most other mods struggle to handle well, especially when they decide to implement a custom trading logic (eg custom delivery priority logic).
The future awaits.

X4 Foundations mods:
Civilian Fleets: Managing your civilian ships has never been easier.
Station Logistics: Managing your station networks has never been easier.
Scrap Delivery Coordination: No more starving scrap processors.

Eeroth
Posts: 15
Joined: Thu, 22. Dec 11, 17:05
x4

Re: [MOD] Station Logistics (v0.01)

Post by Eeroth » Tue, 5. Dec 23, 12:49

This is a mod that I really do need. It will make game a lot better.
Keep it up!

Vectorial1024
Posts: 224
Joined: Mon, 30. Jul 18, 04:16
x4

Re: [MOD] Station Logistics (v0.01)

Post by Vectorial1024 » Thu, 7. Dec 23, 17:53

Thanks for the support!

The nature of this mod means that it is rather "difficult" to test; there would need to have multiple stations each having valid supply chains to verify this mod works. And there needs to have enough ships (eg a few dozen M transporters) and enough time (eg 20 hrs) to let it flow. (Especially now I do not have that much free time to spend to observe the trade behavior...)

You can try out this mod to see if it really works, but I think this mod should work.
The future awaits.

X4 Foundations mods:
Civilian Fleets: Managing your civilian ships has never been easier.
Station Logistics: Managing your station networks has never been easier.
Scrap Delivery Coordination: No more starving scrap processors.

zebai
Posts: 36
Joined: Wed, 9. May 07, 19:30
x4

Re: [MOD] Station Logistics (v0.01)

Post by zebai » Sat, 6. Jan 24, 03:40

I always seem to have logistic issues with my stations so looking for any improvement but my current issues are more related to with the station itself more than the transport. It seems all logistics scripts i've seen use the buy/sell rules of the station to determine need. So if my warehouse is low on superfluid but my factory that uses it for as intermediary item has say 20,000 of 30,000 in tock but because its an intermediary item it wants to hold onto 21,000 untis my transports consider the superfluid out of stock and my warehouse process will stall.

Do i resort to a dozens of different stations for each intermediary to prevent this or can I hope for some logistics mod to make it easier to connect inventories.

Not that this isn't fixable, I could manually set the stock levels but I don't typically find such issues until its an issue you see, and it could happen with any of my goods. Sigh..it makes me regret not creating just 1 huge super structure but i was trying to avoid the lag fest of a hundreds of modules in one station.

Vectorial1024
Posts: 224
Joined: Mon, 30. Jul 18, 04:16
x4

Re: [MOD] Station Logistics (v0.01)

Post by Vectorial1024 » Sat, 6. Jan 24, 19:08

zebai wrote:
Sat, 6. Jan 24, 03:40
I always seem to have logistic issues [...]
It's most likely a station planning issue. It's so-to-speak a higher-level problem.

No real need to rush to mega stations this early. Looking from how X Rebirth provided the static station blueprints, I think there are 2 possible ways of designing a working station:
  • Single-purpose stations with no intermediate wares
  • General provider stations where its intermediate ware is in obvious excess (think eg produces 3600/h but consumes 1440/h, so there is a net of 2160/h)
The game is smart to identify obvious surpluses and issue sell offers, and then the wares can be moved by vanilla trade scripts.

Something like that. You could restructure your stations to have more general provider stations in the logistics network and then the excess intermediate wares should be moved by the scripts.

It also helps to NOT actually have excessive storage. My rule of thumb is to have enough storage for the station to run 2hr - 4hr uninterrupted. If the storage is too much then the game might just plan for multi-dozen hours of continuous intermediate production and hoard the intermediate wares.

Hope the above helps!
The future awaits.

X4 Foundations mods:
Civilian Fleets: Managing your civilian ships has never been easier.
Station Logistics: Managing your station networks has never been easier.
Scrap Delivery Coordination: No more starving scrap processors.

Tishlin
Posts: 1
Joined: Sun, 2. Sep 07, 23:10
x4

Re: [MOD] Station Logistics (v0.01)

Post by Tishlin » Mon, 15. Jan 24, 04:27

I've been using this mod in my game and it seems to be working very well. I like that I don't need to clutter my fleet list up with traders and can keep them assigned to stations.

The only thing that took me a little bit to work out was that though you can link multiple stations to a single station each station can only "originate" one pairing. So stations need to be paired "up" the chain of your logistics network. Refineries to processing stations (or trade stations), processing stations to trade station, trade station to wharf, that sort of thing.

So far I've got about 7 different stations moving resources through a central trade hub. They prioritize linked station trades so I can leave the trade rules pretty open and trust that surplus will get sold off when they have nothing better to do.

Two thumbs up from me.

lv9pv
Posts: 63
Joined: Thu, 3. Jan 08, 05:51
xr

Re: [MOD] Station Logistics (v0.01)

Post by lv9pv » Tue, 16. Jan 24, 13:09

I would really like to try this in my running save, but not able to install it using Vortex. Vortex complains about invalid or unsupported content.xml Looking at the content.xml I'm guessing its because the mod don't have an ws_id and is asking for dependency by name and not id ?

Can I trick Vortext to accept installing this mod by handcrafting the content.xml my self ?

Edit to add:
Making up an id did let me install it with vortex. I could not find anywhere in the files where that id was called so I'm guessing it will work ?

Vectorial1024
Posts: 224
Joined: Mon, 30. Jul 18, 04:16
x4

Re: [MOD] Station Logistics (v0.01)

Post by Vectorial1024 » Wed, 17. Jan 24, 04:10

lv9pv wrote:
Tue, 16. Jan 24, 13:09
I would really like to try this in my running save, but not able to install it using Vortex. Vortex complains about invalid or unsupported content.xml Looking at the content.xml I'm guessing its because the mod don't have an ws_id and is asking for dependency by name and not id ?

Can I trick Vortext to accept installing this mod by handcrafting the content.xml my self ?

Edit to add:
Making up an id did let me install it with vortex. I could not find anywhere in the files where that id was called so I'm guessing it will work ?
I didnt expect Vortex requires a workshop ID...?

That said, originally this mod is intended to be NOT on Nexus (also NOT on workshop), for early testing purposes. Given that it works quite well for a long time (no major problems reported here so far), I am gonna put this on both the workshop and Nexus later.
The future awaits.

X4 Foundations mods:
Civilian Fleets: Managing your civilian ships has never been easier.
Station Logistics: Managing your station networks has never been easier.
Scrap Delivery Coordination: No more starving scrap processors.

Vectorial1024
Posts: 224
Joined: Mon, 30. Jul 18, 04:16
x4

Re: [MOD] Station Logistics (v0.01)

Post by Vectorial1024 » Wed, 17. Jan 24, 04:17

Tishlin wrote:
Mon, 15. Jan 24, 04:27
I've been using this mod in my game and it seems to be working very well. I like that I don't need to clutter my fleet list up with traders and can keep them assigned to stations.

The only thing that took me a little bit to work out was that though you can link multiple stations to a single station each station can only "originate" one pairing. So stations need to be paired "up" the chain of your logistics network. Refineries to processing stations (or trade stations), processing stations to trade station, trade station to wharf, that sort of thing.

So far I've got about 7 different stations moving resources through a central trade hub. They prioritize linked station trades so I can leave the trade rules pretty open and trust that surplus will get sold off when they have nothing better to do.

Two thumbs up from me.
Good to know it works well on your side!

The original idea is that, even if the setup is tedious (you indeed need to create each pair one by one), you win in the long run by simply "forgetting" about the setup and let the mod adjust the trades for you, and also having an easily-scaleable trade network.

However, I originally thought most people would set up their stations where a single warehouse will deal with the factories, and that the factories do not interact directly with each other, so the pair-by-pair setup was justified. If you would prefer "prioritize player to player trading" in a general way, then you actually should be looking for something else.
The future awaits.

X4 Foundations mods:
Civilian Fleets: Managing your civilian ships has never been easier.
Station Logistics: Managing your station networks has never been easier.
Scrap Delivery Coordination: No more starving scrap processors.

lv9pv
Posts: 63
Joined: Thu, 3. Jan 08, 05:51
xr

Re: [MOD] Station Logistics (v0.01)

Post by lv9pv » Wed, 24. Jan 24, 00:42

Vectorial1024 wrote:
Wed, 17. Jan 24, 04:10

I didnt expect Vortex requires a workshop ID...?
It works fine for me when I just created an ID in the file. I just used the mod name as ID and then Vortex installed it fine. So far everything seems to work as expected.

If you plan to develop it further, it would be really nice to have a feature that in a pop-up window show a list of linked stations. Could even list all your stations and let you link them from that window.

When creating a "spoke wheel" of linked stations, It was confusing at first when I tried to link station A to station B, then station A to station C and it didn't work. Adding Station B to A , then C to A worked. For me at least it felt most natural to do it the other way around, both ways would be even better =)

Thank you for this mod. I like it very much so far.

Vectorial1024
Posts: 224
Joined: Mon, 30. Jul 18, 04:16
x4

Re: [MOD] Station Logistics (v0.01)

Post by Vectorial1024 » Wed, 24. Jan 24, 19:33

lv9pv wrote:
Wed, 24. Jan 24, 00:42
Vectorial1024 wrote:
Wed, 17. Jan 24, 04:10

I didnt expect Vortex requires a workshop ID...?
If you plan to develop it further, it would be really nice to have a feature that in a pop-up window show a list of linked stations. Could even list all your stations and let you link them from that window.

When creating a "spoke wheel" of linked stations, It was confusing at first when I tried to link station A to station B, then station A to station C and it didn't work. Adding Station B to A , then C to A worked. For me at least it felt most natural to do it the other way around, both ways would be even better =)
Yeah, I think there is a good demand for allowing easy addition for "1-to-many" links. It also makes sense, given how my headcanon station setup is also spoke wheel "1-to-many" shape anyways.

But still, allow me to mention one existing feature: you can actually create/remove links from the "my properties -> station list" page! So no need for me to create a new UI just to list the stations.

I have been thinking about an easy way to show the existing links, but I know totally nothing about UI modding (can UI modding really show graphical lines anyways?), and it would be too difficult to learn it. An alternative is to somehow fire a generic mission highlighting the currently linked stations, but last time I tried to look at the mission files, there was nothing similar to get started.

Then again, recent irl has been busy, so gotta hold this back (fun fact: there is also a scheduled bugfix update for Civilian Fleets that I simply forgot/"too-busy" ...
The future awaits.

X4 Foundations mods:
Civilian Fleets: Managing your civilian ships has never been easier.
Station Logistics: Managing your station networks has never been easier.
Scrap Delivery Coordination: No more starving scrap processors.

Vectorial1024
Posts: 224
Joined: Mon, 30. Jul 18, 04:16
x4

Re: [MOD] Station Logistics (v0.02)

Post by Vectorial1024 » Fri, 15. Mar 24, 20:17

v0.02 is released, bringing in the ability to view the station logistics pairing of stations with these simple steps:
  • Right click the station on the map
  • Select "review linkages"
  • See the logistics partners of said station on the map as a guidance to them
Special credits to DeadAir for hinting at how the guidance mission could be made.
The future awaits.

X4 Foundations mods:
Civilian Fleets: Managing your civilian ships has never been easier.
Station Logistics: Managing your station networks has never been easier.
Scrap Delivery Coordination: No more starving scrap processors.

Post Reply

Return to “X4: Foundations - Scripts and Modding”