I've created a patch do distribute incoming cargo over multiple industries, This so i can get some extra good's out on my stations by building extra factories.
It's my first patch and my first c++ in 10 years, so any feedback is welcome.
It works as follows:
When the game tries to deliver the cargo from the unloading vehicle to the industry instead of finding the first one and drop all the items in that industry it first checks how much accepting industries there are.
If there is only one it will drop the cargo on that one.
If there is more than one it will divide the amount of cargo evenly over all the industries, and buffer the remaining cargo for the next run.
Eg: 5 items of cargo delivered to 2 factories mean both factories will get 2 items and 1 item will be buffered. When the next 5 units arrive it will add the 1 still buffered and deliver 3 cargo to the factories.
The buffered cargo isn't saved when saving (As far as I know, I don't know how data is getting saved), so saving and loading may cause some lost cargo, but this is only a small amount (< num factories for the station per station). I don't think it's worth
I'm not sure how this patch will work in multiplayer or if it will cause desyncs, I've got no knowledge about how the multiplayer code works.
Note that when applying the patch to an already patched game or newer version it may be needed to manually adjust the savegame version in saveload.cpp and settings.iniThere is a setting to toggle the function on and off, By default, it is off. So you have to enable this manually.
cargodistribute_r27917_1.diff [8.94 KiB]
Downloaded 31 times
- [+] Spoiler