1.0 and beyond

Okay Guys,
At Greg’s suggestion I’d like to set some goals here for JInput releases.

We’d like to get 1.0 out relaitvely soon so maybe we can have it to give out at GDC. With that in mind I pose the question:

(1) What are the requirements for 1.0?

(2) What are the post 1.0 festures if any?

(3) What are their priorities?

Some things I’d like to add to the source base (but not for 1.0 I don’t think.)

(A) A “isSupported()” call on the plug-in interface to allow you to deploy plug-inbs that dont actually work on the dployed system without error.

(B) A “null plug-in”, basically a heavilly commented empty framework to make writing new plug-ins easier.

© Supprot for force feedback beyond rumblers.

What do others think is needed and at what priority?

quote What are the requirements for 1.0?
[/quote]
Reliable keyboard and mouse support on the major platforms (AFAIK there are still keyboard issues on some Macs - no qualifier keys are working)
Basic game pad/joystick support should be working as well of course. But if we don’t even have solid support for async keyboard and mouse it would really stink.

quote What are the post 1.0 festures if any?
[/quote]
Emulation of gamepads/joystick with keyboard could be built in to the JInput framework instead of having to code every game with both keyboard and gamepad support explicitly.
For that it would be great to provide for standard configuration screens - for assigning buttons/keys and calibrating. But that really should be layered on top of JInput.

JInput is really fairly basic - the lowe level nature allows for so many different controls to be plugged in as it is I think feature-wise there isn’t much to add.

quote A “null plug-in”, basically a heavilly commented empty framework to make writing new plug-ins easier.
[/quote]
+1 something like an AbstractInputDevice would be sweet.

quote Supprot for force feedback beyond rumblers.
[/quote]
yep

It’s been a while since I looked at it - I know it supports axis and buttons, but how would it support something like a button that reports the force it was hit with - e.g. like a music keyboard/drumkit sort of device, or even just a drawing tablet… should we ever bother with such devices, as they aren’t directly related to gaming usually?
I guess a light gun sort of device is already supported with the existing framework (e.g. the arcade target shooting games where you aim the gun at the floor to reload etc.). I’

Things that are interesting but I’m assuming will remain outside the scope f JInput:
-video and audio input (one day JMF might be supported well enough?)
-remote control e.g. piping input from a JInput controller on one machine so it shows up as if it were a JInput controller on another machine - could maybe be used for some types of network gaming, but would it ever be a practical implementation?

quote What are the requirements for 1.0?
[/quote]
Maybe documentation, there seem to be the same issues (mainly plugins) comming up a few times here, maybe a dev guide of some sort for developers using the API.

quote A “isSupported()” call on the plug-in interface to allow you to deploy plug-inbs that dont actually work on the dployed system without error.
[/quote]
+1

quote A “null plug-in”, basically a heavilly commented empty framework to make writing new plug-ins easier.
[/quote]
Do you mean an abstract, or a template?

quote Supprot for force feedback beyond rumblers.
[/quote]
Last time I looked windows was still the only platform supporting them (sorry about that linux users, I will get round to it), maybe that should be a priority post 1.0 if not for 1.0

Endolf

Okay,
I could take a first pass at docs this weekend if you guys want.

Do we want to add isSupported() for 1.0?

I’d like to make the AbstractInputDevice a 1.5 feature unless someone else wants to take it on as I won’t be able to do it justice til after GDC and to be useful it needs to be well thought out and done right.

Similarly I’d like to look at the virtual kb/mouse device post 1.0 if thats okay.

SO right now I see the following for 1.0:

New Features:
isSupported()
Bug Fixes:
OSX keyboard support for “missing” keys.

Is that it then?

JK

Yeah that looks pretty good. As far as the docs go, maybe grab some of the test apps that are posted here and include them as a reference.
I really should get the latest build and do a bit of testing.

