YesNoOk
avatar

KOF Command Buffering (Read 22864 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
  • ****
  • Lost all his MUGEN stuff in hard disk crash. :(
  • CHIKARA TO EIKOU!!!
    • 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 Video Editor and Web Programmer

And possibly more other shady things lol

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.