Mat@MDickie.com
Wrestling MPire: Moves














 


Adding your own moves to the wrestling games is perhaps one of the most exciting prospects. However, you may be disappointed to discover that it's also the hardest! The visuals in a game go far beyond a mere "animation". There is just as much code that brings it all to life and makes it mean something. You'll have to get your head around that in order to make your own moves work properly. This tutorial covers the basics...


Source Animation
This tutorial assumes that you've already created the animation in question. There is no time to go into that here. However, I did document my thoughts on the animating process in this article from 2006. You may want to glance at it before you consider making your own. You can also find the original animation files in the Graphics section of this site. Whatever you create, it's important to export the 3DS file to the game's directory so that it has access to it. The default ones are located in "Characters/Sequences/Moves". If you're adding one or two little moves to a file that already exists, you don't need to worry about this first step. However, if you're intent on creating your own separate file full of new animations, you'll have to make sure that the program is aware of it. You must open up Anims.bb and make a new entry in the LoadSequences( ) section show above. Simply copy the way previous animation sequences have been referred to, but remember to change the number inside pSeq(cyc,???) to something unique. You should also enter the correct file names of your new creations (I have used "Custom_Execute.3ds" as an example). Remember there are TWO sides to every move animation - the "execution" of the move and the "receiving" of the move...


Specific Frames
Once you're clear about where your animations are located, you need to get specific about which frames are relevant to your move. Load up Moves.bb and at the top you'll see all the animations being processed by LoadMoveSequences( ) function. This is what happens before every match when the characters are loaded into the game. It puts considerable strain on the game's loading time and performance, so you shouldn't add lots of animations arbitrarily. You'll notice that most of the moves are preceded by the MoveRequired( ) function. This surveys the scene to see if the animation needs to be loaded up at all (because if no wrestler has it in his arsenal, it doesn't!). I've excluded it from this example, but if you end up adding lots of moves you should reinstate it to be used with each move's unique ID. To get started on your first move, the most important thing is that you use ExtractAnimSeq to load in the frames of your animation. Each separate animation is assigned to the variable called pSeq(cyc,???) - complete with a unique number inside. Those of the 2 you will add should carry on from the previous one (466 and 467 respectively in this case). Notice there is one for the "execution" of the move and another for "receiving" it as a victim. The reference to pSeq( ) at the end is the SOURCE animation we talked about in the previous step. Make sure these numbers correspond to the numbers you assigned to your 3DS file. The two numbers in the middle of the line are the frames at which your particular animation starts and ends. Revisit your animation and check what these are if you didn't notice them. It's important because these are the frames of animation that the game will pull out and associate with your move...


Preparing To Program
Once the game has a handle on your animation, it's time for the real work to begin! It needs its own chunk of code in the program in order to be used. It's not advisable to start from scratch, so scroll down to the MoveAnims( ) section of Moves.bb and pick out a move that resembles your own. If you choose wisely, this will save a lot of work later. Simply copy all the code under that move's heading and then paste it down at the bottom of the list BEFORE the one reserved for the "Reversal Process" at the end...


Triggering The Animation
You should now identify your move with its own name and enter in a unique animation number where it says pAnim(cyc)=???. This number will forever be associated with your move. Notice that it bears no relation to the animation numbers you used at the pSeq(cyc,???) stage. This is because there are TWO animations ("executing" and "receiving") that go into any ONE move, so the number of moves will always be out of kilter with the number of animations. Bearing this in mind, alter the references to animA and animB at the top of your code to your executing and receiving sequences respectively. For your first move, they should be 466 and 467 as shown in the example. At this juncture, you'll also notice that it's possible to change the speed at which the move animation plays. 2.0 is the standard, but you may need to increase it or decrease it based on how many frames you used and what suits the move best. It's of no concern now and can be dealt with later...


