YesNoOk
avatar

KOF Command Buffering (Read 12970 times)

Started by Messatsu, January 27, 2005, 06:36:56 pm
Share this topic:
KOF Command Buffering
#1  January 27, 2005, 06:36:56 pm
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
According to CDNateur mahn, this works. :P

Code:
[Statedef 52087]
anim = 1;blank anim
ctrl = 0*(var(0):=20 + var(2):=20 + var(4):=20 + var(6):=20 + var(8):=20 + var(10):=20 + var(12):=20 + var(14):=20)
;even numbered variables are to store and modify timeouts for various commands
;even numbered variables + 1 are the countdowns for their even numbered semi-constants

[State];countdown
type     = null
trigger1 = var(1)
trigger1 = var(1):= var(1) - 1
trigger1 = 0
trigger2 = var(3)
trigger2 = var(3):= var(3) - 1
trigger2 = 0
trigger3 = var(5)
trigger3 = var(5):= var(5) - 1
trigger3 = 0
trigger4 = var(7)
trigger4 = var(7):= var(7) - 1
trigger4 = 0
trigger5 = var(9)
trigger5 = var(9):= var(9) - 1
trigger5 = 0
trigger6 = var(11)
trigger6 = var(11):= var(11)-1
trigger6 = 0

[State];if command is entered and is not already buffered, buffer it
type     = null
trigger1 = root, command = "QCF" && !var(1)
trigger1 = var(1):= var(0)
trigger1 = 0
trigger2 = root, command = "QCB" && !var(3)
trigger2 = var(3):= var(2)
trigger2 = 0
trigger3 = root, command = "HCF" && !var(5)
trigger3 = var(5):= var(4)
trigger3 = 0
trigger4 = root, command = "HCB" && !var(7)
trigger4 = var(7):= var(6)
trigger4 = 0
trigger5 = root, command = "DP" && !var(9)
trigger5 = var(9):= var(8)
trigger5 = 0
trigger6 = root, command = "RDP" && !var(11)
trigger6 = var(11):= var(10)
trigger6 = 0

;The helper should exist the entire match on the first tick, so we shouldn't have to use numhelper(52087) = 1 before using its redirection
;Ultra Argentina Backbreaker DM

