The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: Dwachs on April 17, 2009, 07:19:43 PM

Title: [patch] new cursor movement
Post by: Dwachs on April 17, 2009, 07:19:43 PM
with this patch it is possible to select any ground on the map (bridges etc..)

the patch contains only the changed cursor movement, I did not touch any tools yet. So expect weird result when clicking around.
Title: Re: [patch] new cursor movement
Post by: gerw on April 18, 2009, 07:16:46 AM
Very nice patch!

It is intended, that, while pointing on a bridge, both kartenboden and bridge are highlighted?

I'm looking forward to use full 3d coordinates in the tools.
Title: Re: [patch] new cursor movement
Post by: Dwachs on April 18, 2009, 08:36:50 AM
Quote from: gerw on April 18, 2009, 07:16:46 AM
Very nice patch!

It is intended, that, while pointing on a bridge, both kartenboden and bridge are highlighted?

thank you :)

Yes this is intended to give a hint about the height of the cursor. In fact, all levels between cursor and ground are highlighted. But on the not-marked tiles only the front part of the cursor ist shown.

Any other ideas how to indicate the 3rd coordinate visually are welcome! The method used in the old isometric game "xcom ufo defense" is my personal favourite ;)
Title: Re: [patch] new cursor movement
Post by: gerw on April 18, 2009, 08:49:57 AM
Quote from: Dwachs on April 18, 2009, 08:36:50 AM
Any other ideas how to indicate the 3rd coordinate visually are welcome! The method used in the old isometric game "xcom ufo defense" is my personal favourite ;)

I think it is a good idea. Therefore we need a new cursor, where the front vertical edge is highlighted.

For those, who don't know XCom: http://cache.kotaku.com/assets/images/kotaku/2008/09/xcom_ufo_defense.jpg (http://cache.kotaku.com/assets/images/kotaku/2008/09/xcom_ufo_defense.jpg)
Title: Re: [patch] new cursor movement
Post by: z9999 on April 18, 2009, 09:11:22 AM
Interesting.
Doesn't cursor move to on the sea yet ?
Title: Re: [patch] new cursor movement
Post by: prissi on April 18, 2009, 08:33:24 PM
I though of drawing the ground with blue (yellow?) transparent color.
Title: Re: [patch] new cursor movement
Post by: Dwachs on April 19, 2009, 02:36:01 PM
Quote from: prissi on April 18, 2009, 08:33:24 PM
I though of drawing the ground with blue (yellow?) transparent color.

could you provide more details? which ground should be transparent? the marked one? all above? all below?
Title: Re: [patch] new cursor movement
Post by: prissi on April 19, 2009, 07:30:18 PM
I mean draw a colorful overlay (orange like the marker) with the ground graphics, just like the reserved ways or stop areas on the tile the cursour actually is on.
Title: Re: [patch] new cursor movement
Post by: Dwachs on April 20, 2009, 05:09:27 AM
Quote from: z9999 on April 18, 2009, 09:11:22 AM
Doesn't cursor move to on the sea yet ?

The termination criterion of one loop was false, I will update the patch this week.
Title: Re: [patch] new cursor movement
Post by: Dwachs on April 21, 2009, 08:27:27 PM
New patch file. Now all tools should work (but unexpected behaviour can be expected at some points).

Please test! :)
Title: Re: [patch] new cursor movement
Post by: z9999 on April 22, 2009, 03:53:55 PM
Some impressions

- Underground mode: Can't move to empty tile. So, can't build new road/track.
- Underground mode: Too many markers with stop building tool and hard to look.
- Upgrading road/track and downgrading road/track don't use 3d coordinate.
Title: Re: [patch] new cursor movement
Post by: sojo on April 22, 2009, 05:51:12 PM
This is a little bit confusing. Can it drawn in difficult colors?

