Page 2 of 2
Posted: 01 May 2006 21:35
by gigajum
Julz wrote:visual cues for engine age (new / well used / time to replace) would be wonderful. I do hope this is implemented.
No it is not. Maybe it will, i hope so. It looks great

Posted: 02 May 2006 05:13
by Hazen
I refined my idea a bit. I played around with
ImageMagick and wrote a little script that applies a dirt map to an image.
Now assuming that in future the 32bit trains are in some kind of package (say a zip-packed file with a directory for all the sprites, for example,
dv12.pak), it would be easy then to extract all the sprites and throw them to a script that converts the sprites to look dirty. After that the script makes a duplicate of the original train.pak and renames it something like
dv12_dirt.pak and replaces the sprites with the dirty ones. So the only differences between
dv12.pak and
dv12_dirt.pak are the name and the sprites.
The point of this is, that the only thing that the code needs to do is:
- check if a
train_name_dirt.pak exists
- use the
train_name_dirt.pak when trains age is over X years
I dont' think that this kind of functionality would be too hard to implement in a patch. And of course, if
train_name_dirt.pak isn't found, then everything would continue as normal.
One of the downsides of using this kind of script is that it takes around two seconds (on my computer, 1.8 GHz) to create the new sprite. So with 40 sprites per train and around 20 trains it would take close to half an hour to convert all.
On the upside, this should be easy to code and you could easily replace the dirtmap with your own, if you're not happy with it for a reason or another.
I'll leave you with the actual script, couple of samples (I borrowed Crazy Vaclav's grain hoppers from the wiki) and a dirtmap that I used.
Code: Select all
#!/bin/bash
#Dirtify script by Hazen, version 0.1
#Usage: ./dirtify train_image.png dirt_map.png
convert -level 10%,100%,1.0 $1 dark.png
composite -compose Dst_In -gravity center dark.png $2 mask.png
composite -gravity center mask.png dark.png dirt_$1
mogrify -level 10%,100%,1.0 dirt_$1
rm dark.png mask.png
Edit: fixed the link
Posted: 02 May 2006 09:42
by XeryusTC
It looks nice on the locomotives, however the spheres have a big dent in them now :s. I think that dirt spots should be smaller and maybe more liniear so it looks like the dirt is actually comming from the round and was swept (right context?) against the train.
Posted: 02 May 2006 10:08
by dmh_mac
I think the maximum amount shouldn't be much more than what you have at 1x dirtyfication. 2x is over the top...
Posted: 02 May 2006 10:22
by richk67
Hazen - nice pics, but I would increase the brightness and contrast with each successive layer. Like a fog filter on a camera, your overlay has the effect of reducing both.
Posted: 02 May 2006 10:28
by Ben_Robbins_
I agree to dmh_mac, the 3rd one is a bit too far. Your dirt texture image has its dark dirty bits and light clean bits...could the clean bits not be invisible, opake....
Posted: 02 May 2006 10:38
by dmh_mac
I think he's already using a subtractive blend.
Also opaque and invisible arent realy the same thing...
Posted: 02 May 2006 10:48
by Ben_Robbins_
I couldnt say what i ment right....basically, if the dirt jpg had a bright green layer behind it with opacity at 100% could the green still be seen
Posted: 02 May 2006 19:07
by ZxBiohazardZx
Ben_Robbins_ wrote:I agree to dmh_mac, the 3rd one is a bit too far. Your dirt texture image has its dark dirty bits and light clean bits...could the clean bits not be invisible, opake....
i agree for the loco, on the oil car it kinda looks better (the grain one not)
Posted: 02 May 2006 19:10
by Crazy Vaclav
They are all grain trucks. And I agree, 1x is enough.
Posted: 02 May 2006 19:17
by peter1138
This is, of course, already possible. With NewGRF (tm). However, the graphics there are probably too small to make much difference...
Posted: 02 May 2006 19:37
by MeusH
Peter1138: Yes, of course it is possible, but it would require doubling/tripling amount of sprites and sudden graphical changes.
The overlay would add just one or two images of dirt, and would be generated probably on the fly.
Posted: 02 May 2006 20:23
by charlieg
Erm these dirty maps are so flawed.
Trains spend the majority of their time in motion. The other major factor is gravity. Therefore things do not just change colour or darken, but the dirt is either spread or dripped on the surfaces of a train. So your ideal dirtmap will contain elements of both.
Posted: 02 May 2006 20:26
by DaleStan
MeusH wrote:The overlay would add just one or two images of dirt, and would be generated probably on the fly.
Requiring ... how much processor power?
Posted: 02 May 2006 20:45
by MeusH
DaleStan wrote:MeusH wrote:The overlay would add just one or two images of dirt, and would be generated probably on the fly.
Requiring ... how much processor power?
And that's the problem. It would allocate the sprite image and paste the dirt texture on non-transparent places of the sprite.
This is a nice idea, but it is purely cosmetic, with lot of possible effort for not a big benefit... Remind us post 0.7, maybye?

Posted: 02 May 2006 21:51
by Redirect Left
I actually like the way the spheres look like they are dented, it shows use over the years

Posted: 02 May 2006 23:17
by Ichi
shouldn't there be a texture that shows the paint of the trains falling off? And showing some rust underneath it? That would make it way more realistic, since not only dust hits trains (rocks, birds, insects, cars, cows, people, etc.)
Posted: 03 May 2006 16:49
by Hazen
charlieg wrote:Erm these dirty maps are so flawed.
Trains spend the majority of their time in motion. The other major factor is gravity. Therefore things do not just change colour or darken, but the dirt is either spread or dripped on the surfaces of a train. So your ideal dirtmap will contain elements of both.
and
Ichi wrote:shouldn't there be a texture that shows the paint of the trains falling off? And showing some rust underneath it? That would make it way more realistic, since not only dust hits trains (rocks, birds, insects, cars, cows, people, etc.)
Yes, paint falling off and dirt on specific places would be really nice and it would look more realistics, but it would mean that we would need a huge amount of individual dirt maps. Other way (which would achieve even better results) to make this would be to render all the models with dirt textures. Problem with both of these is the
huge amount of textures and/or work that is needed to achieve this.
I'm trying to make this work with one (or maybe a couple) dirtmap, which would be applied to
allready existing sprites. The result, of course, being far from ideal but still, I think, better than nothing. So not only one map has to work for all trains, it has to work on all trains on all angles (forty of them).
DaleStan wrote:
MeusH wrote:The overlay would add just one or two images of dirt, and would be generated probably on the fly.
Requiring ... how much processor power?
Is this so different from the
realtime remapable colours that the same techniques couldn't be used? And if this is impossible, the possibility of generating the dirty sprites beforehand remains.