LucasForums

LucasForums (http://www.lucasforums.com/index.php)
-   General Editing (http://www.lucasforums.com/forumdisplay.php?f=156)
-   -   NEW ANIMATIONS IN JKA/JK2 - HowTo (http://www.lucasforums.com/showthread.php?t=107116)

ASk 07-29-2003 10:15 AM

NEW ANIMATIONS IN JK2/JA - HowTo
 
New Updates are in red
Last update was at: April 1st 2004 - no, this is not an aprils fool joke :)



Disclaimer: use the process described here at your own risk. Authors are not responsible for any data loss / damage that may

occur as a result of following these instructions.

Any modification that wishes to use these instructions to create the animations for their mod MUST include the following in

the readme/credits file:

For JK2:
========= start paste =========

New animations in this mod were created using the skeleton made by Corto and the glaMerge program made by ASk. All rights for
these are reserved to the original creators.


======== end paste ============

For JA:
========= start paste =========

New animations in this mod were created using the skeleton made by keshire and the glaMerge program made by ASk. All rights for
these are reserved to the original creators.


======== end paste ============

New animations in JK2/JA



Your animation must have the base 'DaVinci' pose as first frame. It will be ignored during merge.


JK2:

The process is simple.

Get the .xsi skeleton from this link:

Skeleton
I think the link is broken now, does anybody have a mirror of that, so I can update

Make your new animations, and export this file as XSI.


Suggestion by Corto: Use only one animation per XSI, it will keep things more tidy.

Open Assimilate, add the XSI to it
Double-click the file, and check these boxes:

- Keep "motion" bone

- Create own skeleton

Add these bones to PCJ
- skeleton_root
- pelvis
- lower_lumbar
- upper_lumbar
- thoracic
- cervical
- cranium
- face


Set the scale to 0.64, origin to 0,0,24


Save the .car file, time to get dirty (and use the command line)

Run carcass.exe with the following command-line parameters:

-flatten path:\to\your\file.car

Now, time for the fun part.

(continue after JA instructions)
========= end of JK2-specific =====

JA:

The process is simple.

Get the .xsi skeleton from the OJP repository (how to access - http://www.lucasforums.com/showthrea...hreadid=119776):

Make your new animations, and export this file as XSI.


Suggestion by Corto: Use only one animation per XSI, it will keep things more tidy.

Use the .car file in the Modelling SDK released by Ravensoft awhile ago
Run carcass.exe with the following command-line parameters:

-flatten path:\to\ravensofts.car

Now, time for the fun part.

============= end of JA-specific ==

Get the glaMerge program, written by yours truly from

GlaMerge

Put these files in the same directory as the exe:

_humanoid.gla
your.gla

Run the program using

glamerge _humanoid.gla your.gla


Optional switches:

-o - Makes the program optimise the output, removing any redundant bone data. For the above animation, file size is 9.56mb without -o, versus 9.53mb with

-l - Makes the program dump the bone (hierarchy, bone names) data from both gla's. This will be appended to file named 'bone.log' (will be created if necessary)

If you specify both switches, the second one (in the order they were specified) will be ignored


It should prompt you for the output file name.

And wait a bit (a file with 2000 frames takes about 5 minutes on my CPU, and should take around 1-2 minutes on a modern one)

After it is done, just add the new animations to animations.cfg using this format:
Code:

ANIM_NAME        startingframe        framecount loopframe speed

For example:
Code:

NEW_ANIM        17278        40        -1        20
Do this for all the animations, remember to update the startingframe positions accordingly (first new animation should start

at 17278).

Now, the animations are ready to be played in modview.

Example:

New animation

For programmers:

To add support for them ingame, add the same name as you used in the animations.cfg in these 2 source files:

========== game\anims.h ============
Code:

typedef enum //# animNumber_e
{
//=================================================
//ANIMS IN WHICH UPPER AND LOWER OBJECTS ARE IN MD3
//=================================================
BOTH_1CRUFTFORGIL = 0,                //# G2 cannot have a reverse anim at beginning of file
.........
FACE_DEAD,                                //#
////////////////////////////////////////////
//
//  Add your animations here
//
////////////////////////////////////////////
NEW_ANIM,
//////////// end of example ////////////////



//# #eol
MAX_ANIMATIONS,
MAX_TOTALANIMATIONS
} animNumber_t;

========= eof of game\anims.h =========

and

======== cgame\animtable.h ===========
Code:

stringID_table_t animTable [MAX_ANIMATIONS+1] =
{
//=================================================
//ANIMS IN WHICH UPPER AND LOWER OBJECTS ARE IN MD3
//=================================================
ENUM2STRING(BOTH_1CRUFTFORGIL),                //# G2 cannot have a reverse anim at beginning of file
......
ENUM2STRING(FACE_FROWN),                                //#
ENUM2STRING(FACE_DEAD),                                //#
////////////////////////////////////////////
//
//  Add your animations here
//
////////////////////////////////////////////
ENUM2STRING(NEW_ANIM),
//////////// end of example ////////////////
//must be terminated
NULL,-1
};

======== eof of cgame\animtable.h ===========


Afterwards, refer to them ingame with the usual coding.

Enjoy.


P.S.: If you have any technical questions about the process, feel free to post them here, and I will try to reply to them to the best of my ability

Credits:

- ASk - coder of glaMerge

- Corto - creator of the JK2 skeleton

- keshire - creator of the JA skeleton

- Special thanks to Wudan and Razor_Ace


History:
- Fixed origin
- Updated glamerge program, updated instructions to reflect that
- Updated glamerge program once more, updated instructions
- Added bone reordering (to fix wrong internal bone order, providing the hierarchy is fine) to the program. Should produce correct animations now.
- Fixed an overlooked harcoded constant
- Implemented a hack around relativeness of gla format. Proper solution is recalculation of bone offsets, but that does not work at the moment :(
- "merged" info from keshire's post about JA animations. I hope he doesn't notice :P
New updates are in red

CortoCG 07-29-2003 10:27 AM

If you have some tech. questions about the .xsi file, which I doubt cuz isn't much more to tell, post them here. But, if you have question about animation stuff (like IK chains and keyframing, or using the animations trackview) pls, register at http://cortocg.com and post at the forums in the correct category. I'll reply as much questions as my knowledge allows me.

Cheers!

ChangKhan[RAVEN] 07-29-2003 12:46 PM

I only looked through your steps quickly, but I'll go through them in more detail (maybe try to make my own anim using your process). But it looks mostly right. Two things I see though:

The origin should be 0, 0, 24, not 0, 0, 30

Assimilate generates the animation.cfg based on the anims you have... do any of you have the original .xsi files and .car file? If so, you might be able to use your new XSI with our old ones (now that the skeleton matches) and build the skeleton properly, like we did...?

ChangKhan[RAVEN] 07-29-2003 12:48 PM

Also, depending on your project, you don't need *all* of the original XSI files (especially the cinematic ones or ones you're replacing).

ASk 07-29-2003 12:51 PM

We have neither, except the root.xsi which is in the SDK, and the .scn files, which are the raw version of root.xsi

As far as I know, the original XSI's are more than 700mb of data, and I do not know of anyone that has them either.

We do not have the .car file, rather, I looked at the bone structure and added the PCJ's manually, and the scale is taken from the humanoid gla.

This method generates a new .gla file, which is then merged. When I compiled test anims with carcass using command-line (to force -flatten, just in case), it did not generate an animations.cfg file)


Origin updated.


[edit]

This project's purpose is to enable modders to add new animations to JK2's humanoid gla (and from what I have seen, adding new animations to JA will be even more straightforward). I believe there are plans to strip all the non-mp related animations from the .gla, but that will be done using tools made by Wudan. However as it is now, this project adds new animations, it does not delete any.

ChangKhan[RAVEN] 07-30-2003 01:19 AM

Quote:

Originally posted by ASk
We have neither, except the root.xsi which is in the SDK, and the .scn files, which are the raw version of root.xsi

As far as I know, the original XSI's are more than 700mb of data, and I do not know of anyone that has them either.

I think we might be able to provide them, if someone was brave enough to try to use them and had enough space on their hard drive (would end up needing a couple gigs free at least, I think). I think James offered them to a few people before who were struggling with the anim problem when JK2 came out.

Quote:

Originally posted by ASk
We do not have the .car file, rather, I looked at the bone structure and added the PCJ's manually, and the scale is taken from the humanoid gla.
We could easily provide that, along with Assimilate.

Quote:

Originally posted by ASk
This project's purpose is to enable modders to add new animations to JK2's humanoid gla (and from what I have seen, adding new animations to JA will be even more straightforward). I believe there are plans to strip all the non-mp related animations from the .gla, but that will be done using tools made by Wudan. However as it is now, this project adds new animations, it does not delete any.
Well, you have to, at best, replace anims, unless you're going to do code changes, too, to add new animation slots.

ChangKhan[RAVEN] 07-30-2003 01:26 AM

Quote:

Originally posted by imyourfather
Finally, here it is

You'll need bink to watch it.

- I converted it to exe (to allow better portability) and put it on my site. Hope you don't mind

Wow, this is great! I can't wait to see some cool JA mods with new animations! And just in time for modders to get used to the process for JA, too! The JA skeleton is pretty similar to JK2, so the process should easily be usable for the new game. Maybe, CortoCG, we could work with you to get a JA skeleton ready for modders before JA even comes out?

:)

CortoCG 07-30-2003 01:41 AM

=)
 
