Transport Fever 2

Transport Fever 2

Yeol's Senseless Industries 2.21a
Damgam 25 Jan, 2023 @ 11:28pm
Industry Town Config
I have looked into the code that manages industry town spawning and have a few concerns about how it works...

Industry Towns are limited to 10 which isn't noted anywhere for the user. This leads to situation where you spawn these 10 towns relatively early into the game and then you won't get any more of them. What i'd do is to remove the limiter, but when industry is created, roll a dice that determines if that industry is allowed to spawn a town or not. Let's say 20%. That way you don't end up with every industry on the map having a town, but you don't artificially cap the number of them. This is especially an issue with mods adding more levels to industries and such RNG would help significantly more than a hard cap of 10.

Related to the above, there's a minimum level of industry set at 3, and some production conditions which seem to be hardcoded values. I'd lift that minimum industry level to 2 and either remove the production requirements or change them to some percentage (Basically make sure the industry is at full production of level 2 for X amount of time)

With the two of the above changes you make the town spawning a bit more random and less restricted, which in my opinion leads to more interesting and varied gameplay. You never know which industry is about to grow into a town so when it does happen you end up with new puzzle to solve. Right now you can kinda predict that whenever you have a good served industry, it's gonna plop a new town....... but only if there's less than 10 of them already.
< >
Showing 1-15 of 17 comments
Yeol  [developer] 26 Jan, 2023 @ 12:17am 
Thank you for the analysis and suggestions. You have a point with how the current behaviour is predictable. I'll modify it using your suggestions as a base. Good call! Thanks for the feedback.

I'll let you know when these modification have been done.
Damgam 26 Jan, 2023 @ 2:21am 
Actually what you seem to be checking for currently is consumption, not production, which is actually even better because that excludes source industry... Maybe the minimum level isn't even needed then, when combined with the RNG based solution above. Just make sure the industry is being served for some time non stop.

Honestly i don't know what are the limitations of current API and if you have any reliable way to monitor production/consumption regularly.
Last edited by Damgam; 26 Jan, 2023 @ 2:23am
Damgam 26 Jan, 2023 @ 2:24am 
I'm loving this mod so far tbh. Finally industry mod that has well thought and long production chains.
Damgam 29 Jan, 2023 @ 5:35am 
*notices update*
so now senselesstowns.createTownAtPlant adds town item to the table every time but has random chance to actually spawn a town in that industry when it attempts to... So the town isn't created but it still counts towards the new limit of 25... okay...

Definitely an improvement though if you go for this kind of setup i'd remove the max and just keep reducing the spawn chance infinitely until it drops to 1 in which case it becomes ultra rare but still possible.
Last edited by Damgam; 29 Jan, 2023 @ 5:54am
Yeol  [developer] 29 Jan, 2023 @ 7:21am 
I have indeed posted an update, but forgot to test-play the result. That's why I did not yet mentioned it, but you noticed it anyway.

About the changes made: the town creation will start with a chance of 75% and decrease to 25%. I put in a hard limit to prevent the creation of ridiculous number of new villages. I doubt this limit will be reached ever in a normal game, but in modded games...?

A second factor that limits the creation of a new village is the total consumption amount of the industrial plant. The threshold rises every time, so the chance a village will spawn get small every time.

But I'm test-playing it now, to see how it behaves. I keep interest in any feedback of course. Thank for the suggestions.
Damgam 29 Jan, 2023 @ 7:27am 
Ok if it also increases the consumption threshold, sounds good then.
And yea sorry if i sound a bit wishful. I just really like this feature except a few little details i've been mentioning above. :D
You could even release this as a separate mod i guess...
Last edited by Damgam; 29 Jan, 2023 @ 7:29am
Yeol  [developer] 29 Jan, 2023 @ 11:15am 
I've published a correction. There was a bug, which provoked a crash when a town would spawn. That is fixed. I also modified the algorithm more towards your suggestion: Decreasing chance from 100% to 1%. The hard cap of 25 is still present, but I might increase it later when I see how it behaves.
Damgam 30 Jan, 2023 @ 5:34am 
Nice :)
GordonDry 18 May, 2023 @ 3:47am 
Is the type of industry taken into account?

If I place a resource output industry out in the wilderness between the mountains I don't want to have a town spawned there, but if I place a processing industry between two towns it's okay if there a town is spawned.
Yeol  [developer] 18 May, 2023 @ 5:36am 
The only condition is that the industry is not a resource plant. There has to be an input cargo defined. So no towns at rural forests, oil wells or sand pits.
GordonDry 18 May, 2023 @ 7:44am 
Allright. Thank you..
capten1984 20 Jun, 2023 @ 9:40am 
is there a way to disable spawning new cities? I´ve got a Industry area with 3 cities so far...
I prefer to place them manually.
Yeol  [developer] 20 Jun, 2023 @ 9:45am 
Yes, you can disable the option.
capten1984 20 Jun, 2023 @ 9:55am 
ok, cool. but how can i disable it?
Yeol  [developer] 20 Jun, 2023 @ 1:38pm 
When loading the savegame, use "select options", highlight the mod (Senseless Industries), and in the right column you can change the option "Town Spawning" to "no". I hope this helps. Have fun!
< >
Showing 1-15 of 17 comments
Per page: 1530 50