The International Simutrans Forum

 

Author Topic: [r6656-r6664] Building slope basement built in wrong tile  (Read 3119 times)

0 Members and 1 Guest are viewing this topic.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2920
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
[r6656-r6664] Building slope basement built in wrong tile
« on: August 29, 2013, 05:37:22 PM »
When you build a building next to a slope, on the bottom, the building slope basement graphic is used in the diagonal slope tile.
Well, my explanation was horrible so here's a picture.

Both images are the same building but with different rotation.

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: [r6656-r6664] Building slope basement built in wrong tile
« Reply #1 on: August 29, 2013, 06:37:12 PM »
Actually it would look prettier if all three slopes (back and both diagonals) would have walls.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2920
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: [r6656-r6664] Building slope basement built in wrong tile
« Reply #2 on: August 29, 2013, 06:46:19 PM »
But this would kill my creation. I'm creating a rural attraction and it would look lame with 3 city slope graphic.

Offline vorlon

  • *
  • Posts: 62
  • Languages: FI, EN
Re: [r6656-r6664] Building slope basement built in wrong tile
« Reply #3 on: August 29, 2013, 07:48:36 PM »
Perhaps we should have two different artificial slope- tools, which would create different textures to the slope walls. This would give more control of the enviroment to the player.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2346
Re: [r6656-r6664] Building slope basement built in wrong tile
« Reply #4 on: August 30, 2013, 12:12:57 AM »
Confirmed bug - this has been present since 111.2.2 at least.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2346
Re: [r6656-r6664] Building slope basement built in wrong tile
« Reply #5 on: August 30, 2013, 12:40:50 AM »
Patch to fix this in 6664. I can't get to SVN at moment so haven't been able to commit this. Should note that this patch sets slopes to be artificial if there is a building at the top or bottom of the vertical slope.

Really long term we might need to consider a more flexible solution to slopes as the current system does have it's limitations.

Code: [Select]
Index: boden/grund.cc
===================================================================
--- boden/grund.cc    (revision 6664)
+++ boden/grund.cc    (working copy)
@@ -755,7 +755,7 @@
         return;
     }
     sint8 back_bild_nr=0;
-    bool is_building = false;
+    bool is_building = get_typ()==grund_t::fundament;
     const bool isvisible = is_visible();
     bool fence[2]={false, false};
     const koord k = get_pos().get_2d();
@@ -841,12 +841,12 @@
             if(  (diff_from_ground_1-corner_a>0  ||  diff_from_ground_2-corner_b>0)
                 &&  (diff_from_ground_1>0  ||  diff_from_ground_2>0)  ) {
                 back_bild_nr += get_backbild_from_diff( diff_from_ground_1, diff_from_ground_2 )*(i==0?1:11);
+                is_building |= gr->get_typ()==grund_t::fundament;
             }
             // avoid covering of slope by building ...
             if(  (left_back_is_building  ||  gr->get_flag(draw_as_ding))  &&  (back_bild_nr>i*11  ||  gr->get_back_bild(1-i)!=IMG_LEER)) {
                 set_flag(grund_t::draw_as_ding);
             }
-            is_building |= gr->get_typ()==grund_t::fundament;
         }
     }
 
@@ -861,7 +861,6 @@
         if(fence_offset) {
             back_bild_nr = 121 + fence_offset;
         }
-        is_building = get_typ()==grund_t::fundament;
     }
     this->back_bild_nr = (is_building!=0)? -back_bild_nr : back_bild_nr;
 }

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2920
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: [r6656-r6664] Building slope basement built in wrong tile
« Reply #6 on: August 30, 2013, 10:34:29 PM »
Thanks kierongreen, it's working. Someone needs to push this.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2920
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: [r6656-r6664] Building slope basement built in wrong tile
« Reply #7 on: August 31, 2013, 12:42:40 AM »
Now I can finish my object.

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1732
    • Simutrans-BLOG
  • Languages: ES
Re: [r6656-r6664] Building slope basement built in wrong tile
« Reply #8 on: August 31, 2013, 03:41:25 AM »
bright An_dZ... :thumbsup:

Offline moritz

  • *
  • Posts: 10
Re: [r6656-r6664] Building slope basement built in wrong tile
« Reply #9 on: January 14, 2015, 04:56:52 PM »
not 100% fixed:

4 rotations (see the tree), wrong slope type on sides/ not adjacent to building

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4899
  • Languages: EN, DE, AT
Re: [r6656-r6664] Building slope basement built in wrong tile
« Reply #10 on: January 14, 2015, 07:38:24 PM »
This is a different bug, which is years old. It is a limitation of the code: the slope images belong to the tile in front. Both slope images behind the tile are either both building foundations or natural walls. If there is one building above it chooses the building foundations for both.

This could have been fixed for the single-height slope code of previous versions, I do not know whether this can be fixed easily with double-height slopes.