How do you suppose charging is handled, in most 2D fighting-games?


I’m working on making a fighting-game-engine, and I can’t figure out how to handle input. I conceived a simple system, but it doesn’t allow for charge-partitioning. I could go on with no charge-system (at least for the first game I plan on making, with the engine), but I want the engine to be as flexible as possible.


This is pretty much thought up on the spot, and I’m not even sure if it’ll work, but maybe it’ll start you on your way.

how about having a counter that increments when you charge a direction. if no input is given in say 5 frames, reset the counter… Any attack would not have any effect on the counter, as long as it is done within that window.


what the guy above me said.

store the total amount of frames held in a certain direction (Back) as a variable, if that exceeds 60 (1 second), you can execute the attack by hitting F+whatever, this has the highest priority over any command you can do. allow it so you can hit F+whatever within 10 frames of letting go of any Back direction, obviously allow for something like 2-3 frames of leeway between hitting F and Whatever, and make it cancel any normal/command normal attack into the special move (this is the reason kara techniques work, but mostly you want this to happen so your inputs aren’t notoriously difficult), although that really has nothing to do with charge motions!


^ i miss your previous “pitiful scum” av…


This is pretty easy. You have buffered input working I’ll assume, so the stuff is already in place. Add a timer that will count when the direction is being held, and then save that when the move isn’t being held anymore. If it passes the duration requirement (1 sec to save for a 2 sec charge) you add it to the current charge. Once the charge is ready you flag the charge command as possible, and then the first special (or special cancel/override) you check for in your list (or tree) is the forward and punch, or whatever. This has another timer that lasts as long as you want a charge to last for, and then the flag goes away.

I never play charge characters so my understanding of how partitioning works is kinda iffy. I assumed that when you charge at least half of the charge time you could save it. If that’s wrong then please tell me.

zinac or dannobot may come along and add a much better way to do this, I’m not having charge charcters in my game so I never gave it much concern.


Yeah, so I assume that you’ve got some sort of input queue that holds input from the user that you use to check for moves. When a string of input in the queue matches a string in the moveset, the move is activated and that input is taken out of the queue. Input from the user is thrown out after it’s been sitting in the queue for some time delta.
So if the user presses :l:, you add that to the input queue. During subsequent frames, if that is still being held down, you increment a counter for that direction. When that counter reaches the required length for the charge, you add a charge :l: to the input queue.
So the user presses and holds back, then hits forward+ punch, the input queue would look like:
:l:, charge :l:, :r:, :p:
which matches “sonic boom”

I’m not really familiar with charge partitioning, but that’s when a character can store charges, right? You could set the “time to expire” for charge input to a longer time delta than regular input. So like :l: is taken out of the input queue after 0.5 seconds, but charge :l: is taken out after 3.0 seconds.

Also, where are the charge smilies?