Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Mouse ball values  (Read 4250 times)
0 Members and 1 Guest are viewing this topic.
Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Posted 2003-07-31 06:41:59 »

Hi
 We breifly touched on this subject before, but I'm nearing done on the linux version so I was hopeing for some clarification. Currently the windows version returns -1 to +1 for ball movement on the mouse, the problem with this is it is digital, imagine it used for mouselook (quake style) you would get very strange movemtn, you would be moving or not, no speed changes with change of mouse speed, it needs to be more analog, they way I have done this for the linux version is to add up all the values from the events at the native level and return that, this often ends up with much more variable values based on the speed the mouse is moved. I currently have this disabled so the linux version behaves the same as the windows one (whats the point in a port of an API if they play differently). I don't know if its possible under direct input as I don't know much about it, but it seems to me to make sense. What do others think?

Cheers

Endolf

Offline Jeff

JGO Coder




Got any cats?


« Reply #1 - Posted 2003-08-02 03:12:21 »

I agree, after it was explained to me, that the Win32 mouse code is wrong and inadequate.

My suggestion is that it return a reasonable delta value that hopefully is scaled pretty much the same across all of our platforms.  

E, GP, you agree?

If so I'll take an action item to fix Win32 next week.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #2 - Posted 2003-08-02 06:33:24 »

Hi
 Let us know when you've done the windows version and I can flip the code over in the linux one, means the two version will remain consistant Smiley. As for the values to return, with the wheel on my mouse I can feel it almost click round to positions, and i'm wondering if one position = +/-1 to the value in the next event that gets fired. I'm wondering if internally to the hardware there is something similar for the x and y axes. Most games that use the mouse have a mouse speed adjustment, which I suspect is because the different mice and different platforms return different values, I'm not sure how we could scale it anyway, what exactly *is* the maximum value from a mouse? Smiley

Cheers

Endolf

P.S. whilst your at it, there are 5 buttons on my mouse, any ideas how to get the extra two to show up in the win32 jinput? Mouse.Buttons has room for them Grin

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Jeff

JGO Coder




Got any cats?


« Reply #3 - Posted 2003-08-04 16:24:38 »

yeah while Im in there Ill look at the buttojns.

I don't think there really is a max value for the mouse as every read should return a  delta from the last value, which is to sya its a relative value rather then absolute value controller.


Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #4 - Posted 2003-08-04 17:59:46 »

Hi
 exactly, that was my point, I have no idea how we can arrange a set of values to return from the different platforms when we have no idea what values are min and max? Smiley, I suggest we return what the native side gives us and suggest that games writers have a mouse sensitivity setting in their config somewhere that allows the user to change it, just like quake/half-life/unreal/.../... Smiley

Comments?

Endolf

Offline Jeff

JGO Coder




Got any cats?


« Reply #5 - Posted 2003-08-04 21:07:18 »

Again sounds sensible  Cool

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #6 - Posted 2003-08-04 23:50:28 »

I agree. I will adapt to whatever you guys decide in that manner.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #7 - Posted 2003-08-05 00:00:53 »

Note that on the OSX version every input element will know what its min and max is as well as what the scaled values are. HID provides a lot of information about every component.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #8 - Posted 2003-08-05 01:29:11 »

If there is a need for all developers to adjust for mouse sensitivity, should we put some hooks in to make the adjustment in the JInput library.. based on a setting from the application?  

I'm just thinking that if there is going to be a "right" way to use mouse input, it might as well be implemented once in the library.

Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #9 - Posted 2003-08-05 06:23:36 »

Hi
 You saying that MouseBall should have something like setScale(float scale) and all returned values from float getPollData() are scaled by this amount?

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #10 - Posted 2003-08-05 12:03:11 »

Yes, something like that.  I honestly don't know what sort of numbers you would get back on each platform...  but if that makes sense then sure.  If platform specific defaults are set so that it looks approximately the same for Joe Coder regardless of the platform his code is running on that would be great.

Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #11 - Posted 2003-08-05 14:44:46 »

Yeah, you'll be able to do that with the OSX variant. I've spent some extra time to bring back *everything* from the OSX native HID libraries so that these adjustments/changes can be done in Java without me needing to go back into the native HID core since I feel so dirty after writing so much C (not even C++) code.

So unclean.... so unclean....

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline Jeff

JGO Coder




Got any cats?


« Reply #12 - Posted 2003-08-09 04:39:34 »

Quote
If there is a need for all developers to adjust for mouse sensitivity, should we put some hooks in to make the adjustment in the JInput library.. based on a setting from the application?  

I'm just thinking that if there is going to be a "right" way to use mouse input, it might as well be implemented once in the library.


Hm.  If we think its going to be availbale on all paltforms then we can define a shared MouseDevice super-type that has those controls on it.

Oterhwise Id say document it as part of your MouseDevice object and let the user down-cast to access it.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #13 - Posted 2003-08-09 08:21:35 »

Hi
 I think it should be part of the MouseBall coreAPI class, there is no point putting in plugin dependant things, no-one should use them as you then end up with different things happening on different platforms. I thought the whole point was to get something common across the platforms.

Cheers

Endolf

Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #14 - Posted 2003-08-09 14:15:28 »

Normalizing mouse input is certainly something that can be cross platform and put in the core mouse API. A standard mouse under OSX has axis values that range from +/- 32767 as opposed to 0-1 so we just need to normalize on something and then we can scale the values from there.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #15 - Posted 2003-08-09 15:23:57 »

Hi
 The linux plugin an't be normalised as it works at the moment, if queues all the underlying events up, that means if your framerate drops cause of gc or whatever, you will still see a full mouse movement, that means that there is *no* maximum value for mouse movements under linux, it depends on how far you moved it and how long it's been since you last polled.

Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #16 - Posted 2003-08-09 16:06:00 »

Unfortunately I don't believe I can do that with the way the OSX HID system works. Every value that comes back from HID is pretty much listed in rawMin/rawMax, scaledMin/scaledMax and all I can do is give you whatever value is there. I can queue it up, but that's kinda pointless for axis movement as it generates so many events that it doesn't make sense to queue up several hundred of them. Button clicks however are another story. I queue up all keystrokes and button clicks because they are digital actions and I can't lose those.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

BurntPizza (20 views)
2014-09-21 02:42:18

BurntPizza (14 views)
2014-09-21 01:30:30

moogie (14 views)
2014-09-21 00:26:15

UprightPath (25 views)
2014-09-20 20:14:06

BurntPizza (27 views)
2014-09-19 03:14:18

Dwinin (42 views)
2014-09-12 09:08:26

Norakomi (73 views)
2014-09-10 13:57:51

TehJavaDev (96 views)
2014-09-10 06:39:09

Tekkerue (49 views)
2014-09-09 02:24:56

mitcheeb (70 views)
2014-09-08 06:06:29
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!