ATTN AnimationScripting Experts: Is dynamic scripted skeleta

Post » Tue May 08, 2012 4:24 am

Hi everyone,
I am currently evaluating the feasibility of an oblivion mod that uses the OBSE plugin concept to pump realtime skeletal animations into oblivion and apply them to a model. I am currently under the impression that in oblivion animation, we can only execute prebuilt animation sequences (using nifScope and scripts, i read http://cs.elderscrolls.com/constwiki/index.php/Basic_Animation_Tutorial). What I would ideally need instead would be the possibility to directly control the animation skeleton of an actor, so I am still hoping that this might even be possible?
Anyway, I already thought about a possible solution a little and came up with three possible approaches:

1) Direct Skeleton Control: What i mentioned above. Would need the ability to control each nodes relative or absolute Position in local coordinate space. Would be the best option. Maybe using OBSE memory manipulation or something equally funky :biggrin:
2) Using Mini-Animations. In theory, i could define all joint positions and then create a dynamic Group to get the State for one frame, but i think that is not feasible (huge number of combinations for each joint, plus I dont know if several parallel animations for all joints are possible in the same moment).
3) Building custom animation Facilities: It should be possible to create a dynamic model from single entities for each joint and animate these by moving them around. This way, we would have to create new entity models and it would also not look that great where joints intersect. But it would be possible, I imagine. I could even hack a prototype using Limb ellipsoids ecstatica-style (remember that one?).

So,
any one of you have some insight about this issue (preferably a positive statement towards option 1 or some even better and yet feasible idea :biggrin: )

Regards,

Paul
User avatar
Kate Norris
 
Posts: 3373
Joined: Mon Nov 27, 2006 6:12 pm

Post » Mon May 07, 2012 9:30 pm

This is not currently possible, no.

Further, making it possible seems... intense. I don't believe Oblivion has any facility by which it can do this; all skeleton operations are handled by the .kf animation files, which are loaded when needed and used. In theory, someday NifSE may allow the modification of animation files, but that isn't the same as direct skeleton manipulation. I'd expect that it's theoretically possible to write an OBSE plugin that can do this, but it would probably need to change/rewrite/add to Bethesda's code in a lot of places, making it practically impossible.
User avatar
Sabrina Schwarz
 
Posts: 3538
Joined: Fri Jul 14, 2006 10:02 am

Post » Tue May 08, 2012 8:23 am

Hi DragoonWraith,
and thank you so much for your answer, i image you are one of the go-to guys with this question. Due to the Filesytem approach of OB nif data loading it would disqualify for a realtime approach (and therefore sadly also NIFSE).
One thing i could check would be if OB can stream NIF data but i am afraid it wont - do you have insight on that?
Regarding your thoughts about the feasibility of still adding direct skeleton manipulation as a new feature (to OBSE maybe?):
As i have no insight into the engine innards of OB all i think is speculation , but i am currently doing work in the OGRE engine and if OB uses the same basic concepts, the point of entry could reduce to a single location, making this endeavour a little simpler:
OB seems to have an internal scene graph that each frame (during frameloop) should be
- modified by the engine subsystems during their servicing (i.e. the anim subsys writing final limb positions or the displaced mesh to the respective nodes in the graph)
- rendered afterwards.
At least that would be my naive insight into common engine architecture. If that were the case, we would have to hook into the point in execution between the two steps and overwrite the scene graph nodes with our realtime data before the scene graph is rendered.
I don't know if OBSE already hooks into the render loop of OB, would be a important stepping stone. Second we would need the hook to be in the specified place and have knowledge of the structure of the in-memory representation of the scene graph. That might even be the NIF format, as i read that a NIF is essentially a snapshot of that (at least i read that in one of the niftools docs). The target graph nodes would only need changed coordinates, so there should be no change of the in-memory data length to complicate things.
I would love to hear Timeslips opinion on that (regarding OBSE and hooking especially). Would be a really sweet hack, but reality might just be that much more complicated.

Regards,

Paul
User avatar
Robert Jr
 
Posts: 3447
Joined: Fri Nov 23, 2007 7:49 pm

