The International Simutrans Forum

 

Author Topic: [Patch] New underground view  (Read 47620 times)

0 Members and 1 Guest are viewing this topic.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4620
  • Languages: EN, DE, AT
[Patch] New underground view
« on: December 27, 2008, 03:08:37 PM »
Currently I am reworking the underground mode. The new mode has the following properties (features?)
== if switching to underground, the height of the tile under the cursor will be taken as underground-level
== everything under or on underground-level will be displayed as usual
== if the tile is above the underground-level, a currently black tile is displayed at the underground-level
== only tunnels that are on the underground-level are displayed, tunnels above / below the underground-level won't be displayed
== cursor movement on the displayed tiles not on the invisible landscape
-- it should be easier to develop multi-level underground editing with the new underground viewing mode

See the attached screenshots of the same spot of the map, in normal and in new underground mode.

Up to now, I modified the displaying routines. I plan to modify the tools such that 'overground' tools work on all the tiles that are overground, and tunnel tools on the underground-tools.

Any thoughts and comments are welcome.
« Last Edit: December 30, 2008, 11:08:25 PM by prissi »

Offline DirrrtyDirk

  • Devotees (Inactive)
  • *
  • Posts: 1253
  • JR 700 Series Shinkansen
  • Languages: EN,DE
Re: New underground view
« Reply #1 on: December 27, 2008, 03:51:50 PM »
Have you talked to Kieron? I think he started reworking underground a while ago, too...

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: New underground view
« Reply #2 on: December 27, 2008, 06:32:26 PM »
Is there some way to move up/down? I understand that taking the current tile as base is simple for lack of GUI coding, but... ;)

Nevertheless, good work!

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4620
  • Languages: EN, DE, AT
Re: New underground view
« Reply #3 on: December 27, 2008, 06:54:45 PM »
Is there some way to move up/down? I understand that taking the current tile as base is simple for lack of GUI coding, but... ;)

Nevertheless, good work!

thank you :)

it should be easily possible to add tools for moving the underground level up/down.

Offline isidoro

  • Devotee
  • *
  • Posts: 1130
Re: New underground view
« Reply #4 on: December 27, 2008, 07:30:55 PM »
Very nice!  With such an approach, it would be easy to build several connected underground levels.  "Underground artificial slopes" would suffice.

An idea: the overground ramps look strange to me.  The grid can be present only at horizontal sides of tiles at the level chosen, to give 3D impression.
« Last Edit: December 27, 2008, 07:34:12 PM by isidoro »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 19277
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: New underground view
« Reply #5 on: December 27, 2008, 08:11:25 PM »
Changing the cursor tile alignment in itself would be a huge improvement. I should be very interested to see this.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9712
  • Languages: De,EN,JP
Re: New underground view
« Reply #6 on: December 27, 2008, 08:12:59 PM »
Looks very much like locomotion. Is there a patch for testing?

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4620
  • Languages: EN, DE, AT
Re: New underground view
« Reply #7 on: December 28, 2008, 10:40:53 AM »
An idea: the overground ramps look strange to me.  The grid can be present only at horizontal sides of tiles at the level chosen, to give 3D impression.

These overground ramps are drawn to indicate the border between overground and underground terrain. Since internally the z-coordinate of the slopes is the z-coordinate of the tile below, these slopes are  drawn naturally with my approach.

Changing the cursor tile alignment in itself would be a huge improvement. I should be very interested to see this.

The cursor alignment is changed, it will move on the drawn tiles, and not on the regular surface of the ground. The cursor behaviour in the current underground mode was one motivation to develop this patch.

A patch file will follow soon.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4620
  • Languages: EN, DE, AT
Re: New underground view
« Reply #8 on: December 29, 2008, 12:54:30 PM »
Here is the patch file. Under Options -> Display one can toggle the underground-view and change the underground-level gradually.


Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
Re: New underground view
« Reply #9 on: December 29, 2008, 04:47:48 PM »
Some impression.

- Number input box is a problem. Usually, water level is -2, but number input box can't select negative values.
- I want to use existing underground view, too. New underground view is useful in some cases but not always. It's a pain to select each level, and also I want to view all at once.

And one question. Is it intended that all level of monorail and elevated road and tracks will be hidden ?

Problem:
If I build a "High speed road tunnel" on snow, background slope tile was transparent.

[attachment deleted by admin]
« Last Edit: December 29, 2008, 06:35:54 PM by z9999 »

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4620
  • Languages: EN, DE, AT
Re: New underground view
« Reply #10 on: December 29, 2008, 07:25:49 PM »
thank you for testing. You found the following bugs:
== no ground tiles are displayed for tunnel entries
== grid lines are shown inside the tunnel despite being not in underground-mode
== elevated (monorail) tracks are not correctly displayed in underground-mode
== number input can be adapted easily, my test games did have water at 0