Sounds good Jeff
If I get some time this week i’ll do some updates for the linux build (it seems to sigsegv on one of my boxes) and add isSupported to the linux plugin.

Cheers

Endolf

Write it up and I’m patch up whatever needs patch’n right after I finish the jogl custom pixel format update. That update is a biggie and long overdue for the OSX port. I don’t know if it will help performance any, but havign a hard coded pixel format is teh suck :slight_smile:

Okay soudsn good guys. Docs may gt pushed into next week (Lost yesterday to “family time”. Overdue really.)

Ill make the iSupported change monday to the interface and try my hand at the win32 plug-in. The signiture i believe will just be

public boolean isSupported();

On the Apple Plug-in. I’m wondering if it woudl be worth trying to agitate to get someone actually at Apple to weigh in on our missing keys.

Do you think that would be helpful? If so Ill tell Chris to try to push his Apple contacts on it.

Greg knows a lot more about the HIDManager on Apple than I do… I just remember him mentioning that there were known problems - particularly with how the ADB devices (non-USB keyboards) are emulated. Since HID is really a UDB thing, and non-USB input devices are wedged into the Apple HID framework somehow. Greg mentioned that some of the issues were to be fixed with the Panther release, but perhaps not?

Anyway the issue appears to be complex enough that an Apple insider would help a great deal - I’m think of how Gerard Ziemski worked on JOGL and got some changes into the window manager code of the Apple JRE & Panther to help make things work better. We need someone to do the same for JInput maybe?

Okie ill agittate on that

this is going back a bit but…

[quote]I know it supports axis and buttons, but how would it support something like a button that reports the force it was hit with - e.g. like a music keyboard/drumkit sort of device, or even just a drawing tablet…
[/quote]
it would depend on the OS of course, but i’d guess the best way to do it would be to have the pressure applied to the buttons measured the same way as analog sticks, and i’d assume that just like an analog stick, it would report a varying value on polling (maybe normalised between 0 and 1f?) rather than just 1 or 0.

i.e for a drawing tablet, button1.getpolldata() may give 0 for the pen not touching the tablet, 0.10 for lightly resting, and 1.0 for the user pressing hard on the tablet… given the vast array of diferent controllers for PC’s, i would consider this a novelty really. maybe a 1.5 feature?

i have a playstation2 controller but the USB device i use to plug it to my pc is from before that era and doesnt support the analog button press feature of the PS2 controller. they sell those sort of devices pretty cheap these days though, so i might see about getting a newer one to play with.
it seems to me that this will be a particularly dificult feature to work on because of these factors:

  1. does the OS support analog button presses at all?
  2. if so, we need a reliable test case. ie a controller that has and uses that functionality on a game that runs on the target OS. getting these two things for each of the major platforms would be a fair bit of work

btw, what does a drawing tablet currently report for the ‘button’ poll data?

[quote]this is going back a bit but…
it would depend on the OS of course, but i’d guess the best way to do it would be to have the pressure applied to the buttons measured the same way as analog sticks, and i’d assume that just like an analog stick, it would report a varying value on polling (maybe normalised between 0 and 1f?) rather than just 1 or 0.

i.e for a drawing tablet, button1.getpolldata() may give 0 for the pen not touching the tablet, 0.10 for lightly resting, and 1.0 for the user pressing hard on the tablet… given the vast array of diferent controllers for PC’s, i would consider this a novelty really. maybe a 1.5 feature?
[/quote]
Graphics tablets report MUCH more than just pressure :). e.g. a typical modern standard tablet (something you could get for under $100) will have:

  • pressure on a scale typically 0-1024, possibly 0-32768 if you have an expensive one

  • secondary-pressure (i.e. turn the pen upside-down and use the “eraser” end, and that too is pressure-sensitive)

  • tilt (degrees from the vertical of the pen! Yes, it’s very cool when you get used to it ;)), typically 0-256, or bigger range if you have a more expensive tablet

  • almost all wacom tablets also support their “airbrush” pen which is fairly often used as a replacement for a lost pen because retailers often sell out of “normal” pens :frowning: and the airbrush is pretty much the same. Airbrush pens have an extra sensor, a “mouse wheel” with a limited range (i.e. like a volume knob you can only spin it through a limited degrees; this equates to how much paint you wish to spray per second). Again, this supports a range typically 0-256 IIRC.