Sound Effects
Those numbers are all the game needs to trigger the animation properly, so skip past the seemingly important Animate line and start taking a look at what else goes into a move. You'll first thing you'll notice are a bunch of sound effects that tie into the animation. These aren't exactly important, but we might as well get it out of the way. There are 3 main sounds - the "shuffling" of bodies touching, a "step" on the ground (pStepTim(cyc)=99 makes it play), and the "swing" of a body being thrown. You'll notice that each one is preceded by a reference to pAnimTim(cyc). As you'd expect, this refers to how far along the animation is. The number inside Int(??/pAnimSpeed(cyc)) should be the time you would expect it to play. Simply take a look at your animation and make a note of where you would expect to hear a step or a shuffle. However many frames in that is from the start is the magic number you're looking for. The steps and the shuffles aren't important and sound right anywhere, but it's important that the "swoosh" sound is timed perfectly. The number at the end of the ProduceSound( ) function also indicates how loud it should be. The default is 0 which is randomized around a regular volume. Anything beyond that is a specific volume ranging from 0.1 (quietest) to 1.0 (loudest)...


Reversals & Fumbles
After the sound effects, things start to get more interesting and important. If you think it should be possible to reverse your move halfway through, you can set the time at which this stands a chance of happening. Simply look back at your animation and clock how many frames in the key moment is. You then replace the number inside Int(??/pAnimSpeed(cyc)) with this. Fortunately, the ReverseMove( ) function then takes care of everything else automatically! A similar moment is when the move might fall apart, and that tends to occur around the same time with the BreakMove function. However, there are some extra details you need to feed into this function. The number in the middle after cyc and v tells us what kind of move it is. 0 means it requires skill, 1 means it requires strength, and 2 means it requires agility. Similarly, the number at the end indicates how likely a failure is. 1 means the move is very safe and easy, whereas 5 means it is extremely difficult to execute (i.e. a finisher). Take a look at how similar moves have been coded and consider using the numbers I gave those...


Mid-Air Manoeuvring
Next we move onto yet more things that can take place during the move. If you think it should be possible to change the direction of your move in mid-air, you should keep any references to the MoveTurn( ) function. This is also quite simple and does all the hard work for you. All you have to worry about is entering the correct number at the end, which is the speed at which it turns in a given direction. You may find 2.0 is too swift and 1.0 looks more realistic. You may also find it's turning in the wrong direction based on the orientation of the move, in which case you can reverse it by changing it to a NEGATIVE number. This tends to be the case for moves that fall backwards like suplexes. Similarly, the FindSmashes( ) function will find any items or bystanders that the move should be smashing into! There's no need to fiddle with this one. The reference to "limbs" in the middle is automatically figuring out whether the head or hips of the victim are overlapping with anything vulnerable. Incidentally, any references to v are a shorthand for "victim". If the perpetrator of the move is falling too, you may see a FindSmashes( ) function that begins with cyc to refer to him. The important thing is that you enter the correct times during which these things should take place. Notice it is a case of > and < instead of =. You need to look at your animation and figure out the times during which it should be possible to turn or bang into things...


Throw-Outs
A similar line you may see towards the end of a move is the risk of it spilling out of the ring. The MoveThrowOut( ) function deals with this. Again, you need to feed into it the two times during which this should be possible (usually only a brief period when the victim flies beyond rope height). At the end, there's also an important number to enter which helps the game understand what kind of move is causing the opponent to be thrown out. They are as follows:
1 = Thrown forward, feet first onto back (i.e. bodyslam)
2 = Thrown forward, head first onto back (i.e. chokeslam)
3 = Thrown behind, feet first onto back (i.e. suplex)
4 = Thrown behind, head first onto back (i.e. back suplex)
5 = Thrown forward, forward first onto front (i.e. press slam)
6 = Thrown forward, feet first onto front (i.e. suplex drop)
7 = Thrown behind, head first onto front (i.e. flapjack)
8 = Thrown behind, feet first onto front (i.e. reverse suplex)
9 = Thrown behind, sideways onto front (i.e. gorilla press slam)
10 = Thrown forward, sideways onto front (i.e. double lift)