Quote:

Originaly posted by ChanKhan[RAVEN]
Maybe, CortoCG, we could work with you to get a JA skeleton ready for modders before JA even comes out?
Great Mr. Gummelt! I'm in. I think ASk needs to work on his glamerger program too, so we'll talk to see what do we need to get the skeleton fully operational :) and mergeable animations for JA.
We'll let you know by posting in here.
Now, if you at Raven have another "plan of attack", I'm at your entire disposal, and I think ASk is too. You have my email, you have my website (with fully op. forums), so, let's get on it.

CortoCG 07-30-2003 05:48 AM

What we need:
 
Here is a list of things that ASk and me we'll be needing to make a ready-to-make-animations skeleton:

- the base humanoid skeleton with all the bones (if it doesn't have all of them I'll create them as I did with JO) you used for JA, in dotXSI.
- the humanoid animations file for SP and MP to look for the correct hierarchy and bone linking order.
- a humanoid Ghoul2 model to preview stuff, unskinned if you like, we don't need that.
- the .car file used to compile the humanoid animations file should saves us some time.
- the tools used to compile a new gla/glm combo: like the xsi exporter/importer, carcass and assimilate, to make correct dumps of the skeletons.
- any extra info on the tools or the gla transformation matrices you wanna add would be most welcome.

