Transport Fever 2

Transport Fever 2

Yeol's Senseless Industries
Genshu 10 Jan, 2020 @ 3:51pm
Multiple Input for Industry possibly bugged?
Hey Yeol, this is kind of a big thing. I noticed it in my last game at the Commercial Center but couldnt put my thinger on whats going wrong, because it didn't got the production it should as soon as i supplied it with fabrics ( before it only got food).

Now I have the same problem with the food processing plant, first it only got grain and everything went normal, as soon as I delivered a second input, meat, the production kinda stays the same.

I just saw whats actually happening: If there is an input of 400 grain and 200 meat, the production stays at the level of the higher input, so it will always be arround 400-430 depending on the vehicles you are using. The consumption of meat seams to be completely irrelevant to the industry.
< >
Showing 1-15 of 25 comments
Genshu 10 Jan, 2020 @ 4:00pm 
I have to correct myself, it's not completely irrelevent, but the secondary input raises the production not by the amount it should. Now i got production arround 500, but it should be 600!
Genshu 10 Jan, 2020 @ 4:43pm 
And I just replicated the scenario in an sandboxgame, same results. For an an industry with only one input, the production = consumption of input. With multiple inputs this gets messed up somehow, the consumption rates of both inputs should be added, but they wont.
COCKHEAD 10 Jan, 2020 @ 5:09pm 
Are you sure you are shipping everything to final customers. I was struggling to work out the numbers on my cc that was gettign fed textiles from wool and fibre and cattle hide, the numbers werènt adding up. Then i realised my bottke neck was i didnt have enough end customers to my towns hence my cc numbers were not adding up.

I am not sure if its a similar scenerio for you but it helped me.
Genshu 10 Jan, 2020 @ 5:13pm 
No, everything is fine. I made sure there is no rookie mistake involved. And thats why I double checked it in a sandboxgame as well.
Genshu 10 Jan, 2020 @ 5:21pm 
As you can see, the consumption of the food processing plant in the upper right are, 390 grain and 202 meat, so it should have 592 production at this exact moment, but it has 511. Same goes for the comercial center: 522 + 371 = ? It's not 661
Last edited by Genshu; 10 Jan, 2020 @ 5:25pm
COCKHEAD 10 Jan, 2020 @ 8:00pm 
Yes i see what you are trying to say. I have no answer for this lol. But all i say is, in general tpf2 is alot easier to make use of the consumption and ratss of factories and lines compared to tpf1.

I have noticed in my games the correllation between consumption and production are slighty off but i just ignored it as i thought it was because i was doing shipping and train deliveries with a slower frequency. But it seem you are using road freight with i assume a higher frequency, so i am not sure, but i also confirm the same issue ( if it is one)
Yeol  [developer] 10 Jan, 2020 @ 11:56pm 
Thank you, Jiburiruu, for the test. I was planning to do them also, but not had the time for it till now.

Anyway, I see that the general setup works, but that the numbers between production and supply within an industrial plant do not add up perfectly. As I remember, this issue has been reported also by others, without using the Senseless mod. The inner working of factories seem not to work at 100% efficiency. Was this implemented by the developers, or is it a side-effect of their algorithm (clipping of individual capacities), I do not know. But the loss of production is not something I can fix.

Anyway, I will do these test also, but again, Jiburiruu, big thanks for doing these tests, and sharing it with us,
Genshu 11 Jan, 2020 @ 2:09am 
It's a shame. Guess I have to use these industries for onlyone input then at the moment. I hate it if things don't add up... I figured it could be some mistake in the modding files, but if it's a problem of the basegame it can't be helped.
Genshu 11 Jan, 2020 @ 4:14am 
I added milk to the experiment, no surprises, same results. What I just realized was that only one input gets displayed on the cargohold of the industry. Only the grain gets stashed and consumed while meat and milk only shows up in the infopanel but not visually. I don't know if that could be relevant, I just saw that this is happening. Maybe the thing can be avoided by splitting the cargohold of an industry assigning them to the different input options.
Genshu 11 Jan, 2020 @ 4:40am 
And another update on my investigation :D

