The International Simutrans Forum

 

Author Topic: [120.0] Land remains when lowering terrain at shore  (Read 9362 times)

0 Members and 1 Guest are viewing this topic.

Offline V813

  • *
  • Posts: 47
  • Hi from Hong Kong :)
  • Languages: EN, ZH
[120.0] Land remains when lowering terrain at shore
« on: July 21, 2014, 04:46:17 PM »
Hi,

I'm playing with Simutrans 120.0 with pak128 v2.3.

I was using the "lower land" tool at the shoreline, intending to remove land and turn it into sea. However the land remains there, only lowered to a level equal to the sea level:



I could not remove this piece of land in any way.

Thanks!

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1202
    • Simutrans-BLOG
  • Languages: ES
Re: [120.0] Land remains when lowering terrain at shore
« Reply #1 on: July 21, 2014, 05:05:17 PM »
It is a disturbing problem, I wonder if they are planning improve this?.  ???

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5531
  • Languages: EN, NO
Re: [120.0] Land remains when lowering terrain at shore
« Reply #2 on: July 21, 2014, 08:47:25 PM »
That the land remains on the first click is intentional, and I can't see how this more flexible terrain thing could work differently. Although I do agree that it is a bit difficult figuring how to get water now. You have to change the climate to water using the new climate tools, which hopefully the pak set author has exposed in some toolbar.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: [120.0] Land remains when lowering terrain at shore
« Reply #3 on: July 21, 2014, 09:48:52 PM »
Well my intention was actually that water should flood shores when they are lowered (at least in most cases, sometimes this isn't possible). However you can just change the climate afterwards as Ters states.

Offline V813

  • *
  • Posts: 47
  • Hi from Hong Kong :)
  • Languages: EN, ZH
Re: [120.0] Land remains when lowering terrain at shore
« Reply #4 on: July 22, 2014, 03:20:38 AM »
I can't find toolbar buttons for climate tools in pak128. Is there any keyboard shortcut?

Thanks :D

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2720
  • Languages: EN
Re: [120.0] Land remains when lowering terrain at shore
« Reply #5 on: July 22, 2014, 04:08:05 AM »
Pak128 has not finished fully migrating to the new terrain system. It also lacks the double height stuff that pak64 shows to some extent.

In pak64 you can build water over tiles, I assume such a feature will be exposed in the new pak128 once it is done.

Offline gauthier

  • Devotee
  • *
  • Posts: 3628
    • SNFOS'website (in both FR and EN)
  • Languages: FR, EN, JP
Re: [120.0] Land remains when lowering terrain at shore
« Reply #6 on: July 22, 2014, 08:26:32 AM »
Pak128 2.3 hasn't such tools. However latest nightlies of pak128 (with half heights) does.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5531
  • Languages: EN, NO
Re: [120.0] Land remains when lowering terrain at shore
« Reply #7 on: July 22, 2014, 08:40:59 AM »
Well my intention was actually that water should flood shores when they are lowered (at least in most cases, sometimes this isn't possible).

I've never seen that happen. The lowering tools gives first land of the same height as the water. If you continue to use it, you get the Netherlands. But if the automatically flooed, how are one then to create flat shores?

Offline gauthier

  • Devotee
  • *
  • Posts: 3628
    • SNFOS'website (in both FR and EN)
  • Languages: FR, EN, JP
Re: [120.0] Land remains when lowering terrain at shore
« Reply #8 on: July 22, 2014, 10:42:27 AM »
Water should flood only when a flat shore is lowered.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5531
  • Languages: EN, NO
Re: [120.0] Land remains when lowering terrain at shore
« Reply #9 on: July 22, 2014, 11:48:28 AM »
But how would one then create the Netherlands?

Offline Leartin at

  • Devotee
  • *
  • Posts: 1260
  • PAK-DEV P192C
  • Languages: DE, EN
Re: [120.0] Land remains when lowering terrain at shore
« Reply #10 on: July 22, 2014, 12:14:49 PM »
by going beneath water level somewhere at land, then continuing to lower land until you reach the ocean. No reason why anything but the tile next to water would be flooded.

Offline gauthier

  • Devotee
  • *
  • Posts: 3628
    • SNFOS'website (in both FR and EN)
  • Languages: FR, EN, JP
Re: [120.0] Land remains when lowering terrain at shore
« Reply #11 on: July 22, 2014, 12:15:08 PM »
Quote
shore
I mean : flat land bordering water. If you lower flat land in the middle of land, it won't flood.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: [120.0] Land remains when lowering terrain at shore
« Reply #12 on: July 22, 2014, 09:20:34 PM »
The intention was to more or less recreate the old behaviour. As such when a tile is lowered to sea level, and is next to a water tile then it should flood. Note this doesn't create a chain flood al la transport tycoon but only floods the individual tile that has been lowered. However someone may have changed this from my original implementation.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: [120.0] Land remains when lowering terrain at shore
« Reply #13 on: July 24, 2014, 08:41:28 PM »
Right, I've confirmed that no flooding happens now at all - is this intentional?

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5531
  • Languages: EN, NO
Re: [120.0] Land remains when lowering terrain at shore
« Reply #14 on: July 24, 2014, 09:34:50 PM »
If you know where the code is located, can't you just check what the person who did it wrote in the commit message of the revision that changed those lines? (This is done with svn blame if you don't know.) Or have there been later changes to those lines?

