News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

[Patch] New underground view

Started by Dwachs, December 27, 2008, 03:08:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dwachs

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.
Parsley, sage, rosemary, and maggikraut.

DirrrtyDirk

Have you talked to Kieron? I think he started reworking underground a while ago, too...
  
***** PAK128 Dev Team - semi-retired*****

VS

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!

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

Dwachs

Quote from: VS 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!

thank you :)

it should be easily possible to add tools for moving the underground level up/down.
Parsley, sage, rosemary, and maggikraut.

isidoro

#4
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.

jamespetts

Changing the cursor tile alignment in itself would be a huge improvement. I should be very interested to see this.
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.

prissi

Looks very much like locomotion. Is there a patch for testing?

Dwachs

Quote from: isidoro on December 27, 2008, 07:30:55 PM
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.

Quote from: jamespetts 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.

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.
Parsley, sage, rosemary, and maggikraut.

Dwachs

Here is the patch file. Under Options -> Display one can toggle the underground-view and change the underground-level gradually.

Parsley, sage, rosemary, and maggikraut.

z9999

#9
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]

Dwachs

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?
Parsley, sage, rosemary, and maggikraut.

Lodovico

Go on, Dwachs. Your path is very usefull. I quite very often need to handle "multilevel tunnels".

Dwachs

#12
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:

# 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.
Parsley, sage, rosemary, and maggikraut.

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.

z9999

Quote from: Dwachs on December 31, 2008, 12:59:16 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.

Dwachs

@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?
Parsley, sage, rosemary, and maggikraut.

z9999

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.

VS

Well, seeing things below current level, maybe with black transparency, might be nice... but it is a very minor detail.

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

kierongreen

Quote from: DirrrtyDirk on December 27, 2008, 03:51:50 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.

Dwachs

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?
Parsley, sage, rosemary, and maggikraut.

jamespetts

Dwachs,

does altering the tools require work from coders or pakset authors or both?
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.

z9999

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]

Dwachs

@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.
Parsley, sage, rosemary, and maggikraut.

isidoro

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?


prissi

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.

jamespetts

Quote from: prissi 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.

What about underground metro systems?
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.

Dwachs

Quote from: prissi on January 06, 2009, 10:19:20 PM
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?
Parsley, sage, rosemary, and maggikraut.

jamespetts

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.
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.

Dwachs

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.
Parsley, sage, rosemary, and maggikraut.

Dwachs

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?
Parsley, sage, rosemary, and maggikraut.

gauthier

tell me when it's implemented in nightly builds ;) I'm looking forward using that :D

DirrrtyDirk

#31
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:
  
***** PAK128 Dev Team - semi-retired*****

jamespetts

Aha, this looks like good progress! I shall have a look at that when I get time.
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.

wernieman

I could make a Spezial Version on monday .....
I hope you understand my English

Frank

Quote from: DirrrtyDirk 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:


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