Jump to content

Loading individual .gla files for animations?


Dusty

Recommended Posts

Just an idea I had; would it be possible to code a field in the animation.cfg that allows for an animation slot to use frames from a different .gla file?

 

It would be an extra field that would default to the _humanoid.gla if not included. That way it would be so much easier to combine animation mods together, because you could put your animations in separate .gla files instead of having to always edit and merge with the _humanoid.gla.

 

I also think it would be cool if you could give SP models their own animation.cfg file just like you can give them their own .gla file...

therfiles and Cerez like this
Link to comment

Only way I know how to is with hex editing. Dusty's method would allow more things to be added that could be used by all characters.

So you're talking about multiple GLA files per character or NPC... @@eezstreet and I are planning to do something like this in JKE for a new facial.gla (using better, complete visemes & facial expressions).

Link to comment

Errr, no, this isn't what you described to me over IRC. :P

Anyway, I don't think it's possible at all for MP because of the weird way GLA is handled (mostly out of necessity)

SP is possible and maybe within the scope of OPENJK since animations.cfg is 100% handled on the engine as opposed to MP. Will not break save compatibility either.

Link to comment

Ok, maybe I lied, that bottom part is totally exactly 100% what you described to me on IRC. Hazard trooper has its own unique animations.cfg, go check it out.

Small unrelated note: hazard trooper animations.cfg has an animation in it which isn't defined in the code (BOTH_CROUCHSHOOT). If you ever watch a hazard trooper shoot, they stand up and recrouch abruptly, thus is why. Unfortunately fixing in OPENJK breaks save compatibility. Lazy, lazy untested programming. ._.

Link to comment
  • 2 weeks later...

Sorry, I forgot to clarify.

 

Basically what I meant was for you to be able to tell the game to use universal animations from different .gla files. That way, if I see a stance animation mod I like and a mod that changes walking animations that both use custom animation frames, instead of having to make a new  _humanoid.gla file that incorporates all of these frames, I could just put a few different gla files in the _humanoid folder and specify in the animation.cfg whether I want the frames for a specific animation (say BOTH_STAND2) to be loaded from a gla besides the standard _humanoid.gla. Maybe it's a silly idea but I thought it would be easier to combine animation mods this way.

 

As for the animation.cfg thing I was saying if you could give an SP model just a custom animation.cfg without it needing to have its own .gla file. Currently you need to copy the whole .gla over IIRC even if all you want is a custom animation.cfg.

Link to comment

Every GLM has to have a GLA it compiles against. So SP I'm sure each humanoid character could have a custom animation.cfg file based on the _humanoid.gla file.

 

Having new gla files where you can specify certain frames from them into a "multi-gla" cfg file seems doable-- as long as all of the GLA files use the same skeleton and contain all the bones used in the GLM file. Just requires some coding, yeah?

Link to comment
  • 2 weeks later...

I think it's an interesting idea, but my question to you is, how would this change stance mods? How does one establish precedence of one stance mod over another?

I think an even better idea would be to setup a structure like this:

Each stance mod would be composed of up to 3 files: a data file (mandatory), an animations.cfg (mandatory) and a GLA (optional). The data file would specify some stuff like which skeleton these animations are for and a few other things. These would probably go in a new ext_data folder, like ext_data/animations. The animations themselves could go in a different folder, like animations/_humanoid/your folder here

 

The current suggestion seems like some way to make animation modding more complex than it has to be. My idea makes multiple stance mods possible. But it's just a passing thought.

Cerez and Archangel35757 like this
Link to comment

I'd just put any additional animations for a given gla in a subfolder, e.g. models/players/_humanoid/_humanoid.gla/backhandstance.gla and models/players/_humanoid/animation.cfg/backhandstance.cfg, but that gets awfully close to the 64 character limit.

Link to comment

Because in my opinion the original GLA doesn't belong there. It's not a model of a player, it's an animation of a player.

Ok... I understand now. So I agree with @@DT85... there should be an "animations" folder on same tier as "models" folder. The "animations" folder would have subfolders for "_humanoid" and each NPC, etc.

 

...and coding changes should be made to load multiple GLA files found within a folder. Example:

 

../animations/_humanoid/*.GLA

 

Where *.GLA would be the list:

 

_humanoid.GLA

facial_lipSync.GLA

cockpits.GLA

etc.

 

------------------------

 

Also,

 

I would like to create a Trooper.GLA specific to troopers and elite soldiers-- which would be for non-force user NPCs and include new hand-to-hand combat (Krav Maga) moves (a la Jason Bourne style). These could all be made into a new _humanoid GLA for the player character-- but Trooper.GLA would be the subset for non-force user soldiers.

 

@@eezstreet -- I'm not sure how memory is handled for the GLA files. But if one _humanoid.gla file serves every humanoid model that is actively in a level... then we'd want to conserve memory and just manage what animations an NPC gets via an "animations.cfg" file, correct (e.g.-- we would not need another Trooper.GLA file... but only the trooper_anim.cfg file that would point to the correct animations in _humanoid.gla).

 

...and we'd want to make sure there are no duplicate animations (for a particular skeleton) across all the GLAs for that skeleton., yeah?

Link to comment

To maximize memory conservation you'd need to have a setup basically identical to what @@DT85 suggests. A set of base animations which is used by every model (weapon stances, running, jumping) with several animation "packs" like lightsabers, acrobatics, force, and probably several ones which are incredibly specific to cutscenes. JKA and JK2 are pretty wasteful when it comes to animation use here because their _humanoid.gla contains every animation that's ever seen in the game ever, even if it's just briefly seen in a cutscene. On the console ports they had to effectively cut the RAM usage in half (since XBOX has only 64MB RAM and the PC version requires 128MB minimum) and one way they did this was to eliminate these animations entirely in favor of pre-rendered cutscenes which were recorded on the PC version onto BINK videos, among other things.

Link to comment

There are specific cutscene.gla files that cover the whole of cutscene actors for each given cutscene, IIRC, no?

 

Well, not to break the _humanoid.gla into too many sub GLA files... I would think you'd only be able to remove 10% or less out to a different GLA. As the player character would need all the animations-- I don't think the _humanoid.gla contains any cutscene specific animations that you wouldn't want the player character to have as well... if there are some they are few (maybe some related to cockpit cutscenes).

 

We'd have to go thru the list to see what should be removed to go into another GLA.

Link to comment

JKA and JK2 are pretty wasteful when it comes to animation use here because their _humanoid.gla contains every animation that's ever seen in the game ever, even if it's just briefly seen in a cutscene.

Incorrect, there are per-level cutscene animations, BOTH_CIN_N, in _humanoid_levelname.

 

Oh, too slow.

Archangel35757 likes this
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...