The industry with multiple inputs is coded like this :

rule = { input = { { 1,0},{ 0,1 } }, output = { COMMERCIAL_GOODS = 1 }, capacity = 200 }

for example. So, my guess is that maybe it can't handle "input = { 1,1}" ? Maybe you need to write an extra rule for "input = {1,1}" or "input = {1,1,1}".

Like:

rule = { input = { 1,1 }, output = { COMMERCIAL_GOODS = 2 }, capacity = 200 }

So it's stated that an input of both inputs should result in an output of 2?

Maybe it should calculate this correctly with the code allready written but it does not; again as I reminder, I have not good knowledge of this stuff. I'm just guessing what could help and theorycraft for solutions or ideas that might help.
Genshu 11 Jan, 2020 @ 5:48am 
Further testing... delivering only meat to an food processing plant works just as fine as only grain, even though it doesn't gets displayed visually, busting my theroy with cargo space. It would be nice to see it though, but thats not the important part.

I think i know now what exactly is happening in this industry:

It knows it has 3 possible inputs and one output. If there is only one input the equasion is simple and works. If there is, however a second or third input things get messy, because the industry doesn't compute different inputs simulteniously. It seems to prioritice the biggest input and uses all units of this kind and goes to the next one, which would be fine BUT the consumption keeps going on for the input which is not processed at the time. While it's processing grain to food, meat gets consumed without contributing to production, causing the desync of consumption and production values.
Last edited by Genshu; 11 Jan, 2020 @ 5:55am
Genshu 11 Jan, 2020 @ 6:27am 
This is the last thing i want to add, because i think there is nothing more to add and I allready invested a stupid amount of time in this :D

there is the "industryutil.lua" file (path: C:\Program Files (x86)\Steam\steamapps\common\Transport Fever 2\res\scripts), there i think it's stated how input of industry works :

local inputRule = (params.input or (inpEnabled and stockListConfig and stockListConfig.rule.input)) or { {} }

Maybe, if something from there is denying the correct processing of multiple inputs, maybe it can be altered threw the mod in order to make it work?

Yeol  [developer] 11 Jan, 2020 @ 10:30am 
Hello Jiburiruu, that is some intensive testing. I've not yet started with the testing of capacities with multiple cargo industries, but I will do it certainly. What I'm wondering about is, does coal+iron_ore work correct for the steel mill? That is an AND-function; both cargo are needed to make an output. Maybe the OR-function as I have used often, is not implemented correctly by the developers?

I will let you know about my test results. But for the moment I'm struggling with the programming to detect workers at industrial plants during game play time...
Genshu 11 Jan, 2020 @ 11:14am 
hey yeol, i don't think there is anything wrong from UG. They don't use this kind of system in any industry chain.

coal and ore gets combined to one output --> 1+1=1

but the problem is that --> 1 or 1 or 1 = 1 ; is not working, or it's working but the system does not use this equation as intended.

if you would code the food processing plant like this : 1 meat+1milk+1grain= 3 food, i bet my ass it would work out just fine. but that would mean you have to suply every food industry with all foodsources, killing diversity and freedom.

at the moment you have the choice of either, only supply one food processing plant with only one possible input, or mix the input and suffer great loss of efficiency, roughly 200 units of food gets lost in the process.

key would be to write a code that teaches the industry to either mix the input in a flexible way, like switching from 1 input = 1 output, too 2 input = 2 output as soon as there are two different sorts of input in the cargobay, use this up and switch back to 1 input = 1 output; or teach it to wait with the processing of the second input which isn't used, like this--> use upp all grain, if no grain in stock use up all meat and so on.
< >
Showing 1-15 of 25 comments
Per page: 1530 50