YesNoOk
avatar

Negative Edge (Read 6627 times)

Started by Messatsu, June 01, 2006, 10:24:55 pm
Share this topic:
Negative Edge
#1  June 01, 2006, 10:24:55 pm
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
This part of the tutorial is strictly for single-button negative edge.

Negative Edge is the ease of comboing a connecting button attack into a special command attack.  Capcom "invented" the technique in the SF2 days and has stuck with their fighting games through the years.  Guilty Gear also makes use of the technique, but certain characters, like Johnny, do not use it.

Code:
[Command]
name = "Hadoken"
command = ~D, DF, F, x
time = 12

[Command]
name = "Hadoken"
command = ~D, DF, F, ~x
time = 12

Application:
Code:
[State -1, Hadoken]
type       = Changestate
value      = 1300
triggerall = command = "Hadoken"
triggerall = statetype = S
trigger1   = ctrl


Many people risk their lives everyday by having Mugen.
Re: Negative Edge
#2  June 01, 2006, 10:25:38 pm
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
Two-to-six button simultaneous release command code.

Mugen by itself will not detect ~a and ~b in the same tick without using tricks.  That is why the following code has been developed.  This needs to be directly under "[statedef -1]" and var(9) must not already be in use (you can exchange it for another variable if you want).
Code:
[State -1, Negative Edge]; - Reset // Release // Hold
type     = null
trigger1 = var(9)&4032
trigger1 = (var(9):= var(9) - var(9)^4032)*0
trigger2 = var(9)&63
trigger2 = (var(9):= var(9) +64*(var(9)&1 && command != "ha") +128*(var(9)&2 && command != "hb") +256*(var(9)&4 && command != "hc") +512*(var(9)&8 && command != "hx") +1024*(var(9)&16 && command != "hy") +2048*(var(9)&32 && command != "hz")) - var(9)
trigger3 = var(9):= var(9)-(var(9)&63) + 1*(command = "ha") + 2*(command = "hb") + 4*(command = "hc") + 8*(command = "hx") + 16*(command = "hy") + 32*(command = "hz")

These commands are absolutely necessary, they can be renamed, but beware of exceeding Mugen's string expression parse length--which I'm guessing is 255 characters.  And you'll also need to rename the commands in the above code.
Code:
[Command]
name    ="ha"
command = /a
time    = 1
[Command]
name    ="hb"
command = /b
time    = 1
[Command]
name    ="hc"
command = /c
time    = 1
[Command]
name    ="hx"
command = /x
time    = 1
[Command]
name    ="hy"
command = /y
time    = 1
[Command]
name    ="hz"
command = /z
time    = 1

These are expected output values if you tied var(9) to a DTC sctrl:
three simultaneous kicks released: var(9)&448=448
three simultaneous punches released: var(9)&3584=3584
combo of two simul kicks: (var(9)&192=192) || (var(9)&384=384) || (var(9)&320=320)
combo of two simul punches:(var(9)&1536=1536) || (var(9)&3072=3072) || (var(9)&2560=2560)
weak punch and kick: var(9)&576=576
medium punch and kick: var(9)&1152=1152
fierce punch and kick: var(9)&2304=2304

To use an example of what a command definition and matching statedef -1 entry should look like:

Code:
[Command]
name    = "KongouKokuretsuzan"
command = ~D, D, D, a + b + c
time    = 18
[Command]
name    = "KongouKokuretsuzanR"
command = ~D, D, D,~a
time    = 18
[Command]
name    = "KongouKokuretsuzanR"
command = ~D, D, D,~b
time    = 18
[Command]
name    = "KongouKokuretsuzanR"
command = ~D, D, D,~c
time    = 18

Code:
[State -1, Kongou Kokuretsuzan]
type       = Changestate
value      = 3700
triggerall = command = "KongouKokuretsuzan" || (command = "KongouKokuretsuzanR" && var(9)&448=448)
triggerall = statetype = S
trigger1   = ctrl

The above two achieves the Mugen-equivalent of:
Code:
name    = "KongouKokuretsuzan"
command = ~D, D, D, ~a + ~b + ~c
time    = 18

A wikipedia entry that I wrote: http://en.wikipedia.org/wiki/Negative_edge
Old and maybe conflicting info here: http://mugenguild.com/forumx/index.php?topic=7812.0


Many people risk their lives everyday by having Mugen.
Re: Negative Edge
#3  June 19, 2006, 11:50:58 pm
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
Since some fag wants to delete my Wikipedia article, I'm copying it here:

The term is used by Capcom and was introduced to fighting games by the first iteration of Street Fighter II and has appeared in numerous, if not all, fighters made by Capcom since then. The Guilty Gear fighting game series is also known to have this feature. Negative edge likely comes from the description of what happens at the hardware level when the technique is performed. When a button is pressed, and for the duration it is held, a positive charge is associated with the button. A positive edge, or when the button input registers a change from 0 charge to a positive charge, marks the first instance in time that a button has been pressed. A negative edge would then be detection of the release of a button, or when the button input changes from a positive charge to a 0 charge.
 
 It is slightly advantageous to use this technique since a combo can be performed in slightly less time than without negative edge. The example of a fierce punch (to be abbreviated as FP) then Hadoken, executed with FP, will be used. FP is pressed then, down, down-forward, forward, are pressed in succession on the arcade stick, and lastly, FP is pressed again. Now with negative edge. FP is pressed and held, the directional commands are correctly input and the FP is released. This results in a decrease of one whole key press.
 
 On the other hand, negative edge is sometimes viewed as an annoyance. Keys may be inadvertently held, a directional command that would correspond to a special move is input and situations change quickly enough that move isn't desired to be performed, and is executed when the button held is inadvertently released. None of the previously mentioned games have a switch to turn on or off such a feature, so players who'd want to play without it, do not have the option.


Many people risk their lives everyday by having Mugen.
Re: Negative Edge
#4  June 20, 2006, 06:28:16 am
  • ***
    • www.youtube.com/user/corntortillas

  • Online
What the fuck...

People don't have anything better to do than complain that Wikipedia isn't GameFAQS. 

Geeze, it's surprising how people can be such assholes.
Re: Negative Edge
#5  July 12, 2006, 04:32:02 am
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
There seems to be a glitch with doing this during hitpause.  Variables are not being updated when that happens.  Working on it at the moment.


Many people risk their lives everyday by having Mugen.
Re: Negative Edge
#6  July 12, 2006, 08:12:14 pm
  • ****
  • 君の事、マスターにしてあげる! 御願い、信じてマスター!♥
    • Philippines
    • Skype - o_hermanm
    • www.rotbrc.com
Hm. varsets and varadds should have ignorehitpauses then. And the CMDs should have ignorehitpauses as well.
Orochi Herman: MUGEN Creator, Producer and Web Programmer
https://www.facebook.com/OrochiHerman/
Re: Negative Edge
New #7  June 09, 2008, 03:03:53 pm
  • *
    • xhva.net
Be careful of operator precedence in the negative edge testing. Because of missing parenthesis in the example code above, it evaluates incorrectly:
     command = "KongouKokuretsuzanR" && var(9)&448=448

will actually test the equality ( = ) first, meaning it'll evaluate as
     Is 448=448 ?   Returns 1 (true)
     var(9)&1 ?   Returns 0 (false)

whereas if you use
     command = "KongouKokuretsuzanR" && (var(9)&448)=448

it evaluates properly:
     var(9)&448 ?   Returns 448
     Is 448=448? Return true

The mugen docs list operator precedence in expressions.html , about half way down. "=" is above "&".

I found this bug while modifying a character who had this code implemented -- I could trigger EX moves that required two punches by using any punch and light kick (which is stored as 1 in var(9), thus returning in any unfixed test). Subtle! Took me a while to grok this. I thought I was going mad. :P

So in short, the following line will work:
     triggerall = command = "KongouKokuretsuzan" || (command = "KongouKokuretsuzanR" && (var(9)&448)=448)


Edit: Note this also applies to http://mugenguild.com/forumx/index.php?topic=7812.20 . Should I post there too?
Last Edit: June 09, 2008, 03:25:50 pm by xhva