That's it I think :D.

P.S.: call me just 'Corto', Mr. Gummelt, everybody here calls me like that :).

ASk 07-30-2003 07:33 AM

Attention: glaMerge had been updated (again).

Changes:

Fixed behaviour when -o was not specified. Without -o switch, the program works much faster, but creates larger files.

Removed hardcoded values, program should now work for merging any 2 skeletons with same bone number (and order), as long as GLA format stays the same.

Fixed some of bone dump features

Several minor bug fixes added with parsing command line


Known bugs: if using -l switch to dump the hierarchy and origins (mxdaSkel_t data), origins have incorrect (albeit consistent) values. This does not affect the normal operation in any way.

tFighterPilot 07-30-2003 07:56 PM

It was still for 40 frames, the total length was 75 frames.

Anyway, I made a new one, which don't have problems, but less interesting (A normal kick)

What do you think?

ASk 07-30-2003 08:11 PM

Sorry for deleting all the posts, but the thread was going to be cluttered with non-related remarks. Only the posts that are related to currently active discussions are remaining.

Don't be mad at me, it's for the best :)

ASk 07-31-2003 05:08 AM

Since carcass is picky, and fixing bone order proved to be harder to do on the real skeleton, I finally got to adding bone reordering function to the glaMerge program.

If now, the hierarchy is the same, and bone in position 15 for original file (for example) is in position 50 for user file, the program will automatically rearrange the bone data to fit the same sequence.

This fixes quite a bit of weird bone 'bleed', and hopefully the program will work correctly now.


Do not forget to get the updated version (glaMerge 1.1b) from the link in the first post!

tFighterPilot 07-31-2003 11:19 AM

I redownloaded the file, and it's the exact same thing, and in the readme, it says 1.0b

CortoCG 07-31-2003 01:02 PM

For the record, that problem cannot be fixed with 3dsmax, I spent the whole night reordering bones and relinking the whole thing. It's impossible to have a bone in the last place of the list while it's children still are in the middle, it just sounds too esoteric. That's simply devil's work... Or a coder's ;). Anyway, seems like now it works fine thanks to the coding ability of ASk.

On the other hand I would like to hear a word from Raven's guys about that strange bone ordering contradiction, just for curiosity (I know curiosity killed the cat).

ASk 07-31-2003 02:24 PM

So I -forgot- to edit the readme, shrug

The version in the program is what matters

tFighterPilot 07-31-2003 02:56 PM

Sorry for that ASk, I thought it was the same version becasue it was in the same size.

Anyway, I'm so glad my animation is fixed now, I thought it was dommed. :D

I hope many others would also make beutiful animations. Too bad you have to replace them with something else, though it won't be a problem when making a whole new SP map.

ASk 07-31-2003 03:22 PM

Size of the executable should be exactly 65536 bytes
I updated the zip with the new readme and forced a cache clean, so to be on the safe side, redownload it

