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

Post Reply
MJS
Director
Director
Posts: 540
Joined: 28 Jul 2005 09:31

Re: Patch: Grass growth on unused tracks

Post by MJS »

The grass seems to clear ahead of a locomotive. Wouldn't it be more logical if the grass would disappear behind a locomotive/train?
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 »

MJS wrote:The grass seems to clear ahead of a locomotive. Wouldn't it be more logical if the grass would disappear behind a locomotive/train?
Yes, but there is no 'Vehicle Leave Tile' callback where I can do that :)
User avatar
White Rabbit
Tycoon
Tycoon
Posts: 1734
Joined: 22 Jun 2005 19:15

Re: Patch: Grass growth on unused tracks

Post by White Rabbit »

Maybe add a delay to the change?
Image
MJS
Director
Director
Posts: 540
Joined: 28 Jul 2005 09:31

Re: Patch: Grass growth on unused tracks

Post by MJS »

If you know the speed of the train, you could calculate the 'when', I guess.

Something completely different: overhead wires now go only straight ahead at a junction if the next tile on the diverging line is non-electrified. However, grass does not grow on the first bit of a side track if the main track is without grass. That's a pity, actually, isn't it? Do you think the same method could be implemented here as for the overhead wires?
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 »

MJS wrote:Do you think the same method could be implemented here as for the overhead wires?
Not a bad idea at all my friend, not bad at all...
MJS
Director
Director
Posts: 540
Joined: 28 Jul 2005 09:31

Re: Patch: Grass growth on unused tracks

Post by MJS »

Thank you :-) And while you're on the case: you've surely noticed tunnels are also without grass.
FinnAir, 25th Mar 1935.png
FinnAir, 25th Mar 1935.png (303.77 KiB) Viewed 1003 times
User avatar
Ben_K
Tycoon
Tycoon
Posts: 1166
Joined: 01 Jun 2006 15:15
Location: Sydney, AUS

Re: Patch: Grass growth on unused tracks

Post by Ben_K »

Yeah, I only did basic sprites for the initial coding. I havent done tunnels etc. yet. Obviously if people like the grass Ive done I can do more for the rest of the tiles. One thing that is a shame is that its done by tile and not by track piece so crossing tracks will be clean and so will vertical ones, like in your picture. Im sure its possible eventually though.

Edit: In fact, I think you may be able to use the standard overlays on the tunnel tiles too. Boekabart might be able to advise us on this.
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 »

Ben_K wrote:In fact, I think you may be able to use the standard overlays on the tunnel tiles too. Boekabart might be able to advise us on this.
I think we can - did not do this yet, though.

I've implemented the idea mentioned above. Now, a track piece (per piece!) will not show 'less growth' than the amount of growth 'stored' in its neighboring tracks. This will usually not effect the main line, but that switch track to the not-so-often used sideline will get the maximum of the main track and the first tile of the sideline, which will be the amount of growth on the sideline.

Positive side effects:
* Vehicle 'seems to' no longer clear the track in front of it, but under it (in fact it DOES, it just doesn't show :))
* Parallel 'diagonal' tracks are no longer a dotted line of growth and not.

Cost in map-bits: 0. Just a little more complicated drawing code!

Enjoy!
Attachments
Positive effects shown here! <br />(Please ignore the spaces between the cars - it's another experiment I'm doing)
Positive effects shown here!
(Please ignore the spaces between the cars - it's another experiment I'm doing)
bb_OldTracks_v9_FancySwitches.png (92.6 KiB) Viewed 4907 times
bb_oldtracks_v9_r11226.diff
(9.75 KiB) Downloaded 133 times
chrissicom
Route Supervisor
Route Supervisor
Posts: 415
Joined: 07 Oct 2004 10:05

Re: Patch: Grass growth on unused tracks

Post by chrissicom »

Nice update, I'll also update the code used in ChrisIN. Also another question as I got it from a ChrisIN user. Is it possible to make this patch optionable, i.e. disable/enable it with a patch option so if you don't like the grass or eventually have an ultra slow computer which needs every bit of performance you can turn it off?
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 »

chrissicom wrote:NIs it possible to make this patch optionable, i.e. disable/enable it with a patch option so if you don't like the grass or eventually have an ultra slow computer which needs every bit of performance you can turn it off?
I'll think about it, I wouldn't know why not, and agree that it should be an optional thing.
zooks
Transport Coordinator
Transport Coordinator
Posts: 262
Joined: 29 Jun 2006 08:36

Re: Patch: Grass growth on unused tracks

Post by zooks »

i like the idea but its not complete, so a setting to turn it off would be nice

look at the station and the tunnels and you see what i mean
Attachments
Confuse a Cat Ltd., 13th Dec 1955.png
Confuse a Cat Ltd., 13th Dec 1955.png (178.9 KiB) Viewed 1224 times
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 »

zooks wrote:look at the station and the tunnels and you see what i mean
I see that you constructed a lot for nothing! :)

But seriously - I doubt that I'll be able to get it to work for stations, probably there won't be space in the map array for this (anyway they do keep stations clean :) ). Tunnels can be expected to be done tomorrows, just like the patch setting (or transparency option in fact - since the patch doesn't change any behavior at all).

I also notice another bug in your screen shot: for some tracks on slopes, the offset isn't calculated correct. I'll take a look at that too.
zooks
Transport Coordinator
Transport Coordinator
Posts: 262
Joined: 29 Jun 2006 08:36

Re: Patch: Grass growth on unused tracks

Post by zooks »

I see that you constructed a lot for nothing! :)
i love doing that :)
thats where most of my hours go..
User avatar
Ben_K
Tycoon
Tycoon
Posts: 1166
Joined: 01 Jun 2006 15:15
Location: Sydney, AUS

Re: Patch: Grass growth on unused tracks

Post by Ben_K »

With regard to stations, I know my overlays will look daft. They are wider than the track gap and would overlap the platforms! I suppose that may be justification to use just rusty tiles for the 1st stage and then limit the station to only stage 1 of growth? What do you think Boekabart? If you like it, I'll do some rusty track overlays.

I think it has to be an on/off patch option. Especially if we want it in trunk one day (Which I do!). I would also like to see each stage configurable so that I can change how soon the tracks get overgrown. Im guessing its possible with some work?
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 »

Ben_K wrote:What do you think Boekabart? If you like it, I'll do some rusty track overlays.
The problem is that I'm not sure whether station tiles have the 8 bits that it requires to keep track of the track usage. If not, I would have to take the track usage from both ends of the station -> might be a bit slow for a drawing function.
Ben_K wrote:I think it has to be an on/off patch option. Especially if we want it in trunk one day (Which I do!). I would also like to see each stage configurable so that I can change how soon the tracks get overgrown. Im guessing its possible with some work?
On/off: I agree completely.
Configurable: At this moment, I don't think it's very useful configuring the formula used to calculate the 'track usage number', which ranges from 0 to 255, 0 being 'used often and recent', since it's quite well balanced already, I think.
This number currently is divided by 64, resulting in the 4 growth stages (0..63 being no growth). Those threshold, currently at 64,128 and 192, could be configurable, I suppose - at a slight performance cost.
User avatar
Ben_K
Tycoon
Tycoon
Posts: 1166
Joined: 01 Jun 2006 15:15
Location: Sydney, AUS

Re: Patch: Grass growth on unused tracks

Post by Ben_K »

Hmmm... I just have the feeling that different people would probably like different levels of grass. If it affects the patches usability then leave it. :)
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 »

Ben_K wrote:Hmmm... I just have the feeling that different people would probably like different levels of grass. If it affects the patches usability then leave it. :)
I'm not sure I understand what you mean by 'different levels of grass'.
T-Unit
Transport Coordinator
Transport Coordinator
Posts: 368
Joined: 03 Feb 2007 18:53
Location: Leeds, England

Re: Patch: Grass growth on unused tracks

Post by T-Unit »

boekabart wrote:I'm not sure I understand what you mean by 'different levels of grass'.
I think he means:
No grass
A little grass
More grass
Lots of grass
User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Re: Patch: Grass growth on unused tracks

Post by athanasios »

I personally think that the last stage is too much. I would like to have the option (in grf config. window) to exclude it.
Since Dave Worley has already done a rusty grf maybe you cooperate with him?
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.
Youri219
Traffic Manager
Traffic Manager
Posts: 191
Joined: 28 Apr 2007 11:53

Re: Patch: Grass growth on unused tracks

Post by Youri219 »

Grass in the desert also looks a bit silly, haven't tested snow yet. Any chance you can adjust the colour of the 'grass' to the colour of the tile it is on?
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 41 guests