An easy keyboard shortcut to increase/decrease underground-level can be implemented too. Would that suffice for your purposes?

Offline Lodovico

  • *
  • Posts: 80
Re: New underground view
« Reply #11 on: December 30, 2008, 07:26:33 PM »
Go on, Dwachs. Your path is very usefull. I quite very often need to handle "multilevel tunnels".

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4620
  • Languages: EN, DE, AT
Re: [Patch] New underground view
« Reply #12 on: December 31, 2008, 12:59:16 PM »
Here is a new patch file. All issues indicated by z9999 are solved. The pak64-roadtunnel causes graphical glitches that are not due to my patch and appear in older versions already (tested in 2168).

Now, also a simple tool is implemented: increase / decrease the underground-level by special keys. The effect is only visible if underground-mode is active. One has to add the following lines to pakxx/config/menuconf.tab:
Code: [Select]
# WKZ_INC_UNDERGROUND_LEVEL = 20
# WKZ_DEC_UNDERGROUND_LEVEL = 21
simple_tool[20]=,HOME
simple_tool[21]=,END
this will increase / decrease the underground-level if the 'home' / 'end' keys are pressed. Ofcourse, different keys than 'home'/'end' can be defined.

edit: some more notes:
-- I assumed '20' to be the maximal underground-level, I did not found an easy way to detect the maximal height in a map. One could add a visible indication what underground-level is currently chosen, for instance in the ticker etc.
-- Behaviour of tools and toolbars is similar as before. I did not touch it.
-- The standard image for grounds in underground-mode is black with gridlines for empty tiles and the sidewalk-image for tunnel ways. Here, one could modify the besch / pak-system to allow textures for the underground-tiles.
-- With this underground-mode, there is the possibility to add slopes in tunnels. Not implemented yet.
« Last Edit: December 31, 2008, 01:07:13 PM by Dwachs »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 19277
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Patch] New underground view
« Reply #13 on: December 31, 2008, 01:06:33 PM »
This looks very promising!

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
Re: [Patch] New underground view
« Reply #14 on: December 31, 2008, 04:39:19 PM »
Here is a new patch file. All issues indicated by z9999 are solved.

Thank you. It seems that everything is working properly.

Quote
Now, also a simple tool is implemented: increase / decrease the underground-level by special keys.

It's very useful, thank you.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4620
  • Languages: EN, DE, AT
Re: [Patch] New underground view
« Reply #15 on: January 05, 2009, 06:28:21 PM »
@z9999: What is your reason that you want to use also the 'old' underground view? quick finding of all tunnels? Or is it enough to change the displayed underground level with the keyboard?

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
Re: [Patch] New underground view
« Reply #16 on: January 05, 2009, 08:05:17 PM »
I first thought it is difficult to positional awareness between each height.
But in fact it was not.
Other reasons are quick finding tunnels and for pleasure like "follow me" mode. These are not so important.

So, I will drop my demand. Changing level with the keyboard is enough.
Thank you.

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: [Patch] New underground view
« Reply #17 on: January 05, 2009, 08:36:43 PM »
Well, seeing things below current level, maybe with black transparency, might be nice... but it is a very minor detail.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: [Patch] New underground view
« Reply #18 on: January 05, 2009, 08:45:22 PM »
Have you talked to Kieron? I think he started reworking underground a while ago, too...
Haven't heard anything... I've really not had the time for anything to do with simutrans recently. I was planning on dealing with multilevel tunnels by reusing the artificial slope buttons. Got as far as some logic being there for detecting clicks on ends of tunnels. I don't think I'm going to make much progress soon though - at the moment I don't even have an internet connection at home.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4620
  • Languages: EN, DE, AT
Re: [Patch] New underground view
« Reply #19 on: January 06, 2009, 11:53:37 AM »
The next step for this patch would be to alter all the tools. In the way, that 'overground tool' work on the tiles that are normally shown, while underground-tools work on the underground tiles.

For multi-level tunnels I thought similarly about using the artificial slope tools: building a slope on a tunnel end gives an upward slope in the tunnel way. However, displaying will get complicated since an upward slope belongs programwise to the level below. And path-finding will be another difficulty I fear.

Any opinions on both issues?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 19277
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Patch] New underground view
« Reply #20 on: January 06, 2009, 12:29:03 PM »
Dwachs,

does altering the tools require work from coders or pakset authors or both?

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
Re: [Patch] New underground view
« Reply #21 on: January 06, 2009, 12:38:44 PM »
One question.

In current your patch, we can build a stop and set schedule on the middle level of way. (see first picture) This was impossible in original simutrans.
I don't know this is intended or not, but I like this very much.
Will this remain in the future ?


[attachment deleted by admin]

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4620
  • Languages: EN, DE, AT
Re: [Patch] New underground view
« Reply #22 on: January 06, 2009, 12:55:49 PM »
@james petts: altering the tools means only coder work. I did not look into it. But I think a lot of checks like 'is mouse position over/under ground' have to be added.

