Page 4 of 4 FirstFirst 1234
Results 31 to 36 of 36

Thread: Mouse pointer 'set position' or bust!

  1. #31
    Junior Member
    Join Date
    Oct 2010
    Posts
    23

    Re: Mouse pointer 'set position' or bust!

    Quote Originally Posted by DRJ
    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.

  2. #32

    Re: Mouse pointer 'set position' or bust!

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

  3. #33
    Junior Member
    Join Date
    Jan 2011
    Posts
    6

    Re: Mouse pointer 'set position' or bust!

    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

  4. #34
    Senior Member
    Join Date
    May 2010
    Posts
    207

    Re: Mouse pointer 'set position' or bust!

    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

  5. #35
    Senior Member
    Join Date
    May 2010
    Posts
    207

    Re: Mouse pointer 'set position' or bust!

    @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!

  6. #36
    Junior Member
    Join Date
    Jan 2011
    Posts
    6

    Re: Mouse pointer 'set position' or bust!

    @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

Page 4 of 4 FirstFirst 1234

Similar Threads

  1. Replies: 1
    Last Post: 12-27-2012, 06:03 PM
  2. Replies: 3
    Last Post: 01-22-2012, 06:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •