Page 1 of 1

handle multi vs single press

Posted: Tue Oct 17, 2017 10:52 am
by KanedaFr
Hi,

Before I reinvent the wheel, is there a 'common' way to handle multi press ?
Let me explain.
If you press A, you kick
if you press B, you punch
if you press C, you jump
if you press ABC, you call the devil and destroy every enemy on screen!!!

To press ABC at the EXACT same time/frame is a PITA.
So I had to deal with ABC pressed on a 2 or 3 frames interval.
BUT if I do this, it's totally possible to start to kick (A) before I detect the player wants in fact use the special attack (pressing BC on next frame)
I could wait a frame or two to launch action but it will look as a lag (and I hate Bubsy!!!)

So does it mean I had to handle a way to 'revert' kick/punch/jump when it's finally obvious what the player REALLY want ?

How do you handle it ? How do others games handle it ?

Thanks for any hint ;)

note : i'm not talking about SF2-like moves, it has to be handle a totally different way...

Re: handle multi vs single press

Posted: Tue Oct 17, 2017 11:18 am
by Miquel
Lagging input is definitely a no go, it will become less enjoyable.

In your concrete situation I will do next things:
- Awesome attack is done with A+B instead of A+B+C
- When you are handling kick or punch, detect the pressing of the other button for some frames, if is there, change to inferno attack.

The point is changing from the beginning of kick/punch animation to destroy all animation (probably) bears no noticeable change, while moving from jumping to non-jumping animation is difficult both in terms of graphics and physics.

Re: handle multi vs single press

Posted: Tue Oct 17, 2017 6:32 pm
by cero
Most commercial games use lag, and maybe 30-40% revert the action.

Re: handle multi vs single press

Posted: Tue Oct 17, 2017 6:55 pm
by Sik
KanedaFr wrote:
Tue Oct 17, 2017 10:52 am
BUT if I do this, it's totally possible to start to kick (A) before I detect the player wants in fact use the special attack (pressing BC on next frame)
And the special attack will cancel out the kick while also doing damage to just about everything on screen anyway. Whatever got kicked got bonus damage, if anything :v

I wouldn't get too hung up on this case. Heck, maybe even just detect if all three are pressed at once regardless of when (pressing A+B+C is hard, 3 frames of grace period is not going to do on a real controller).

Re: handle multi vs single press

Posted: Thu Oct 19, 2017 1:48 pm
by Natsumi
There is no one way to handle this I believe, but it depends on the game. The way I would do it, is check for A+B+C, and if its pressed, have some code to cancel the current attack or whatever is happening. It would help if the kick animation starts a little slower and finishes fast, so its not nearly as abrupt when it stops and transitions to another animation.

Re: handle multi vs single press

Posted: Sat Oct 21, 2017 11:13 pm
by KanedaFr
thanks for your feedbacks.
You were right about jump, so I totally remove it of the problem : C could only be the last one pressed , to avoid starting a jump.
it's almost working, i now have to add a delay between 2 special attacks but logic is right, thanks to you guys !