Post » Mon May 07, 2012 11:36 pm

Hi DragoonWraith,
and thank you so much for your answer, i image you are one of the go-to guys with this question. Due to the Filesytem approach of OB nif data loading it would disqualify for a realtime approach (and therefore sadly also NIFSE).
I agree, yes.

One thing i could check would be if OB can stream NIF data but i am afraid it wont - do you have insight on that?
I believe that Oblivion does maintain an internal representation of NIFs, but the details are not well known to me (or, I believe, to anyone). It's probably at least somewhat similar to what Niflib offers, but probably different enough to cause headaches. How it will respond to attempts to modify it, I have no idea. I've never worked with it directly (I'd like to, but it'd take more decoding and rewriting than I'm prepared to do).

Regarding your thoughts about the feasibility of still adding direct skeleton manipulation as a new feature (to OBSE maybe?):
Almost certainly would have to be a plugin project, rather than part of OBSE itself. I'm not aware of anyone working in this direction.

As i have no insight into the engine innards of OB all i think is speculation , but i am currently doing work in the OGRE engine and if OB uses the same basic concepts, the point of entry could reduce to a single location, making this endeavour a little simpler:
Hmm... Similar, yes, I'm fairly certain. Unfortunately, I don't know these technical details. Scruggsy or JRoush would probably be the ones most likely to know these sorts of details, I'd think. Possibly IanPatt; I'm not sure how much he remembers of Oblivion, though, since he hasn't worked on it in a while.

OB seems to have an internal scene graph that each frame (during frameloop) should be
- modified by the engine subsystems during their servicing (i.e. the anim subsys writing final limb positions or the displaced mesh to the respective nodes in the graph)
- rendered afterwards.
At least that would be my naive insight into common engine architecture. If that were the case, we would have to hook into the point in execution between the two steps and overwrite the scene graph nodes with our realtime data before the scene graph is rendered.
I don't know if OBSE already hooks into the render loop of OB, would be a important stepping stone. Second we would need the hook to be in the specified place and have knowledge of the structure of the in-memory representation of the scene graph. That might even be the NIF format, as i read that a NIF is essentially a snapshot of that (at least i read that in one of the niftools docs). The target graph nodes would only need changed coordinates, so there should be no change of the in-memory data length to complicate things.
I would love to hear Timeslips opinion on that (regarding OBSE and hooking especially). Would be a really sweet hack, but reality might just be that much more complicated.
I'm reasonably sure that OBSE does not hook the scene renderer. OBGE... probably does? But I'm not sure of the details on that. Timeslip would be a great resource here, I agree.
User avatar
mimi_lys
 
Posts: 3514
Joined: Mon Apr 09, 2007 11:17 am

Post » Tue May 08, 2012 1:15 am

No, OBGE is just hooking the render-pipeline. The per-frame loop is rather opaque, I woudn't have any hope it can be understood completely in any way. You may understand sub-components, but not all of it.

It's true that Niflib is very similar to the engine. That's just because both are "just" different views of the same structure/functionality. It's just natural. Though I don't really think the concept of the engine gives the ability to do procedual animations. Too much inter-dependent pre-calculated datastructures. A nightmare to do on-the-fly.
User avatar
Erika Ellsworth
 
Posts: 3333
Joined: Sat Jan 06, 2007 5:52 am

Post » Tue May 08, 2012 9:36 am

No, OBGE is just hooking the render-pipeline. The per-frame loop is rather opaque, I woudn't have any hope it can be understood completely in any way. You may understand sub-components, but not all of it.

It's true that Niflib is very similar to the engine. That's just because both are "just" different views of the same structure/functionality. It's just natural. Though I don't really think the concept of the engine gives the ability to do procedual animations. Too much inter-dependent pre-calculated datastructures. A nightmare to do on-the-fly.
Yeah, that sounds pretty much as I suspected.
User avatar
naana
 
Posts: 3362
Joined: Fri Dec 08, 2006 2:00 pm

Post » Tue May 08, 2012 4:05 am

What about using the ragdoll physics instead? You could use various "grab" points in the actor body to manipulate it as needed.
User avatar
Rudi Carter
 
Posts: 3365
Joined: Fri Sep 01, 2006 11:09 pm

Post » Tue May 08, 2012 10:28 am

What about using the ragdoll physics instead? You could use various "grab" points in the actor body to manipulate it as needed.
Ragdoll physics only takes over when the actor is unconscious or dead, and I'm fairly sure that won't give enough control for what azrael wants.
User avatar
Epul Kedah
 
Posts: 3545
Joined: Tue Oct 09, 2007 3:35 am

Post » Mon May 07, 2012 10:16 pm

Ragdoll physics only takes over when the actor is unconscious or dead, and I'm fairly sure that won't give enough control for what azrael wants.
There is at least one mod for Morrowind (Vampire Embrace I think), that kills a NPC in order to make it's inventory accessible by the player. You can resurrect that NPC after the animation (that could break quests depending on the NPC, but maybe Azrael want to use it with an specific NPC).

The face animation would be a problem, but then you could use a copy of the NPC for the body animations and the NPC for the head (I think Deadly reflex uses a similar system for dismemberments).

Of course animating the body this way would be extremely complex, and prone to deforming the body, but IF various scripted hold points can be used, it would be a matter of finetunning.

I'm not saying this would be simple. What I am saying is that dynamic animations MAY not be impossible using ragdoll physics and without another alternative, investigating further on this option could be an option.
User avatar
Andrea Pratt
 
Posts: 3396
Joined: Mon Jul 31, 2006 4:49 am

Post » Tue May 08, 2012 6:44 am

There is at least one mod for Morrowind (Vampire Embrace I think), that kills a NPC in order to make it's inventory accessible by the player. You can resurrect that NPC after the animation (that could break quests depending on the NPC, but maybe Azrael want to use it with an specific NPC).
Yes, I'm aware, but there are issues with killing off some NPCs (scripts may be checking for NPC death and misinterpret what just happened). More important, though, is the control issue.

The face animation would be a problem, but then you could use a copy of the NPC for the body animations and the NPC for the head (I think Deadly reflex uses a similar system for dismemberments).
Yes, but the thing about dismemberment is that the limb or head in question doesn't have to be lined up with the body. If it does (as it would here), you have an almost-impossible scripting job on your hands.

Of course animating the body this way would be extremely complex, and prone to deforming the body, but IF various scripted hold points can be used, it would be a matter of finetunning.
The other issue is that I'm not sure of any way to actually grab and move hold points through script. That's probably relatively simple (as in, I can envision such a command being added by OBSE or plugin), but it hasn't been done yet.

I'm not saying this would be simple. What I am saying is that dynamic animations MAY not be impossible using ragdoll physics and without another alternative, investigating further on this option could be an option.
Way too many limitations, and I don't think you'll ever get it to look right.



azrael, depending on what you want done, you could try using a cutscene; we can make those, you know. Very under-used modding technique, but it may allow you around some limitations.
User avatar
Jessie Rae Brouillette
 
Posts: 3469
Joined: Mon Dec 11, 2006 9:50 am

Post » Mon May 07, 2012 10:24 pm

@Dragoonwraith, you had various really good points here. I had a very little grasp on animations, so, what I'm about to say may be really stupid:

Suposing you can use a dead NPC as an anim object and that you can use the same instance of an object as anim object for different animations at the same time (maybe I'm suppossing too much here), You could use invisible animated objects, using all of them the same body, as an anim object.

This way, the invisible objects would be grab points and deppending of the animation you give them, you would give a different movement to it's attached body part.

The same could be made with the head (the original actor with the body invisible), with the dead body with invisible head attached as an anim object by the neck.

As the original actor is not killed (only a duplicated dead body is added), no quest would be broken.
User avatar
Meghan Terry
 
Posts: 3414
Joined: Sun Aug 12, 2007 11:53 am

Post » Tue May 08, 2012 1:01 am

@Dragoonwraith, you had various really good points here. I had a very little grasp on animations, so, what I'm about to say may be really stupid:
Ignorance (not knowing the problem that makes something infeasible) is not stupidity until you refuse to fix it :)

Suposing you can use a dead NPC as an anim object and that you can use the same instance of an object as anim object for different animations at the same time (maybe I'm suppossing too much here), You could use invisible animated objects, using all of them the same body, as an anim object.

This way, the invisible objects would be grab points and deppending of the animation you give them, you would give a different movement to it's attached body part.

The same could be made with the head (the original actor with the body invisible), with the dead body with invisible head attached as an anim object by the neck.

As the original actor is not killed (only a duplicated dead body is added), no quest would be broken.
OK, the problems here are that within Oblivion, to the best of my knowledge, "ragdoll" and "animations" are mutually exclusive. An actor's motions are either controlled by animation, or by the ragdoll. If the actor is unconscious or dead, it doesn't run any animations. If it's not, then it won't ragdoll.

Also, another issue is that despite being invisible, the Havok ragdoll system will still see the "overlapping" body parts, and since it's a physics engine, it won't let two objects occupy the same space. You can force it with script, but then that disables the ragdoll.
User avatar
Josephine Gowing
 
Posts: 3545
Joined: Fri Jun 30, 2006 12:41 pm

Post » Mon May 07, 2012 11:43 pm

Ignorance (not knowing the problem that makes something infeasible) is not stupidity until you refuse to fix it :)


OK, the problems here are that within Oblivion, to the best of my knowledge, "ragdoll" and "animations" are mutually exclusive. An actor's motions are either controlled by animation, or by the ragdoll. If the actor is unconscious or dead, it doesn't run any animations. If it's not, then it won't ragdoll.

Also, another issue is that despite being invisible, the Havok ragdoll system will still see the "overlapping" body parts, and since it's a physics engine, it won't let two objects occupy the same space. You can force it with script, but then that disables the ragdoll.
One of those things that looks easier until one knows enough about it then :P .

By the way and going a little off topic, it's possible to attach an actibable object as an anim object to an actor? or more specifically, could a teleporting door be attached to a creature?
User avatar
Eoh
 
Posts: 3378
Joined: Sun Mar 18, 2007 6:03 pm

Post » Tue May 08, 2012 9:25 am

A teleport door is not typically animated, but generally, all animations played on an actor have to be a part of that actor. No "attaching" animations like that. You could have a creature that you can activate to teleport somewhere, I think, but it wouldn't be like, a part of the creature, it'd be just the creature as a whole.
User avatar
SUck MYdIck
 
Posts: 3378
Joined: Fri Nov 30, 2007 6:43 am

Post » Mon May 07, 2012 11:56 pm

A teleport door is not typically animated, but generally, all animations played on an actor have to be a part of that actor. No "attaching" animations like that. You could have a creature that you can activate to teleport somewhere, I think, but it wouldn't be like, a part of the creature, it'd be just the creature as a whole.
Thanks for the response :) .
User avatar
NAtIVe GOddess
 