Code:
[State -1, UAB]
type = ChangeState
triggerall = (command = "HCB" && helper(52087),var(7) && helper(52087, var(7) != helper(52087), var(6))) || (command = "2xHCB");this part might be unnecessary-> && helper(52087, var(7) != helper(52087), var(6)
triggerall = (command = "x" || command = "y")
triggerall = statetype !=A;this is always a req, so if you expand to trigger2, 3, and so on, you don't need to modify this into a triggerall
trigger1   = ctrl


Many people risk their lives everyday by having Mugen.
Re: KOF Command Buffering
#2  January 27, 2005, 06:38:34 pm
  • ****
  • 君の事、マスターにしてあげる! 御願い、信じてマスター!♥
    • Philippines
    • Skype - o_hermanm
    • www.rotbrc.com
I'm no KOF junkie-- Please explain more in plain english.

I'm interested.
Orochi Herman: MUGEN Creator, Producer and Web Programmer
https://www.facebook.com/OrochiHerman/
Re: KOF Command Buffering
#3  January 28, 2005, 02:55:25 am
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
Short explanation and notice this is untested by me:  52087 is a helper to store command presses. 

Even numbered variables are to store and modify timeouts for various commands.  Odd numbered variables (Even numbered variables + 1) are the countdowns for their even numbered semi-constants.  Odds are just there for quick modification.

Code:
triggerall = (command = "HCB" && helper(52087),var(7) && helper(52087, var(7) != helper(52087), var(6))) || (command = "2xHCB");this part might be unnecessary-> && helper(52087, var(7) != helper(52087), var(6)
Here, we check if we've done the command without buffering "2xHCB" or that one part was buffered "helper(x),var(7)" but it wasn't buffered on this tick and that on this tick, the other half the command was executed.

Sorry if that wasn't good enough.  It's really pretty simple and I hope it works as CDNateur mahn says. :P


Many people risk their lives everyday by having Mugen.
Re: KOF Command Buffering
#4  January 28, 2005, 02:59:43 am
  • ******
  • Just a butcher on a mission.
    • www.justnopoint.com/lbends
I think you can cut down on the variables if you used some AND ORs in there.
One variable can theoretically store up to 32 boolean values in mugen.
That means you could have only one variable for the buffer, but it would require a bit more code.

Now wait as winane bursts in with a way to store multiple timers into one variable.
Re: KOF Command Buffering
#5  January 28, 2005, 03:03:34 am
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
Quote
Now wait as winane bursts in with a way to store multiple timers into one variable.
That'd be more work than its worth.  I'm betting Mugen's inaccurate math triggers would impede what you'd need to do for that.


Many people risk their lives everyday by having Mugen.
Re: KOF Command Buffering
#6  January 28, 2005, 03:09:19 am
  • ******
  • Just a butcher on a mission.
    • www.justnopoint.com/lbends
wait, it just hit me :idea:

pseudo code:

QCF+b, add 1 to var.
QCB+x, add 10 to var
QCFx2+ ab, add 100 to var


real code:

Code:
[Statedef 52087]

[State];countdown
type = null
trigger1 = var(1)%10 >= 1
trigger1 = var(1):= var(1) - 1
trigger1 = 0
trigger2 = var(1)%100 >= 10
trigger2 = var(1):= var(1) - 10
trigger2 = 0
trigger3 = var(1)%1000 >= 100
trigger3 = var(1):= var(1) - 100
trigger3 = 0

you figure out the rest.

Edit: right now, this would only allow a 9 tick buffer, but it's easily expandable.
Last Edit: January 28, 2005, 03:12:27 am by Dante of Borg
Re: KOF Command Buffering
#7  January 28, 2005, 03:12:38 am
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
You only have a nine tick max size for the buffering then. ???


Many people risk their lives everyday by having Mugen.
Re: KOF Command Buffering
#8  January 28, 2005, 03:13:44 am
  • ******
  • Just a butcher on a mission.
    • www.justnopoint.com/lbends
You are 11 seconds too late for pointing that out :)
Re: KOF Command Buffering
#9  January 28, 2005, 03:20:12 am
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
I'm not given a red warning when you modify posts from the send post dialog. :mink:


Many people risk their lives everyday by having Mugen.
Re: KOF Command Buffering
#10  January 28, 2005, 03:36:43 am
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
*cough* that code won't work...


Many people risk their lives everyday by having Mugen.
Re: KOF Command Buffering
#11  January 28, 2005, 03:49:27 am
  • ******
  • Just a butcher on a mission.
    • www.justnopoint.com/lbends
*cough* that code won't work...

fixed?

Code:
[Statedef 52087]

[State];countdown
type = null
triggerall = var(1)%10 >= 1
trigger1 = var(1):= var(1) - 1

[State];countdown
type = null
triggerall= var(1)%100 >= 10
trigger1 = var(1):= var(1) - 10

[State];countdown
type = null
triggerall = var(1)%1000 >= 100
trigger1 = var(1):= var(1) - 100
Re: KOF Command Buffering
#12  January 28, 2005, 03:57:14 am
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
Example.  var(1) = 1000.

1000%10 == 100 && 100 >= 1, so var(1)--


Many people risk their lives everyday by having Mugen.
Re: KOF Command Buffering
#13  January 28, 2005, 04:09:13 am
  • ******
  • Just a butcher on a mission.
    • www.justnopoint.com/lbends
where did you learn math?

1000%10 = 0, 10 divides into it perfectly.


modulus ( % ) is not the same as divide ( / )
Last Edit: January 28, 2005, 04:11:54 am by Dante of Borg
Re: KOF Command Buffering
#14  January 28, 2005, 04:13:21 am
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
ha!~ nevermind. :-[  That reduces the buffer by one though. :P


Many people risk their lives everyday by having Mugen.
Last Edit: January 28, 2005, 04:15:02 am by Dante
Re: KOF Command Buffering
#15  January 28, 2005, 04:14:10 am
  • ******
  • Just a butcher on a mission.
    • www.justnopoint.com/lbends
It's ok, just go grab a coffee or something to wake you up.

Edit: Code modified to support 20 tick buffer

Code:
[Statedef 52087]

[State];countdown
type = null
triggerall = var(1)%21 >= 1
trigger1 = var(1):= var(1) - 1

[State];countdown
type = null
triggerall= var(1)%441 >= 21
trigger1 = var(1):= var(1) - 21

[State];countdown
type = null
triggerall = var(1)%9261 >= 441
trigger1 = var(1):= var(1) - 441

I did this really quick, didn't check my math yet.

Edit 2: Math checked, may need rechecking.
Last Edit: January 28, 2005, 04:21:37 am by Dante of Borg
Re: KOF Command Buffering
#16  January 28, 2005, 04:16:36 am
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
Or better yet.  Go to sleep.


Many people risk their lives everyday by having Mugen.
Re: KOF Command Buffering
#17  January 28, 2005, 04:23:37 am
  • ******
  • Just a butcher on a mission.
    • www.justnopoint.com/lbends
This could probably make it into the tips and tutorials section don'cha think?

Edit: Ok, all this could be contained in state -1,-2, or -3 using only two variables total :)  the helper is now rendered completely useless.

Adding !IsHelper to every sctrl here can be done as a precaution.

Code:
[State -1];countdown
type = null
triggerall = var(2)&1
triggerall = var(1)%21 >= 1
trigger1 = var(1):= var(1) - 1

[State -1];countdown
type = null
triggerall = var(2)&2
triggerall= var(1)%441 >= 21
trigger1 = var(1):= var(1) - 21

[State -1];countdown
type = null
triggerall = var(2)&4
triggerall = var(1)%9261 >= 441
trigger1 = var(1):= var(1) - 441

[State -1];detect
type = null
triggerall = command = "QCF+b"
trigger1 = var(2):= var(2)+1
trigger1 = var(1):= var(1)+20

[State -1];detect
type = null
triggerall = command = "QCB+x"
trigger1 = var(2):= var(2)+2
trigger1 = var(1):= var(1)+420

[State -1];detect
type = null
triggerall = command = "QCFx2+ab"
trigger1 = var(2):= var(2)+4
trigger1 = var(1):= var(1)+9240

;this snippet goes in every "move" controller in state -1, must be edited
triggerall = (command = "QCF+b") || (var(2)&1) ;the number being ANDed must correspond to the power of two the move was assigned
trigger1 = var(2):= var(2)-1 ;the number being subtracted here is the same as above

;Note- put this at the end or the buffer will be cut short 1 tick

[State -1];erase
type = null
triggerall = var(2)&1
triggerall = var(1)%21 < 1
trigger1 = var(2):= var(2)-1

[State -1];erase
type = null
triggerall = var(2)&2
triggerall= var(1)%441 < 21
trigger1 = var(2):= var(2)-2

[State -1];erase
type = null
triggerall = var(2)&4
triggerall = var(1)%9261 < 441
trigger1 = var(2):= var(2)-4


Edit2:  Maybe I should start my own little code archive on my site ???
Last Edit: January 28, 2005, 05:03:37 am by Dante of Borg

B²92

Re: KOF Command Buffering
#18  January 28, 2005, 01:34:08 pm
20 tick buffer = not enough. KOF'02 allows something like 25-30 ticks, KOF'01 & older ones allow up to 35-40 ticks.
Re: KOF Command Buffering
#19  January 28, 2005, 02:17:36 pm
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
Helper codes become portable.  I try to write code assuming that all 60 player variables are taken up as much as possible.


Many people risk their lives everyday by having Mugen.
Re: KOF Command Buffering
#20  January 28, 2005, 04:17:42 pm
  • ******
  • Just a butcher on a mission.
    • www.justnopoint.com/lbends
Just replace the numbers with powers of 31 or 41 then, it 20 ticks isn't enough.
Re: KOF Command Buffering
#21  January 28, 2005, 05:08:33 pm
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
While it saves variable space, your code isn't very easy to modify. :P  I'd say to stick with the helper as you don't need to use your brain at all.


Many people risk their lives everyday by having Mugen.
Re: KOF Command Buffering
#22  February 03, 2007, 02:11:01 am
  • ****
  • "Moyashi tsuku shite yaru..."
And I'd say to stick with Abraham Lincoln's idea. But he has forgotten to explain to people who might not catch so quickly what var(1) and var(2) is. And what are those numbers - 21, 441 and 9240? And why 3 of them? If I want to use 30 ticks command buddering should I use 31, 961 and 29791 instead then? And how many moves can be used with this command buffering code? 'Cause 31^7 is already 27'512'614'111 o_O That means it can be used with no more than 7 moves? Please, explain more!
Re: KOF Command Buffering
#23  February 03, 2007, 05:51:45 am
  • ******
  • [E]
    • Mexico
this code might be similar, i use it to store how long has a key been pressed.

;____________________________
;
;[E] reading a button
;____________________________
;notes
;the buttons count up to 15 ticks, when they are being pressed,
;if released they get set to0
;there are 7 buttons so that makes it 7 - 4 bits groups
;
;
;this is the base code
;
;increase the counter
;[State -2, read a button]
;type = varSet
;trigger1 = ((var(17)&(((2**(N))*15)/2**(N))) < 15); && command = "hold_a"
;var(17) =  (var(17)&(var(17)& ((2**32)-1)-(((2**(N))*15))))+( (var(17)&(((2**(N))*15))) + (1*(2**(N)))  )
;ignorehitpause = 0
; reset the counter
;[State -2, not read a button]
;type = varSet
;trigger1 = command != "hold_a" && command != "a"
;var(17) = (var(17)&(var(17)& ((2**32)-1)-(((2**(N))*15))))
;ignorehitpause = 0
;
;
;
;
;increase the counter
[State -2, read a button]
type = varSet
trigger1 = (var(17)&15) < 15
var(17) =  (var(17)&(var(17)& ((2**32)-1)-15))+((var(17)&15)+1)
ignorehitpause = 0
; reset the counter
[State -2, not read a button]
type = varSet
trigger1 = command != "hold_a" && command != "a"
var(17) = (var(17)&(var(17)& ((2**32)-1)-(15)))
ignorehitpause = 0

;increase the counter
[State -2, read a button]
type = varSet
trigger1 = (var(17)&240) < 240
var(17) =  (var(17)&(var(17)& ((2**32)-1)-240))+((var(17)&240)+16)
ignorehitpause = 0
; reset the counter
[State -2, not read a button]
type = varSet
trigger1 = command != "hold_b" && command != "b"
var(17) = (var(17)&(var(17)& ((2**32)-1)-240))
ignorehitpause = 0


this might be much harder ot the processor but might be easier to understand.

just a question and ignore my semi-retiredness ignorance, but, what's wrong wiht mugen's built in buffering timing ?
Re: KOF Command Buffering
#24  February 03, 2007, 06:26:04 am
  • ****
  • "Moyashi tsuku shite yaru..."
Wow, I'll try, thanks. You've written the code only for two buttons though.
I'd like to hear more about Lincoln's method anyway :)
Last Edit: February 03, 2007, 06:34:42 am by Elix
Re: KOF Command Buffering
#25  February 20, 2007, 05:54:31 am
  • ******
  • [E]
    • Mexico
