Player Animations

Post Reply
DerSaidin
Site Admin
Posts: 89
Joined: 2009-08-27 21:49
Location: Brisbane, Australia

Player Animations

Post by DerSaidin » 2010-10-23 06:36

We now have a nice player model, mesh and texture. We need it rigged with a skeleton and animated so we can get it ingame ASAP!

The player model:
Image
Image
Image

Skeleton should be similar to the ones used in other idtech4 titles, or UE3.
Remember, Xreal can take player models in .md5mesh (idtech 4) format, or .psk (UE3) format.

Animations required:
- Movement
-- Walking
-- Running
-- Jumping
-- Falling
-- Crouched
-- Hit/taken damage
-- Falling (alive->wounded) & Wounded (lying on ground in pain, but still alive) & Dead
- Attacks (spell casts)
-- see http://www.dersaidin.net/weaver/concept ... ayers4.jpg
- Attacks (sword)
-- Drawing sword
-- Sheathing sword
-- Attacks (left->right, right->left, thrust, block/parry)

Variations for some animations would be excellent.

Attack animations should also work for hands in first person view.

Endoperez
Dev Team
Posts: 13
Joined: 2010-11-17 12:24

Re: Player Animations

Post by Endoperez » 2010-11-23 15:50

I've made preliminary walk and jump animations. They show up on the engine, but the character model shows up huge. Does the /testmodel bring the models in on the same scale the player character is supposed to be animated on, or does it bring objects in larger-than-life?

Also, I'm wondering when it'd be possible to have one "move forward" animation (char rot from camera facing and move forward), and the ability to have (at least one) animation that's played when a key is pressed. That'd allow the testing of walk and run, and attack/being hit/jumping/falling down/crouching etc etc.

I know basic scripting, but I'm not a programmer. If there's a simple character-control script/code file and an easy way to compile it, I can edit stuff myself. If it gets much more complicated than that, I'd still be able to rename files as needed so at least the keypress-keyed-to-animation testing would be possible.

P.S.
In case anyone's wondering, I've promised to rig and animate the main character. I'm not a very experienced animator, but I should be able to make at least placeholder-quality animations. Once the game is in a state where some sort of gameplay is possible and more people come in, if my animations suck you'll hopefully be able to find someone better. :lol:

Endoperez
Dev Team
Posts: 13
Joined: 2010-11-17 12:24

Re: Player Animations

Post by Endoperez » 2010-11-28 20:49

I've got the first working versions of the placeholder animations done. The character is already facing the right way! :lol: More importantly, I now can bring my animations to the engine and see how they look in the actual game.
Attachments
first_pass_animations.jpg
first_pass_animations.jpg (34.53 KiB) Viewed 8093 times

Endoperez
Dev Team
Posts: 13
Joined: 2010-11-17 12:24

Re: Player Animations

Post by Endoperez » 2010-12-03 17:36

Variations for possible menu images.
Attachments
testmenu4.jpg
testmenu4.jpg (27.41 KiB) Viewed 8071 times
testmenu3.jpg
testmenu3.jpg (29.18 KiB) Viewed 8071 times
testmenu2.jpg
testmenu2.jpg (25.47 KiB) Viewed 8071 times

Endoperez
Dev Team
Posts: 13
Joined: 2010-11-17 12:24

Re: Player Animations

Post by Endoperez » 2010-12-03 21:43

I now have placeholder animations for most basic movement animations, and now that I'm using the right exporter (the md5exporter available here) they work much better. :P I've worked a rough draft of the crouch walk, landing (after jumps), and step (turning in place to follow mouse movement) animations. I've also fixed the old animations - I had some trouble rotating the spine axis the right way, originally, and this resulted in pose flipping not working with spines. Once I got that fixed and had the spines rotated the right way, the spine's animation broke down. That's fixed now, so I'll have to get back to vertex painting and fix lots of minor and major issues. Fingers, armpits, shoulder area, hip area... they're all areas that commonly cause trouble. A single joint is generally easier to rig than an area where several bones interact. The one I'm most worried about are the little cloth flaps near the hips. I'll probably need some helper bones in there, and I'm not sure how I'll do those yet.

DerSaidin
Site Admin
Posts: 89
Joined: 2009-08-27 21:49
Location: Brisbane, Australia

Re: Player Animations

Post by DerSaidin » 2010-12-05 04:00

Nice work Endoperez, you've made a lot of progress, its great to see an animated player model working in game.

For the flaps, I agree, you need another bone for front and back (maybe more than one). I'm not sure if bones off spine1 or spine2 would work better.

Endoperez
Dev Team
Posts: 13
Joined: 2010-11-17 12:24