F.e. From (top to bottom) red to green. So you have on top a dark red and you go to a dark green over orange or yellow. But I'm not sure if this is possible.
Title: Re: [patch] new cursor movement
Post by: prissi on April 22, 2009, 06:11:22 PM
Differen colors is not possible. And 3D coordinates are not yet used, this is just preview for the changes to come to simwerkz.cc needed.
Title: Re: [patch] new cursor movement
Post by: Dwachs on April 22, 2009, 07:27:33 PM
Quote from: z9999 on April 22, 2009, 03:53:55 PM
Some impressions
- Underground mode: Can't move to empty tile. So, can't build new road/track.
- Upgrading road/track and downgrading road/track don't use 3d coordinate.
This should be solved now.

Quote from: z9999 on April 22, 2009, 03:53:55 PM
- Underground mode: Too many markers with stop building tool and hard to look.
I changed the 'helper' marker to the grid graphics, which yield a more moderate look. Is it better?

Quote from: sojo on April 22, 2009, 05:51:12 PM
This is a little bit confusing. Can it drawn in difficult colors?
I used the marker and border graphics as defined in each pakset. At a later stage one can change this.

Quote from: prissi on April 22, 2009, 06:11:22 PM
And 3D coordinates are not yet used, this is just preview for the changes to come to simwerkz.cc needed.
The patch file contains all necessary changes, everything should be working with 3d-coordinates :o

I will ask wernieman to cross-compile the patch.
Title: Re: [patch] new cursor movement
Post by: wernieman on April 22, 2009, 08:21:29 PM
See http://patches.simutrans-germany.com/ (http://patches.simutrans-germany.com/)
Title: Re: [patch] new cursor movement
Post by: knightly on April 22, 2009, 08:57:58 PM
First of all, thanks a lot for your great work, Dwachs. ;)

I tried the SDL/Mingw version compiled by Wernieman, and it seems that the cursor does not highlight the bridge surface at the slope end of the bridge. Is it the intended behaviour?
Title: Re: [patch] new cursor movement
Post by: Dwachs on April 23, 2009, 05:10:16 AM
@wernieman: Thank you very matsch!

@Knightly: At least this behaviour is known. It is not easy to fix. I will try to do so this evening.
Title: Re: [patch] new cursor movement
Post by: z9999 on April 23, 2009, 06:40:18 AM
Quote from: z9999 on April 22, 2009, 03:53:55 PM
- Underground mode: Too many markers with stop building tool and hard to look.
It looks better, thank you.
Quote from: z9999 on April 22, 2009, 03:53:55 PM
- Underground mode: Can't move to empty tile. So, can't build new road/track.

It works, thank you. Is it difficult to mark the same height tile ?
Currently, starting cursor popsition is on the road, but ending cursor position is on the ground. This is a little difficult to recognize.
Title: Re: [patch] new cursor movement
Post by: z9999 on April 23, 2009, 06:42:50 AM
Quote from: z9999 on April 22, 2009, 03:53:55 PM
- Upgrading road/track and downgrading road/track don't use 3d coordinate.
I think this still not work correctly. Can you upgrad/downgrade topmost ways ?
And also, elevated monorail could be ugpgrated to normal monorail graphics, this should not happen.
Title: Re: [patch] new cursor movement
Post by: knightly on April 23, 2009, 06:53:51 AM
Regarding image ug03.png posted by z9999 above :

Would it be better if, on the ground surface, the squares above the road will also be highlighted? Those squares also fall within the coverage area of the stop.
Title: Re: [patch] new cursor movement
Post by: Dwachs on April 23, 2009, 07:08:36 AM
Quote from: z9999 on April 23, 2009, 06:40:18 AM
Is it difficult to mark the same height tile ?
Currently, starting cursor popsition is on the road, but ending cursor position is on the ground. This is a little difficult to recognize.
yes, it is difficult. If the underground tile that should be marked is empty, there is nothing to put the cursor on.

I try to fix up- and downgrading today evening.

Quote from: Knightly on April 23, 2009, 06:53:51 AM
Regarding image ug03.png posted by z9999 above :