oh, sorry about it, here is teh code for alll the buttons.

Code:
;____________________________
;
;[E] reading a button
;____________________________
;notes
;the buttons count up to 15 ticks, when they are being pressed,
;if released they get set to0
;there are 7 buttons so that makes it 7 - 4 bits groups
;
;
;this is the base code
;
;increase the counter
;[State -2, read a button]
;type = varSet
;trigger1 = ((var(17)&(((2**(N))*15)/2**(N))) < 15); && command = "hold_a"
;var(17) =  (var(17)&(var(17)& ((2**32)-1)-(((2**(N))*15))))+( (var(17)&(((2**(N))*15))) + (1*(2**(N)))  )
;ignorehitpause = 0
; reset the counter
;[State -2, not read a button]
;type = varSet
;trigger1 = command != "hold_a" && command != "a"
;var(17) = (var(17)&(var(17)& ((2**32)-1)-(((2**(N))*15))))
;ignorehitpause = 0
;
;
;
;
;increase the counter
[State -2, read a button]
type = varSet
trigger1 = (var(17)&15) < 15
var(17) =  (var(17)&(var(17)& ((2**32)-1)-15))+((var(17)&15)+1)
ignorehitpause = 0
; reset the counter
[State -2, not read a button]
type = varSet
trigger1 = command != "hold_a" && command != "a"
var(17) = (var(17)&(var(17)& ((2**32)-1)-(15)))
ignorehitpause = 0

