Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Thu Feb 22, 2018 7:08 pm

All times are UTC




Post new topic  Reply to topic  [ 38 posts ]  Go to page Previous 1 2
Author Message
PostPosted: Wed Oct 13, 2010 3:16 pm 
Offline
TTDPatch Developer
TTDPatch Developer
User avatar

Joined: Fri Mar 07, 2003 1:10 pm
Posts: 3602
Location: Germany
Looking at "pilar chopping.png", these won't solve all combinations

Considering some sleep combinations, and track foundations under bridges, there are a lot combinations.

If we only consider only TTDs original possible combinations, we have two possible basic states:
- nothing under bridge
- something under bridge

Then we have can cut the tile in two zones.

So you have the left zone pillar, and the right zone pillar.

Each of this pillar zones have 3 basic states: flat, higher or lower in the middle of bridge. (more if you allow steep slopes)


Top
   
PostPosted: Wed Oct 13, 2010 7:23 pm 
Offline
Engineer
Engineer

Joined: Thu Sep 30, 2010 11:38 pm
Posts: 20
eis_os
This is much easier. Tile has 4 corners, 2 for the front side of the bridge, and 2 for the back side, about which we will temporarily forget.
So we have 2 front corners.
1. Draw default sprite from the height of the highest corner (including foundation) up to the bridge.
2. Then we draw half-sprite for the lowest corner only. (Of course, if both corners are at the same level, then we don't draw half-sprite at all.)
Repeat this two steps for the back side and we are done, all 4 pillars have correct height. We don't care about steep slope, because max height difference for the each side of the tile is only one height level.


Last edited by uni657 on Thu Oct 14, 2010 6:12 pm, edited 1 time in total.

Top
   
PostPosted: Wed Oct 13, 2010 8:35 pm 
Offline
Route Supervisor
Route Supervisor
User avatar

Joined: Tue Mar 29, 2005 12:44 pm
Posts: 391
Location: Hungary
I have checked your modified ottd build. It works very well with the original bridges, but it fails with TBRS as you said, and it fails with the TTRS bridges too. It looks like the for me, the height detecting for halftiles is failing. "HasBit(image, 0)" shouldnt be an issue anymore doesnt it? After looking your patch, still the "hasbit will be the problem":
Code:
switch(type) {
+      case 0: case 1: case 2: case 9: // wooden, girder and concrete bridges
+         draw_odd_pillar = true;
+         break;
+      case 3: case 4: case 5: // suspension bridges, different pillars for each bridge part
+         if (image == SPR_BTSUS_X_PILLAR_TILE_E || image == SPR_BTSUS_Y_PILLAR_TILE_E) {
+            draw_odd_pillar = true;
+         } else {
+            p = tileh_bits[HasBit(image, 0) * 2 + axis];
+         }
+         break;


Is this switch requied? Halftiles method cant solve this? At least this should be disabled if that bridgeslot have been modified by newgrf? I havent explored further the sources, or the available sprites in ttrg.grf, so I might be wrong.


Attachments:
TTRS.png
TTRS.png [ 43.42 KiB | Viewed 1307 times ]

_________________
Image
Image
Top
   
PostPosted: Thu Oct 14, 2010 10:54 am 
Offline
TTDPatch Developer
TTDPatch Developer
User avatar

Joined: Fri Mar 07, 2003 1:10 pm
Posts: 3602
Location: Germany
uni657 wrote:
eis_os
This is much easier. Tile has 4 corners, 2 for the front side of the bridge, and 2 for the back side, about which we will temporarily forget.
So we have 2 front corners.
1. Draw default sprite from the height of the highest corner (including foundation) up to the bridge.
2. Then we draw half-sprite for the lowest corner only. (Of course, if both corners are at the same level, then we don't draw half-sprite at all.)
Repeat this two steps for the back side and we are done, all 4 pillars have correct height. We don't care about steep slope, because max height difference for the each side of the tile is only one height level.

Sorry, I forgot to write that archive in my previous post contains OpenTTD binary with this patch.


As soon as you have heavier pillars, you system won't work, as you get visually distortion if you half pillar doesn't fit the right slope...

(Like a Brick Viaduct grf)


Top
   
PostPosted: Thu Oct 14, 2010 6:27 pm 
Offline
Engineer
Engineer

Joined: Thu Sep 30, 2010 11:38 pm
Posts: 20
thgergo
Removed half of that switch, now TBRS pillars are drawn correctly.

eis_os wrote:
As soon as you have heavier pillars, you system won't work, as you get visually distortion if you half pillar doesn't fit the right slope... (Like a Brick Viaduct grf)
Nothing wrong with the pillars of the brick viaduct.


Attachments:
brick_viaduct.png
brick_viaduct.png [ 65.37 KiB | Viewed 1242 times ]
Top
   
PostPosted: Thu Oct 14, 2010 7:23 pm 
Offline
Tycoon
Tycoon

Joined: Wed Apr 27, 2005 7:09 am
Posts: 5136
uni657 wrote:
Nothing wrong with the pillars of the brick viaduct.

Shouldn´t them be centered on the tile borders?

regards
Michael

_________________
Image


Top
   
PostPosted: Thu Oct 14, 2010 8:50 pm 
Offline
Route Supervisor
Route Supervisor
User avatar

Joined: Tue Mar 29, 2005 12:44 pm
Posts: 391
Location: Hungary
michael blunck wrote:
uni657 wrote:
Nothing wrong with the pillars of the brick viaduct.

Shouldn´t them be centered on the tile borders?

regards
Michael

This is just for an optical illusion for the viaduct, it looks higher than the real "z" height could allow that.

_________________
Image
Image


Top
   
PostPosted: Thu Oct 14, 2010 9:24 pm 
Offline
Tycoon
Tycoon

Joined: Wed Apr 27, 2005 7:09 am
Posts: 5136
thgergo wrote:
This is just for an optical illusion for the viaduct, it looks higher than the real "z" height could allow that.

Well, no. As the track (and the whole bridge) is centred on its ground tiles, so should the foot of the pillars.

regards
Michael

_________________
Image


Top
   
PostPosted: Fri Oct 15, 2010 8:04 am 
Offline
TTDPatch Developer
TTDPatch Developer
User avatar

Joined: Fri Mar 07, 2003 1:10 pm
Posts: 3602
Location: Germany
uni657 wrote:
thgergo
Removed half of that switch, now TBRS pillars are drawn correctly.

eis_os wrote:
As soon as you have heavier pillars, you system won't work, as you get visually distortion if you half pillar doesn't fit the right slope... (Like a Brick Viaduct grf)
Nothing wrong with the pillars of the brick viaduct.



The bridge pillars in the valley are totally wrong...

_________________
TTDPatch dev in retirement ... Search a grf, try Grf Crawler 0.9 - now with even faster details view and new features...
Image


Top
   
PostPosted: Fri Oct 15, 2010 8:55 am 
Offline
Engineer
Engineer

Joined: Thu Sep 30, 2010 11:38 pm
Posts: 20
eis_os wrote:
The bridge pillars in the valley are totally wrong...
How should they look then? Compared to unmodified OpenTTD this is exact pillar length, that author of the grf wanted.

By the way, how pillars are drawn in TTDPatch? I tried to look, but unfortunately, I don't understand assembler.


Top
   
PostPosted: Fri Oct 15, 2010 8:58 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9025
Location: Sol d
The pillars have the correct length. But look at how off-centre from the tile centre they are with respect to the / direction of the tiles. The bridge must be oblique.

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
PostPosted: Fri Oct 15, 2010 12:31 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Apr 19, 2004 8:09 pm
Posts: 1732
Location: Sweden
As the bridge is 20 pixels wide, and the pillar seems to be flat to the side of the bridge, the pillar should also be 20 px wide, with the current width it should be drawn in the middle of the lower red line:


Attachments:
tt10.png
tt10.png [ 11.6 KiB | Viewed 1144 times ]

_________________
Image
Swedish trains * Swedish Town Names * BlockCAD * The GRFMaker Community Page
Top
   
PostPosted: Fri Oct 15, 2010 4:00 pm 
Offline
TTDPatch Developer
TTDPatch Developer
User avatar

Joined: Fri Mar 07, 2003 1:10 pm
Posts: 3602
Location: Germany
It's all about optical illusion and trying to fix newgrfs.
Technical there is no correct way to fix drawing bridge pillars for newgrfs without adding new additions to newgrf. And as soon as people change trg*.grf to add new bridges there isn't a correct way for TTD default bridges either...

_________________
TTDPatch dev in retirement ... Search a grf, try Grf Crawler 0.9 - now with even faster details view and new features...
Image


Top
   
PostPosted: Fri Feb 09, 2018 1:34 pm 
Offline
Engineer
Engineer
User avatar

Joined: Thu Feb 01, 2018 12:36 pm
Posts: 10
Location: Czech Republic, Ostrava
Hi,

what about custom spritenumber? Have you solution for custom spritenumbers or you still replacing toyland sprites?

I need other front bridge sprites for road and other for rails. But i dont know how to add custom spritenumbers or which spritenumbers is free.

_________________
Image


Top
   
PostPosted: Fri Feb 09, 2018 2:16 pm 
Online
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5103
Location: Canada
vasatko wrote:
Hi,

what about custom spritenumber? Have you solution for custom spritenumbers or you still replacing toyland sprites?

I need other front bridge sprites for road and other for rails. But i dont know how to add custom spritenumbers or which spritenumbers is free.
This can be done via Action D GRF Resource Management. If you have the TBRS NFO code, you can see how it is done.

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018


Top
   
PostPosted: Mon Feb 12, 2018 10:41 am 
Offline
Engineer
Engineer
User avatar

Joined: Thu Feb 01, 2018 12:36 pm
Posts: 10
Location: Czech Republic, Ostrava
Hi, thx, but I saw to WiKi and to TBRS code and i dont know what is it. Can you give me quick lection how to GRFRecourceManagement use? Or exist some tutorial, manual etc?

Im looking to your link for GRM and Action6 and to your code.

_________________
Image


Top
   
PostPosted: Mon Feb 12, 2018 11:40 am 
Online
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5103
Location: Canada
vasatko wrote:
Hi, thx, but I saw to WiKi and to TBRS code and i dont know what is it. Can you give me quick lection how to GRFRecourceManagement use? Or exist some tutorial, manual etc?

Im looking to your link for GRM and Action6 and to your code.
I can send you an example of the code that I use, but I am still working on it for a tutorial that I will be posting some time in the next several weeks. I will post a link here when it is ready, probably near the end of March.

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018


Top
   
PostPosted: Mon Feb 12, 2018 1:12 pm 
Offline
Tycoon
Tycoon

Joined: Wed Apr 27, 2005 7:09 am
Posts: 5136
vasatko wrote:
Hi, thx, but I saw to WiKi and to TBRS code and i dont know what is it. Can you give me quick lection how to GRFRecourceManagement use? Or exist some tutorial, manual etc?

Im looking to your link for GRM and Action6 and to your code.

You could use m4nfo instead of plain nfo for coding bridges.
There´s also a tutorial how to use allocated sprites rather than overwriting TTD sprites.

regard
Michael

_________________
Image


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 38 posts ]  Go to page Previous 1 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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-2018 phpBB Limited

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