Would it be better if, on the ground surface, the squares above the road will also be highlighted? Those squares also fall within the coverage area of the stop.
The problem here is, that simutrans uses the same method to mark the ground where the cursor is and create the preview of the catchment area. Your proposal means that more tiles are marked, which is IMHO not a good idea. See the screenshots of z9999 above.

These difficulties in the underground view were the main motivation for me to develop the new underground view ...
Title: Re: [patch] new cursor movement
Post by: Dwachs on April 23, 2009, 07:56:07 PM
Quote from: z9999 on April 23, 2009, 06:42:50 AM
I think this still not work correctly. Can you upgrad/downgrade topmost ways ?

Here is a new patch file, which fixes your observations. Thank you for testing!

I included also the possibility to build elevated ways on top of elevated ways without cheating ;) Dont know whether prissi likes that or not :o
Title: Re: [patch] new cursor movement
Post by: wernieman on April 24, 2009, 06:59:42 AM
New Compiler run with the new-patch

See: http://patches.simutrans-germany.com/ (http://patches.simutrans-germany.com/)

But I delete there the old one (3433)
Title: Re: [patch] new cursor movement
Post by: Dwachs on April 24, 2009, 08:31:32 AM
Thank you!
Title: Re: [patch] new cursor movement
Post by: z9999 on April 24, 2009, 11:48:26 AM
Quote from: Dwachs on April 23, 2009, 07:56:07 PM
I included also the possibility to build elevated ways on top of elevated ways without cheating ;)
Thank you. It's great, and I understand now why upgrading/downgrading topmost way didn't work.
Quote from: Dwachs on April 23, 2009, 07:56:07 PM
Dont know whether prissi likes that or not :o
Maybe... not ?  :'(


So, this cursor feature will come with height-cut mode ?
If not, there is no way to select ground tiles under bridges.
Title: Re: [patch] new cursor movement
Post by: Dwachs on April 24, 2009, 12:08:17 PM
After integration of this cursor patch, the new underground mode will come in trunk too. We decided to first complete this patch here, the new underground mode can use all the reworked tools.

Quote from: z9999 on April 24, 2009, 11:48:26 AM
So, this cursor feature will come with height-cut mode ?
If not, there is no way to select ground tiles under bridges.

I can add support of the ctrl-key: that means ctrl+click selects the ground. What do you think? The ctrl-key is not used anymore with the cursor-patch.
Title: Re: [patch] new cursor movement
Post by: wernieman on April 24, 2009, 12:23:15 PM
Will there be a new patch-Version this weekend or did you work for the trunk?

When you will make a new patch-version, then I must plan a new compilerrun ... so there will be enough tests befor you programm for the trunk.
Title: Re: [patch] new cursor movement
Post by: z9999 on April 24, 2009, 02:00:14 PM
Quote from: Dwachs on April 24, 2009, 12:08:17 PM
I can add support of the ctrl-key: that means ctrl+click selects the ground. What do you think? The ctrl-key is not used anymore with the cursor-patch.

Well, I'm not sure which way is good, but easy way to access to behind tiles or objects would be needed for any construction tools, I think.
Title: Re: [patch] new cursor movement
Post by: prissi on April 24, 2009, 05:21:03 PM
Maybe CNTRL should glue the cursor to the ground in the mouse movement routine ... that was also my suggestion when I first discussed with Daniel about this. But then of course there will be the slice mode in future.
Title: Re: [patch] new cursor movement
Post by: Dwachs on April 24, 2009, 06:28:32 PM
new patch.

ctrl-key now selects ground. But you have to move the mouse after pressing/releasing the ctrl-key to toggle the right beaviour. I.e. simply pressing ctrl-key does not move the pointer.
Title: Re: [patch] new cursor movement
Post by: prissi on April 24, 2009, 07:19:28 PM
Why does some tools use get_grund? Especially the schedule tool should it fall back?
Title: Re: [patch] new cursor movement
Post by: z9999 on April 24, 2009, 11:45:36 PM
I tested the lastest version, but this version doesn't work well.