Moment Of Impact
All of the above are luxuries for the perfectionist, so feel free to omit them at first. What is absolutely essential is the moment of impact that comes near the end of the code. Again, the timing needs to be right as you assess when the victim thumps to the ground and enter this number after pAnimTim(cyc)=???. There's then a special MoveImpact( ) function that does most of the hard work for you - but not all of it. There are 3 numbers you need to enter to help the game make sense of the move. The one at the end is simply a check to see whether weapons should be an issue or not. If the move uses the right hand at the moment of impact then your should probably set it to 1 to acknowledge that. Otherwise set it to 0 to ignore weapons. The larger number in the middle is a power rating that falls between 1 and 10 (though seldom below 5). This indicates how much damage the move should do to an opponent. A normal move should be 5, 6, or 7, whereas finishers tend to be 8, 9, or 10. The first number after cyc and v tells us what TYPE of impact we're dealing with and helps to emit the right sound effects, etc. The options are as follows:
0 = Attack impact (i.e. standing clothesline)
1 = Gentle slam/drop (i.e. bodyslam)
2 = Hard slam/drop (i.e. press slam)
3 = One body crushed against another (i.e. belly-to-belly slam)
4 = Head crush (i.e. stunner)
5 = Extreme impact (i.e. superplex)


Ending The Animation
Now all that remains is to make sure that the animation ends smoothly. Believe it or not, this is actually one of the trickiest parts! An error here can ruin the entire effect and prevent the move from blending into the action. First, you need to be sure that pAnimTim(cyc)>??? refers to the EXACT moment the animation ends. If the wrestlers have not finished moving by this point then their transition into a lying state will look jumpy. For the artist, it's also important that the shapes of the bodies are consistent with those of other moves at the end. As we shall see, move animations don't have the luxury of blending smoothly into the next animation so we have to cover the cracks ourselves. To do this, we have to call on my SharpTranstion( ) function. It's important that both ChangeAnim( ) and SharpTransition( ) both refer to the same animation as found in Anims.bb. They will normally be either 150 for lying on the back or 152 for lying on the front. In this case, the perpetrator of the move remains standing up with an animation of 0 and only the victim lay on his back with an animation of 150. The last number in the SharpTransition( ) function can also be important. This is the ANGLE that you want the person to end up at. 0 means their orientation is no different to when the move started, but you will often see 180 which means they have been tossed onto their backs from a suplex. -1 asks the game to assess the situation for itself based on the data in the animation file, but this is not recommended. The remaining number 1 that you see is a similar check that asks if you want to update the wrestler's location based on what happened in the move. We invariably do, so just leave it at 1. The final piece of code is a call to the EndMove( ) function which takes care of everything else for you... 


Adding To The Library
Your move is technically done at this juncture and all that remains is to look up the "Moves" section of Values.bb and make a new entry to the arsenal. First, you should increment the moveList(1) number to acknowledge that the list of moves has expanded. Then copy the last move you see in the list, remembering to update the n number to the next number along (73 in this case). n is a temporary variable I use to save myself typing out the same number several times! You'll often see it at the beginning of lines of code like this. All you have to worry about is adding the correct info for your move. The name you give it will appear in the editor to help people select it. The moveAnim( ) number on the end should be the same as the unique animation number your move had in Moves.bb (pAnim(cyc)=???). Remember this is NOT the same as either of the two numbers that were given to the fiddly little sequences with pSeq(cyc)=???! You should also stay away from the number 1 that we see in brackets on this list. We would normally change things like that, but here it identifies the move as a "standing" (i.e. regular) move and should not be changed...


The Next Step
Once all of the above has been taken care of, you should see your new move in the editor and can finally see how it looks in the game! Prepare to be disappointed though, because the chances of it being perfect first time are pretty slim. Both the code and the animation itself will needed to be tidied up over several sessions. But once you do get the hang of it, you may want to spread your wings and tackle GROUND moves in Ground.bb instead of the "standing" moves we've dealt with in this tutorial. You will find that these are mostly "submission" moves which work slightly differently and use twice as many animations. The principles are the same though, so if you copy an existing move it shouldn't be hard to adapt it to suit your own. You may also want to look at the top rope moves in Buckles.bb and even the double-team moves in Teams.bb! These are extremely challenging animations to produce, but the programming remains the same...

Copyright MDickie 2000 - 2010