Yo so I came up with a new buffering system and then JMorphMan helped me fine tune it, gather data, and all around did loads of testing. We went back and forth for about a week on this system.
NOTE THAT ALL THIS IS STILL AN IDEA IN PROGRESS AND THINGS COULD CHANGE WITH FURTHER TESTING AND FEEDBACK
What does this buffer system do?It allows you to input commands based on how long of time between each press and/or release like most commercial games. And it fixes the reversed command bug. And it has ZERO lag!
How does it work?It uses an explod system to detect inputs and to activate commands instead of using MUGEN's cmd system. You will need 1 var unless you want to replicate the hitpause system.
SHOW US!You can download a KFM built with this system here (http://mugenguild.com/forum/msg.2358661)
There are 2 main sections. The -2 and the .cmd
For example QCF will look like this in the -2
;---------------------------------------------------
[State -2, QCF: Down 1000]
type = Explod
triggerAll = !NumExplod(90010002)
trigger1 = command = "down" || command = "rlsdown"
anim = 1
ID = 90010002
removeTime = 10
pauseMoveTime = 10
superMoveTime = 10
ignoreHitPause = 1
[State -2, QCF: Down-Forward 1000]
type = Explod
triggerAll = !NumExplod(90010003)
triggerAll = NumExplod(90010002)
trigger1 = command = "dfwd" && P2Dist x >= 0
trigger2 = command = "dback" && P2Dist x < 0
anim = 1
ID = 90010003
removeTime = 10
pauseMoveTime = 10
superMoveTime = 10
ignoreHitPause = 1
[State -2, RemoveExplod]
type = RemoveExplod
trigger1 = NumExplod(90010003)
id = 90010002
ignoreHitPause = 1
[State -2, QCF: Forward 1000]
type = Explod
triggerAll = !NumExplod(90010006)
triggerAll = NumExplod(90010003)
trigger1 = command = "fwd" && P2Dist x >= 0
trigger2 = command = "back" && P2Dist x < 0
anim = 1
ID = 90010006
removeTime = 10
pauseMoveTime = 10
superMoveTime = 10
ignoreHitPause = 1
[State -2, RemoveExplod]
type = RemoveExplod
trigger1 = NumExplod(90010006)
id = 90010003
ignoreHitPause = 1
There is a logic to the explods.
9 six digit identifier- numpad directional connotation
So forward in QCF might look like this 90010006
The identifiers are loosely based on the state. For easier copy paste I decided to try to standardize them early on so after this post I'll post what I have already set.
Anyway what's happening here is that you'll tap or release DOWN and it creates an explod. When you hit DF it sees the D explod is alive and activates the DF explod. Killing the 1st explod. You have 10 ticks between each press before they kill themselves and you cannot do the motion. Anyway, after DF you press forward and it will see the DF explod and create the Forward explod while removing the DF one. Again you now have 10 ticks to press your attack button.
You should also note this
trigger1 = command = "fwd" && P2Dist x >= 0
trigger2 = command = "back" && P2Dist x < 0
trigger1 means that if P2 is in front of you you're tapping forward and if they are behind you you are tapping back. You're still really tapping forward but this is fixing the reversed command bug!
Note that for air specials different games have different rules. You'll find the code example in the next post but lets talk about this.
In some games like KOF when you jump over P2 and try to do an air fireball the command is flipper to down, down-toward, toward P2 who is behind you so you can use the same explod in the air as in the ground for these.
With Capcom games the rotation does NOT flip. So if you jump over P2 and do the rotation it'll be Down, Down-Away, Away from P2. Basically you keep going the direction you are facing.
You'll need to test your game to see which method it uses.
This brings us to the .cmd aka -1
Notice the main statechange is now a varset
[State -1, Light Kung Fu Palm]
type = VarSet
var(1) = 1000
triggerall = !AILevel
triggerall = NumExplod(90010006) && (command = "x" || command = "rlsx")
trigger1 = statetype != A
trigger1 = ctrl
ignorehitpause = 1
[State 0, ChangeState]
type = ChangeState
trigger1 = HitPauseTime = 0
trigger1 = var(1)=1000
value = 1000
triggerall = NumExplod(90010006) && (command = "x" || command = "rlsx")
this means that if the Forward explod is still alive when you press or release X you'll set the var to the stateno
Why do we set a var? Well, this method needs help with hitpauses. So we store the command till there is no hitpause anymore. That's why it has ignorehitpause = 1
Next follows the actual changestate
[State 0, ChangeState]
type = ChangeState
trigger1 = HitPauseTime = 0
trigger1 = var(1)=1000
value = 1000
With this you can be sure the move will come out after the hitpause ends as it should!
Then let's go back to the -2
[State -2, VarSet]
type = VarSet
triggerall = Time=1
trigger1 = MoveType = A
var(1) = 0
We will place the above to reset the var to 0. If you have moves that need this and are not in the MoveType = A status then you'll want to add their info here or place the varset in their state. I'll assume you know what to do from there :P
So that's almost it BUT!!!! here is the ONLY spot me and JMM couldn't figure out a fix for.
In my next post I will show off the QCFx2 but for now let's talk about it. The hitpause will rapidly press the keys you press for you each tick as it stores the buffer. Making commands that overlap not work correctly. There are 2 fixes for this. We have been discussing the simpler one.
;---------------------------------------------------------------------------
;Triple Kung Fu Palm (uses one super bar)
[State -1, Triple Kung Fu Palm]
type = VarSet
var(1) = 3000
triggerall = power >= 1000
triggerall = !AILevel
trigger1 = NumExplod(90030002) && ((command = "x" || command = "rlsx")|| (command = "y" || command = "rlsy"))
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = command = "TripleKFPalm"
trigger2 = statetype != A
trigger2 = hitdefattr = SC, NA, SA, HA
trigger2 = stateno != [3000,3050)
trigger2 = movecontact
trigger3 = command = "TripleKFPalm"
trigger3 = stateno = 1310 || stateno = 1330 ;From blocking
ignorehitpause = 1
[State 0, ChangeState]
type = ChangeState
trigger1 = HitPauseTime = 0
trigger1 = var(1)=3000
value = 3000
You'll notice this time we are using the old command system too. For overlapping commands you'll want to do this for moves that cancel from a hitpause. This won't have the buffer method but it's not going to be noticeable in a combo as you'll be doing fast inputs anyway. And in a scenario like this you won't hit the reversed command glitch either.
HOWEVER! If you still don't want to use the MUGEN cmd system and want to keep that var free you can simulate your hitpause with code. If you do this you don't have to worry about the Varset commands at all. Set them to changestates as normal. And never worry about using MUGEN's cmd system again.
PLEASEIf you can think of a way to get around the hitpause issue please post it. Or if you have suggestions that can improve or simplify this in general. I'd like this to be as easy as we can make it!