Patch: Diagonal level crossings
Moderator: OpenTTD Developers
Patch: Diagonal level crossings
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.
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
-
- diagonal_crossings-miniin.diff
- Patch against SVN MiniIN r5838.
- (19.85 KiB) Downloaded 779 times
-
- diagonal_crossings.diff
- Patch against SVN trunk r5911.
- (26.15 KiB) Downloaded 956 times
-
- ncrossingsw.grf
- GRF file for the new crossing graphics.
- (7.53 KiB) Downloaded 1617 times
Last edited by Maedhros on 16 Aug 2007 09:30, edited 12 times in total.
-
- Tycoon
- Posts: 1828
- Joined: 10 Jul 2006 00:43
- Location: Spain
Diagonal crosings
¡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:
http://www.tt-forums.net/viewtopic.php?t=26385
Can you put a preview image with the normal crossing?
There is a topic about diagonal crossings in TTD Patch:
http://www.tt-forums.net/viewtopic.php?t=26385
Sorry if my english is too poor, I want learn it, but it isn't too easy.
- [list][*]Why use PNG screenshots in 8 bpp games.
[*]Caravan site New Industry. · Spain set. · Some spanish trains for locomotion[*]Favourites:GRVTS · ECS · FIRS
-
- Tycoon
- Posts: 1828
- Joined: 10 Jul 2006 00:43
- Location: Spain
Thanks
Thanks. I like it.
It will be needed four new graphics (with two tiles) for the crossings:And the same in vertical.
It will be needed four new graphics (with two tiles) for the crossings:
Code: Select all
\ / Road
===\===============/== Train
\ /
\ /
Last edited by maquinista on 02 Aug 2006 22:53, edited 1 time in total.
Sorry if my english is too poor, I want learn it, but it isn't too easy.
- [list][*]Why use PNG screenshots in 8 bpp games.
[*]Caravan site New Industry. · Spain set. · Some spanish trains for locomotion[*]Favourites:GRVTS · ECS · FIRS
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.
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.
WTF?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.
...
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
- StopRightThere
- Chief Executive
- Posts: 761
- Joined: 18 Dec 2005 20:10
- Location: United Kingdom
OMG! This patch is awesome!
Bye Bye OpenBVE
Official TT-Hot young ginger Doctor Who assistant FanClub
Formerly known as AdditionalData
Official TT-Hot young ginger Doctor Who assistant FanClub
Formerly known as AdditionalData
-
- Tycoon
- Posts: 1828
- Joined: 10 Jul 2006 00:43
- Location: Spain
It's a option
This is a option. If you don't like it, you don't need build it.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.
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.
- [list][*]Why use PNG screenshots in 8 bpp games.
[*]Caravan site New Industry. · Spain set. · Some spanish trains for locomotion[*]Favourites:GRVTS · ECS · FIRS
That's not what he said. He only finds diagonal bridges more useful then diagonal road crossings. Both are useful IMO.maquinista wrote:This is a option. If you don't like it, you don't need build it.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.
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.
-
- Tycoon
- Posts: 1828
- Joined: 10 Jul 2006 00:43
- Location: Spain
Ok
Yes, I have understand it.gigajum wrote:That's not what he said. He only finds diagonal bridges more useful then diagonal road crossings. Both are useful IMO.maquinista wrote:This is a option. If you don't like it, you don't need build it.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.
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.
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.
- [list][*]Why use PNG screenshots in 8 bpp games.
[*]Caravan site New Industry. · Spain set. · Some spanish trains for locomotion[*]Favourites:GRVTS · ECS · FIRS
- Ben_Robbins_
- Tycoon
- Posts: 1234
- Joined: 20 Nov 2005 01:56
- 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
Woah. 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.
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.
WOWBen_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)
That's impressive. Is there no way of automation?
One third. Electric uses the exact same sprites as regular; it just adds the catenary sprites.Ben_Robbins_ wrote:This would be 1/4 of the total amount (just counting the rail/electric/mono/mag)
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.
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 thereMaedhros wrote:Those are impressive, but 308 per landscape, per road type is insane.
You won't find that in the newgrf specs.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.
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
- Ben_Robbins_
- Tycoon
- Posts: 1234
- Joined: 20 Nov 2005 01:56
- 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.
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
Let the computer do the work for you, instead of doing it yourself.Ben_Robbins_ wrote:Gigajum: Dunno what you mean by automation really...
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,
the game animates the flashing crossing lights by 'palette cycling'. it swaps some colors in game (how it actually works isn't that interesting)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.
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
After action reports: The path to riches, A dream of skyscrapers
After action reports: The path to riches, A dream of skyscrapers
Who is online
Users browsing this forum: No registered users and 32 guests