Optimized Super Armor Code

Started by Kensuke, December 01, 2007, 08:30:58 PM

Previous topic - Next topic

Kensuke

I was wondering what people consider their "optimized" super armor code...

I've seen many done before and I have my own way of doing it as well...

I just thought it would be good to see some other examples of super armor, how it was coded and what makes it different.
~Ultimate Kensuke of the True Lightning~

Real Bout High School Battle

Coming.....soon....

Cyanide

There's essentially 2 ways to do this.

One is with hitoverride.

The other is to override the default gethit states. (this kinda has the bonus of allowing you to use gethitvar(animtype) and take the hard hits properly providing super armour feel, rather than hitoverrides hyperarmour or else method.

There is no other official method of doing this although i suppose overlaying helper sprites onto an invisible character would be effective.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

Kensuke

can you explain overriding the default gethit states... I believe I've seen that most frequently in the more "polished" creations....

wheras my experiments with Hitoverride have been... somewhat not as pleasing...
~Ultimate Kensuke of the True Lightning~

Real Bout High School Battle

Coming.....soon....

Byakko

The gethit states are in the common1.cns file that is found in the data folder. It's used by everyone by default, hence why it's named common.
Overriding a state from the common states simply means putting states with the same numbers in your own cns file. As in, copy the states in the common1.cns, paste them into your own file, then modify them : you just overrode it.

As for this particular case, you override the gethit states by not changing the naimation to the gethit animations and sending your character back to his previsou state right after the first tick of the gethit state. (after the first tick so that it will be able to actually register that you got hit, and decrease your life)

Now, using hitoverride basically does the same, actually. Send your character to a particular state that has movetype = H (so that Mugen will register the hit and all), then send back to the previous state.

In the end, it's basically the same, in principle : you get hit, you go to a state that registers the gethit but doesn't display anything particular, then you go back to your previous state (make sure have said previous state be able to resume its action from where it was cut off)
Just that overriding the gethit states makes it feel a little "cleaner".
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.

Kensuke

Hmm i find when i use hit override that it sometimes just goes back to standing...


is there a certain amount of ticks you use? or what state would you use?

or rather how would you store the state consistantly so that you keep doing the move instead of fit going back to a standing state (a problem i consistently have)
~Ultimate Kensuke of the True Lightning~

Real Bout High School Battle

Coming.....soon....

Cyanide

value = prevstateno

Thats rather easy. Problem is working around the bugs within your original state like sparks and sounds. And only firing off the hitdef as many times as you actually need it.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

Kensuke

Hmmm.... I've also had the problem of my char's clsn2's disappearing... But I'll try making an example.. so it will be visible.
~Ultimate Kensuke of the True Lightning~

Real Bout High School Battle

Coming.....soon....

Bastard Mami

try coordinating your triggers using animelemnos or animelemtimes, so you are less prone to bugs; and if using super armor, don0't use velset or anim in the statedef.