Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Thu Apr 25, 2019 5:20 am

All times are UTC




Post new topic  Reply to topic  [ 95 posts ]  Go to page 1 2 3 4 5 Next
Author Message
PostPosted: Wed Aug 02, 2006 9:50 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Thu Mar 30, 2006 6:24 pm
Posts: 603
Location: Durham, UK
Hi everyone,

This is a patch to add diagonal level crossing support to OpenTTD. This is still a work-in-progress - although it works well, there aren't any graphics for it yet, so level crossings still appear to be perpendicular to the road, leaving trains to float over them. If there are any artists out there who'd be interested in this, I'd love to hear from you. :)

Something else I'm looking to fix is activating the lights on the other half of the crossing when the first are activated, and some other cleanups like allowing road vehicles to stop on the tile but before the level crossing.

Edit^4: It's pretty much complete now - it does everything I want it to, although the code could probably do with some cleaning up.

WARNING: Adding the patch option now without bumping the savegame version breaks any savegames already made with this savegame version.

If you've got any suggestions for how to do any of that, or feedback on the patch, please post it here. :)


Attachments:
File comment: Patch against SVN MiniIN r5838.
diagonal_crossings-miniin.diff [19.85 KiB]
Downloaded 621 times
File comment: Patch against SVN trunk r5911.
diagonal_crossings.diff [26.15 KiB]
Downloaded 804 times
File comment: GRF file for the new crossing graphics.
ncrossingsw.grf [7.53 KiB]
Downloaded 1340 times


Last edited by Maedhros on Thu Aug 16, 2007 9:30 am, edited 12 times in total.
Top
   
 Post subject: Diagonal crosings
PostPosted: Wed Aug 02, 2006 10:07 pm 
Offline
Tycoon
Tycoon

Joined: Mon Jul 10, 2006 12:43 am
Posts: 1808
Location: Spain
¡Thanks! It must be a great patch.
Can you put a preview image with the normal crossing?

There is a topic about diagonal crossings in TTD Patch:
viewtopic.php?t=26385

_________________
Sorry if my english is too poor, I want learn it, but it isn't too easy.


Top
   
 Post subject:
PostPosted: Wed Aug 02, 2006 10:20 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Thu Mar 30, 2006 6:24 pm
Posts: 603
Location: Durham, UK
Ok, here's a preview. I warned you it looked strange. :lol:


Attachments:
File comment: Preview of diagonal level crossings.
Nendinghattan Transport, 17th Mar 1991.png [180.32 KiB]
Downloaded 2492 times
Top
   
 Post subject: Thanks
PostPosted: Wed Aug 02, 2006 10:45 pm 
Offline
Tycoon
Tycoon

Joined: Mon Jul 10, 2006 12:43 am
Posts: 1808
Location: Spain
Thanks. I like it.
It will be needed four new graphics (with two tiles) for the crossings:
Code:
 \                   / Road
===\===============/== Train
     \           /
       \       /
And the same in vertical.

_________________
Sorry if my english is too poor, I want learn it, but it isn't too easy.


Last edited by maquinista on Wed Aug 02, 2006 10:53 pm, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Wed Aug 02, 2006 10:52 pm 
Offline
Route Supervisor
Route Supervisor
User avatar

Joined: Sun Apr 24, 2005 9:21 pm
Posts: 387
Location: Torquay, England
And we need eight sprites per railway type, making 24.

And then we need to go ask everyone who made roadsets to make the extra 24 sprites for their roadsets.

And then we need to go ask everyone who made replacement railway types to make the extra 8*howevermanyroadsetsthereare sprites for their railway types.

...

See the problem with that?

Anyway, TTD has seperate sprites for the railway, monorail and maglev tracks by themselves. It uses these when drawing junction tiles - it draws 2 sprites on 1 tile. If we could utilize the same method for drawing your diagonal road crossings (and, in fact, ordinary road crossings too), we certainly wouldn't have to worry about other roadsets or tracksets. ;)


Top
   
 Post subject:
PostPosted: Wed Aug 02, 2006 11:03 pm 
Offline
Route Supervisor
Route Supervisor

Joined: Wed Mar 08, 2006 8:33 am
Posts: 511
Location: Germany
iNVERTED wrote:
And we need eight sprites per railway type, making 24.

And then we need to go ask everyone who made roadsets to make the extra 24 sprites for their roadsets.

And then we need to go ask everyone who made replacement railway types to make the extra 8*howevermanyroadsetsthereare sprites for their railway types.

...


WTF?

24 new pictures and enough. Who wants to have that feature, too, can add diagonal rail crossing pictures to his grfset. If not the default ones are used. IMO


Top
   
 Post subject:
PostPosted: Wed Aug 02, 2006 11:06 pm 
Offline
Route Supervisor
Route Supervisor
User avatar

