handle multi vs single press

For anything related to IO (joypad, serial, XE...)

Moderator: BigEvilCorporation

Post Reply
User avatar
KanedaFr
Administrateur
Posts: 1114
Joined: Tue Aug 29, 2006 10:56 am
Contact:

handle multi vs single press

Post by KanedaFr » Tue Oct 17, 2017 10:52 am

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...

Miquel
Very interested
Posts: 287
Joined: Sat Jul 30, 2016 12:33 am

Re: handle multi vs single press

Post by Miquel » Tue Oct 17, 2017 11:18 am

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.

cero
Very interested
Posts: 222
Joined: Mon Nov 30, 2015 1:55 pm

Re: handle multi vs single press

Post by cero » Tue Oct 17, 2017 6:32 pm

Most commercial games use lag, and maybe 30-40% revert the action.

User avatar
Sik
Very interested
Posts: 682
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: handle multi vs single press

Post by Sik » Tue Oct 17, 2017 6:55 pm

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).
Sik is pronounced as "seek", not as "sick".

User avatar
Natsumi
Very interested
Posts: 81
Joined: Mon Oct 05, 2015 3:00 pm
Location: 0x0
Contact:

Re: handle multi vs single press

Post by Natsumi » Thu Oct 19, 2017 1:48 pm

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.

User avatar
KanedaFr
Administrateur
Posts: 1114
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Re: handle multi vs single press

Post by KanedaFr » Sat Oct 21, 2017 11:13 pm

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 !

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest