playMaker

Author Topic: Gestures and combos.  (Read 2663 times)

Red

  • Hero Member
  • *****
  • Posts: 563
Gestures and combos.
« on: May 17, 2013, 10:02:35 PM »
So, i've been toying with the idea of figuring out a combo system... wondering if anyone has ever tried it before? i was thinking something like a wait as a drop-out from each particular stage and just connecting the next combo state change to the third... having a branching system would probably be the most logical i would think.

but, what could you do to wire that up with a touch-interface? not having a capable device to test with myself i've not actually bothered looking too deeply into that application of playmaker. anyone have much experience with that?

psst, if you have a pack that does that kinda thing, you never know, it might be worth some coin on the asset store (just make sure to document it heavily if you go that route.)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Gestures and combos.
« Reply #1 on: May 18, 2013, 03:49:50 AM »
Hi Red,

 Combo are "easy" to build actually.

 several ways.

-- Either you use ArrayMaker to escaladate the combo progress, say you have three keys to press, simply have an array of 3 bool and flag them as proper keys are hit and refer to the array to know where you are at and if the pressed key is valid to progress within the combo. That's more likely the way to go if you plan on defining your combos in an abstract way ( xml, test or database)

-- else, you simply maintain states and variables. Fsm states is a very powerful way to progress through a define set of actions. This is where Fsm shines actually. When you start the combo checking procedure, the active state ONLY move to the next state if the action supposed to be performed succeeded, then you simply move down your states until the combo is validated. Very easy and super nice to debug, improve, make variants.

In All cases, you will likely need a manager to finally dispatch combos events to your app ( like inputs), cause several combos might overlap, especially if you are not only dealing with keys but with touch input, I implemented not so long ago a gesture recognizer system and the trick is not in the detection but the management of several combos that overlap in terms of success ( say a swipe is as valid as a swipe up, but you want to differenciate them, and maybe prioritize them, check first if a swipe up was done, else swipe combo will take over if validated). you also have timing to take in consideration. For example, the user has to swipe and click. then you are confronted to a problem of timing since if you also want to react to a regular swipe. For this you need to prevalidate combos, cause the swipe needs to wait for the Swipe+click to fail before firing. So while easy for simple combos it can get quickly complex if you are not carefully designing what you mean by combos and the expectation for flexibilities.

Bye,

 Jean