@z9999: If I understand your right, you have three levels of streets above each other, and now you can select the middle level, if you choose the underground level right? I hope this behavior can be recovered, since I altered also the computation of mouse position in underground mode.

In the original underground mode one can build tunnel ways only from already existing ways, this condition can be relaxed now I think.

Offline isidoro

  • Devotee
  • *
  • Posts: 1130
Re: [Patch] New underground view
« Reply #23 on: January 06, 2009, 05:08:34 PM »
For the tools:  to simplify things, why not keeping the underground tools while in underground mode and not allow to build overground?

For the ramps:  why not marking them as if overground, or with a different color?


Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9712
  • Languages: De,EN,JP
Re: [Patch] New underground view
« Reply #24 on: January 06, 2009, 10:19:20 PM »
With some though, I do not think many tools require a change. Especially since most tools now take a 3d coordinate anyway. (Was one of the more recent changes.)

But I think it would better to enforce tunnels to be built in connection with overground ways.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 19277
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Patch] New underground view
« Reply #25 on: January 06, 2009, 10:59:35 PM »
With some though, I do not think many tools require a change. Especially since most tools now take a 3d coordinate anyway. (Was one of the more recent changes.)

But I think it would better to enforce tunnels to be built in connection with overground ways.

What about underground metro systems?

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4620
  • Languages: EN, DE, AT
Re: [Patch] New underground view
« Reply #26 on: January 07, 2009, 08:38:01 AM »
But I think it would better to enforce tunnels to be built in connection with overground ways.
You mean automatically placing tunnel entries, overground street and underground way if the player wants to build from an overground tile to an underground tile?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 19277
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Patch] New underground view
« Reply #27 on: January 22, 2009, 08:10:29 PM »
Hmm, any more progress on getting the tools sorted out for this? It'd be good to put this in Simutrans-Experimental if the tools were fixed.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4620
  • Languages: EN, DE, AT
Re: [Patch] New underground view
« Reply #28 on: January 23, 2009, 06:21:43 AM »
Hi James, I did not work on that recently. Feel free to use this in your experimental build. You will have to translate the patch file (gib -> get ...). I will help sorting out bugs with respect to the tools.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4620
  • Languages: EN, DE, AT
Development snapshot
« Reply #29 on: January 30, 2009, 08:13:24 PM »
Now, I the 'old' underground mode and the 'new' coexist friendly.

Pressing 'U' gives you the new mode, with the level where the landscape is cut according to cursor position. Pressing again 'U' toggles the 'old' mode. Another 'U' returns to normal mode.

The tools for changing the underground level are as described above.

Here is a windows binary, patch attached:
http://rapidshare.com/files/191721652/simutrans-ug.exe.html

Please test for bugs in displaying and in the build-tunnel tool. All other tools I did not touch/test, expect undocumented behaviour there ;)

I also ask for opinions about the toggling method. How should the different view modes be toggled?

Offline gauthier

  • Devotee
  • *
  • Posts: 3628
    • SNFOS'website (in both FR and EN)
  • Languages: FR, EN, JP
Re: [Patch] New underground view
« Reply #30 on: January 30, 2009, 09:16:20 PM »
tell me when it's implemented in nightly builds ;) I'm looking forward using that :D

Offline DirrrtyDirk

  • Devotees (Inactive)
  • *
  • Posts: 1253
  • JR 700 Series Shinkansen
  • Languages: EN,DE
Re: [Patch] New underground view
« Reply #31 on: January 30, 2009, 10:50:34 PM »
Why do you use rapidshare for the file instead of the simutrans-germany sites?

EDIT:
Oh and by the way: the file doesn't work here.

EDIT2:

Here's the (german) error message:
« Last Edit: January 30, 2009, 11:00:56 PM by DirrrtyDirk »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 19277
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Patch] New underground view
« Reply #32 on: January 30, 2009, 10:58:38 PM »
Aha, this looks like good progress! I shall have a look at that when I get time.

Offline wernieman

  • Devotees (Inactive)
  • *
  • Posts: 713
    • Werniemans-Webside (only German)
Re: [Patch] New underground view
« Reply #33 on: January 30, 2009, 11:59:08 PM »
I could make a Spezial Version on monday .....

Offline Frank

  • Inactive/Retired
  • *
  • Posts: 1431
  • Languages: DE
Re: [Patch] New underground view
« Reply #34 on: January 31, 2009, 12:13:55 AM »
Why do you use rapidshare for the file instead of the simutrans-germany sites?

EDIT:
Oh and by the way: the file doesn't work here.

EDIT2:

Here's the (german) error message:


compile with debug dll?

if compile with MS VC++ 2005/2008 EE then require .net-Framework

and upload to patches.simutrans-germany.com, this page required not javascript