News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

[11.x/passenger-generation] building on water

Started by Philip, September 17, 2013, 12:42:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Philip

This is a minor issue (haven't found anything major in a while), but town buildings sometimes are built at the water level, which results in drowning-sheep graphics, as in the attached screenshot. There are two approaches to fixing this, either changing fundament_t to always display a land image, or changing the hausbauer.cc code to build up if at sea level. I think the latter is better, but might make it more difficult to merge with the lake code?


diff --git a/bauer/hausbauer.cc b/bauer/hausbauer.cc
index 9779b8b..0a5cc7f 100644
--- a/bauer/hausbauer.cc
+++ b/bauer/hausbauer.cc
@@ -553,7 +553,8 @@ gebaeude_t* hausbauer_t::baue(karte_t* welt, spieler_t* sp, koord3d pos, int org
// get_weg_yoff will change from the "ground" level to the level of
// a flat bridge end on a slope.  (Otherwise it's zero.)
// So this is the desired level...
- if (front_z == gr->get_pos().z) {
+ if (front_z == gr->get_pos().z &&
+     front_z > welt->get_grundwasser()) {
// Build down to meet the front side.
build_up = false;
}



jamespetts

Thank you very much for spotting this. I must confess, I have not yet had a chance to look into the lake code, so I am not sure whether this would interfere with it. Another possible solution would be simply not building at all in this case; can you see any issues with that approach?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Philip

That's a good idea, I hadn't thought of that option. No issues that I can think of—it will reduce city size a little, but not enough to matter, really.

scamps

Why not use Standard behavior where all building on slopes are raised? This is more realistic, more visually pleasing (IMHO), has no gameplay effect (well, probably can effect possibility of building elevated ways, but that is a rare case).

Also it is rather hard to select submerged buildings on opposite slope from camera. I remember trying to find a new pub for a minute, even with city buindings turned off.

Or maybe just raise buildings near water level and industries.

Carl

I think think scamps' suggestion is a good one. At the moment, the logic of whether a slope will be raised or lowered upon adding a building is entirely opaque to the player -- sometimes it just seems random.

jamespetts

Hmm - it often looks rather silly to have large outcrops from the sides of slopes for buildings, even more so when these slopes are near water.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Philip

I think the case where three corners of the slope are at the lower level, in particular, probably looks best the way it is now (conversely, we should probably build up when three of our corners are at the higher level—which isn't always the case now, it seems) I'm not sure about the other cases, or how complicated things will be with double-height tiles. I'm in favour of trying James's idea not to build on sea-level slopes at all, to avoid the Battleship Island effect, but would like to suggest an exception be made, again, for tiles with a single corner at sea level and three corners at the higher level.

Carl

I'm not sure I agree about no building on coasts, but I suppose one could always manually raise these in order to get the same result.

jamespetts

Philip's proopsal seems sensible to me. I do not regard this as not building on coasts, but rather not building on cliffs, as the sloping tiles between the last flat section of land and the sea are more akin to cliffs than to the sort of land on which anyone would actually build.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

scamps

Granted that we settled on non-building proposal,
May I add a request not to build roads ending into water, unless building a bridge? Just for cosmetic reason. Hopefully that won't cause many issues (none come to mind).

jamespetts

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.