It always points ground tiles without CTRL key.
Only the magnifier icon moves up and down, but orange cursor doesn't move and always points ground tiles.


[edit]
If there are 3 height on one tile, I can select low and middle but can't select topmost height.
If there are only 2 height on one tile, I can select ground  but can't select upper height.
Title: Re: [patch] new cursor movement
Post by: Dwachs on April 25, 2009, 08:33:56 AM
Thanks for reporting. I will look into it this weekend.
Title: Re: [patch] new cursor movement
Post by: wernieman on April 25, 2009, 07:45:26 PM
I make a spezial run (see http://patches.simutrans-germany.com/ (http://patches.simutrans-germany.com/))

Sorry that today and not yesterday, but yesterday my Girdfriend (and wife) think, that is more importan to play with the Laptop then to make the upload ... ;o)
Title: Re: [patch] new cursor movement
Post by: Isaac Eiland-Hall on April 26, 2009, 05:08:40 AM
Quote from: wernieman on April 25, 2009, 07:45:26 PMyesterday my Girdfriend (and wife) think

Well, as long as you can get the both of them to agree, I think that's what's most important. ;D
Title: Re: [patch] new cursor movement
Post by: Dwachs on April 26, 2009, 11:55:40 AM
new patch, selection of all tiles works correctly again.

@z9999: thanks for testing!

@wernieman: could you please make a new spezial build?
Title: Re: [patch] new cursor movement
Post by: wernieman on April 26, 2009, 12:50:43 PM
See http://patches.simutrans-germany.com/ (http://patches.simutrans-germany.com/)
Title: Re: [patch] new cursor movement
Post by: jamespetts on April 26, 2009, 12:58:04 PM
Very nice! Much easier to use than the standard cursor.
Title: Re: [patch] new cursor movement
Post by: z9999 on April 26, 2009, 02:09:11 PM
Thank you. It's working well.
A little thing. CTRL operation is not needed in underground mode, is is ?
CTRL is used in 2 cases, building straight road/rail and downgrading road/rail.
If we build a new road/rail in underground mode, ending position is always surface, thus this is not a problem.
But if we want to build a new road/rail from existing road/rail to existing road/rail with CTRL key in underground mode, it might be confused a little, I think.
Title: Re: [patch] new cursor movement
Post by: prissi on April 26, 2009, 09:27:50 PM
If not changed, all building in underground is anyway straight connection only.
Title: Re: [patch] new cursor movement
Post by: Dwachs on April 27, 2009, 05:05:04 AM
@z9999: you are right with your concerns. Using ctrl-key to select ground AND to build straight is interfering.

What solutions would you (all) prefer?
Title: Re: [patch] new cursor movement
Post by: jamespetts on April 27, 2009, 06:00:52 AM
CTRL+SHIFT?
Title: Re: [patch] new cursor movement
Post by: z9999 on April 27, 2009, 06:34:57 AM
Quote from: prissi on April 26, 2009, 09:27:50 PM
If not changed, all building in underground is anyway straight connection only.
Ahh, yes. I was wrong, I didn't read the code, sorry.

if(event_get_last_control_shift()==2  ||  grund_t::underground_mode) {


But, CRTL is still interfering in downgrading road/rail.
Is there any reason not to use SHIFT key ?
SHIFT key was to select topmost and this isn't used anymore.
Title: Re: [patch] new cursor movement
Post by: Dwachs on April 27, 2009, 06:44:28 AM
CTRL-key was used to select the topmost way ;)

SHIFT-key seems to be used only in connection with the minimap.

Shall I change the patch to use SHIFT-key to select ground?
Title: Re: [patch] new cursor movement
Post by: z9999 on April 27, 2009, 07:31:43 AM
Quote from: Dwachs on April 27, 2009, 06:44:28 AM
Shall I change the patch to use SHIFT-key to select ground?

It is up to prissi.

I changed to following code and seems to be working well.

bool select_karten_boden = event_get_last_control_shift() & 1;

