Post new topic    
Slime Knight
Send private message
With incoming Android releases, there are more inputs 
 PostMon Aug 12, 2013 5:55 am
Send private message Reply with quote
Was inspired to make this post after I saw this on the mailing list from James:

"Android: Turn off by default Accelerometer, Gyroscope, and Multitouch gestures.
None of these are actually used in any way yet."

Accelerometer and gyro are pretty standard on phone and tables these days. Multitouch exists, but the amount of individual inputs is not. Some devices can only do 2 while some can do up to 4 or 5.

Would any of you want to use this functionality? And how would you like to see it implemented?


Some ideas:

Accelerometer could be mapped as a key named SHAKE. or SHAKE_LIGHT and SHAKE_HARD. This would let you use it in existing plotscripts easily as another key to look for, and would let you remap/multimap it to keyboard or other buttons.

Gyro would be a bit more complicated. Perhaps a game bitset where tilt can be mapped as an analog joystick on the X plane.

Thoughts?
Liquid Metal King Slime
Send private message
 
 PostMon Aug 12, 2013 3:19 pm
Send private message Reply with quote
sdl-android provides Accelerometer and gyroscope support as fake Joystick axises. I am not sure that is how I would want to expose those inputs to plotscripting, especially since our existing joystick support is pretty weak, but that gives you and idea of what is available.
Slime Knight
Send private message
 
 PostTue Aug 13, 2013 9:00 am
Send private message Reply with quote
The most sensible way would probably just be a magic variable that has a 0-256 value of what the accelero is returning. Gyro sounds a bit more involved.

There could also be a bitset for a game for "Waggle activates Use Key", and let people work around that.
Metal King Slime
Send private message
 
 PostTue Aug 13, 2013 11:32 am
Send private message Reply with quote
I've never used a cellphone app that used any of those inputs, but a 'shake' or single valued return doesn't sound very useful. Why not return the 3D input with new script commands "accelerometer(axis)" and "gyroscope(axis)"? We could also optionally map those down to additional joysticks, throwing away one axis, but that seems rather pointless because very likely zero OHR games support multiple joysticks.

However, the accelerometer input especially needs to be filtered to be useful; that should be done in the engine.

Looking at the code, I'm surprised to see that all of gfx_fb, gfx_sdl and gfx_directx appear to have complete support for multiple joysticks and that ti is exposed to scripting. Does that mean that only script commands for querying the number of joysticks and information about each joystick are missing? (Aside from the bad joystick support in the rest of the engine.)
Slime Knight
Send private message
 
 PostTue Aug 13, 2013 10:52 pm
Send private message Reply with quote
I'm surprised you haven't. If you have access to an iOS device, Real Racing is a good use of tilt.
Metal King Slime
Send private message
 
 PostWed Aug 14, 2013 8:59 pm
Send private message Reply with quote
If I had access to an iOS device, I would be busy porting the OHR to it! I haven't actually ever used my phone as anything other than phone, alarm clock, or development platform. I never got around to playing any games.
Slime Knight
Send private message
 
 PostThu Aug 15, 2013 8:12 am
Send private message Reply with quote
Aw. If you weren't across a really really really big ocean I'd loan you mine (ipad mini) to do it.
Display posts from previous: