YesNoOk
avatar

Your mugen coding quirks (Read 7737 times)

Started by Renzo F, September 07, 2007, 04:48:52 am
Share this topic:
Your mugen coding quirks
#1  September 07, 2007, 04:48:52 am
  • *****
    • Peru
This thread is about the quirks you use when coding. For example:

  • I define CLSN for throw animations, even if my character is invencible and can't be pushed in that state.
  • I ever indent the code like this to align the values or attributes:

[State 935, Cambio]
type         = ChangeState
trigger1      = (pos y > 0) && (vel y > 0)
value         = 52

  • Sometimes, I comment my code in Spanish, sometimes, in english.

What else do you have?
Re: Your mugen coding quirks
#2  September 07, 2007, 04:51:34 am
  • ****
  • Aka ShadesTeam/Zeckle
i make it so that every state and controller is numbered correctly
Shades 2 site:Shades of Manhattan
Re: Your mugen coding quirks
#3  September 07, 2007, 06:32:20 am
  • ******
  • [E]
    • Mexico
same things as renzo. also:

i make it so most of my code refers to the stateno variable instead of the actual state number, that way i only copy paste code and change the statedef and leave everithing else the same and it already works. all my chars share the same palette.
i make a big reference.txt file with all teh planed layout and even code moves that will never trigger.

