Page 1 of 2

Sloped stations (r15114)

Posted: 16 Jan 2009 00:24
by Wolf01
v04 Bugfixing
- Fix: Airports have foundations again
- Fix: Roadbays on slopes now show the right graphics
- Fix: Vehicles now don't sink on the roadbay if placed on slope
- Fix: Debug PBS graphics now shows correct trackbit on sloped stations
- Change: a lot of code duplication and useless code removed

===========
v03 Initial release

Here's the first good looking version of my sloped stations patch.
It still have some bugs like the road bay placed on slopes but not facing the slopes become sloped too. (FIXED)
Rail stations don't look so good, ok they are really weird.
Roadstops and truckstops are really good, I didn't tried it with trams yet.
This patch should be compatible with old savegames because I didn't added new things, I only changed a bit the drawing code and the check which disallowed to build stations facing slopes.
Savegames made with this patch should be compatible with trunk too.
What it misses is newgrf support, a little of code style and less code duplication.

Try it and let me know what you think :D

Win32 build attached, it should need only the original grfs to work

Re: Sloped stations (r15098)

Posted: 16 Jan 2009 04:32
by jaybud4
Just a thought, rail stations might look better if you draw the rails AFTER the station.
That way the station won't go over the rail and look horrible.
Granted, it's not a perfect solution, but...

Re: Sloped stations (r15098)

Posted: 16 Jan 2009 10:26
by SirkoZ
A very useful patch indeed. Keep up the good work, Wolf01.

Re: Sloped stations (r15098)

Posted: 16 Jan 2009 16:44
by Wolf01
jaybud4 wrote:Just a thought, rail stations might look better if you draw the rails AFTER the station.
That's the case I want to not do at all, stations must be drawn over the rails (like the 8 shaped test track) with the proper sloped graphics
What you mean is already done at the squared test track, since tracks/roads come with terrain tile the terrain will always be drawn over the station and the station partly disappear

Re: Sloped stations (r15098)

Posted: 17 Jan 2009 00:11
by Wolf01
Updated first post, new version, less duplicate code, less stupid comments, less bugs and thank you frosch for the support :D

Re: Sloped stations (r15098)

Posted: 17 Jan 2009 05:37
by DaleStan
Wolf01 wrote:less stupid comments, less bugs
"Fewer", "fewer"! Bugs and comments (stupid or otherwise) are both countable. If you can count them there are fewer of them; if you can't count it, there's less of it.

Re: Sloped stations (r15114)

Posted: 17 Jan 2009 10:33
by MJS
So your idea, Wolf, is that somebody now draws a sloped station that will also look right, is that correct? Because with the default stations it looks quite ugly indeed.

Re: Sloped stations (r15114)

Posted: 17 Jan 2009 11:03
by Wolf01
Drawing sloped station is not enough, I need first to code the support for the new 4 sloped tiles which might be included in openttd(d/w).grf, then I'll have to think about a newgrf callback and what it should do.

These are some ideas I have:
* Foundation always leveled, example: buffer stop should be always horizontal also on slopes
* Allowed slope directions, example: always buffer stop, can be built on slope, but not facing the slope (or you'll get a step)
* Different graphic for the same station class when built on plain or on slope, to avoid too many entries on the station class list

Re: Sloped stations (r15114)

Posted: 17 Jan 2009 14:00
by ostlandr
I like this idea! Not sure if I would use it for rail, but sloped stations for bus/truck stops would be wonderful. I hate it when I count the tiles and decide I need a bus stop there - and it's a sloped tile. I tend to build joined drive-through stations for passengers and mail, and sometimes with slopes and curves I can't do that.

Re: Sloped stations (r15114)

Posted: 18 Jan 2009 17:54
by andythenorth
Nice patch.

Sloped rail stations: EDIT (because maybe I was a bit unfair about this patch). I wouldn't use them for trains, but that doesn't matter, other people might like them. I don't know of any sloped stations in real life anywhere except a cog railway or cable railway (with apologies to Belugas for bringing real life into the discussion). One thing though, I know how much work goes into the station grfs, and slopes just produces about 8x more drawing work.

Sloped road stops: absolutely yes, brilliant. :D For towns like this, it would really help in the game. Also, there are no problems to do with 'real life' and not many graphics would be needed.
road_stops_slopes_yes.png
road_stops_slopes_yes.png (210.28 KiB) Viewed 12653 times
cheers,

Andy

Re: Sloped stations (r15114)

Posted: 19 Jan 2009 03:36
by belugas
andythenorth wrote:Sloped rail stations: no thanks. :( Find me a sloped station in real life anywhere except a cog railway or cable railway (with apologies to Belugas for bringing real life into the discussion).
No offense taken. But i'd say that I like the sloped rail station, actually.
Thing is, as always, you do like them? Do not use them. As simple as that.
Keep on working fine Wolf01 :D

Re: Sloped stations (r15114)

Posted: 19 Jan 2009 08:01
by andythenorth
belugas wrote:Thing is, as always, you do like them? Do not use them. As simple as that.
I've edited my post above in case it was discouraging to Wolf01. (It's a nice patch!)

I've thought of a situation where I would use sloped rail stations. I still wouldn't use them for train platforms, but they could be useful for some of the many non-track tiles in sets like ISR, especially the road tile pieces. This would need new sprites drawing though :twisted:

cheers,

Andy

Re: Sloped stations (r15114)

Posted: 19 Jan 2009 10:26
by khamura
andythenorth wrote:I've thought of a situation where I would use for sloped rail stations. I still wouldn't use them for train platforms, but they could be useful for some of the many non-track tiles in sets like ISR, especially the road tile pieces. This would need new sprites drawing though :twisted:
One word:

Waypoints. 8)