But I think other tools also need to change to '& 2' instead of '== 2'.
Title: Re: [patch] new cursor movement
Post by: prissi on April 27, 2009, 09:35:40 AM
I am not keen on using an other code, since this functionality for Kartenboden will be possible with the slice mode anyway. Those hidden features make life difficult for most of the peoples. Rather get away from CNTRL at all in the end.
Title: Re: [patch] new cursor movement
Post by: Spike on April 27, 2009, 09:49:54 AM
From designers point of view, ctrl and shift are bad ideas, since they are not apparent to new player. Only way to know about these features is by reading the documentation, a thing only few players do.

Simutrans did not have such obscurities originally.

I would ask to rethink the solution, and find a UI that is more accessible to players. I know ctrl and shift sneaked into Simutrans in other places, too, but when I got to know it was already done.

Make features accessible to players. That means either show them their choices, or give clues how to get to other choices.
Title: Re: [patch] new cursor movement
Post by: z9999 on April 27, 2009, 10:01:05 AM
Then, please remove selecting ground with CTRL key feature.
And also please don't implement this 3d cursor feature until slice mode will be implemented.
Title: Re: [patch] new cursor movement
Post by: Dwachs on April 27, 2009, 07:13:16 PM
Patch updated according to your wishes :)

I hope sliced mode can follow soon.
Title: Re: [patch] new cursor movement
Post by: prissi on April 27, 2009, 08:36:09 PM
My suggestion on a transparent ground tile for the top.
Title: Re: [patch] new cursor movement
Post by: Dwachs on April 28, 2009, 06:19:37 AM
Nice! I would prefer TRANSPARENT25_FLAG instead of TRANSPARENT50_FLAG in simview.cc. The marked tile is highlighted too heavy imho.
Title: Re: [patch] new cursor movement
Post by: wernieman on April 28, 2009, 06:34:01 AM
Should I make a Compilerrun with patch cursor-2437.patch ore new_cursor-r2437-v2.diff?
Title: Re: [patch] new cursor movement
Post by: Dwachs on April 28, 2009, 06:54:00 AM
Quote from: wernieman on April 28, 2009, 06:34:01 AM
Should I make a Compilerrun with patch cursor-2437.patch ore new_cursor-r2437-v2.diff?

with prissi's new_cursor-r2437-v2.diff. Thank you !!!
Title: Re: [patch] new cursor movement
Post by: wernieman on April 28, 2009, 07:31:07 AM
See http://patches.simutrans-germany.com/ (http://patches.simutrans-germany.com/)
Title: Re: [patch] new cursor movement
Post by: prissi on April 28, 2009, 09:30:04 AM
This is just a suggestion; maybe the highlighting color should be configurable via simuconf.tab, since the cursor border have different colors in different sets.
Title: Re: [patch] new cursor movement
Post by: gerw on April 28, 2009, 01:03:00 PM
In the current version (v2), the orange overlay is drawn above the tool cursor. Can this be changed?
Title: Re: [patch] new cursor movement
Post by: Dwachs on April 28, 2009, 01:36:33 PM
in simview.cc  line 184 has to be moved beyond line 195 :)
Title: Re: [patch] new cursor movement
Post by: gerw on April 28, 2009, 04:28:00 PM
Ok. Then anybody should do this ;)
Title: Re: [patch] new cursor movement
Post by: Dwachs on April 28, 2009, 07:06:37 PM
Updated patch file. The tool cursor is drawn above the orange overlay.

I tested pak64, pak128, pak.german and pak.96. All use an orange marker. So there is no need to change the cursor color. Using player colors (as for station coverage) did not look nice to me.
Title: Re: [patch] new cursor movement
Post by: z9999 on April 28, 2009, 07:26:08 PM
You forgot pak128.japan, it is blue.
BTW, when I move cursor in underground mode, it shows the object on the ground.
Is this a known problem ?
Title: Re: [patch] new cursor movement
Post by: prissi on April 28, 2009, 08:01:43 PM
THis is an error. It was actually intended for bridges ...
Title: Re: [patch] new cursor movement
Post by: wernieman on April 29, 2009, 07:29:25 AM
I make a Compilerrun with the lates patch

