News:

Want to praise Simutrans?
Your feedback is important for us ;D.

New Tools: Remove Along Path, Flatten Path

Started by PJMack, April 25, 2022, 11:04:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PJMack

I created a PR (Simutrans-Extended#532) for a pair of tools, one which calls the remove tool for all tiles along a path, the other which uses the up/down tools to flatten a path.  The idea behind these are to prep ground for ways. 

For the remove along path tool, if starting from a natural ground tile, the path follows the ground contours, otherwise it would only apply to items that are the same height as the starting point.  This is handy for elevated way removal.  Items that cannot be removed will be silently skipped.

The flatten path tool uses the up and down tools to attempt to flatten land along a path making cuttings and embankments where necessary and possible.  Any place where the ground cannot be raised or lowered all the way will be raised or lowered as much as possible and the remainder silently skipped.

Both tools have been placed in the special construction tools for Pak128.Britain for its PR (Simutrans-pak128.britain#136).  The path flatten tool is not with the landscaping tools to prevent accidental usage.

The reason this is two PRs and not four is that half the code is shared between the two tools.



Edit: The PR works fine on a debug build but crashes on an optimized build.  I put it in draft mode until I can find the issue.

PJMack


Matthew

#2
I gave these a try. Everything worked more or less as expected: landscape smoothed (even to great depths). It handled things like player vehicles on the path without difficulty. Great work!

Unexpected consequences:
  • Reclaiming land from the sea, or building sea inlets, is a lot easier. I always found this really fiddly before. Stand by for a lot more artificial airport islands, I suspect.
  • The Path Remover tool is great for solving traffic jams in urban areas :P .
  • In a way this is a big change to the Extended experience (potentially Standard too, as this seems eminently suitable for backporting)... New players may never discover the relaxing rhythm of building an embankment by thousands of clicks. The world's health systems may appreciate the reduction in wrist strain though!  ;D

Two points for further consideration.

Firstly, I am not sure whether the Special Construction Tools menu is the right place for these. I do appreciate the point that they are very powerful tools, where you can easily bankrupt a new company with a single drag. But the Landscape menu does feel a more natural home and better for discoverability.

Secondly, it seems that pak.128-Britain-Ex has now equalized the cost the cost of landscaping with the Raise Land tool (clicked twice to raise two vertices of a tile to the level of an adjacent tile) and landscaping with the Build artificial slopes tool (clicked once). (An unfortunate development in my opinion, but this thread is probably not the place to re-open that discussion).

[EDIT: The old costs are still used in B-B. So have the costs only been changed in the new_tools branch or are the old costs stored in the B-B savegame??]

 However, other paksets may not have done so. Is the Flatten Path tool using the Raise Land cost or the Build artificial slopes cost? The results seems closer to Raise Land, but the cost appears as a single item like it does for Build artificial slopes, and the corner costs appear consistent with that.
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

PJMack

The path remover tool had been on my TODO list for a while and was almost part of the new elevated way system.  The land flattening tool was because I was getting tired of accidentally clicking or dragging to the wrong place when flattening land for a cutting or embankment.  Both are essentially the same psuedo tool that iteratively calls the existing removal and landscaping tools respective to their purpose.  They can do nothing that existing tools cannot do with enough clicks.

As these tools are expensive and probably not for beginners, so hiding them was deliberate.  The menu layouts are set per pakset.

The flatten path uses the raise land and lower land tools and the raise/lower land pricing so that everything done by the flatten path tool is priced exactly as if done by hand with the raise or lower tools.  The pricing display is such that the total is shown for each highlighted tile rather than each corner.

The new default landscaping price changes are in master already (They were both divided by two pending more research).  The raise land and artificial slope prices are set in the settings and saved with the game, so any games started before the price changes would still have the old costs unless they were changed manually by the server administrator or player for local games.  As with most settings, the pakset designers can override the default values, and the user/admin can override those values, even when the game is still running.

jamespetts

Excellent, thank you for this. This definitely makes things easier for the player. One thing, however, that I discovered in testing is that it does not seem to work well over artificial slopes: it fails to flatten these. I would suggest that, wherever an artificial slope be encountered, this tool should revert the slope to natural before proceeding.

I note the discussion about land reclamation from the sea being easier with this. I also note that land reclamation from the sea has no additional cost compared with simply raising land generally. This, I think, is an oversight: I will need to implement a new, additional cost for reclaiming sea tiles over and above the basic landscaping cost to ensure that the economics of sea reclamation are realistic and that incentives be not distorted.

In relation to the relative costs of artificial slopes, so far as I can see, the cost differential for these has been preserved. The fundamental idea is always that building natural slopes should cost less than building artificial slopes, so that the space saving of building a straight sided cutting or embankment costs more than the more space-intensive sloped sided cutting - just as in reality. I have, however, increased this differential slightly in Pak128.Britain-Ex.

I think that this should be ready to incorporate when the handling of artificial slopes has been fixed.
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.

PJMack

Quote from: jamespetts on May 01, 2022, 02:42:22 PMExcellent, thank you for this. This definitely makes things easier for the player. One thing, however, that I discovered in testing is that it does not seem to work well over artificial slopes: it fails to flatten these. I would suggest that, wherever an artificial slope be encountered, this tool should revert the slope to natural before proceeding.
You're Welcome.  I just pushed code so that the new landscaping tool would call the revert slope function first if the shift key is held.  In testing, there were situations where enabling pre-reverting slope cause the tool to un-flatten the land, and other situations where pre-reverting just added costs.

Quote from: jamespetts on May 01, 2022, 02:42:22 PMI note the discussion about land reclamation from the sea being easier with this. I also note that land reclamation from the sea has no additional cost compared with simply raising land generally. This, I think, is an oversight: I will need to implement a new, additional cost for reclaiming sea tiles over and above the basic landscaping cost to ensure that the economics of sea reclamation are realistic and that incentives be not distorted.
I do not think it is actually easier to do land reclamation with the new tool than with dragging the existing up tool.  Nevertheless, some research into the costs may be necessary.
Quote from: jamespetts on May 01, 2022, 02:42:22 PMIn relation to the relative costs of artificial slopes, so far as I can see, the cost differential for these has been preserved. The fundamental idea is always that building natural slopes should cost less than building artificial slopes, so that the space saving of building a straight sided cutting or embankment costs more than the more space-intensive sloped sided cutting - just as in reality. I have, however, increased this differential slightly in Pak128.Britain-Ex.
I believe that the ratios were in balance, hence why I preserved them.  Recently, I have been reading up on the costs of landscaping using Gillette's book (linked in the snippet of pricing forum post) and found costs of landscaping in dirt in 1900-1910 US to be about 5-10 cents per cubic yard not including haulage.  I have not figured out what to make of that as far as pak128.Britain-Ex is concerned.

jamespetts

Thank you for that - that is helpful. I have merged this, but I do note that the menu buttons (1) do not have tooltips and (2) have shortcut letters shown that do not correspond with any actual shortcut key in the game. I should be grateful if you could look into that.

The land reclamation will need further investigation as to costs indeed.
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.

PJMack

I fixed the tool-tips in a new code PR.

I removed the shortcut letters and redid the pakset PR so it no longer depends on the tunnel changes.

jamespetts

Splendid, thank you: now incorporated.

I have also added the feature to have a separate cost for reclamations from the sea - if you have any research as to how this might better be balanced (currently, it is approximately 13x the basic land raising cost), then that would be most helpful.
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.

Octavius

#9
Quote from: jamespetts on May 01, 2022, 08:02:07 PMI have also added the feature to have a separate cost for reclamations from the sea - if you have any research as to how this might better be balanced (currently, it is approximately 13x the basic land raising cost), then that would be most helpful.
To give you some numbers, construction cost of Maasvlakte 2 in the Netherlands was 3 billion euros or about 2.5 billion pounds in the period 2008-2013 for 15 square kilometres of land plus 5 square kilometres of water that had to be dredged to 25 metres. This included seawalls, beaches and basic rail, road and water infrastructure, but not the actual port facilities constructed there. So that's about 170 million pounds per square kilometre. The used construction method was supplying a big pile (275 million cubic metres) of sand using ships.

Another data point is the Noordoostpolder, constructed between 1936-1942 for about 125 million guilders or 12 million pounds. That included dikes, pumping stations, canals and basic road infrastructure. Surface area is about 500 square kilometres, so that's about 24 thousand pounds per square kilometre. The construction method was a polder: build a dike around it, then pump the water out. Unfortunately for Simutrans purposes, with that construction method, cost doesn't really scale with surface area.