Personally, I can find the current behaviour useful. gauthier's suggestion sounds good, although there is the issue of how to deal with an already lowered region being connected to the sea, especially accidentally.

Offline gauthier

  • Devotee
  • *
  • Posts: 3628
    • SNFOS'website (in both FR and EN)
  • Languages: FR, EN, JP
Re: [120.0] Land remains when lowering terrain at shore
« Reply #15 on: July 25, 2014, 07:56:51 AM »
If there is flooding on more than the tiles that have just been lowered, the game could show a warning message about flooding with two buttons "continue" and "cancel".

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5531
  • Languages: EN, NO
Re: [120.0] Land remains when lowering terrain at shore
« Reply #16 on: July 25, 2014, 08:23:40 AM »
If there is flooding on more than the tiles that have just been lowered, the game could show a warning message about flooding with two buttons "continue" and "cancel".

Simutrans doesn't do such dialogs. Either it happens, or it doesn't, without futher user input.

Offline gauthier

  • Devotee
  • *
  • Posts: 3628
    • SNFOS'website (in both FR and EN)
  • Languages: FR, EN, JP
Re: [120.0] Land remains when lowering terrain at shore
« Reply #17 on: July 25, 2014, 09:34:19 AM »
So what ? Is that impossible to implement ?

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5531
  • Languages: EN, NO
Re: [120.0] Land remains when lowering terrain at shore
« Reply #18 on: July 25, 2014, 12:35:02 PM »
So what ? Is that impossible to implement ?

Not impossible, but there might be obstacles. I think it's mostly a fundamental design guideline, though, perhaps to avoid having to deal with changes to the game state during processing of an action. There isn't even a "Are you sure you want to quit?" or "Do you want to save the map before exiting?" dialog! That has been requested, but turned down.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9518
  • Languages: De,EN,JP
Re: [120.0] Land remains when lowering terrain at shore
« Reply #19 on: July 30, 2014, 09:14:47 PM »
If there was once a flooding intended when lowering shores, it never worked. I find this irritating too.

EDIT: ok, reintroducing flooding of coastal slopes was easy when lowering one by one. Still some troubles with horizontal coasts. (The code in question is not very easy to follow.)
« Last Edit: July 30, 2014, 10:42:22 PM by prissi »

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2720
  • Languages: EN
Re: [120.0] Land remains when lowering terrain at shore
« Reply #20 on: July 31, 2014, 02:52:07 AM »
Some kind of OpenTTD style flooding of land that gets connected to water is a bad idea. As it is the water drag tool as seen in RC120 Pak64 is unsafe and the ultimate troll tool.

When expanding bodies of water (dragging the elevated part away from the water) it should automatically expand. If you suddenly hit low elevation, the same as the water, it should remain unchanged and only the last elevated segment to be removed would have water expand 1 tile into it.

The water fill tool requires safety and finance checks. Currently there is nothing in Pak64 to stop a user from flooding the entire map fast with it just by starting a company (the debt run up does not mater). I would advise the following.
1. A map parameter that defines the maximum (and minimum) water to land ratio. Changes that would result in exceeding these limits cannot be performed so people cannot flood fill the entire map to water (as that would exceed maximum water limit) and neither can they terraform an island map into mostly land (as that would exceed maximum land limit).
2. A finance check to check if they can afford it. If the flood action would bring them into the red then it should be cancelled.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5531
  • Languages: EN, NO
Re: [120.0] Land remains when lowering terrain at shore
« Reply #21 on: July 31, 2014, 08:01:41 AM »
A finance check to check if they can afford it. If the flood action would bring them into the red then it should be cancelled.

The tool can't have finance checks, because the public player is almost always in red. Futhermore, in some cases, even normal players need to be able to operate in the red for short periods. If normal players actually need this tool at all, they might need it as one of the final touches to complete something that will bring them out of debt.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9518
  • Languages: De,EN,JP
