A dirty fix to stop industries being deleted ...
Moderator: OpenTTD Developers
-
- Traffic Manager
- Posts: 198
- Joined: 31 Oct 2007 10:54
- Location: a/c closed
A dirty fix to stop industries being deleted ...
There's a thread in the Development MB about patching the game's ability to randomly close down and create industries. The patch is a good idea, because whilst this function is fine in computer-generated maps, it's darned annoying to see the game trash a carefully thought-out scenario.
For example, in the scenario I'm currently working on, the game closed down 18 industries in the first two game-years, completely undermining the design of the scenario. This can be rather disheartening, and I believe would tend to discourage players from bothering to create elaborate scenarios once they realised what the game will do to them!
I hope the patch gets into trunk, but at the moment for me the game crashes even when the patch is compiled against a (supposedly) compatible nightly.
So here's a very simple workaround that I came up with for the time being, to prevent the game trashing scenarios, that I thought perhaps might be useful for other players ...
Instead of placing industries into a scenario from the outset, just place a sign at the intended location. Then once the scenario is loaded into the game, use the ingame cheat to switch to an unused player slot (say Player 8 ) ... allocate that player $20 million, then use the 'Fund Industry' to establish the industry when you're ready to connect to it. (Note, you'll probably need to Configure Patches to 'Local Authority being permisssive' about demolishing things!)
Of course, signs can be switched on /off from the tools button, so the map doesn't need to be 'contaminated' with lots of signs being displayed during gameplay.
I've found this simple workaround to be useful, especially as I prefer to develop passenger and mail networks before I start on industries, and this way the scenario is protected from the code's enthusiasm for completely trashing things!
For example, in the scenario I'm currently working on, the game closed down 18 industries in the first two game-years, completely undermining the design of the scenario. This can be rather disheartening, and I believe would tend to discourage players from bothering to create elaborate scenarios once they realised what the game will do to them!
I hope the patch gets into trunk, but at the moment for me the game crashes even when the patch is compiled against a (supposedly) compatible nightly.
So here's a very simple workaround that I came up with for the time being, to prevent the game trashing scenarios, that I thought perhaps might be useful for other players ...
Instead of placing industries into a scenario from the outset, just place a sign at the intended location. Then once the scenario is loaded into the game, use the ingame cheat to switch to an unused player slot (say Player 8 ) ... allocate that player $20 million, then use the 'Fund Industry' to establish the industry when you're ready to connect to it. (Note, you'll probably need to Configure Patches to 'Local Authority being permisssive' about demolishing things!)
Of course, signs can be switched on /off from the tools button, so the map doesn't need to be 'contaminated' with lots of signs being displayed during gameplay.
I've found this simple workaround to be useful, especially as I prefer to develop passenger and mail networks before I start on industries, and this way the scenario is protected from the code's enthusiasm for completely trashing things!
- Attachments
-
- The usual approach ...
- A022.jpg (200.85 KiB) Viewed 5548 times
-
- The workaround ...
- A023.jpg (197.83 KiB) Viewed 5537 times
Re: A dirty fix to stop industries being deleted ...
Wouldn't it be better to fix this properly by a patch? This is a bit awkward solution.
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: A dirty fix to stop industries being deleted ...
Yes certainly, a patch is a far more preferable solution.
This approach is just offered as a suggestion (a dirty fix really, as indicated in the thread title) for anyone using the Scenario Editor, to use as an intermin solution - until a permanent patch is accepted into trunk. There again, there's no indication of plans to permanently address this difficulty with scenarios ... so this approach might turn out to be the only way for scenario creators to get around the glitch. Well, it's the only solution I could think of anyway!
At the moment, when I'm play-testing scenarios, they're all completely trashed within 3 to 5 game-years ... and this makes it impossible to see how factors like city-growth would influence the positioning of farms, forests etc within the scenario.
I'm also testing the use of motorways as a mechanism for limiting the growth and shape of cities, given that town-growth seems to be (conveniently) halted by the presence of dual carriageways ... but if all the industries I've set up in a city get deleted by the game within a few years, it distorts the outcomes for these playtests.
As I hinted in my first post, it really is a complete waste of time trying to create scenarios of any complexity given the current code. But yep, you're right - this is an awkward solution, it is only suggested as a usable workaround for the time being.
This approach is just offered as a suggestion (a dirty fix really, as indicated in the thread title) for anyone using the Scenario Editor, to use as an intermin solution - until a permanent patch is accepted into trunk. There again, there's no indication of plans to permanently address this difficulty with scenarios ... so this approach might turn out to be the only way for scenario creators to get around the glitch. Well, it's the only solution I could think of anyway!
At the moment, when I'm play-testing scenarios, they're all completely trashed within 3 to 5 game-years ... and this makes it impossible to see how factors like city-growth would influence the positioning of farms, forests etc within the scenario.
I'm also testing the use of motorways as a mechanism for limiting the growth and shape of cities, given that town-growth seems to be (conveniently) halted by the presence of dual carriageways ... but if all the industries I've set up in a city get deleted by the game within a few years, it distorts the outcomes for these playtests.
As I hinted in my first post, it really is a complete waste of time trying to create scenarios of any complexity given the current code. But yep, you're right - this is an awkward solution, it is only suggested as a usable workaround for the time being.
Re: A dirty fix to stop industries being deleted ...
A hacky patch to do this involves rewriting CheckIndustryCloseDownProtection in industry_cmd.cpp to always return true. Ill post a diff with a proper patch tonight, if nobody else does it first.
Re: A dirty fix to stop industries being deleted ...
would be so nice with an options if the game, to enable or disable closing and spawning of new industries
Feel free to join my server on 90.185.50.242. its coop, meaning 1 company to dominate the whole map its more random and not as pro as the Openttd Coop guys.
-
- Traffic Manager
- Posts: 198
- Joined: 31 Oct 2007 10:54
- Location: a/c closed
Re: A dirty fix to stop industries being deleted ...
andrewas ... well, occasionally problems do have very simple solutions, so it wouldn't necessarily be a hack.
If all that is needed to fix this is to just set a single Boolean flag somewhere, then hopefully your fix could be added to 'Configure Patches' as a simple on/off option, and find its way into trunk fairly quickly.
Fingers crossed anyway!
If all that is needed to fix this is to just set a single Boolean flag somewhere, then hopefully your fix could be added to 'Configure Patches' as a simple on/off option, and find its way into trunk fairly quickly.
Fingers crossed anyway!
Re: A dirty fix to stop industries being deleted ...
Actually, you can fix the problem with the other patch - its actually a bug in OTTD, and its being aggravated by additional checking. Patch against revision 11771 or earlier and you wont get that assert, or remove checking in date.cpp, fairly simple to do, check the SVN repository for the relevant diff.
- belugas
- OpenTTD Developer
- Posts: 1507
- Joined: 05 Apr 2005 01:48
- Location: Deep down the deepest blue
- Contact:
Re: A dirty fix to stop industries being deleted ...
That is out of the question, as far as i am involved.one billion daleks wrote:... fix this is to just set a single Boolean flag somewhere, then hopefully your fix could be added to 'Configure Patches' as a simple on/off option, and find its way into trunk fairly quickly.
That would not be enough, i fear.andrewas wrote:A hacky patch to do this involves rewriting CheckIndustryCloseDownProtection in industry_cmd.cpp to always return true.
The BEST way to do so would be do play in ChangeIndustryProduction, and follow the work been on the Industry member prod_level.
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
-
- Traffic Manager
- Posts: 198
- Joined: 31 Oct 2007 10:54
- Location: a/c closed
Re: A dirty fix to stop industries being deleted ...
Oh well, never mind.
Actually, I've found the method of creating labels as 'place-holders' for industries is working perfectly well, and isn't proving awkward at all.
So this workaround has made the problem with industry go away. Now I just get the occasional new industry generated, and those ones can just be left in situ, or demolished by the player.
Actually, I've found the method of creating labels as 'place-holders' for industries is working perfectly well, and isn't proving awkward at all.
So this workaround has made the problem with industry go away. Now I just get the occasional new industry generated, and those ones can just be left in situ, or demolished by the player.
Re: A dirty fix to stop industries being deleted ...
And how do you do this?use the ingame cheat to switch to an unused player slot (say Player 8 ) ... allocate that player $20 million
-
- Traffic Manager
- Posts: 198
- Joined: 31 Oct 2007 10:54
- Location: a/c closed
Re: A dirty fix to stop industries being deleted ...
The ingame cheats are accessed with keypress [Ctrl][Alt][C]
But if this doesn't work, then it will be because you already have [Ctrl][Alt][C] defined to perform some other function on your PC. For example, I used to have it set up as a keyboard shortcut to access the Windows Calculator. So I had to redefine that shortcut to something else before the OTTD cheats could be accessed.
You'll see a message saying "By using cheats, you betray your fellow competitors. Keep in mind that such a disgrace will be remembered for eternity" ...
... but hey, I wouldn't worry about that! ...
... as far as I'm concerned, cheats are essential to make the game run properly!
But if this doesn't work, then it will be because you already have [Ctrl][Alt][C] defined to perform some other function on your PC. For example, I used to have it set up as a keyboard shortcut to access the Windows Calculator. So I had to redefine that shortcut to something else before the OTTD cheats could be accessed.
You'll see a message saying "By using cheats, you betray your fellow competitors. Keep in mind that such a disgrace will be remembered for eternity" ...
... but hey, I wouldn't worry about that! ...
... as far as I'm concerned, cheats are essential to make the game run properly!
Re: A dirty fix to stop industries being deleted ...
I wrote a patch than allowed also to use Ctrl+alt+shift+C in these cases (as ctrl+alt+something is very often used as hotkey for something) but the patch was rejected for trunk.one billion daleks wrote:But if this doesn't work, then it will be because you already have [Ctrl][Alt][C] defined to perform some other function on your PC. For example, I used to have it set up as a keyboard shortcut to access the Windows Calculator. So I had to redefine that shortcut to something else before the OTTD cheats could be accessed.
As I can't redefine the ctrl-alt-c shortcut (it is non-redefinable as it is in openttd) I can't use cheats unless I compile my own version with the patch.
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: A dirty fix to stop industries being deleted ...
That's odd that your patch was rejected Bilbo, as it sounds like a perfectly reasonable idea to me!
Another alternative would be to activate cheats from the console, like in other games, but I couldn't find anything on the wiki that says you can use that method.
So how come you can't redefine [Ctrl][Alt][C] on your PC ... what happens when you use that hotkey outside the game ...?
Another alternative would be to activate cheats from the console, like in other games, but I couldn't find anything on the wiki that says you can use that method.
So how come you can't redefine [Ctrl][Alt][C] on your PC ... what happens when you use that hotkey outside the game ...?
Re: A dirty fix to stop industries being deleted ...
Doesn't work with Beta 2.
-
- Traffic Manager
- Posts: 198
- Joined: 31 Oct 2007 10:54
- Location: a/c closed
Re: A dirty fix to stop industries being deleted ...
Oh, I didn't know that ... I'm running beta-1.
Do you know if that's a bug in beta-2, or a deliberate change to the code ...?
Do you know if that's a bug in beta-2, or a deliberate change to the code ...?
Re: A dirty fix to stop industries being deleted ...
In windows versions the cheat is: [ctrl] + [alt] + [WIN] + [C] (WIN = Windows Key)
Re: A dirty fix to stop industries being deleted ...
I know, I read than on the wiki too. Unfortunatly, my keyboard lacks the "windows" keys, so I cannot use this either. I find them annoying, so I actually never bought a keyboard equipped with them.sforget wrote:In windows versions the cheat is: [ctrl] + [alt] + [WIN] + [C] (WIN = Windows Key)
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: A dirty fix to stop industries being deleted ...
Yes.. this worked.. whaha.. what a great function. Crossing tunnels.. is really a neat function!!!sforget wrote:In windows versions the cheat is: [ctrl] + [alt] + [WIN] + [C] (WIN = Windows Key)
-
- Traffic Manager
- Posts: 198
- Joined: 31 Oct 2007 10:54
- Location: a/c closed
Re: A dirty fix to stop industries being deleted ...
That's good news Nemesis ... now you can switch off those pesky AI players and start managing all eight companies y'self!
Re: A dirty fix to stop industries being deleted ...
one billion daleks wrote:That's good news Nemesis ... now you can switch off those pesky AI players and start managing all eight companies y'self!
I never play with the computer. They ruin (?) the world!
Who is online
Users browsing this forum: Google [Bot] and 13 guests