tFighterPilot 07-31-2003 03:33 PM

The previous thing I've downloaded was 1.1b.

I know it because :
A)It said so when I executed glamerge
B)The animation worked :)

I'll download it anyway, because of the readme

tFighterPilot 07-31-2003 03:35 PM

Would you send it to www.jk2files.com, so everyone could benefit from it?

ASk 07-31-2003 03:43 PM

I sent them a link to the tutorial as news post. If they choose not to pursue it, it's their choice.

tFighterPilot 07-31-2003 03:52 PM

I'm quite sure they will.

It's not everyday someone makes a program that can add animations into _humanoid.gla

reaper1576 07-31-2003 06:51 PM

i have a question about skeleton types are we still limited to a human skeleton as i could do with being able to uses a few differnt types

tFighterPilot 07-31-2003 07:02 PM

I just thought about that too, can we use the AT-ST skeleton?

Wudan 07-31-2003 07:58 PM

It wasn't a priority for Corto to make a good ATST skeleton because you can't really use those in MP ... and what else would you make an ATST do?

But I'm sure it's possible - anything is possible.

tFighterPilot 07-31-2003 08:16 PM

Dance!

:cowdance

tFighterPilot 07-31-2003 08:17 PM

Wait a second, all he does is dancing.

Ok, the atst skeleton is useless.

CortoCG 07-31-2003 08:35 PM

iamyourfather, since you're the only one interested very much on makin anims, why don't you join us at #jk2coding or #jkacoding on irc.quakenet.org?

reaper1576 07-31-2003 09:26 PM

corto i would be instrested in finding out more to you know where you can conatact me at the JODFMOD & DF2E Forums

CortoCG 07-31-2003 10:45 PM

Sure reaper, I'm still part of JODFMOD =).

tFighterPilot 07-31-2003 11:32 PM

I managed to change the run animation

Check that out!

He is supposed to run like a dancing russian, but his hands are in the default place, so he now seems like someone who realy realy needs to go.

ChangKhan[RAVEN] 08-01-2003 12:55 AM

Just and update for you guys, James saw these threads and he and I were discussing what we could do to get you guys what you need to make your tool set able to make animations for JA's humanoid skeleton. He or I will let you know as soon as we get it all straightened out...

CortoCG 08-01-2003 05:54 AM

Quote:

Originally posted by ChangKhan[RAVEN]
Just and update for you guys, James saw these threads and he and I were discussing what we could do to get you guys what you need to make your tool set able to make animations for JA's humanoid skeleton. He or I will let you know as soon as we get it all straightened out...
Thanks for the update.

reaper1576 08-01-2003 07:43 AM

Quote:

Originally posted by ChangKhan[RAVEN]
Just and update for you guys, James saw these threads and he and I were discussing what we could do to get you guys what you need to make your tool set able to make animations for JA's humanoid skeleton. He or I will let you know as soon as we get it all straightened out...
That would be brilliant that would help alot with projects

CortoCG 08-01-2003 12:44 PM

Quote:

Originally posted by reaper1576
corto i would be instrested in finding out more to you know where you can conatact me at the JODFMOD & DF2E Forums
Reap, man, I forgot to tell you, I'll be posting more in here so everyone can catch, and not so much in private forums. So if you wanna find out more about what ASk and I are working on, you'll have to stay tuned :D.

I'll post what's new on the team's forums :).

reaper1576 08-01-2003 02:43 PM

ok np thanks

CortoCG 08-03-2003 11:51 PM

Now the .zip file with the valid_skeleton includes the humanoid2.car file I use to compile new anims, that should save you a couple of annoying steps on the process.

You might have to modify the file internally to match your names and subdirs.

Anakin 08-04-2003 08:21 AM

Yippee!! I have now created my first animation, a few smoothing points to iron out, but its looks ok :)

Thanks to ASk and Corto for helping me last night :)

reaper1576 08-04-2003 09:41 AM

Corto i have a idea about the AT-AT we was talking about the other day you can get me on icq ill be on and off

BoBo_Fett 08-04-2003 02:29 PM

I made a new GUI for carcass based on the info in this thread.
In my program just click "on compile human model" browse for your .xsi and it'll generate a .car file for you and start the compile process. The output messages from carcass will be displayed in a window in the GUI.

There is also a dump GLM/GLA option.

note:
The program has to be in the same directory as carcass.exe

http://jedidreams.codealliance.ca/do.../carhelper.zip


All times are GMT -4. The time now is 10:06 AM.

Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
LFNetwork, LLC ©2002-2011 - All rights reserved.