I'm hoping to publish cross platform, including Steam, Android, IOS, maybe even 3ds Depending on nintendo lol.
So I count at least four control schemas that I need to build. Mouse/keyboard for PC, Gamepad for PC/Console, Touch for various tablets/phones, and I guess some kind of gamepad/touch/secondscreen hybrid abomination for wiiU/3ds if Nintendo comes through. I'd also like to allow keymapping, because some people just have a different keyboard or are more comfortable with a different setup.
It seems like a pretty complex problem, and while I have no doubt that I will eventually figure it out, I was wondering if there is an easier way. Is there some kind of abstraction layer I can use between the myriad of input devices? I found a plugin for Construct, but of course I am using C2
Keys/buttons are straightforward: I set up a pair of dictionaries, so I can look up the key and button for an event and use them both in an OR block. I set up a separate event triggered by a gesture or something for touch.
It looks like movement is boiling down to two analog sticks, Left for movement and Right for Look/Shield. Seems I should feed the first analog stick into a MoveX and MoveY variable. I should also feed WASD into those variables, as well as an onscreen analog stick if no keyboard or gamepad is detected. Do you have any tips for making sure I avoid any kind of "off by one" lag when I aggregate inputs like that?
Right analog stick controls a camera point. The point is also controlled by the mouse, so I need to figure out how to decide between those. If the "Shield" button is held, the player will also face the camera point, allowing strafing, and raise whatever they have in their shield slot. Touching a nonbutton point on the screen will have the same effect: player faces that point and raises the shield, even if the other finger is on the analog onscreen control.
Have I got the right Idea? Am I thinking along the right lines? Is there an easier way to handle all this? Any feedback or ideas are quite welcome!