;increase the counter
[State -2, read a button]
type = varSet
trigger1 = (var(17)&240) < 240
var(17) =  (var(17)&(var(17)& ((2**32)-1)-240))+((var(17)&240)+16)
ignorehitpause = 0
; reset the counter
[State -2, not read a button]
type = varSet
trigger1 = command != "hold_b" && command != "b"
var(17) = (var(17)&(var(17)& ((2**32)-1)-240))
ignorehitpause = 0

;increase the counter
[State -2, read a button]
type = varSet
trigger1 = (var(17)&3840) < 3840
var(17) =  (var(17)&(var(17)& ((2**32)-1)-3840))+((var(17)&3840)+256)
ignorehitpause = 0
; reset the counter
[State -2, not read a button]
type = varSet
trigger1 = command != "hold_c" && command != "c"
var(17) = (var(17)&(var(17)& ((2**32)-1)-3840))
ignorehitpause = 0

;increase the counter
[State -2, read a button]
type = varSet
trigger1 = (var(17)&61440) < 61440
var(17) =  (var(17)&(var(17)& ((2**32)-1)-61440))+((var(17)&61440)+4096)
ignorehitpause = 0
; reset the counter
[State -2, not read a button]
type = varSet
trigger1 = command != "hold_x" && command != "x"
var(17) = (var(17)&(var(17)& ((2**32)-1)-61440))
ignorehitpause = 0