Posts: 3348
Joined: Tue Aug 15, 2006 6:46 am

Post » Tue May 08, 2012 6:24 am

Hi again,
and sorry for not responding for quite some time, a very interesting discussion you have got going regarding ragdolling. Sadly, it looks like this wont be a viable option. I have one Question regarding

"but IF various scripted hold points can be used": With hold points, do you mean a skeleton? Would a human skeleton like from kinect sdk go into the right direction?

On the topic of direct hooking into the frame loop, thank you all for your share, frankly, that doesnt sound good.Still, this week, I checked around OBSE and OGE sources to get a feel for myself :flamed: . Regarding that, i stumbled upon the nitransformcontroller in NiControllers.h

// 040
class NiTransformController : public NiSingleInterpController
{
public:
NiTransformController();
~NiTransformController();
};

Does that mean that the class has no further methods (data class?) or just that we dont know them? Its the first time i saw the words RTTI ...
Would it be possible to hook/monitor the memory of the NiTransformController by hooking into the ctor or something and then get the memory locations of callers to identify the potential entry point to the frameloop? Then maybe we could disassemble their surroundings, I imagine that the controller is accessed every frame during animation output onto the scene graph.
User avatar
Elle H
 
Posts: 3407
Joined: Sun Aug 06, 2006 3:15 am


Return to IV - Oblivion