Patch: Disable Random Closing and Opening of Industries
Moderator: OpenTTD Developers
Patch: Disable Random Closing and Opening of Industries
I've been trying to play passenger only games, and invariably even if the map was generated with no industry, some eventually appears and I fail to resist the urge to connect them. Anyway I've also been thinking about the possibility of league games, and the effect of random industries on scenarios. So I thought it would be useful to be able to disable random creation and closing of industries. So here it. Feel free to help me test it.
- Attachments
-
- No_Random_Industry_r1.patch
- Patch against r11199 to disable random construction and closing of industries.
- (3.81 KiB) Downloaded 701 times
Re: Patch: Disable Random Closing and Opening of Industries
Maybe its better to use 2 options for seperating closing and opening or use one option which allowes you to set these individual. I would like to play without closing industries, but new industries should be opened anyway.
Re: Patch: Disable Random Closing and Opening of Industries
*agree* with Progman.
and does the closing apply to both primary and secondary industry?
iirc, closing of primary industry happens when the production rate goes below a certain level (can anyone tell if this is right?) - with your patch, what happens if the production goes below that level? can it decrease and decrease downto zero?
and does the closing apply to both primary and secondary industry?
iirc, closing of primary industry happens when the production rate goes below a certain level (can anyone tell if this is right?) - with your patch, what happens if the production goes below that level? can it decrease and decrease downto zero?
Re: Patch: Disable Random Closing and Opening of Industries
yay! i am not fond of closing industries, so i'll give it a try.
*<(:-}
- athanasios
- Tycoon
- Posts: 3138
- Joined: 23 Jun 2005 00:09
- Contact:
Re: Patch: Disable Random Closing and Opening of Industries
I agree too.
1. No new raw industries.
2. No new industries.
3. No closing of raw industries (3a Oil Wells)
4. No closing of industries.
But 4 has been discussed extensively before. My opinion, as I have already said before, is for industries not served to deteriorate and to need money (fund them) to come back to operation by time. They should fall to ruins after a very long time of inactivity (50 - 60 years).
1. No new raw industries.
2. No new industries.
3. No closing of raw industries (3a Oil Wells)
4. No closing of industries.
But 4 has been discussed extensively before. My opinion, as I have already said before, is for industries not served to deteriorate and to need money (fund them) to come back to operation by time. They should fall to ruins after a very long time of inactivity (50 - 60 years).
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.
I prefer to be contacted through PMs. Thanks.
"If no one is a fool I am also a fool." -The TTD maniac.
I prefer to be contacted through PMs. Thanks.
Re: Patch: Disable Random Closing and Opening of Industries
option4 would be good for easy mode and player guide games...
option3 would be good for a hard mode if not too many industries are on the map... So players would need not only compete for them, but try to maintain them alive!
option3 would be good for a hard mode if not too many industries are on the map... So players would need not only compete for them, but try to maintain them alive!
- belugas
- OpenTTD Developer
- Posts: 1507
- Joined: 05 Apr 2005 01:48
- Location: Deep down the deepest blue
- Contact:
Re: Patch: Disable Random Closing and Opening of Industries
Just for your information, the creation of random industries can be blocked by Action 00 for industries, property 18. Set it to zero and you have less of a problem.
I have to admit the closing may be a little trickier. But setting bits 1 or 2 in property 21 in conjunction with Industry Production Callback would certainly do the trick
I have to admit the closing may be a little trickier. But setting bits 1 or 2 in property 21 in conjunction with Industry Production Callback would certainly do the trick
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
Re: Patch: Disable Random Closing and Opening of Industries
Huh? The production callback has something to do with random closing? If so, that's a bug.belugas wrote:Just for your information, the creation of random industries can be blocked by
I have to admit the closing may be a little trickier. But setting bits 1 or 2 in property 21 in conjunction with Industry Production Callback would certainly do the trick
I would guess that bits 4 and 5 would be more useful.
Belugas: OpenTTD can do production changes smaller other than halve/double. Can newGRFs request this?
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Re: Patch: Disable Random Closing and Opening of Industries
I had no idea that sort of thing was possible with newgrfs. But looking at the Action 0 Docs I would agree that it would be an easy way to prevent random industries from appearing. If we wanted to have the same functionality to prevent closing, woudn't we have to add some property to the industry spec that could be modified by a newgrf? If TTD patch would agree to such a change, then I would be for it, but since my patches have been just little tweaks here and there, I doubt that my opinion matters very much.belugas wrote:Just for your information, the creation of random industries can be blocked by Action 00 for industries, property 18. Set it to zero and you have less of a problem.
I can also see how granularity of control, as has been suggested, could be useful in various situations, but it makes the patch a great deal more complicated than it is. Right now its just a few lines in the close industry code, and a single line in the MaybeNewIndustry function.
- belugas
- OpenTTD Developer
- Posts: 1507
- Joined: 05 Apr 2005 01:48
- Location: Deep down the deepest blue
- Contact:
Re: Patch: Disable Random Closing and Opening of Industries
If i'm not mistaken, cb29, cb35 (industry_cmd.cpp:1861) and industry production callback (action2) (newgrf_industries.cpp:487) do follow the specs.DaleStan wrote:Belugas: OpenTTD can do production changes smaller other than halve/double. Can newGRFs request this?
Are you talking about a new kind of feature? I guess anything can be done, as long as we all agree on the requirement (including Csaboka, of course)
Or did you (already) find a bug?
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
Re: Patch: Disable Random Closing and Opening of Industries
It's not a bug so much as a misfeature. Callbacks 29/35 can only specify power-of-two production changes. Unless I miss my guess, industries not using those callbacks, or industries returning 04 from CB29, will get the whole range of small percentage changes.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Re: Patch: Disable Random Closing and Opening of Industries
That is smooth economy, but I disabled it for industries using production callbacks, as it could close them if they didn't produce anything for more that a month.
Re: Patch: Disable Random Closing and Opening of Industries
On a dedicated linux machine i recieved a segmentation fault after several months, but could not reproduce it.
The other thing i am not happy about is that it changes the savegame.
The other thing i am not happy about is that it changes the savegame.
*<(:-}
Re: Patch: Disable Random Closing and Opening of Industries
For now I am considering this patch as proof of concept. Meanwhile I'm looking into the NewGRF specs to see if I can change behavior that way. I'm also waiting to see what the Devs do in regards to preventing closure via NewGRF. Anyone is welcome to play around with the code, but I don't plan on doing anything with it for a while.
Re: Patch: Disable Random Closing and Opening of Industries
Hi wleader
Look this old patch: http://www.tt-forums.net/viewtopic.php?f=33&t=33781
I don't know how works "newindustries" now, if it works. But I stopped this patch because "newindustries", this patch does all of your patch does. Last version was for r11118, then they are discontinued.
Since August, I'm playing with r11118 and this patch, with stable economy (no changes, no new industries, don't close industries...)
Look this old patch: http://www.tt-forums.net/viewtopic.php?f=33&t=33781
I don't know how works "newindustries" now, if it works. But I stopped this patch because "newindustries", this patch does all of your patch does. Last version was for r11118, then they are discontinued.
Since August, I'm playing with r11118 and this patch, with stable economy (no changes, no new industries, don't close industries...)
-
- Engineer
- Posts: 20
- Joined: 08 May 2002 05:01
Re: Patch: Disable Random Closing and Opening of Industries
i think this patch is a good idea, and using newgrfs for this seem a bit over the top for me
a path option would be the best choice imho as it would work "out of the box", w/o any external dependencies (not to mention it would theoretically allow changing it mid game in a more "clean" way)
(but if a newgrf comes out, i'll definitely use it
)
a path option would be the best choice imho as it would work "out of the box", w/o any external dependencies (not to mention it would theoretically allow changing it mid game in a more "clean" way)
(but if a newgrf comes out, i'll definitely use it

Re: Patch: Disable Random Closing and Opening of Industries
Just updated this patch to the latest version. No changes or anything, just updated to r11781
- Attachments
-
- norandom_new.diff
- (3.61 KiB) Downloaded 379 times
Re: Patch: Disable Random Closing and Opening of Industries
If you play on very large map (like 2048x2048) most of the industry would rot before your network would become big enough with this approach - one day you serve say 10% of industries on the map and in next 10 years everything not conected would disappear. Not a god idea.athanasios wrote:But 4 has been discussed extensively before. My opinion, as I have already said before, is for industries not served to deteriorate and to need money (fund them) to come back to operation by time. They should fall to ruins after a very long time of inactivity (50 - 60 years).
If you need something, do it yourself or it will be never done.
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
Re: Patch: Disable Random Closing and Opening of Industries
I thought of another idea that may be used to solve the problem. Create some closed_industry counter and every time industry is closed, increment it. Every time some new industry is spawned somewhere, decrement it. The larger would be the counter, the more chance of new industry to appear. This would mean that total number of industries on map would remain relatively stable even when industries have smaller chance of appearing (bad terrain, badly set chances ...)
If you need something, do it yourself or it will be never done.
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
-
- Traffic Manager
- Posts: 198
- Joined: 31 Oct 2007 10:54
- Location: a/c closed
Re: Patch: Disable Random Closing and Opening of Industries
Just following up on the speculation about a bug in Industries earlier in the thread ...
I had ECS implemented and this happened ...
A farm I was supplying with fertiliser and vehicles, and collecting fibre and cereal from ... just closed down on me out of the blue. That was rather annoying, as the farm was the starting point for a whole supply chain, and when it closed down, it triggered a cascade of collapse through the entire chain. Unlike say - oilwells - I couldn't see why a farm would close down under those circumstances ...
Another thing, I was supplying Steel, Glass and Dye to a vehicle factory ... but the Dye deliveries weren't being recorded in the factory's stockpile, it stayed at zero ... the truck unloaded the dye and it just vanished - it wasn't even sitting intransit at the station.
I'm running 0.6-beta1 by the way.
Just mentioning these things on the offchance they have some relevence to the thread!
I had ECS implemented and this happened ...
A farm I was supplying with fertiliser and vehicles, and collecting fibre and cereal from ... just closed down on me out of the blue. That was rather annoying, as the farm was the starting point for a whole supply chain, and when it closed down, it triggered a cascade of collapse through the entire chain. Unlike say - oilwells - I couldn't see why a farm would close down under those circumstances ...
Another thing, I was supplying Steel, Glass and Dye to a vehicle factory ... but the Dye deliveries weren't being recorded in the factory's stockpile, it stayed at zero ... the truck unloaded the dye and it just vanished - it wasn't even sitting intransit at the station.
I'm running 0.6-beta1 by the way.
Just mentioning these things on the offchance they have some relevence to the thread!

Who is online
Users browsing this forum: No registered users and 3 guests