Model Movement and Character Weapons

Blitz3D Forums/Blitz3D Programming/Model Movement and Character Weapons

Trip42(Posted 2005) [#1]
I have two issues that I'm working through for a fighting game that I'm working on. Hopefully someone can provide me with some suggestions so that I don't end up do hitting a wall down the line.

First, in my game one character might throw another character. The attacking character would have a "throw" animation and the receiving character a "being thrown" animation.

What I'm debating is if program should somehow move the model while the "being thown" animation is playing, or if the animation should show the model moving and then update the model position after the animation is over. In that case any idea how to determine where the end position is? And tips on syncing the throwing animation with the being thrown animation woudl be helpful.

Secondly, the fighters in the game should have the ability to pick up a variety of weapons. I'm thinking that I should build all of the weapons into my model (attached to the hand) and use different textures for each weapon. I can then make the textures alpha 0 to hide the weapon when the character is not "carrying" it. Does this make sense? Or do I need a slap upside the head?


Tom(Posted 2005) [#2]
This is one of the methods you mentioned, and probably more suitable for your game.

When animating, you really don't want to have to move the root bone of a meshh too far from the entitys 'pivot', not unless such an animation included the transition back to the 'idle' position e.t.c. Otherwise you'll get nasty looking warps.

If your character is thrown backwards, in -Z axis, I'd try animating the Z axis of the pivot of the mesh in my animating program, and use normal bone controlled animation for any X/Y axis movement.

Depending on how you're exporting to blitz, I'd cancel the pivotal animation (I don't normally ever export base/pivot info anyway).

In Blitz, if you animated it on the spot, you'd just see the character move up then down, and you'd apply Z movement manually to the entity itself. So when it's done being thrown, it transitions back to idle or whatever, and the position it's now at, is also the position of the pivot.

And advantage of using this method is you can control how far you want to throw a character. You could also do the Y axis movement in the same way, also offering runtime control of how high a character would be thrown.

Hope you understand some of that, it's hard to explain without some visual examples :)

As for weapons, build them seperately and just parent them to a hand or forearm bone. Won't take you a few minutes to figure out what rotation you'd need to apply to each weapon after parenting it to make it align nicely.

Catch me on Irc some time if you want to talk more abotu animating!

Cya
Tom

'Scouse' on irc.blitzed.org channel #blitzbasic

Or use CGI IRC
http://www.playerfactory.co.uk/irc.html


Trip42(Posted 2005) [#3]
Thanks Tom,

I will take your advice on animating the characters, however it seems like it could be very tricky getting the timing down if the model isn't moving at a constant speed.

Say one character picks the other up over his head, holds him for 5 seconds and then throws him down. In this case the model would move -z for some period (lifting up and over) 0z for 5 seconds and then +z (throwing forward). Should this be broken into separate animations? one for lifting, one being held and one being thrown?

Any suggestion on a data structure for storing this information. eg. what animation to play and how to move the model.


Next, I've read suggestions about parenting weapons to bones before, but I am having some trouble. First, I'm building my models in Milkshape, exporting as Milkshape ASCII files, importing them into Character FX to do the animating, and then exporting to .B3D files to use in the game.

After doing this if I call countChildren (or whatever it's called) it returns 1. It doesn't appear that my models retain their bone structure.

Anyone have experience with this tool set?

Thanks,
-Brian


Tom(Posted 2005) [#4]
CountChildren() only returns the child count of the specified parent entity, you'll need to do a recursive CountChildren() to find all the bones and their names e.t.c

Here's some routines from the code archives: (Beakers example is simpler)

http://www.blitzbasic.com/codearcs/codearcs.php?code=796
http://www.blitzbasic.com/codearcs/codearcs.php?code=787


Trip42(Posted 2005) [#5]
Thanks guys, I got the weapons system up and working. And for the most part the animations are working great. With one exception.

In my game world I have a box that the characters collide with. When the game detects a collision the character is supposed to climb onto the box. So I start the "Climb onto box" animation and move the character forward and up each cycle.

However blitz prevents the movement from occuring because moving the character to the new position on top of the box causes a collision which stops the model.

So... how is the best way to go about moving the model during the animation without blitz stopping the model because of the collision?

Thanks,
-Brian


octothorpe(Posted 2005) [#6]
How about simply turning off collisions between the model and box in question while the climbing animation is playing?


RemiD(Posted 2016) [#7]
About managing the turns/movements/animations of a character who is grabed/throwed, i would position/rotate the grabed/throwed character like the grabing/throwing character during the animation (so when you create the animation of your grabed/throwed character his origine must be at the same position with the same orientation than the origine of the grabing/throwing character), and once the grabed/throwed character has been thrown, use his origine to turn/move him again...