Note: tablets have to contend with a lot of abuse, and so the “pressure” sensitivity is usually dodgy. You get a lot of false positives and negatives in the low pressure range, so OS drivers typically have a “threshold” below which the driver ignores the signal. e.g. for 0-1024 you would have a threshold recommended by manufacturer of 30 or similar.

If you crank that down to 10 your tablet starts doing weird stuff :(. I guess if you have an RFI-free environment you can perhaps get away with lower values?

Which means…typically they will return pressure STARTING at 30 - you’ll never see “0-29”. I have yet to experiment to see how this gets reported into JInput, but previous experiments with linux drivers in debug mode suggests they supply the pressure untranslated; so you do indeed see nothing below 30. In that case, it might help if JInput had some minor feature to support detection of thresholds and perhaps an auto-translation of the range? I have no idea how the hw drivers report the current threshold (i.e. whether or not there is a standard) I just know that they do.


I for one think that supporting tablets in all their glory is an excellent idea (and not jsut because I have some ;)). In the last few years they’ve become very cheap, and the $50 A5 tablets are an excellent replacement for a mouse. If you don’t think gamers would use them, well…my flatmate used to keep nicking mine to play that Yahoo game where you have to draw a word for other people to guess. He said it made a huge difference ;).

It may sound silly, but when something as mainstream as Yahoo games has a game that rewards tablets its worth considering that there could well be more tablet-games appearing IF they were easy to write for.

It’s a bit like explicitly dual-screen games (of which a handful appeared 5 years ago)…the games are there, even if they haven’t achieved mainstream hardware support yet. Multi-monitor setups are still too expensive for most gamers, but a $50 tablet is a much lower barrier.

Anyway…AFAICS there needs to be no special support for tablets because AIUI they just report their stuff as various axes, and that’s presumably exactly what we want?

(nb: as soon as I re-install my linux machine I’ll test some of these exotic features with windows and linux; can’t at the moment because the latest WACOM drivers need a new kernel to be compiled, and my kernel’s broken :()

[quote]Anyway…AFAICS there needs to be no special support for tablets because AIUI they just report their stuff as various axes, and that’s presumably exactly what we want?
[/quote]
Hi
In theory as long as they have a device file called /dev/input/event* they should be fine, it will be interesting to see how broken^H^H^H^H^H^Hwell it works :wink:

Endolf

back to isSupported()-topic:

[quote]I also want to get the ControllerEnvironment.isSupported()
[/quote]
Please let us discuss this first. IMHO the isSupported() approach is a bit to simple. I would prefer a mechanism that can address more problems. eg:

  • plugin not suitable for platform (just for completeness)
  • plugin suitable for OS but not for the CPU archicture (eg. missing port of the JNI library)
  • unsupported OS version (eg: no event interface in linux <= 2.2)
  • insufficient access rights (can happen on unix-like OSes …)
  • degraded use possible (eg. read-only permission, usage of joydev/keybdev interface when evdev not available)

Hi
I think it’s up to the plugin to decide if it’s going to work or not, it has access to all the system properties and the classpath, so it can work out whats around, it can also find out the file permissions problems etc. All the plugin architecture is concerned with is ‘will this plugin work’, if you can run in a restricted mode, the answer to isSupported() is true. Maybe in the case say of the rumblers, an exception could be thrown if read/write permissions to the files cannot be obtained. At the end of the day, the DefaultEnvironment calls all the isSupported() methods, so the user won’t get anything to work with.

Cheers

Endolf