What can be done? Blending animations and more

Feb 9, 2010 at 8:28 PM

Hi, I must admit I haven't really read through the tutorials, just tested them but I hope that is ok. I am currently creating my first 3d game, a small one and was wondering if Xen is something for me. Can Xen(from what is already built in of cause) blend animations? Meaning mixing bone transformation animation, like if a player runs and waves at the same time(if the running is one animation and waving another)?

How would one approach modelling(from a programmers point of view) if you want a charactre to hold something like the "Skinned Model Extensions Tutorial" from creators club? Can it be done?

I have read about shaders, models, meshes, some terrain making using heightmap and some animations and also custom content importer(for including bones from a .x file) so I have some knowledge but by using Xen I was hoping to be able to get the work done somewhat easier and without having to go that deep into these things, is that doable?


The game will not have a lot of objects, no fancy fancy shaders nor complex lightning(ambient and some directional light) but if possible some shadows. It will load static meshes, some models with animation data.

Thank you for reading everything and do help me shed some light on Xen and on XNA!

Coordinator
Feb 9, 2010 at 11:14 PM
Edited Feb 9, 2010 at 11:16 PM

Hi. The model format in xen supports simple weighted animation blending. In practice this is often perfectly adequate for 99% of animation blending problems.
You can actually see it in action in the animation stress test (Tutorial 20). Each character is blending the idle and walking/running animation.

Your example is actually one of the trickier techniques to pull off. In such a case, for a big budget game you might require quite advanced per-bone weighting of the animation (so you could weight the arm to the wave animation, instead of the run animation). Xen doesn't support this (for complexity reasons in the interface).

However, there are ways around it (which end up simpler, but less flexible) such as authoring the walk animation in two parts (upper body and lower body). It's then a case of weighting the wave animation, and fading out the upper body walk animation at the same time. Provided the wave only animates the upper body, it should look fairly seamless.
Of you can override the bone positions manually, if you are brave. :-)

As for bone position, this is also demonstrated. The advanced model animation tutorial shows getting the bounding box and world space transform of the bones in a character. This is the starting point you would use to attach an object to a character.

With the exception of the model format and particle system, xen is quite low level. For example, xen does not provide you with built in shadowing, etc (although there is a tutorial called shadow mapping, it is actually a demonstration of how a technique such as shadow mapping is achieved). It's design (out side of the model and particle system classes) is very much to provide a stable base to rapidly and reliably develop your code.

Thanks for getting in contact. :-)

Feb 10, 2010 at 5:01 AM

Thanks for a fast answer and a great one. I sort of took a really bad example for the animationblending since I forgot that you use upperbody movement when you run. In my game I will restrict myself from this I think, meaning that when blending 2 animations I will make sure that no the same two bones are use. If I understand you this is the best approach(for small project with limited knowledge/resources). I will take a day or two learning Xen and see if I can use it together with Riemers tutorials and so called recipes and hopefully Xen will make the development process a bit more easier.


Is the whole of Xen XBOX 360 compatible(except the WinForm that is)? Or are there some pitfall to be aware of?

 

Coordinator
Feb 10, 2010 at 9:30 AM

There are some very small things (eg, keyboard / mouse input) as you'd expect. And certain shader operations require special syntax, but otherwise it's 100% compatible.
Any method that is windows only will be marked [WINDOWS ONLY] in it's doc.

Feb 10, 2010 at 8:46 PM

Thank you for what seems to be a superb library and for your quick reply. Will be sure to let people you know of we use it and what the result is.

 

Feb 12, 2010 at 8:25 AM

Since I have done a lot of 2D before going into 3D I was wondering what approach one might take using 2D. Should one use the spritebatch object or DrawTargetTexture2D or?

Coordinator
Feb 12, 2010 at 9:45 AM
Edited Feb 12, 2010 at 9:45 AM

There are a bunch of 2D elements in Xen.Ex.Graphics2D, although they are not setup for use as game objects (they are more intended for things like laying out rendering passes,etc). They are quite heavy objects (making sure cameras are set right, dealing with heirachy, drawing exact number of pixels, etc).

XNA SpriteBatch isn't supported in xen (for a whole LOAD of reasons - sprite batch is a massive hack). However there is SpriteElement, which should give you similar flexibility and (hopefully) even better performance.

 Otherwise, for all other drawing, just make sure you are using a Camera2D (Element classes deal with the camera for you)