With incoming Android releases, there are more inputs

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply
User avatar
FyreWulff
Slime Knight
Posts: 107
Joined: Wed Mar 13, 2013 9:16 pm
Location: The Internet
Contact:

With incoming Android releases, there are more inputs

Post by FyreWulff »

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?
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

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.
User avatar
FyreWulff
Slime Knight
Posts: 107
Joined: Wed Mar 13, 2013 9:16 pm
Location: The Internet
Contact:

Post by FyreWulff »

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.
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

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.)
Last edited by TMC on Tue Aug 13, 2013 11:36 am, edited 2 times in total.
User avatar
FyreWulff
Slime Knight
Posts: 107
Joined: Wed Mar 13, 2013 9:16 pm
Location: The Internet
Contact:

Post by FyreWulff »

I'm surprised you haven't. If you have access to an iOS device, Real Racing is a good use of tilt.
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

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.
User avatar
FyreWulff
Slime Knight
Posts: 107
Joined: Wed Mar 13, 2013 9:16 pm
Location: The Internet
Contact:

Post by FyreWulff »

Aw. If you weren't across a really really really big ocean I'd loan you mine (ipad mini) to do it.
Post Reply