SiegeEngineers / aoe2techtree

Age of Empires II Tech Tree
https://aoe2techtree.net/
MIT License
226 stars 59 forks source link

Continued New Scrolling problems #83

Closed ghost closed 3 years ago

ghost commented 3 years ago

The new scrolling feature creates a bizarre and trippy experience on my devices. For research and web browsing I use devices that have excellent omni-directional scrolling built-in, such as the standalone Apple Touchpad, or a Mac Laptop. So naturally, overriding that leads to not only a degraded experience, but unexpected and strange behavior.

Here is an idea for a fix:

If scrolling is a 2D vector, if at any time the x component is observed to be nonzero, set a flag to indicate "This user wishes to control their own horizontal scroll" and skip any custom scrolling behavior entirely for that user, from that point forward. That way, only users using a simpler input device, which only scrolls on the Y axis, would have their scrolling overridden.

Personally however, my vote (for what it's worth) would be for removing the new behavior entirely. Here's why:

The reason I believe it should be completely removed is, users have legitimate reasons for wanting to scroll vertically, and this feature not only takes that away from them, but replaces it with a strange unexpected behavior -- even with a conventional mouse and scroll wheel. For instance, maybe they need to view the site in a smaller window. That may seem like a sub-optimal way to browse the site, but why should the site dictate preconditions for how users must use it? It doesn't seem right to include behaviors that punish some users for browsing the site like they would any other website.

If it's really essential to make the scroll behavior work exactly like in game, realize that the game itself comes with a lot of assumptions. The game is designed for a mouse-PC combination. Honestly, anytime I'm at my PC and thinking about this game, I'm playing it. For me personally, the tech tree site is for occasions when I need to consult the tech tree from a secondary device, like a laptop.

I also feel like any developer who has experienced just how smooth built-in omnidirectional scrolling can be on some devices would never want to take that away, just to provide a small convenience to other users who already have equivalent means at their disposal (including scrolling with the keyboard arrows). There is no alternative equivalent to smooth built-in omnidirectional scrolling -- once you take it away, it's gone :(

pardoman commented 3 years ago

Agreed, the current behavior is horrible in Chrome/Mac when using the touch pad.

pardoman commented 3 years ago

Here's an example of the jumping behavior.

I first scroll in one direction by swiping left on a trackpad a few times, then scroll back by swiping right. Notice the jumping behavior, especially when scrolling back.

aoe-scroll-issue

HSZemi commented 3 years ago

Well, I do not have access to an input device that does multidirectional scrolling. This means I cannot test if this simple solution works for you both, so please test it and report back: https://hszemi.github.io/aoe2techtree/#Aztecs

While this feature might in its current state be a nuisance to you, and understandably so, it has been requested by others. I myself find it very handy as well. Therefore I would very much like to keep it, and instead try to make it work for you as well.

The right hand side part of the tech tree should adapt its height to the available vertical space, so scrolling vertically there should never be necessary. If that is not the case, I would consider that a bug. Alternatively, there should be a vertical scrollbar that can be used. Or keyboard arrows, as you suggested.

A UI control to disable the feature I would see as a last resort since that would take up valuable screen space. I hope there is a more covert way to resolve your issues.

paulirish commented 3 years ago

I can repro the odd scrolling issues when using the trackpad on my macbookpro.

I spent some time with https://hszemi.github.io/aoe2techtree/ and it seems smooth there, no jumps.


I will point out that there's an alternative to this wheel/delta handling… The shiftkey + scrollwheel combo does universally scroll horizontally. AFAIK it's been supported in OS/browsers for decades.

I have been successfully using shift+wheel on the webapp for a while now. (you can try on my older fork that's missing the wheel handling) Of course, most people aren't aware of this and that's a UX challenge on its own.

HSZemi commented 3 years ago

Thank you for testing and reporting your result :yellow_heart:
Since the change apparently is an improvement and does not have new known side effects, I have applied it to the main site.

I know about scrolling vertically with shift+wheel, but on the techtree website it feels like walking with ball and chain to me. I need 11 turns of the wheel to traverse the tech tree completely with shift+wheel, as opposed to about six turns with horizontal auto-scroll. An added bonus is of course that the in-game tech tree also scrolls horizontally without shift.

paulirish commented 3 years ago

An added bonus is of course that the in-game tech tree also scrolls horizontally without shift.

yeah that's a very good point.

HSZemi commented 3 years ago

Looks like the current solution has not spawned new issues so far :slightly_smiling_face: Closing this for now.