Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Sat May 25, 2013 8:45 pm

All times are UTC




Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Fri Oct 17, 2008 4:19 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Fri Jun 16, 2006 5:18 pm
Posts: 267
Location: Somwhere near a computer
http://www.tt-forums.net/viewtopic.php?f=32&t=40068&p=737264

See that post for the specification of this patch.

Version History
0.0.1 - Initial Release 17/10/08

o Added the choice to advanced settings to chose none or all are able to close
o Built against R14469

0.0.2 Added Open option as well 17/10/08
o Added the ability to stop industries opening.

0.0.3 18/10/08
o Update so that you do not have 'empty' primary industries any more.

Please can you post if you notice any weirdness with the opening and/or closing sections.
Also please post if the empty primaries do appear when this is enabled, thank you.


NOTE: code breaks the NewGRF specification and therefore, it may break NewIndustry GRF


Attachments:
File comment: Patch
industry_open_close.patch [6.34 KiB]
Downloaded 94 times
File comment: Binary v0.0.3
OTTD.zip [2.81 MiB]
Downloaded 71 times

_________________
SORRY for poor punctuation

Lealta Alla Famiglia
TFM
Stoned Fish Gaming


Last edited by burty on Sun Oct 19, 2008 4:23 pm, edited 3 times in total.
Top
 Profile  
 
PostPosted: Fri Oct 17, 2008 5:36 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Sun Jan 27, 2008 1:02 pm
Posts: 298
This is quite a nice option, although I doubt whether the devs will ever accept this because NewGRF is the preferred format. Even so it really has its benefits and personally I'd like to see this in-game.

Please allow me to give some comments about this patch:

patch wrote:
{LTBLUE}Industries Allowed To Close During Gameplay {ORANGE}{STRING1}
Not Every Word Of A String Has To Be Capitalized.

Don't add the strings for openable industries if the option is not implemented (yet?)

