Patch: Grass growth on unused tracks

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Tautrimas
Engineer
Engineer
Posts: 54
Joined: 20 May 2008 17:29
Location: Lithuania (Europe)

Re: Patch: Grass growth on unused tracks

Post by Tautrimas »

I've just played a bit with old 11226 revision and I must say it is pretty awesome feature. Maybe it is possible to update this patch?
User avatar
Phazorx
Engineer
Engineer
Posts: 12
Joined: 20 Jul 2004 23:13
Contact:

Re: Patch: Grass growth on unused tracks

Post by Phazorx »

Updated patch to r14450 (with hel of planetmaker)
(significant: moved data to m2 bits 8-15, to avoid overlapping wth YAPP)
Attachments
poldtracks.14450.diff
old tracks update for revision 14450
(10.31 KiB) Downloaded 235 times
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Patch: Grass growth on unused tracks

Post by planetmaker »

actually... The source code tells that the old tracks info is moved to m7, the extended map array :)
boekabart
Transport Coordinator
Transport Coordinator
Posts: 333
Joined: 25 Aug 2005 09:44
Location: Eindhoven, Netherlands

Re: Patch: Grass growth on unused tracks

Post by boekabart »

Phazorx wrote:Updated patch to r14450 (with hel of planetmaker)
(significant: moved data to m2 bits 8-15, to avoid overlapping wth YAPP)
Thanks for the update! For the record: since I don't have time to do it myself, I encourage other people to keep my patches alive!
MJS
Director
Director
Posts: 540
Joined: 28 Jul 2005 09:31

Re: Patch: Grass growth on unused tracks

Post by MJS »

This patch uses its own built-in graphics on top of any tracks set, doesn't it? Or does it need specially enhanced track grfs?
2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06
Contact:

Re: Patch: Grass growth on unused tracks

Post by 2007Alain2007 »

heres is and update and also the GRF
grass on tracks.R16176.diff
oldtracks.grf
For Community Integrated Version http://code.google.com/p/civopenttd/
2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06
Contact:

Re: Patch: Grass growth on unused tracks

Post by 2007Alain2007 »

This can be used for snow on tracks as well if some one draws the GRF for it the patch should work with both :)
For Community Integrated Version http://code.google.com/p/civopenttd/
dpaanlka
Engineer
Engineer
Posts: 22
Joined: 18 Sep 2006 23:26

Re: Patch: Grass growth on unused tracks

Post by dpaanlka »

An additional idea - grass growth (or perhaps just general deterioration) on unused roads that have no local authority. In other words, any road that isn't too near a town (where it is more likely to be used by residents, etc) deteriorates over time with lack of use.
rsdworker
Traffic Manager
Traffic Manager
Posts: 148
Joined: 18 Mar 2009 13:58

Re: Patch: Grass growth on unused tracks

Post by rsdworker »

looks nice - useful for old abandoned lines
2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06
Contact:

Re: Patch: Grass growth on unused tracks

Post by 2007Alain2007 »

Hi not knowing much about C++ but i would not think it be to hard to add road tiles to this

And also if some one made a new GRF file for this that had snow and sand you could use this in more then just the uk maps :)
For Community Integrated Version http://code.google.com/p/civopenttd/
drew22299
Engineer
Engineer
Posts: 58
Joined: 05 Jun 2006 15:30

Re: Patch: Grass growth on unused tracks

Post by drew22299 »

Sorry if this is a newbie question but how do you add this patch into the game? I have tried adding it to previous versions of OTTD but it didn't show up in the game or as new graphics.

Does this patch need to be compiled with source code for it to work?

Thanks,
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Patch: Grass growth on unused tracks

Post by DaleStan »

Please read the sticky entitled "Howto apply a patch/diff file".
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
xZise
Engineer
Engineer
Posts: 57
Joined: 19 Mar 2009 16:52
Location: Bad Schwartau

Re: Patch: Grass growth on unused tracks

Post by xZise »

One note to the diff above (@ R16176):
You have to add "MP_" to the "RAILWAY" in the 3rd line of the function "IncreaseTrackUsage".

Sincerely
xZise
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Patch: Grass growth on unused tracks

Post by Yexo »

