[WIP] Trails

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

Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

[WIP] Trails

Post by Roujin »

This topic is dedicated for my patch that adds a third road type, a kind of dirt road only to be used by heavy trucks and maybe horse carriages. The idea came from andythenorth in this thread: http://www.tt-forums.net/viewtopic.php?f=32&t=37964

FYI, I've talked to Rubidium about the topic of new road types, and new road types won't be added in trunk until a rewrite of the system is done. So this will stay a patch of its own for now, with (sadly) only eyecandy-purposes.

The patch is currently WIP.
I will update this thread if there are news.
* @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
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: [WIP] Trails

Post by Roujin »

[reserved for future use]
* @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
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: [WIP] Trails

Post by Roujin »

andythenorth, the .pcx file you uploaded in the other thread seems to have a wrong pallete. I'm applying the palette to it now and will reupload it here then.

You can find the palette here in two formats:
svn://svn.openttd.org/extra/ottd_grf/palettes/openttd.gpl
svn://svn.openttd.org/extra/ottd_grf/palettes/palette.act
* @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
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5658
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: [WIP] Trails

Post by andythenorth »

Roujin wrote:andythenorth, the .pcx file you uploaded in the other thread seems to have a wrong pallete.
Oops. That's a pain. Looks like I can use the .act file to load swatches in Photoshop. Out of interest, did it look like the colours were transposed (just not correct for OTTD) or were they correct OTTD colours, used in the wrong place?
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: [WIP] Trails

Post by Roujin »

I think it was transposed, since the grfcodec would not encode it, saying something like "Error: wrong palette". But maybe it was just in another order? I don't know.. but the palette has to be correct, else the grfcodec won't accept it and make it into a .grf.