;increase the counter
[State -2, read a button]
type = varSet
trigger1 = (var(17)&983040) < 983040
var(17) =  (var(17)&(var(17)& ((2**32)-1)-983040))+((var(17)&983040)+65536)
ignorehitpause = 0
; reset the counter
[State -2, not read a button]
type = varSet
trigger1 = command != "hold_y" && command != "y"
var(17) = (var(17)&(var(17)& ((2**32)-1)-983040))
ignorehitpause = 0

;increase the counter
[State -2, read a button]
type = varSet
trigger1 = (var(17)&15728640) < 15728640
var(17) =  (var(17)&(var(17)& ((2**32)-1)-15728640))+((var(17)&15728640)+1048576)
ignorehitpause = 0
; reset the counter
[State -2, not read a button]
type = varSet
trigger1 = command != "hold_z" && command != "z"
var(17) = (var(17)&(var(17)& ((2**32)-1)-15728640))
ignorehitpause = 0

;increase the counter
[State -2, read a button]
type = varSet
trigger1 = (var(17)&251658240) < 251658240
var(17) =  (var(17)&(var(17)& ((2**32)-1)-251658240))+((var(17)&251658240)+16777216)
ignorehitpause = 0
; reset the counter
[State -2, not read a button]
type = varSet
trigger1 = command != "hold_s" && command != "s"
var(17) = (var(17)&(var(17)& ((2**32)-1)-251658240))
ignorehitpause = 0
Re: KOF Command Buffering
#26  May 07, 2007, 05:39:34 pm
  • ****
  • "Moyashi tsuku shite yaru..."