Joined: Sun Apr 24, 2005 9:21 pm
Posts: 387
Location: Torquay, England
I was joking about the asking everyone bit. :P


Top
   
 Post subject:
PostPosted: Thu Aug 03, 2006 12:21 am 
Offline
Chief Executive
Chief Executive
User avatar

Joined: Sun Dec 18, 2005 8:10 pm
Posts: 761
Location: United Kingdom
OMG! This patch is awesome!

_________________
Bye Bye OpenBVE :(
Official TT-Hot young ginger Doctor Who assistant FanClub
Formerly known as AdditionalData


Top
   
 Post subject:
PostPosted: Thu Aug 03, 2006 7:21 am 
Offline
Traffic Manager
Traffic Manager

Joined: Mon Jul 24, 2006 10:40 am
Posts: 153
What about diagonal bridges? I think those would be much more useful, as the lack of diagonal bridges often generates pretty ugly crossings... Not to mention that road crossing RR is far from safe.


Top
   
 Post subject: It's a option
PostPosted: Thu Aug 03, 2006 9:29 am 
Offline
Tycoon
Tycoon

Joined: Mon Jul 10, 2006 12:43 am
Posts: 1808
Location: Spain
Ar4i wrote:
What about diagonal bridges? I think those would be much more useful, as the lack of diagonal bridges often generates pretty ugly crossings... Not to mention that road crossing RR is far from safe.
This is a option. If you don't like it, you don't need build it.
Magic bridges are other interesting option. They isn't incompatibles with diagonal crossings.
Two options are better than only one option.

_________________
Sorry if my english is too poor, I want learn it, but it isn't too easy.


Top
   
 Post subject:
PostPosted: Thu Aug 03, 2006 9:41 am 
Offline
Route Supervisor
Route Supervisor

Joined: Wed Mar 08, 2006 8:33 am
Posts: 511
Location: Germany
maquinista wrote:
Ar4i wrote:
What about diagonal bridges? I think those would be much more useful, as the lack of diagonal bridges often generates pretty ugly crossings... Not to mention that road crossing RR is far from safe.
This is a option. If you don't like it, you don't need build it.


That's not what he said. He only finds diagonal bridges more useful then diagonal road crossings. Both are useful IMO.
But i think the diagonal bridges have the problem with saving the information in the map array. On some tiles you need to save informations of 2 bridges. I don't know what all is saved in the map array of every bridge, but it is saved there.


Top
   
 Post subject: Ok
PostPosted: Thu Aug 03, 2006 9:49 am 
Offline
Tycoon
Tycoon

Joined: Mon Jul 10, 2006 12:43 am
Posts: 1808
Location: Spain
gigajum wrote:
maquinista wrote:
Ar4i wrote:
What about diagonal bridges? I think those would be much more useful, as the lack of diagonal bridges often generates pretty ugly crossings... Not to mention that road crossing RR is far from safe.
This is a option. If you don't like it, you don't need build it.


That's not what he said. He only finds diagonal bridges more useful then diagonal road crossings. Both are useful IMO.
But i think the diagonal bridges have the problem with saving the information in the map array. On some tiles you need to save informations of 2 bridges. I don't know what all is saved in the map array of every bridge, but it is saved there.
Yes, I have understand it.
The three options (diagonal crossings, diagonal bridges and magic brigdes) are good.

_________________
Sorry if my english is too poor, I want learn it, but it isn't too easy.


Top
   
 Post subject:
PostPosted: Thu Aug 03, 2006 3:30 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Nov 20, 2005 1:56 am
Posts: 1230
Location: Abu Dhabi, UAE
24 didnt sound too bad so I started, but kept thinking of more...After almost 3 hours Ive decided to stop with just the railway ones done. Theres 308 different tiles here that i could think of. This would be 1/4 of the total amount (just counting the rail/electric/mono/mag)


Attachments:
diagonal crossings4.PNG [178.09 KiB]
Downloaded 1811 times

_________________
Ben
Top
   
 Post subject:
PostPosted: Thu Aug 03, 2006 3:42 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Thu Mar 30, 2006 6:24 pm
Posts: 603
Location: Durham, UK
Woah. :shock: Those are impressive, but 308 per landscape, per road type is insane. I guess there are probably ways to overlay sprites on top of each other, so I'll have to start looking at the newgrf specs and seeing how that could be done.

I've updated the patches by the way - they now activate the other half of a diagonal level crossing at the same time as the first half. Sounds simple, but the patch is now more than twice the size. :roll:


Top
   
 Post subject:
PostPosted: Thu Aug 03, 2006 3:51 pm 
Offline
Route Supervisor
Route Supervisor

Joined: Wed Mar 08, 2006 8:33 am
Posts: 511
Location: Germany
Ben_Robbins_ wrote:
24 didnt sound too bad so I started, but kept thinking of more...After almost 3 hours Ive decided to stop with just the railway ones done. Theres 308 different tiles here that i could think of. This would be 1/4 of the total amount (just counting the rail/electric/mono/mag)


WOW :shock:

That's impressive. Is there no way of automation?


Top
   
 Post subject:
PostPosted: Thu Aug 03, 2006 5:53 pm 
Offline
TTDPatch Developer
TTDPatch Developer

Joined: Wed Feb 18, 2004 3:06 am
Posts: 10285
Ben_Robbins_ wrote:
This would be 1/4 of the total amount (just counting the rail/electric/mono/mag)

One third. Electric uses the exact same sprites as regular; it just adds the catenary sprites.

Some of the lights in there look like they're facing along the tracks, not along the road. The last two in the second row on the left side, for example.


Maedhros wrote:
Those are impressive, but 308 per landscape, per road type is insane.

No. That's 308 per road type per track type -- 924 per road type, unless you pull overlays. Ben's got all the landscapes in there

Maedhros wrote:
I guess there are probably ways to overlay sprites on top of each other, so I'll have to start looking at the newgrf specs and seeing how that could be done.

You won't find that in the newgrf specs.

I might suggest:
Four gate/light sprites per base sprite: one left and right gate/light for open/clear and another for closed/occupied. One might work, but I'm worried that there might be bounding-box fun if you do that.
Then duplicate this for the other direction. (N/S vs E/W)

Then just grab the appropriate sprites out of trg?r.grg, and past them on top of the road base. Except that this will work poorly for maglev.

_________________
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


Top
   
 Post subject:
PostPosted: Thu Aug 03, 2006 7:09 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed Oct 15, 2003 10:00 pm
Posts: 2566
Location: Jarrow, UK
Also, there's the small point that the flashing lights are done by palette cycling, so you only actually need two thirds as many (lights off, lights on).

_________________
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED


Top
   
 Post subject:
PostPosted: Thu Aug 03, 2006 7:15 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Nov 20, 2005 1:56 am
Posts: 1230
Location: Abu Dhabi, UAE
Dalestan: I see what you mean, but i think when the lights alternate to the other red dot, the direction the signal faces should be clearer. If not, they can be tweaked when they can be seen better in a scenario.

Gigajum: Dunno what you mean by automation really...

Might try making some more later, cause this is a cool feature I recon, but I'll wait a bit, cause theres other graphics to make at the moment. Feal free to do what ever with those tiles if anyone needs them for anything though.

(oh yeah, i didnt do the mars scape...dang..)

<edit> brianetta: ''palette cycling''? theres 3 at the moment, on left, on right and off.

_________________
Ben


Top
   
 Post subject:
PostPosted: Thu Aug 03, 2006 7:47 pm 
Offline
Route Supervisor
Route Supervisor

Joined: Wed Mar 08, 2006 8:33 am
Posts: 511
Location: Germany
Ben_Robbins_ wrote:
Gigajum: Dunno what you mean by automation really...


Let the computer do the work for you, instead of doing it yourself.
You have 11 different ground pictures, 4 different rail types, 3 pictures for the crossing lights, and so on. Isn't it possible to tell the computer how he has to mix the pictures to generate alle the ~1000 different tile pictures which are needed,


Top
   
 Post subject:
PostPosted: Thu Aug 03, 2006 8:38 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Mar 26, 2004 1:27 am
Posts: 1628
Location: Netherlands, Enschede
Ben_Robbins_ wrote:
Dalestan: I see what you mean, but i think when the lights alternate to the other red dot, the direction the signal faces should be clearer. If not, they can be tweaked when they can be seen better in a scenario.

Gigajum: Dunno what you mean by automation really...

Might try making some more later, cause this is a cool feature I recon, but I'll wait a bit, cause theres other graphics to make at the moment. Feal free to do what ever with those tiles if anyone needs them for anything though.

(oh yeah, i didnt do the mars scape...dang..)

<edit> brianetta: ''palette cycling''? theres 3 at the moment, on left, on right and off.

the game animates the flashing crossing lights by 'palette cycling'. it swaps some colors in game (how it actually works isn't that interesting)
It means that you only need 2 signal states, On and Off. See the original ttd sprites as an example of how it works (you need 2 specific palette index colors)

_________________
Creator of the Openttd Challenge Spinoff, Town Demand patch
The path to riches, a report on playing on a daylength server on ultra hard mode.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 95 posts ]  Go to page 1 2 3 4 5 Next

All times are UTC


Who is online

Users browsing this forum: JGR and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2019 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2019.
Hosted by Zernebok Hosting.