Now here's something new: A screenshot to tease you a bit ;)
The local farmer of Funborough Farm has made some trails with his tractor ;)
Funborough Transport, 24th Apr 1950.png
Funborough Transport, 24th Apr 1950.png (103.68 KiB) Viewed 1360 times
On a different note, after converting the thing to the proper palette, there were some action colors in it. Don't know if you've already learned about them since you're rather new to openttd grfs.. these are blinking colors of some sorts, and you normally don't want them in your sprite (except you're using them on purpose).
Here is a program that can be run over a sprite to replace action colors with similar looking ones: http://www.tt-forums.net/viewtopic.php?f=26&t=7519

I'll repost the sprites you gave me before, after I've done that..

edit: another thing: there is a certain limitation we have to get along with: the road sprites include the ground (grass, bare ground using some palette swap, or with pavement). Therefore for the combination of road and trails, we have to draw the road first, then the trails. Now if there is a x-crossing of road and trail, there can't be done much. The brown mud will be shown over the road. We can live with that I think, just imagine the heavy vehicles crossing the road there have made it muddy.
However, if we have a T-crossing of road and trail, we can make it better looking, if you adjust the half-tiles of the trails accordingly. Just imagine you lay a half tile of the trails over an orthoganal road piece. It should then look like the trail is nicely splitting off the road. Could you do that?

(I'm not sure if it's understandable what I wrote, so ask if it wasn't clear..)
* @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
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5658
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: [WIP] Trails

Post by andythenorth »

Roujin wrote: Now here's something new: A screenshot to tease you a bit ;)
The local farmer of Funborough Farm has made some trails with his tractor ;)
Funborough Transport, 24th Apr 1950.png
Hey, that works surprisingly well! I wasn't sure how much the sprites would line up etc. I have ideas for ways to improve them, but I'm tied up drawing grfs at the moment. Looks good.

There is a test .grf for Heavy Equipment here - can you get the mining truck to go down the trail? :wink: (truck is available in 1985, use 2nd CC to change it to the colour of your choice).
Roujin wrote:On a different note, after converting the thing to the proper palette, there were some action colors in it.[snip]
I'll repost the sprites you gave me before, after I've done that..
Apologies for that - I know about action colours (I am trying to figure out a way to use them to get blinking amber beacons on Heavy Equipment vehicles) - but I didn't intend to use them in trail sprites :shock:

I've got the palette loaded into Photoshop swatches; when you post the sprites, I'll check they are matching up; possibly Photoshop colour management has transposed some, or, more likely, it's conversion to indexed colours on the PCX export that has caused the problem.
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: [WIP] Trails

Post by Roujin »

okay, here's the .pcx file.
It was only one pixel that had an action color, so no worries :lol:

Have you read my edit in the post above?
About the mining truck: sorry, some more coding is required first before vehicles can go on the trails, and I don't have time anymore right now.. will come back at that later/tomorrow...
Attachments
trails.pcx
converted to openttd palette and ran over with palconvert
(89.67 KiB) Downloaded 473 times
* @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
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5658
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: [WIP] Trails

Post by andythenorth »

Roujin wrote:About the mining truck: sorry, some more coding is required first before vehicles can go on the trails, and I don't have time anymore right now.. will come back at that later/tomorrow...
Nah, don't worry. I figured it might not be ready yet. Here's a fake teaser:
trails_teaser_2.png
trails_teaser_2.png (107.32 KiB) Viewed 1148 times
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5658
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: [WIP] Trails

Post by andythenorth »

Roujin wrote:edit: another thing: there is a certain limitation we have to get along with: the road sprites include the ground (grass, bare ground using some palette swap, or with pavement). Therefore for the combination of road and trails, we have to draw the road first, then the trails. Now if there is a x-crossing of road and trail, there can't be done much. The brown mud will be shown over the road. We can live with that I think, just imagine the heavy vehicles crossing the road there have made it muddy.
That's fine, desirable even - but means taking a certain amount of care with how I draw the edges of the trails - they currently have green in them. Similar issue to dealing with different climate tiles; I guess I need to pick the brains of someone who has drawn a roadset (such as US Roads).
Roujin wrote:However, if we have a T-crossing of road and trail, we can make it better looking, if you adjust the half-tiles of the trails accordingly. Just imagine you lay a half tile of the trails over an orthoganal road piece. It should then look like the trail is nicely splitting off the road. Could you do that?
(I'm not sure if it's understandable what I wrote, so ask if it wasn't clear..)
I can probably figure it out. If not, I'll leave you a PM. Won't do anything on that today.
Last edited by andythenorth on 22 Jun 2008 18:26, edited 1 time in total.
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: [WIP] Trails

Post by Roujin »

Here's a little something to illustrate what I mean. The vehicles won't enter the halftiles anyway, but reverse on the last tile before the halftile.

Current situation:
Trails_road.png
Trails_road.png (67.84 KiB) Viewed 969 times
Proposal for the half tiles (right side illustrates how it would look like with a road):
trails_road_tile.png
trails_road_tile.png (2 KiB) Viewed 12825 times
Of course, it would still need to look well if there's no road but plain grass where the trail ends...
* @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
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5658
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: [WIP] Trails

Post by andythenorth »

Roujin wrote:...[snip]...Of course, it would still need to look well if there's no road but plain grass where the trail ends...
Yep, I think I get it, so to confirm, the trail tile goes over the regular road? Therefore anything I draw for the trail, like muddy tyre tracks, will be overlaid on the tarmac road surface?

(I don't know how OTTD handles it, but in other co-ordinate systems, a sprite with have a higher z index would appear above one with a lower z index - so we could refer to the trail piece as having a higher z index)
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5658
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: [WIP] Trails

Post by andythenorth »

Roujin wrote:Of course, it would still need to look well if there's no road but plain grass where the trail ends...
OK, give this a go:
1. I've tried two different approaches, I don't know which will work best until I see it overlaid in the game :)
2. PCX should now 'just work' with the right palette. Let me know if there's any more issues...
trails.pcx
(88.3 KiB) Downloaded 209 times
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: [WIP] Trails

Post by Roujin »

Yes, this time it worked right away :)

Here is a screen showing the new tiles.
Two of the halftile ones seem brighter than the other two though...
Attachments
trails_new.png
trails_new.png (87.91 KiB) Viewed 1232 times
* @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
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5658
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: [WIP] Trails

Post by andythenorth »

Roujin wrote:Two of the halftile ones seem brighter than the other two though...
That's as expected - I was experimenting. :wink: I don't really like either of those that much yet, I need to do more work on junctions I think. I'll get back on that sometime this week - will also do the GUI sprites.
connan
Engineer
Engineer
Posts: 18
Joined: 08 May 2007 20:46
Location: Germany, Dresden

Re: [WIP] Trails

Post by connan »

Could the half tile transition be traffic dependent?
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: [WIP] Trails

Post by Roujin »

Not without major changes in code that I want to avoid.
* @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
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: [WIP] Trails

Post by Roujin »

News! I've enabled road vehicles (non-tram ones, that is) to drive on trails. So here's some screens (quick one with standard vehicles). Will grab your test .grf and make another one with it now...

edit: here we go.
Some Terex mining trucks work their way through difficult terrain in order to transport Iron Ore from the remotely located Gruntfingfield Mines ;)
Some Terex mining trucks work their way through difficult terrain in order to transport Iron Ore from the remotely located Gruntfingfield Mines.
Some Terex mining trucks work their way through difficult terrain in order to transport Iron Ore from the remotely located Gruntfingfield Mines.
trails_mine.png (124.82 KiB) Viewed 924 times
Attachments
Daily Work at Sarnwell Farm
Daily Work at Sarnwell Farm
trails_farm.png (121.85 KiB) Viewed 1127 times
The little village of Fluntfingbridge in the woods.
The little village of Fluntfingbridge in the woods.
trails_village.png (186.35 KiB) Viewed 1131 times
* @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
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: [WIP] Trails

Post by Roujin »

Okay, back to some serious business now..

as you can see in the screenshot below, right now the three road types are freely combinable. Question is, should it stay like that, or should some combinations be forbidden?

e.g. forbid road and trail on the same roadbit (note: different roadbits on one tile can stay allowed). Or, keep it like it is - it doesn't really make sense, but it could be seen as "dirty road" for eyecandy.

Also an issue is trail + tram. In the middle of the image, there's some tram+trail track. It can hardly be seen, only some pixels difference from "tram-only" tracks. That is because tram is drawn above trail (only thing that makes sense in my opinion...).

Screenshot:
trails_roadtypes.png
trails_roadtypes.png (96.21 KiB) Viewed 1068 times
Other than that, how are the graphics progressing, andy? 8) I think we should also do trail stations (bus/truck), so that you can place nice stations on trail tracks, without having an ugly piece of road on them (like shown the farm picture I posted above...)
* @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
User avatar
Ammler
President
President
Posts: 953
Joined: 18 Jun 2006 18:18
Location: Switzerland
Contact:

Re: [WIP] Trails

Post by Ammler »

2way trails?

(shouldn't it be thinner then normal roads.)

One path in the middle and maybe some parts for bypssing other vehicels?

Greets
Ammler
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: [WIP] Trails

Post by Roujin »

Well, one could draw it like this, but the road vehicles would still drive on their sides, like they do on normal roads.
* @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
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 12 guests