and more importantly, i split my cmd in two.
the first part is full of varsets, for each and every condition that makes changestates trigger, so i have a varset for ctrl, another for statetype=A, another for statetype=S, etc...
the second part are the changestates, i only check for the vars i set before.
Re: Your mugen coding quirks
#4  September 07, 2007, 11:58:03 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
my cns although messy as hell (i don't number my sctrls accurately) always follows a logical progression with the sctrls in use

Vars, random stuff, hitdef then required to complete the move sctrls.

I also often try to code as much of a move as possible in one state, not sure why just do.

Last one would be what i refer to as coding blind, where you do the entire move without testing it until every little bit of code is fleshed out and all you have left is vel and time tweaking. If it works you have achieved success, i generally forget to add a changestate in the CMD though  ;P


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.
Re: Your mugen coding quirks
#5  September 07, 2007, 05:21:36 pm
  • *****
    • Peru
Quote
and more importantly, i split my cmd in two.
the first part is full of varsets, for each and every condition that makes changestates trigger, so i have a varset for ctrl, another for statetype=A, another for statetype=S, etc...
the second part are the changestates, i only check for the vars i set before.
== Easier AI commands.

Quote
I also often try to code as much of a move as possible in one state, not sure why just do.
I have the same "problem?". I feel like creating a State just for play an animation and then change to state 0 is forbidden :D

Other quirk I have is sometimes the state numbers doesn't match the animation or sprite numbers, and the animation number doesn't match the sprite group numbers. I doesn't really matter, but I'm a maniac and sometimes I take 1 hour to just order all that mess.

Bea

Re: Your mugen coding quirks
#6  September 07, 2007, 05:33:00 pm
  • *****
  • MUGEN Grandma
    • Brazil
    • www.smeenet.org
I insist in coding chains by setting bits onto an int variable in order to make clean cmd files.

My cmd files usually look like that:

;---------------------------------------------------------------------------
;Hazan Tensho Kyaku
[State -1, Hazan Tensho Kyaku]
type = ChangeState
triggerall = (var(55) & 16384)
triggerall = power >= 1000
trigger1 = (command = "Hazan Tensho Kyaku")
value = 3200

I deal with damage and juggle by using variables as well and most of the times, the anim id matches the state id, but it's not always the case.

I'm prone to use Animelemtime(number) = 0 rather than animelem = number.

And I code different strength attacks in the same state, using a variable which I set in the CMD to tell them apart, unless they behave way too differently.

That's all I can remember for now.


Princess Adora: "My friend saw She-Ra take her dress off in the shower. She said she has an 8 pack. She said She-Ra is shredded."

SF2NES is dead. Long live SF2NES.
Re: Your mugen coding quirks
#7  September 07, 2007, 07:05:46 pm
  • ******
  • [E]
    • Mexico
I insist in coding chains by setting bits onto an int variable in order to make clean cmd files.

My cmd files usually look like that:

;---------------------------------------------------------------------------
;Hazan Tensho Kyaku
[State -1, Hazan Tensho Kyaku]
type = ChangeState
triggerall = (var(55) & 16384)
triggerall = power >= 1000
trigger1 = (command = "Hazan Tensho Kyaku")
value = 3200

I deal with damage and juggle by using variables as well and most of the times, the anim id matches the state id, but it's not always the case.

I'm prone to use Animelemtime(number) = 0 rather than animelem = number.

And I code different strength attacks in the same state, using a variable which I set in the CMD to tell them apart, unless they behave way too differently.

That's all I can remember for now.




+1

Re: Your mugen coding quirks
#8  September 07, 2007, 08:39:25 pm
  • *****
    • Peru
I use custom juggle detection too, but it is completely f*cked up when playing Simultaneous modes and with P.O.T.S. duck hunt bonus char/stage :P
Re: Your mugen coding quirks
#9  September 07, 2007, 09:03:18 pm
  • avatar
  • ******
    • USA
I use totally random state numbers for the common1.cns states, so everything's messed up and there's almost no order at all :P, even some helper states aren't the same as the helper Id and all that shit...
Re: Your mugen coding quirks
#10  September 07, 2007, 11:06:57 pm
  • *****
  • Three times thicker font than a normal user.
I try to remain relatively organized. I have a list of all the animations and their respective numbers down in notepad.
Quote
Imagine a zanguief runing to attack ryu, ryu does a quick+kind of weak fast punch and hit the chest of zanguief, will this punch be enough to zanguief say/think \"oh no, this punch hurted a little, I better stop the attack and put my hand on my chest to help contain the pain while ignoring if ryu is going to make other attacks now"


Cenobite 53 said:
If someone isn't able to get girls laid, why buying this exorcist needing piece of retardet piece of bullshit an not wisiting his local red light district. For that money he could  :hump: tons of hookers.
Re: Your mugen coding quirks
#11  September 07, 2007, 11:14:49 pm
  • *****
  • Horrible
    • Sweden
    • http://network.mugenguild.com/anjel/
I forget to crop sprites ;P
And altso when i add sprites, i dont remember to change group, so the sff goes fucked up.
And i try to use less sctrls, so i use IfElse all the time.
My states a mess, random sctrls everywhere.
My shitty mugen stuff:
Re: Your mugen coding quirks
#12  September 08, 2007, 01:48:02 am
  • avatar
  • ****
States [1000,1999] are special attacks.
eg.
1000 - Weak Hadouken
1010 - Strong Hadouken
1020 - Fierce Hadouken
1030 - EX Hadouken
- Same layout for every other special except the hundreds go up. (Shoryuken uses 1100, Tatsumaki uses 1200 etc)
Obviously, I don't mind making several states for the same attack, because I just don't. Even if the Hadouken's have no distinguisable features between them, I make different states for different versions anyway.

States [3000,3999] are super arts.
Self-explanatory, tens go up if the Super Art has another version, hundreds go up if it's another Super Art altogether.

Projectiles (Hadouken, Shinkuu Hadouken) use [6000,6999].

As for .air, I have it all in order, so there's no [Begin Action 9000] before [Begin Action 500], etc.

As for .cmd, I've yet to be as organised as I am with the others because my .cmds are just full of crap when I write them. So crap to the point I can't even do EX Shoryuken without doing EX Hadouken. But this will be fixed soon, once I get off my arse and do something.

And vars, well, I don't want to get into that because I'm very inexperienced with them, so obviously I don't order them in any right way, just messed up stuff.
Re: Your mugen coding quirks
#13  September 08, 2007, 04:32:06 am
  • *****
  • Thanks and God bless
    • USA
    • ricepigeon.neocities.org
I always indent the code also.

another thing, dunno if this counts, is I always end up throwing in some joke comment in the statedefs. for example:

Code:
; Vegeta! What does the scouter say about Kikyo's Stateno?
[Statedef 9000] ;ITS OVER NINE THOUUSAAAAAANNND!!!!!!!!
movetype = H

and for the sctrls, I always end up naming them with brief descriptions. Helps me to remember what its supposed to do without having to look at the actual code:

Code:
[State 192, You're Screwed now, bub]
type = playsnd
trigger1 = (Anim = 190) && (AnimElem = 1)
value = 192,0
channel = 0

[State 100, What Goes Up Must Come Down]
type = VelSet
trigger1 = AnimElem = 7
y = 3.8

[State 111, Return to Ground]
type = PosSet
trigger1 = AnimTime >= 28
y = 0
Re: Your mugen coding quirks
#14  September 11, 2007, 05:50:41 pm
  • ***
  • Silence is golden. So go platinum.
    • addham2it.com
I just write a bunch of random numbers and hope it works.   :-D

Actually I keep everything ultra organized, and I've started specifying (via comments) exactly what each individual move is. I gribe about most Air Edit programs because they delete my comments! GRRRRR.
Bailan en la playa!
Re: Your mugen coding quirks
#15  September 11, 2007, 05:54:13 pm
  • *****
  • Horrible
    • Sweden
    • http://network.mugenguild.com/anjel/
I just write a bunch of random numbers and hope it works.   :-D

Actually I keep everything ultra organized, and I've started specifying (via comments) exactly what each individual move is. I gribe about most Air Edit programs because they delete my comments! GRRRRR.

Use Fighter Factory, it doesent delete your comments :D
My shitty mugen stuff:
Re: Your mugen coding quirks
#16  September 11, 2007, 06:52:56 pm
  • ****
  • "Moyashi tsuku shite yaru..."
I tend to revise my coding and remove unnecessary text, lines in state controllers, convert everything to the same syntax. It took me quite some time to work out a standard order for the parameters in HitDefs. Also I have many simiar quirks to others.
Re: Your mugen coding quirks
#17  September 11, 2007, 06:57:41 pm
  • ******
  • [E]
    • Mexico
oh yeah, since i starter coding when mugen was still being updated, i always put all the parameters for all sctrls, even if i am perfectly fine with the default value; mostly because default stuff could still change o na  newer version. that and not using deprecated trigger like animelem, same reason as above.
Re: Your mugen coding quirks
#18  September 11, 2007, 07:30:25 pm
  • ***
  • Silence is golden. So go platinum.
    • addham2it.com
Oh, here's another one. I'm working on 9 characters at once....... but I work on them in alphabetical order! Any time I start on a new section (like I'm currently working on gethit elements) I always start with Burnisha because she's the first alphabetically.. It's partially because my windows explorer automatically alphabatizes everything.
Bailan en la playa!