Re: Player Animations

Post by Endoperez » 2010-12-06 10:08

I managed to get by with two bones for the back flaps, and using the thigh bones for the front flap. The front flap is so small that it works like that. The back flap was also surprisingly easy, I used two constraints to have the bone copy the thigh's rotation but not go too far forward. Even my crouch_forward animation, where the back leg is very far back, works. :D

Endoperez
Dev Team
Posts: 13
Joined: 2010-11-17 12:24

Re: Player Animations

Post by Endoperez » 2010-12-06 14:24

Here are the basic movement animations. Besides the basic mesh file, there are animations for crouching down, moving while crouching, idle, jump and landing, running forwards and backwards (actually the same animation, but it seems to work...), and a little step for aligning with the camera. There are three versions of the step: step.md5anim (which is the only one that's used ATM), and step_right and step_left files, so that the animation is mirrored when the player turns the other way.
Attachments
basicmovement_06dec.rar
Placeholder movement animations
(205.33 KiB) Downloaded 448 times

Endoperez
Dev Team
Posts: 13
Joined: 2010-11-17 12:24

Re: Player Animations

Post by Endoperez » 2010-12-08 22:08

I started working on the sword stuff, trying to change the center of the sword object, testing which bones it should attach to and where those should be, etc. I got it imported without trouble, but exporting it back into a .md5mesh file is proving problematic. I can't choose which object the exporter exports! For a time, none of the animations worked and trying to enter map instantly crashed the game. I now suspect this was because the player model had been replaced by a sword, which didn't have the bones the animations tried to use.

Code: Select all

 # Export Mesh data
  
  meshes = []
  for obj in Blender.Object.Get():
    data = obj.getData()
    if (type(data) is Blender.Types.NMeshType) and data.faces:
      mesh = Mesh(obj.name)
      print "Processing mesh: ", obj.name
Blender.Object.Get() returns a list of all objects in scene.

I can write the name of the object I want to export to the code myself if no one wants to add an UI interface for that, but I'm not sure how I add it in Python. Would this work? My guess is in italics. edit: My guess is ** marked by stars ** since italics don't work inside code tags, heh.

Code: Select all

    if (type(data) is Blender.Types.NMeshType) and data.faces **and (obj.name is 'CharacterFinal01')**:
      mesh = Mesh(obj.name)
      print "Processing mesh: ", obj.name
Attachments
exportbug.jpg
This is when I realized something was up.
exportbug.jpg (17.1 KiB) Viewed 8029 times

DerSaidin
Site Admin
Posts: 89
Joined: 2009-08-27 21:49
Location: Brisbane, Australia

Re: Player Animations

Post by DerSaidin » 2010-12-09 10:33

Lol @ player in sheath !

I haven't done blender programming, that hack looks reasonable, but it also depends how the contents of your scene are structured.

Imo the sword should be a different file. Keep it in a separate file. You can import it and play with it (scale it, attach it for animations).
You should delete the sword (and any bones part of it) as part of your cleanup to export.
You can apply the same scaling to the sword in the separate model.

Endoperez
Dev Team
Posts: 13
Joined: 2010-11-17 12:24

Re: Player Animations

Post by Endoperez » 2010-12-09 13:24

I have to match the sword's center to the bones' positions and rotations. It takes few tries to find suitable positions, and I use some dummy objects in it. With dummy or two, the character and the sword, I need to juggle between three different scenes. I thought it would be simpler to edit the script, but I'm not that experienced with Python so that wasn't as easy as I thought. Still, I'll try to set up the default saving folder into the ../player/fallen and add the check for the object name. It shouldn't take long.

Any way, once I've found a position and rotation in which the sword works with the hand and the sheath, I'll export it once and then I won't have to touch it again except if I want to change its scale. I'll keep it around and use it to see how the animations work. Obviously it will only be in the Blender file and won't be saved into the .md5mesh or .md5anim files. If you think it shouldn't be there, I can remove it from any .blend files I'll send to you, but it doesn't matter IMO.

We haven't discussed the source files yet. I won't mind giving you the .blend when I'm finished, that will make it easier to edit any animations if there are any mistakes or things have to be changed. If you get a better animator, he might also be able to use my weight painting and/or rig as a base - if he wants to! :oops: :lol:

Endoperez
Dev Team
Posts: 13
Joined: 2010-11-17 12:24

Re: Player Animations

Post by Endoperez » 2010-12-20 21:09

I've been a bit sick lately, and haven't really had time to work on this any further. I'm not sure if I'll have a computer during the holidays, either. I'll probably have more free time in January, though.

Merry Christmas for all!

Post Reply