The International Simutrans Forum

 

Author Topic: [6532] Wrong bridges  (Read 3907 times)

0 Members and 1 Guest are viewing this topic.

Offline Václav

  • Devotee
  • *
  • Posts: 3230
  • formerly VaclavMacurek
  • Languages: CZ, EN
[6532] Wrong bridges
« on: June 06, 2013, 07:39:34 AM »
In 6532, already built bridges are OK - but new bridges are built with wrong ends - and with wrong pillars.

Ends (end tiles) - if road (or railway or anything else) has to be sloped, end tiles have been switched with each other. In the front of bridge is used back end tile - and in the back of bridge is used front tile.

Wrong pillars - pillars are not built in full height - top level (touching tile with road or railway ...) is not built.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: [6532] Wrong bridges
« Reply #1 on: June 06, 2013, 06:57:57 PM »
Confirmed - it should all just be graphical errors. I'll work on getting these fixed it was part of expanding bridge images to make graphics fit better but didn't get entirely finished before the double height patch was incorporated.

Offline Václav

  • Devotee
  • *
  • Posts: 3230
  • formerly VaclavMacurek
  • Languages: CZ, EN
Re: [6532] Wrong bridges
« Reply #2 on: June 06, 2013, 08:22:21 PM »
Confirmed - it should all just be graphical errors. I'll work on getting these fixed it was part of expanding bridge images to make graphics fit better but didn't get entirely finished before the double height patch was incorporated.
As I looked, it may be very interesting - mostly for trains and ships.

Rivers may take more real face. And trains going on those half slopes may be a little better than going on full slopes.


And of course, I beg your pardon for missing screenshots.


But until this will be corrected (at least wrong sloped end tiles), I cannot go on in great changes of transportation web - that are allowed by ships I created for pak96.comic I play.
« Last Edit: June 07, 2013, 09:12:54 AM by Václav »

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: [6532] Wrong bridges
« Reply #3 on: June 09, 2013, 11:20:47 PM »
Attached patch fixes ramp slope images during dragging and enables correct selecting of start images. I've created a new function which chooses between ramp and start images as this check was duplicated several times and I thought it best to move the checks to just one place (I'm not sure whether this should be inlined? probably doesn't matter). I've not encountered problems with pillars myself could you supply a screenshot?

Images for bridges have been extended:
BackStart/FrontStart - used when starting slope is single height
 BackStart2/FrontStart2 - used when starting slope is double height

Additionally the following are planned but not implemented (yet):
BackImage/FrontImage - to be used when only one tile high
BackImage2/FrontImage2 - to be used when two or more tiles high
BackRamp/FrontRamp - to be used when way rises by 1 tile
BackRamp2/FrontRamp2 - to be used when way rises by 2 tiles

All of the 2 variants are/will be optional and existing pak files continue to work correctly.

Offline Václav

  • Devotee
  • *
  • Posts: 3230
  • formerly VaclavMacurek
  • Languages: CZ, EN
Re: [6532] Wrong bridges
« Reply #4 on: June 10, 2013, 04:35:31 AM »
I am sorry but I have not any experience with compiling of game code - and also I have no any compiling software.
« Last Edit: June 10, 2013, 04:50:32 AM by Václav »

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: [6532] Wrong bridges
« Reply #5 on: June 10, 2013, 06:40:10 AM »
Hopefully this will be in a nightly build soon anyway.

Yona-MV

  • Guest
Re: [6532] Wrong bridges
« Reply #6 on: June 11, 2013, 01:07:44 AM »
I guess this is the graph error

on purpose, enlarge the map size and the bridges were not generated ???


Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: [6532] Wrong bridges
« Reply #7 on: June 11, 2013, 07:14:26 AM »
Cannot reproduce this screenshot with patch applied.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: [6532] Wrong bridges
« Reply #8 on: June 13, 2013, 10:06:39 PM »
Fix is in trunk r6546.

Offline Václav

  • Devotee
  • *
  • Posts: 3230
  • formerly VaclavMacurek
  • Languages: CZ, EN
Re: [6532] Wrong bridges
« Reply #9 on: June 14, 2013, 05:27:30 AM »
I have downloaded today's nightly, 6548:

Bridge ends are right again - but pillars are still not built in full height. Or is this what you did not patched?

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: [6532] Wrong bridges
« Reply #10 on: June 14, 2013, 07:05:57 AM »
Please provide a screenshot which shows the pillar problem.

Offline Václav

  • Devotee
  • *
  • Posts: 3230
  • formerly VaclavMacurek
  • Languages: CZ, EN
Re: [6532] Wrong bridges
« Reply #11 on: June 14, 2013, 09:12:27 AM »
Here it is.

Here it is on road bridge - but situation with other bridges is the same.

Rail bridge behind was built long time ago. For it that bridge is built right.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: [6532] Wrong bridges
« Reply #12 on: June 14, 2013, 12:00:51 PM »
Thanks will look into this later

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: [6532] Wrong bridges
« Reply #13 on: June 14, 2013, 10:47:15 PM »
Simple fix - I hadn't noticed this issue because all bridges I'd tested with had graphics below bridge deck level.

Code: [Select]
Index: bauer/brueckenbauer.cc
===================================================================
--- bauer/brueckenbauer.cc    (revision 6548)
+++ bauer/brueckenbauer.cc    (working copy)
@@ -529,7 +529,7 @@
             if(besch->get_pillar()==1  ||  (pos.x*zv.x+pos.y*zv.y)%besch->get_pillar()==0) {
                 grund_t *gr = welt->lookup_kartenboden(pos.get_2d());
 //DBG_MESSAGE("bool brueckenbauer_t::baue_bruecke()","h1=%i, h2=%i",pos.z,gr->get_pos().z);
-                sint16 height = pos.z - gr->get_pos().z - 1;
+                sint16 height = pos.z - gr->get_pos().z;
                 while(height-->0) {
                     if( TILE_HEIGHT_STEP*height <= 127) {
                         // eventual more than one part needed, if it is too high ...

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4555
  • Languages: EN, DE, AT
Re: [6532] Wrong bridges
« Reply #14 on: June 15, 2013, 11:54:14 AM »
Thank you! In r6549 now.

Btw, the bridge in the screenshot needs parameter 'pillar_asymmetric' set!

Offline Václav

  • Devotee
  • *
  • Posts: 3230
  • formerly VaclavMacurek
  • Languages: CZ, EN
Re: [6532] Wrong bridges
« Reply #15 on: June 15, 2013, 04:05:49 PM »
Btw, the bridge in the screenshot needs parameter 'pillar_asymmetric' set!
This is for sojo, he is maintainer of pak96.comic.