patch wrote:
if (_settings_game.construction.closeable_industries == 0) {
if (closeit && !CheckIndustryCloseDownProtection(i->type)) {
Merge this into a single if(..)

SDT_VAR() breaks savegame compatibility because openttd now expects the variable in every savegame it opens, which is obviously not the case in older saves. Use SDT_CONDVAR() instead.

_________________
Create your own NewGRF? Check out this tutorial!


Top
 Profile  
 
PostPosted: Fri Oct 17, 2008 6:41 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Fri Jun 16, 2006 5:18 pm
Posts: 267
Location: Somwhere near a computer
Sorry mate i forgot to thank you :( REALLY sorry man,
Thank you loads and loads for that :D.


Updated first post with new versions


Edit: Sorry mate forgot to thank you :(

_________________
SORRY for poor punctuation

Lealta Alla Famiglia
TFM
Stoned Fish Gaming


Top
 Profile  
 
PostPosted: Fri Oct 17, 2008 8:35 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Apr 07, 2008 6:29 pm
Posts: 1861
Location: Czech Republic
Sounds good.

Btw I think it should be stored in savegames - it would allow for scenarios to have it as default "build-in" (but still disablable) option. I think most well-done scenarios like the Cindini really don't make sense with enabled closures and openings.

_________________
Please support M:TG Stack Exchange site proposal!


Top
 Profile  
 
PostPosted: Fri Oct 17, 2008 8:49 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Fri Jun 16, 2006 5:18 pm
Posts: 267
Location: Somwhere near a computer
CommanderZ wrote:
Sounds good.

Btw I think it should be stored in savegames - it would allow for scenarios to have it as default "build-in" (but still disablable) option. I think most well-done scenarios like the Cindini really don't make sense with enabled closures and openings.



Thank you :D, i have (i think put it in save games).
The older save games do not work with this but then that does not surprise me... that may be something i look into for future refernce :D.
Thank you CommanderZ :D.

_________________
SORRY for poor punctuation

Lealta Alla Famiglia
TFM
Stoned Fish Gaming


Top
 Profile  
 
PostPosted: Sat Oct 18, 2008 8:16 am 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
You can preserve backward compatibility if you do it correctly..

To do it, you need to increase the version number (in saveload.cpp) by one, compared to the trunk version you based it on, and make all saved patch settings conditional (like Swallow said). That means they will only be expected in a certain range of revisions. And for this range you specify [number you increased to in saveload.cpp] to SL_MAX_VERSION.


PS: after looking at your code, you already use CONDVAR for one of them, but VAR for the other :? also you use the amount of parameters for the VAR line that would be expected by a CONDVAR.. :? I think you should change it to CONDVAR too. This in combination with bumping the savegame version and using that version where now stands "77" should solve the backward compatibility problem.

_________________
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage


Top
 Profile  
 
PostPosted: Sat Oct 18, 2008 8:43 am 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Sun Sep 09, 2007 5:03 am
Posts: 2458
Location: home
I don't think you are there yet.
You have disabled actually closing of industry, but afaik all primary industries get exhausted when used, so your game will end up with a lot of 'empty' primary industries.


Top
 Profile  
 
PostPosted: Sat Oct 18, 2008 9:53 am 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Fri Jun 16, 2006 5:18 pm
Posts: 267
Location: Somwhere near a computer
Updated First Post with new Versions

_________________
SORRY for poor punctuation

Lealta Alla Famiglia
TFM
Stoned Fish Gaming


Top
 Profile  
 
PostPosted: Sat Oct 18, 2008 10:30 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Apr 07, 2008 6:29 pm
Posts: 1861
Location: Czech Republic
Did you test this with ECS/Pikka's industries?

_________________
Please support M:TG Stack Exchange site proposal!


Top
 Profile  
 
PostPosted: Sat Oct 18, 2008 10:53 am 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Fri Jun 16, 2006 5:18 pm
Posts: 267
Location: Somwhere near a computer
No this is a CLEAN OTTD eg No GRFs played with.

_________________
SORRY for poor punctuation

Lealta Alla Famiglia
TFM
Stoned Fish Gaming


Top
 Profile  
 
PostPosted: Sat Oct 18, 2008 11:03 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Apr 07, 2008 6:29 pm
Posts: 1861
Location: Czech Republic
burty wrote:
No this is a CLEAN OTTD eg No GRFs played with.


I mean...what does it do, when a GRF requests an industry closure? It just ignores the request?

_________________
Please support M:TG Stack Exchange site proposal!


Top
 Profile  
 
PostPosted: Sat Oct 18, 2008 11:24 am 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Fri Jun 16, 2006 5:18 pm
Posts: 267
Location: Somwhere near a computer
CommanderZ wrote:
burty wrote:
No this is a CLEAN OTTD eg No GRFs played with.


I mean...what does it do, when a GRF requests an industry closure? It just ignores the request?


To be honest i do not know since i rarely play with anything more than plain OTTD :D, i will try now but if the GRF requests the closure in the same way as normal industries do then yes the GRF request would be ignored however i am guessing it is not as simple as that therefore meaning that GRFs can still close industries.

_________________
SORRY for poor punctuation

Lealta Alla Famiglia
TFM
Stoned Fish Gaming


Top
 Profile  
 
PostPosted: Sun Oct 19, 2008 1:10 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Fri Jun 16, 2006 5:18 pm
Posts: 267
Location: Somwhere near a computer
I tested this with Chemical vectors GRF and it seems that the chem plants did NOT close.
I played for ~roughly~ ONE game year give or take a month :D.

_________________
SORRY for poor punctuation

Lealta Alla Famiglia
TFM
Stoned Fish Gaming


Top
 Profile  
 
PostPosted: Sun Oct 19, 2008 4:18 pm 
Offline
Chairman
Chairman

Joined: Sat Jan 20, 2007 12:08 pm
Posts: 776
Location: Germany
burty wrote:
I tested this with Chemical vectors GRF and it seems that the chem plants did NOT close.
I played for ~roughly~ ONE game year give or take a month :D.

Well, I guess the real question is not if they don't close (they won't if you don't let them :wink:), but if they are well-behaving after they requested closure. I doubt that NewGRF authors coded state transitions from closed state to a usable state, as that just can't happen normally. And even if by luck (or should I say by accident) it seems to work cleanly it can break at any time, so you should state clearly that your code breaks the NewGRF specification and therefore, it may break NewIndustry GRFs (you might have known that if you had read and understood the current topics on that in TTDPatch Graphics and OpenTTD Graphics forums :roll:).

BTW, one game year is not enough to test that given that ECS industries are protected of closure in the first five years.

_________________
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008


Top
 Profile  
 
PostPosted: Wed Nov 05, 2008 2:37 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Thu Sep 11, 2008 7:32 am
Posts: 1028
Location: Spain
This patch is great, I always play with it :D

I've run into the same problem Alberth has, though. Industries end having such a low production that you can't pick any cargo on them. Sometimes I have to enable closure just to get them out of the map.

_________________
Spanish translation of OpenTTD
Extended heightmaps

Have fun, don't quarrel too much and add as many advanced settings as you can.


Top
 Profile  
 
PostPosted: Wed Nov 05, 2008 2:57 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Tue Apr 05, 2005 1:48 am
Posts: 1506
Location: Deep down the deepest blue
Hehehe... how UNEXPECTED!

NOT!

It's nice people start to realize finally the price of simply preventing industry closure :)

/me feels rejoyced!

_________________
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


Top
 Profile  
 
PostPosted: Tue Nov 11, 2008 1:24 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 06, 2004 11:51 pm
Posts: 1463
Location: The sunny side of Alps
Terkhen wrote:
This patch is great, I always play with it :D

I've run into the same problem Alberth has, though. Industries end having such a low production that you can't pick any cargo on them. Sometimes I have to enable closure just to get them out of the map.

Well, Terkhen - and to rain on belugas' parade some - you can get those industries up, though gradually. The whole point of this patch is for such beautifully crafted scenarios as aforementioned, not for just any random game. If of course I make a newGRF for such behaviour (though limited to default industry set), it can be then used for such scenarios...

_________________
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.

Keep 'em rollin'!


Top
 Profile  
 
PostPosted: Sat Dec 13, 2008 2:39 pm 
Offline
Engineer
Engineer

Joined: Tue Nov 18, 2008 11:01 pm
Posts: 16
I wished this patch work with Pika's Basic Industries.
I'm getting so disappointed when I'm done building a station/network and seeing the industry next to it vanish the second after.

This is in my opinion a must have feature for advanced settings.


Top
 Profile  
 
PostPosted: Sat Dec 13, 2008 2:47 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Fri Jun 16, 2006 5:18 pm
Posts: 267
Location: Somwhere near a computer
I would be willing to get it working with NewGRF industries but would need someone who has knowledge of the workings (c++ code side) of the NewGRFs as whenever I have looked in there I end up go around in forever increasing circles and closeing the program for the next 2months.

Since the source is open as is this patch I am sure someone may be able to patch the patch to work with Pikka's sets

_________________
SORRY for poor punctuation

Lealta Alla Famiglia
TFM
Stoned Fish Gaming


Top
 Profile  
 
PostPosted: Sat Mar 28, 2009 10:35 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Fri Jun 16, 2006 5:18 pm
Posts: 267
Location: Somwhere near a computer
As requested updated to trunk


Attachments:
industry_open_close 15879.patch [5.08 KiB]
Downloaded 35 times

_________________
SORRY for poor punctuation

Lealta Alla Famiglia
TFM
Stoned Fish Gaming
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: Robbedem and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000-2013 phpBB Group

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2013.
Hosted by Zernebok Hosting.