I desperately nedd an explanation on how to use this code :( Because even if I manage to implement it correctly by myself, I don't like using a code I don't understand.
What type of command buffering is it, R[E]ika? I need a command buffering method that "feels like KOF". For example, a traditional KOF XI cancel from Dragon punch (~F, D, $F, x) to Desperation Move (D, DF, F, D, DF, F, x). Is there any method that will allow "D, DF, F, x" to read as Desperation Move command if it is inputted after Dragon punch? And the whole command for the Super Cancel is "~F, D, $F, x, D, DF, F, x" instead of "~F, D, $F, x, D, DF, F, DF, F, x" (which is practically impossible to input).
Re: KOF Command Buffering
#27  May 12, 2007, 11:45:18 pm
  • ******
  • [E]
    • Mexico
oh, mugen works by dafault like that, you just need to play around with the .cmd paremeters.. those are what i currently use.

[Defaults]
command.time = 10
command.buffer.time = 5

;Special Attacks

[Command]
name = "QCBHCFx"
command = ~D,DB,B,DB,D,DF,F,x
time = 20


[Command]
name = "DPx"
command = ~F,D,DF,x
time = 15


but i developd those by  feeling on al older pc, so i need to readjust them now tha ti can run mugen at 100% speed.
Re: KOF Command Buffering
#28  May 13, 2007, 12:48:47 am
  • ****
  • "Moyashi tsuku shite yaru..."
Hm, I'll try experimenting with those values. Then, if command buffering works in MUGEN well, what is this topic about? :)
Re: KOF Command Buffering
#29  May 17, 2007, 02:06:43 pm
  • ******
  • Just a butcher on a mission.
    • www.justnopoint.com/lbends
It's specifically formulated to generate headaches and trigger math related phobias.
All I know is that I've used this like, once, to keep a buffer of individual keypresses rather than strings of command inputs.
Re: KOF Command Buffering
#30  May 19, 2007, 05:45:42 am
  • ****
  • "Moyashi tsuku shite yaru..."
It's specifically formulated to generate headaches and trigger math related phobias.
All I know is that I've used this like, once, to keep a buffer of individual keypresses rather than strings of command inputs.
Strings of command inputs? What do you mean? Like VarSets and ChangeStates in .cns?
Re: KOF Command Buffering
#31  June 04, 2007, 03:14:32 pm
  • **
  • Call me Private42.
Is it possible  to sinalize that I did a motion like QCF+ a using that code? I think I really need to know this in order to finish the tag team on my project...
Re: KOF Command Buffering
#32  June 04, 2007, 09:32:48 pm
  • ******
  • [E]
    • Mexico
maybe.. what are you talking about?
Re: KOF Command Buffering
#33  June 04, 2007, 09:53:51 pm
  • **
  • Call me Private42.
Well..all the chars must have the same command imput , meaning many moves...but if I could use a var to stock the command and the button pressed I could reduce the amount of different commands so intead of making a command for
QCF + a, QCF + b, QCF + c...etc..I could buffer in a var the command QCF and in another (or even in the same , if possible) the button pressed reducing the number of different commands...



Re: KOF Command Buffering
#34  June 04, 2007, 09:59:58 pm
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
You don't need to go that far.
[Command]
name = "QCF_PPP"
command = ~D,DF,F, x
time = 12

[Command]
name = "QCF_PPP"
command = ~D,DF,F, y
time = 12

[Command]
name = "QCF_PPP"
command = ~D,DF,F, z
time = 12

[State -1]
type = changestate
triggerall = command = "QCF_PPP" && command = "x"And I really don't think this is at all necessary for tag team codes.


Many people risk their lives everyday by having Mugen.
Last Edit: June 04, 2007, 10:02:13 pm by ç„¡é™
Re: KOF Command Buffering
#35  June 05, 2007, 09:41:49 pm
  • ******
  • [E]
    • Mexico
dude, that's kinda the same, since you are using 3 commands..

what about separating

[Command]
name = "QCF"
command = ~D,DF,Fx
time = 12


[State -1]
type = changestate
triggerall = command = "QCF" && command = "x"

 i do that for dir+button already