Re: [120.0] Land remains when lowering terrain at shore
« Reply #22 on: July 31, 2014, 10:04:07 AM »
The flooding tool could be just declared not network safe. Then only the admin can do this. I think this is anyway the best solution, i.e. allow flood and drain tool only to player 1.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5531
  • Languages: EN, NO
Re: [120.0] Land remains when lowering terrain at shore
« Reply #23 on: July 31, 2014, 10:49:38 AM »
I don't know how synchronized players play in these networked games, but I imagine it can be a big bother to have to wait for an admin to come around to help raise a lake one wants/needs for a canal.

One could try to make it very expensive, and then have some limit as to how expensive operations one can perform while in dept. This could help for other things as well, but I haven't been able to come up with any rule that will always work and never get in the way. Just having some limit in simuconf.tab is an option, but one still needs a suitable default value.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2720
  • Languages: EN
Re: [120.0] Land remains when lowering terrain at shore
« Reply #24 on: July 31, 2014, 11:47:14 AM »
Generally if you are just starting out there should be no need to use the tool extensively. Also there needs to be minimum lake/water width as currently you can use it as a maintenance free (but vandal prone) super canal (just paint long strips of 1*X or X*1 and use cannals only for elevation changes). Maybe only allow players to extend existing bodies of water and disable the drag effect (so 1 tile at a time) while the service provider can drag it and place water anywhere.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5531
  • Languages: EN, NO
Re: [120.0] Land remains when lowering terrain at shore
« Reply #25 on: July 31, 2014, 03:10:52 PM »
Also there needs to be minimum lake/water width as currently you can use it as a maintenance free (but vandal prone) super canal (just paint long strips of 1*X or X*1 and use cannals only for elevation changes).

I wonder if the game should consider a 1 tile wide lake to be much wider than a canal, therefore much more expensive to create. So a canal would be on the vehicle scale (10-100 m), while the lake is on the tile scale (1 km?).

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: [120.0] Land remains when lowering terrain at shore
« Reply #26 on: July 31, 2014, 07:39:01 PM »
Quote
I wonder if the game should consider a 1 tile wide lake to be much wider than a canal, therefore much more expensive to create. So a canal would be on the vehicle scale (10-100 m), while the lake is on the tile scale (1 km?).
Indeed - 1 tile width should be permitted as even in experimental which can be down to 125m per tile this is still quite wide. Again in experimental there could be ships that can use lakes but not rivers.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5531
  • Languages: EN, NO
Re: [120.0] Land remains when lowering terrain at shore
« Reply #27 on: July 31, 2014, 08:07:12 PM »
125 metres is about the same or less than the width of the bigger canals, like Kiel, Suez and Panama, and they still need maintenance.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9518
  • Languages: De,EN,JP
Re: [120.0] Land remains when lowering terrain at shore
« Reply #28 on: July 31, 2014, 09:36:26 PM »
As in r7425 now: There is still the tool to make water from land, which is not restricted if you want to make a lake. Dragging this will be only allowed in non-networking mode and flooding and raising the water table only for admins.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: [120.0] Land remains when lowering terrain at shore
« Reply #29 on: August 04, 2014, 12:38:45 AM »
Just to add to this - the more aggressive flooding has caused a number of issues with city roadbuilding. Firstly when the city leveled a tile this could become flooded, and the code tried to access a now non existent tile. This caused a crash to desktop, but also once this was fixed the city then built a road on the water which was invisible. I think I've fixed these issues, but there may be similar issues affecting AI waybuilding.

Edit:
There are - crash to desktop and strange artifacts occur quite often with AI now.
« Last Edit: August 04, 2014, 01:03:50 AM by kierongreen »

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5531
  • Languages: EN, NO
Re: [120.0] Land remains when lowering terrain at shore
« Reply #30 on: August 04, 2014, 08:34:16 AM »
There are - crash to desktop and strange artifacts occur quite often with AI now.

Related to just to this water thing, or does it have trouble with double heights as well? Or haven't you been able to dig that far into it?

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: [120.0] Land remains when lowering terrain at shore
« Reply #31 on: August 04, 2014, 09:56:52 AM »
I'm pretty certain it's to do with water. A number of parts of the code which call levelling routines make assumptions about the memory location of a ground tile not changing . Now that levelling can change ground to water this changes the memory location and hence can lead to a crash. Also since the ground that was being levelled is now water the AI cannot build the route it had planned.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: [120.0] Land remains when lowering terrain at shore
« Reply #32 on: August 05, 2014, 08:10:03 PM »
AI and crashes should be fixed in 7283.