xZise wrote:One note to the diff above (@ R16176):
You have to add "MP_" to the "RAILWAY" in the 3rd line of the function "IncreaseTrackUsage".

Sincerely
xZise
I have no idea what you did, but in the patch above there is MP_RAILWAY just as it should. Most likely you deleted the MP_ yourself by accident.
xZise
Engineer
Engineer
Posts: 57
Joined: 19 Mar 2009 16:52
Location: Bad Schwartau

Re: Patch: Grass growth on unused tracks

Post by xZise »

Yexo wrote:
xZise wrote:One note to the diff above (@ R16176):
You have to add "MP_" to the "RAILWAY" in the 3rd line of the function "IncreaseTrackUsage".

Sincerely
xZise
I have no idea what you did, but in the patch above there is MP_RAILWAY just as it should. Most likely you deleted the MP_ yourself by accident.
Oh.... This prefix also exists in the diff-file .... Hmmm I have no Idee, why it was missing, BUT :P there was a conflict. I fixed it semimanually by coping the code of this function. But I forgot some chars before "RAILWAY"! I saw it an fixed it by copy the rest. So there I forgot the "MP_" ^^ Okay :P The diff is okay an the patch great :) Unfortunately there is no influence on the train :(

Sincerely
xZise
drew22299
Engineer
Engineer
Posts: 58
Joined: 05 Jun 2006 15:30

Re: Patch: Grass growth on unused tracks

Post by drew22299 »

Thanks for the information! I'm working as web developer using C# ASP.net - is C++ much different from C#? I was thinking about looking at the source code and having a go at developing something for OTTD.
User avatar
CommanderZ
Tycoon
Tycoon
Posts: 1872
Joined: 07 Apr 2008 18:29
Location: Czech Republic
Contact:

Re: Patch: Grass growth on unused tracks

Post by CommanderZ »

drew22299 wrote:Thanks for the information! I'm working as web developer using C# ASP.net - is C++ much different from C#? I was thinking about looking at the source code and having a go at developing something for OTTD.
Syntax is basically the same, but that's where the similiarity ends ;)
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Patch: Grass growth on unused tracks

Post by DaleStan »

Starting from a language-lawyery knowledge of C++, and rather limited knowledge of C#:
C++ has multiple inheritance instead of interfaces.
C++ has three operators (five, actually, but you'll never see or use two of them) in place of C#'s dot operator.
C++ doesn't enforce the Java-y everything-lives-in-a-class concept. (In fact, baring the corner cases where C code uses one of C++'s new reserved words, all valid C code is valid C++ code.)
C++ lets you overload operators more freely. (In standard C++, for example, it is legal to shift cout "Hello World!" bits to the left. It is further legal to overload the function-call and comma operators. Also (though you should NEVER EVER DO THIS -- provide an implicit conversion to bool instead) && and ||.)
C++ permits programmer-defined implicit conversions. (eg implicit conversions from a file stream to a bool.)
C++ does not have properties. But you can simulate them with a class with overridden assignment and implicit conversion operators.
C++ does not have indexers. But you can simulate them by overloading operator []. (See also above. And you can use non-POD types as indices.)
C++ uses public, protected, and private differently.
C++ templates (Generics) can take parameters that are any combination of any number of types and values. (e.g. bitset<256>)
C++ has pointers in addition to value and reference types.

To some extent, C++ is C# with the safety off. If you want to be protected from shooting yourself in the foot, use C#. But if you need to shoot between your toes, C# won't let you, even if you do know enough to be able to do it safely. Use C++ for that.
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
drew22299
Engineer
Engineer
Posts: 58
Joined: 05 Jun 2006 15:30

Re: Patch: Grass growth on unused tracks

Post by drew22299 »

Thanks for the detailed answer, I didn't realise there were that many differences between the two languages. I looked at the source code and I can see what most of the code is doing but there are so many classes lol
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Patch: Grass growth on unused tracks

Post by Alberth »

drew22299 wrote:I looked at the source code and I can see what most of the code is doing but there are so many classes lol
I don't see why that is funny, but yes, there are a lot of classes and support functions.
You don't need to understand everything before you can make changes, so just study the part that you are interested in.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 3 guests