How does everyone handle input remapping?

Get help using Construct 2

Post » Mon Mar 16, 2015 2:37 pm

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!
B
14
S
5
G
1
Posts: 189
Reputation: 1,536

Post » Mon Mar 16, 2015 4:06 pm

You seem to be going about it the right way, it's just a pain. C2 should get some kind of functionality built in for button remapping because it really should be standard in every game and C2 aims to assist people in making games
B
5
S
1
Posts: 59
Reputation: 497

Post » Mon Mar 16, 2015 10:53 pm

It would be nice to have some kind of unified plugin solution.... For now I'll just keep my own efforts well documented.
B
14
S
5
G
1
Posts: 189
Reputation: 1,536

Post » Tue Mar 17, 2015 1:03 am

I'm using functions, variables, events and aspirins for the multiple headaches that come with...
B
43
S
12
G
14
Posts: 488
Reputation: 10,570


Return to How do I....?

Who is online

Users browsing this forum: AkbarAsgharMG, lwgames, Yahoo [Bot] and 3 guests