Re: Sloped stations (r15114)

Posted: 19 Jan 2009 13:24
by Thief^
Can we get the "inline road stops on slopes" part separated and put forward for merging into trunk? Those already look perfect and we can sort out whether train stations on slopes makes sense or could be made to look good later.

Re: Sloped stations (r15114)

Posted: 19 Jan 2009 13:33
by CommanderZ
Thief^ wrote:Can we get the "inline road stops on slopes" part separated and put forward for merging into trunk? Those already look perfect and we can sort out whether train stations on slopes makes sense or could be made to look good later.
Good idea. Any voluteers to create sloped DTRS graphics? :P

Re: Sloped stations (r15114)

Posted: 19 Jan 2009 19:19
by JacobD88
MJS wrote:So your idea, Wolf, is that somebody now draws a sloped station that will also look right, is that correct? Because with the default stations it looks quite ugly indeed.
I have a suggestion (if its possible coding wise, im not sure) but in the immediate future, until special sloped graphics become available why not make the patch only display the foreground portions of a station tile and any roofs, it may not work with all station sets but it will stop the background portion of a station tile being lost in the slope...

Seen as the majority of station sets comprise of foreground, background, and roof tiles i can't see this being a problem appearance wise, you just need to find some way to tell the graphics engine not to display the background portion on these sloped tiles :)

It would certainly make the default graphics in the FP look nicer anyhoo as non of the station buildings would be there to sink into the slope or fall over the track

Re: Sloped stations (r15114)

Posted: 20 Jan 2009 20:00
by Wolf01
Ok, I'll try to take in account your suggestions (but I should tell that limiting to road stations only need to add code, not to remove it :P) especially to ones for drawing only part of the stations (roofs and maybe benches)
But this when I'll have time, at least somebody doesn't want to give me a boost :)

Re: Sloped stations (r15114)

Posted: 20 Jan 2009 20:50
by coyoteelabs
I would recommend a flag for the station graphics that specifies whether that graphics set has the needed sprites for sloped stations or not.
That way, the patch could be allowed in trunk more easily since it wouldn't need graphics for it to be included.

If a gfx set doesn't have slopped station sprites, just use old behavior and show an error message. This would also prevent glitches when using graphics sets that don't have the needed sprites.

Re: Sloped stations (r15114)

Posted: 20 Jan 2009 21:06
by Thief^
THAT sounds like a good idea.

Though the default drive-through bus and truck stops sould be marked as supporting it, because they look fine on a slope.

Re: Sloped stations (r15114)

Posted: 20 Jan 2009 22:13
by FooBar
Thief^ wrote:Though the default drive-through bus and truck stops sould be marked as supporting it, because they look fine on a slope.
I think it's better to have proper graphics for those right from the start. Since the current drive through graphics are currently shipped within openttd(w).grf, I don't think it would hurt adding the graphics for four additional directions (16 sprites: 4 directions, 2 sprites per direction, 2 types (bus, truck)). I don't mind voluteering to create those sprites tomorrow night.

The sprites could be added to the end of Type 11 for Action 05. And then in the same order as sprites 1324-1327 of trg1[r].grf.