News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Bi-level factories and attractions

Started by HDomos, June 18, 2013, 01:33:05 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

HDomos


In the latest nightly, the factories and attractions that are bigger then 1x1 tile are often split to several heigths, see the french park and the garbage dump in picture. In my game these are quite frequent...

kierongreen

Confirmed: single and double height paks buildings next to water don't have foundations restored correctly after loading under some circumstances. Will investigate more later.

Ters

Not again. My current map is still bearing the scars from the last time something like this happened (it wasn't restricted to water that time).

kierongreen

Looks like a similar issue to elevated ways disappearing over water. This seems to fix it for me:

Index: boden/grund.cc
===================================================================
--- boden/grund.cc    (revision 6554)
+++ boden/grund.cc    (working copy)
@@ -185,7 +185,7 @@
     // water saves its correct height => no need to save grid heights anymore
     sint8 z = welt->lookup_hgt( pos.get_2d() ); // save grid height for water tiles - including partial water tiles
     sint8 z_w = welt->get_water_hgt( pos.get_2d() );
-    if(  (!ist_wasser()  &&  z > z_w)  ||  ist_bruecke()  ||  ist_tunnel()  ||  get_typ() == grund_t::monorailboden  ) {
+    if(  (!ist_wasser()  &&  z > z_w)  ||  ist_bruecke()  ||  ist_tunnel() || get_typ() == grund_t::fundament ||  get_typ() == grund_t::monorailboden  ) {
         z = pos.z; // all other tiles save ground height
     }

Ters

The expression in this if is now so long that I start to wonder which cases are left when it is supposed to be false.

kierongreen

#5
I had the same thought I have to say....

The reason behind all this is to ensure the height grid is saved correctly. Before I added this you got strange effects around lakes when you raised and lowered water. Something which *should* have the same effect would be:

if(  !(get_typ() == grund_t::boden || get_typ() == grund_t::wasser) ||  z > z_w  )


Edit:
Testing this quickly seems to work and it is much shorter, hopefully it doesn't cause problems elsewhere :)

greenling

Hello
i think that on those problem, a too old pakset can have a part.
Opening hours 20:00 - 23:00
(In Night from friday on saturday and saturday on sunday it possibly that i be keep longer in Forum.)
I am The Assistant from Pakfilearcheologist!
Working on a big Problem!

Ters

Quote from: greenling on June 18, 2013, 05:50:02 PM
Hello
i think that on those problem, a too old pakset can have a part.


I seriously doubt it. There might be a different bug somewhere that looks the same, but not all that has wings are birds.

HDomos

My too old pakset is one day old :D compiled from the latest trunk

greenling

Opening hours 20:00 - 23:00
(In Night from friday on saturday and saturday on sunday it possibly that i be keep longer in Forum.)
I am The Assistant from Pakfilearcheologist!
Working on a big Problem!

kierongreen

Incorporated into trunk as of r6560 (thanks turfit :) )