Operating system mouse pointer

Got an idea for OpenTTD? Post it here!

Moderator: OpenTTD Developers

Post Reply
User avatar
Hezkore
Engineer
Engineer
Posts: 27
Joined: 02 Sep 2008 07:45

Operating system mouse pointer

Post by Hezkore »

There should really be an option to disable SDL from hiding the OS mouse pointer, and instead hide the in-game mouse pointer.
There are so many issues with the in-game mouse pointer that it's actually kept me and some of my friends from playing the game we enjoyed so many years ago.
Alternatively, OpenTTD should use something like `SDL_CreateCursor` to create a real hardware cursor.
Keep it simple.
User avatar
Expresso
Tycoon
Tycoon
Posts: 1760
Joined: 09 Aug 2004 00:14
Location: Gouda, the Netherlands

Re: Operating system mouse pointer

Post by Expresso »

What issues are you talking about?
User avatar
Hezkore
Engineer
Engineer
Posts: 27
Joined: 02 Sep 2008 07:45

Re: Operating system mouse pointer

Post by Hezkore »

I was hoping we wouldn't have to go into this, but I'll name a few which all relate to the mouse being drawn by the game and not by the actual OS.

Playing on larger maps on an older computer (sometimes I play this on my 'retro' machine); the mouse will feel extremely sluggish.
This is due to the game not keeping a consistent frame rate and the in-game mouse cursor not being able to keep up with the actual mouse position.

Playing on smaller maps on a newer computer; the mouse renders so fast it becomes invisible when moving around.
No Vertical Sync or Triple buffering option in your GPU settings will solve this.

Playing on very high resolutions; the mouse will be very small, to the point where it's almost invisible.

Changing the interface size will also scale the mouse cursor.
I am very happy with the size of the interface when using a different font as well as double sized interface.
But the mouse looks atrocious.
Example:
Image

One of the key rules to making a game feel responsive is to never interfere with the controls in any way.
Which means that the mouse cursor should act exactly like the player is used to outside of the game.
Never change the speed of the mouse, never change the (double)/click speed, never add or change the acceleration of the mouse etc.
A Mac mouse cursor should act like it does on every Mac computer, a Windows mouse cursor should act like it does on Windows.
Any change -- big or small -- means the player has to adjust to the new changes, making things feel unfamiliar and also less responsive.
OpenTTD doesn't break all of these rules of course, but in general the mouse is a bit unpolished and doesn't act like you'd expect it to, which makes it feel "off".
A hardware/OS cursor is what we're used to, so a "simple" solution would be to just use that instead of trying to mimic the OS' mouse cursor.
Keep it simple.
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Operating system mouse pointer

Post by Eddi »

there are two separate issues in here:
  1. the sluggishness of the interface on slow maps is a problem with the architecture of the game, where the interface is deeply interwoven with the game loop. to separate this is a difficult task and involves touching code that has existed nearly untouched for decades.
  2. using SDL cursor stuff needs porting the game to SDL2, which is also not easy
i know some people tried looking into either of these projects, but i don't know how far they have gotten.
User avatar
Hezkore
Engineer
Engineer
Posts: 27
Joined: 02 Sep 2008 07:45

Re: Operating system mouse pointer

Post by Hezkore »

How to fix this would be:

1. Add option to options menu to "Use hardware cursor"
2. If "Use hardware cursor" is enabled; do NOT call SDL_ShowCursor( 0 ) and never render in-game cursor.
Keep it simple.
gpmaster
Engineer
Engineer
Posts: 2
Joined: 09 Apr 2020 11:59

Re: Operating system mouse pointer

Post by gpmaster »

Hello all,
Any ideas or prices in solving this issue? I'm struggling as well with built in pointer and mouse scroll zoom not functioning issue..
User avatar
njn
Engineer
Engineer
Posts: 13
Joined: 11 Jan 2019 03:03
Location: New York, NY
Contact:

Re: Operating system mouse pointer

Post by njn »

Hezkore wrote: 01 Jan 2019 19:39 How to fix this would be:

1. Add option to options menu to "Use hardware cursor"
2. If "Use hardware cursor" is enabled; do NOT call SDL_ShowCursor( 0 ) and never render in-game cursor.
Is this still an issue for you? If so, we could experiment with an option to turn off the custom cursor, like the SDL driver already does for Emscripten here:

https://github.com/OpenTTD/OpenTTD/blob ... v.cpp#L202
leifbk
Chairman
Chairman
Posts: 810
Joined: 23 Dec 2013 16:33
Location: Bærum, Norway

Re: Operating system mouse pointer

Post by leifbk »

On a big 4K screen, it can be very hard to locate the mouse pointer.

An alternative to using the system mouse pointer could be to add a setting to make the game's own mouse pointer double size.
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Operating system mouse pointer

Post by Eddi »

i'm fairly sure the mouse pointer uses the gui zoom setting.

and you could just make a NewGRF with a bigger mouse pointer. (can be made static to avoid multiplayer problems)
User avatar
jfs
Tycoon
Tycoon
Posts: 1750
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Operating system mouse pointer

Post by jfs »

The game mouse pointer is scaled by the "Interface size" setting in Options.
leifbk
Chairman
Chairman
Posts: 810
Joined: 23 Dec 2013 16:33
Location: Bærum, Norway

Re: Operating system mouse pointer

Post by leifbk »

jfs wrote: 02 Jul 2022 15:24 The game mouse pointer is scaled by the "Interface size" setting in Options.
It would be nice to have a separate setting for the pointer, though. I like the default scaling of everything but the mouse pointer, which is vanishingly small. I don't want huge vehicle windows.
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Operating system mouse pointer

Post by Eddi »

we can't have a setting for everything. you can use the options we already have.
Post Reply

Return to “OpenTTD Suggestions”

Who is online

Users browsing this forum: No registered users and 1 guest