You found it at  http://patches.simutrans-germany.com/ (http://patches.simutrans-germany.com/)

I named it: sim-*-curser-2437-v3.zip
Title: Re: [patch] new cursor movement
Post by: Dwachs on April 29, 2009, 08:48:39 AM
@wernieman: thanks alot! maybe you can remove all older versions from the patch-server?
Title: Re: [patch] new cursor movement
Post by: wernieman on April 29, 2009, 09:20:17 AM
Ups .. I forget
Title: Re: [patch] new cursor movement
Post by: Dwachs on April 29, 2009, 07:18:24 PM
Quote from: z9999 on April 28, 2009, 07:26:08 PM
You forgot pak128.japan, it is blue.

It would be possible to make the overlay color configurable in pak-xyz/simuconf.tab. Preferably using the pre-defined simutrans colors as here:

http://simutrans-germany.com/wiki/wiki/tiki-index.php?page=en_FactoryDef#mapcolor (http://simutrans-germany.com/wiki/wiki/tiki-index.php?page=en_FactoryDef#mapcolor)

Any opinions? better suggestions?
Title: Re: [patch] new cursor movement
Post by: Dwachs on May 06, 2009, 06:02:21 PM
New patch.

Now the overlay color can be configured in simuconf.tab:


# Color of cursor overlay, which is blended over marked ground tiles
# The available colors and their numbers can be found on
#    http://simutrans-germany.com/wiki/wiki/tiki-index.php?page=en_FactoryDef#mapcolor
# Suggested values (155 is the default)
# -- pak64, pak.german, pak128
cursor_overlay_color = 155
# -- pak128.japan
#cursor_overlay_color = 149


If no more bugs are found this patch will go into trunk soon.
Title: Re: [patch] new cursor movement
Post by: prissi on May 06, 2009, 09:26:02 PM
I think the cursor color should go to umgebung_t, since this customisation does not affect gameplay. The idea is all gameplay settings into einstellungen (and thus those are transferred in network games) while all visual not engine settings go to umgebung_t.
Title: Re: [patch] new cursor movement
Post by: Dwachs on May 07, 2009, 06:45:08 AM
thank you for clarifying :)
Title: Re: [patch] new cursor movement
Post by: z9999 on May 07, 2009, 11:29:32 AM
Quote from: Dwachs on May 06, 2009, 06:02:21 PM
If no more bugs are found this patch will go into trunk soon.

Quote from: z9999 on April 27, 2009, 10:01:05 AM
And also please don't implement this 3d cursor feature until slice mode will be implemented.
Title: Re: [patch] new cursor movement
Post by: Dwachs on May 07, 2009, 11:32:56 AM
Quote from: z9999 on May 07, 2009, 11:29:32 AM
And also please don't implement this 3d cursor feature until slice mode will be implemented.

After integrating the 3d-cursor thing, sliced underground mode will be the next step.
Title: Re: [patch] new cursor movement
Post by: z9999 on May 07, 2009, 04:38:48 PM
What I am saying is there is no way to access to ground tile. So don't do that.
Title: Re: [patch] new cursor movement
Post by: wernieman on May 07, 2009, 05:53:19 PM
I make a new compilerrun with the patch ... log at http://patches.simutrans-germany.com/ (http://patches.simutrans-germany.com/)
Title: Re: [patch] new cursor movement
Post by: Dwachs on May 07, 2009, 06:45:33 PM
@wernieman: Thank you!

@all: updated patch, only internal things (cursor-overlay-color variable from einstellungen_t to umgebung_t) changed, no noticeable changes for players, no new compile needed.
Title: Re: [patch] new cursor movement
Post by: Dwachs on May 10, 2009, 06:07:37 PM
this patch is now incorporated in rev 2455 and ready for massive testing in the nightlies:)