Mouse pointer 'set position' or bust!

Allowing end-users to “white-list” sites that they trust to take over the cursor would probably work - but unless it becomes mainstream HTML5 and is implemented on every browser, it’s not very useful. There is a general resistance out there to options like this that require the end user to decide whether they trust a site or not because after enough sites have asked for permission, a large percentage of users get fatigued with thinking about it and just click the “Yes” box whenever it comes up.

But if it were to happen in both the Mozilla engine and WebKit - then it would certainly go some way towards fixing the problem.

However, there is still going to be an issue for touch-screen users - you can’t reposition their fingers! Hence, we still need to figure out an alternative way to handle this - and once we have, we won’t need this feature for desktop machines.

Then what about a very small middle dead zone and with a non linear EXPONENTIAL FUNCTION for the outside more. If you could tune them well I don’t even think there is a need for a dead zone

Yes - I think that’s going to be the answer here. Map the mouse position to the camera’s angular velocity using a “bathtub curve”. It won’t be as familiar - and probably not so easy to use - as the conventional FPS mouse controls - but it’s the best you can reasonably do under the circumstances.

When you do this, there are still some “gotchas”.

  1. It’s all too easy to move the mouse outside of the window altogether - and thereby lose focus.

  2. When your mouse is outside of the window - you can’t move it back in again without spinning the camera wildly along the way.

  3. Aiming quickly and aiming accurately become two mutually exclusive things!

  4. The time I find this most annoying is when I’m trying to take a screen shot! I get it all beautifully posed in the game - but now my mouse is in the middle of the “dead zone”, and I can’t get to the screenshot tool without screwing up the image! Hence you need to have it so that some combination of mouse buttons produce the ability to move the mouse without moving the camera.

  1. It’s all too easy to move the mouse outside of the window altogether - and thereby lose focus.
  1. When your mouse is outside of the window - you can’t move it back in again without spinning the camera wildly along the way.

It is possible to catch when the mouse pointer is outside the frame and then give a approriate solution which could prevent such a thing. It is of course up to the developer then to decide what is approriate.

  1. Aiming quickly and aiming accurately become two mutually exclusive things!

that is of course fine tuning but this is indeed something that will be hard to achieve

  1. The time I find this most annoying is when I’m trying to take a screen shot! I get it all beautifully posed in the game - but now my mouse is in the middle of the “dead zone”, and I can’t get to the screenshot tool without screwing up the image! Hence you need to have it so that some combination of mouse buttons produce the ability to move the mouse without moving the camera.

Creating a puase key button in the game when it is szingle player should be sufficient, I think. For multiplayer you’ll either have to have a keybaord shortcut or something that you propose of course.

Pals?!

I am just wondering… How could people use the command to set the mouse position when everybody else says its not possible?!

We got the Quake II Demo here established with very early standarts of WebGL…

http://crystalin.dyndns.org:8080/GwtQuake.html

Still, how could they use the regular FPS-cotrol style and we cant?! I am more familiar to ActionScript. But I still dont know what the actual threat is… Is it that once we use this function, that bad boys can manipulate it? Or is it that we can´t use the function at all (because Khronos wouldn´t allow us to use it?)

Please make this more clear to me. And btw: happy new year to everyone

Thx
KK

There should be no need for JavaScript code to directly touch the mouse cursor.

Ideally we’d simply switch the mouse to a “delta mode” where the browser hides the mouse and returns mouse delta events. To avoid security problems the regular HTML mouse processing is turned off.

Pressing ESC returns you to normal mouse mode. I think most users are familiar with returning from fullscreen video modes so it should be intuitive to them.

Can anyone see any security problems stemming from this?

To avoid security problems the regular HTML mouse processing is turned off.

You need the cursor to freeze (warpcursor) , otherwise youll be triggering the OS start menu etc, not something you want to see during an action game :smiley:

Though at the moment I’ld rather see the issue of HTML5 sound solved first ATM its a mess

If the browser application has correctly captured the mouse input, there shouldn’t be any external OS interaction, so this wouldn’t be a problem.

Totally agreed on the sound issue! But that’s another topic. :slight_smile:

Yes. What is to prevent a site from putting you in that delta mode and keeping you there, unable to access anything else?

Yes. What is to prevent a site from putting you in that delta mode and keeping you there, unable to access anything else?[/quote]

Pressing escape. Just as you would exit a full screen mode when watching a video on YouTube. I think the average user could cope with that, especially if there was a fading textual reminder they can do that in the same way.

Reserving the escape key for that purpose is not likely to be an acceptable solution to the community at large, but I don’t hate it.

I think all/most web browsers have a fullscreen mode (F11 on chromium + firefox) perhaps when this is engaged then mousecontrol is also surrendered?

Hi all,

I find it difficult to follow this. I know what the problem is. But I do not understand why or how this is a problem. I got to tell my boss why we can not do that. Yet I dont know how/what to tell him. Can please somebody explain this to me? Maybe with example or anything that someone would understand (remember my boss is no coder at all).
Thanks in advance. Regards
easy

I’ll try:

How do FPS’s control the camera?

In most “conventional” 1st person shooter games, you move the camera around by moving the mouse. But you’ll notice that the cursor “pointer” is hidden - and you can keep on moving the mouse endlessly in the same direction - and the camera will spin around and around in that same direction - forever. In a sense, the POSITION of the mouse controls the POSITION of the camera…except that the mouse is on an infinitely large tabletop.

If you think about it - the “invisible” mouse pointer ought to have moved off the edge of the window - off the edge of the desktop - ages ago. So how can this work?

In most games, the game reads the mouse position - and then repositions the (invisible) mouse pointer to the center of the screen every frame. Thus, the mouse can never escape off the edge of the window/screen - and the game can measure how much it moved in each frame.

So what’s the problem?

HOWEVER: When games run in the browser, there is a problem. The browser doesn’t provide functions to reposition the mouse…you simply cannot reposition the mouse from inside the browser using JavaScript alone.

Hence, even if you turn off the mouse pointer to make it invisible (which is also getting tough to do!) - because you can’t keep repositioning it - it will soon run off the edge of the window/screen - and then you lose focus - and the game stops getting mouse position data.

So - as things are right now - it is quite utterly impossible to make the camera move like it does in traditional 1st person games. There is literally no conceivable way to do that.

What are the alternatives?

Well - that’s what we’ve been discussing here. Bottom line is that you end up with some kind of a system where the mouse POSITION controls the camera’s VELOCITY. So you move the mouse away from the center of the screen and the camera starts spinning. If you let go of the mouse - the camera keeps on spinning…until you move the mouse back to the center again. The further you move the mouse from the center of the screen, the faster the camera spings.

That’s NOT like conventional FPS games - and there are good reasons to believe that it won’t be anywhere near as convenient.

Why won’t the browser writers let us reposition the mouse?

The reason is because of security and malware. Imagine you go to some website that wants to play a three minute advert video before it lets you into the site. Right now, you can say “screw that!” and hit the back button - or click on the menu - or even shut down the browser. But if the application writer can reposition the mouse pointer - they can stop you from clicking on ANYTHING except the advert itself! That’s really nasty!

There are other, even more nasty things they could do - but that’s enough to convince the browser folks to completely disallow mouse repositioning in software from JavaScript.

What do we wish could happen?

Well, we don’t want lunatic advertisers trapping our mice! So the proposal here is to allow mouse positioning - but ONLY when the browser is running “full screen” - and to forceably trap the escape key to drop you out of full-screen and return mouse control to the user.

That’s a pretty good suggestion - and I’d certainly back a proposal by the browser folks to get that agreed upon. But standards grow only fairly slowly - and it would take months to years to get this agreed on - and a year or more to get it into all of the mainstream browsers.

So if you’re planning on writing something like an FPS - you’re going to have to think rather carefully about how you’re going to control it - because, for the forseeable future, you can’t make it work like a normal PC-based FPS.

– Steve

@easyA: If you’d like, give my email address to your boss - and I’d be happy to try to explain it directly. I’m <steve@sjbaker.org>, and I’ve been working in game graphics for close to 30 years!

@Steve: Thanks so much. Now this was a good way to explain the whole thing. Even though its actually not good news - I want to thank you. Expect a pm soon…
We will be thinking of a suitable workaround. Regards
easy