About Store Forum Documentation Contact
Donations:
327$/mo



Post Reply 
The Kingdom Of Soul
Author Message
Pixel Perfect Offline
Member

Post: #181
RE: The Kingdom Of Soul
Ha ... grin

I'm sorry to say that since the donkey died she's been carrying ore from the nearest mine but I'm sure she'll be back to normal duties once the villagers actually pay their bills wink
01-19-2015 03:50 PM
Find all posts by this user Quote this message in a reply
Dalmat Offline
Member

Post: #182
RE: The Kingdom Of Soul
hahaha, merciless system.

At least she doesn't worry about fingernails and what dress will she have tonight grin
01-27-2015 01:11 PM
Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #183
RE: The Kingdom Of Soul
I have taken a decision to halt any further development of my game for the time being. This is because I need to concentrate on adding a more capable animation control system in order to bring about the level of animation I require/desire in the game.

I am currently very happy with my procedural control system for 'In-place' animation clips (no overall root movement within the animation) for animations like walking, running, idle and other 'simple' base animations. The addition of an animation driven movement component to this ensures I get good foot movement for bipeds with no foot skating even whilst blending animations.

However, I would like to add the capability of handling root motion driven animation where the animation clip contains all of the movement data and is used to drive the animation for more complex animation sequences, something that a simple procedural static animation system would really struggle with.

I am realistic about this in as much as I only require a simplified system where I can add this type of animation control where required ... effectively switch between the two seamlessly. The complexities of a fully combined procedural and animation driven system lies in the interface between the two and is beyond the time available to a single Indie developer ... and probably my own design capabilities blushing

Having such a system will bring allow me to add more interesting background animations and vastly improve the production of detailed cut scenes, something I couldn't have achieved with the simplistic animation system I currently have, giving the game a more professional look and feel.

The arrival of my motion capture system in the near future will hopefully give me the ability to produce many more detailed animations and now seems like the right time to expand my engines animation capability in anticipation of that.

I'm looking forward to this new challenge and getting back to continuing the game itself smile
02-15-2015 11:53 AM
Find all posts by this user Quote this message in a reply
rstralberg Offline
Member

Post: #184
RE: The Kingdom Of Soul
Good luck with the challenge. I can fully understand the need for that and I guess everyone has struggle with same thing at some time. Its a complicated thing and needs quite much time to get somewhere.

Go for it smile
Cheers Roland
02-15-2015 12:48 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Zervox Offline
Silver Supporter

Post: #185
RE: The Kingdom Of Soul
Just to clarify, Are you talking about improving your physically stored animations or adding something like inverse kinematics?
(This post was last modified: 02-15-2015 02:51 PM by Zervox.)
02-15-2015 02:50 PM
Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #186
RE: The Kingdom Of Soul
Thanks Roland and nice to see you in here again smile

(02-15-2015 02:50 PM)Zervox Wrote:  Just to clarify, Are you talking about improving your physically stored animations or adding something like inverse kinematics?
Adding the ability to handle non fixed position animations where the animation itself is used to drive the controller using the root motion from the animation. This would only be used in specialized situations such as cut scenes and animations where complex motion is involved, as otherwise I can use my AI to move the character controller using standard 'In Place' animations as I presently do.

This, among other things, allows the animations to be choreographed to fit a scene before being exported and simply replayed within a cut scene. No path finding or direct AI control of movement required. In fact, within cut scenes, where the game engine and designer has complete control over the scene and there is no requirement for collision, I could get away with just placing the model in a static position with no character controller and running the animation if it were not for the fact that the bounding box will remain with the static position and cause issues with culling if it's not in the frustum.

The use of inverse kinematics in a full foot placement system would be really nice, especially given that Esenthel already provides an IK solver. However, having already experienced a colleague coding a solution for this some years back I'm a little reluctant to go down that road as it took him a long time to get 95% of the way there and then seemingly as long again to try to iron out the last 5% without ever quite managing to handle all the situations in a visually acceptable way. The devil really is in the detail!
02-15-2015 04:45 PM
Find all posts by this user Quote this message in a reply
Zervox Offline
Silver Supporter

Post: #187
RE: The Kingdom Of Soul
(02-15-2015 04:45 PM)Pixel Perfect Wrote:  Adding the ability to handle non fixed position animations where the animation itself is used to drive the controller using the root motion from the animation. This would only be used in specialized situations such as cut scenes and animations where complex motion is involved, as otherwise I can use my AI to move the character controller using standard 'In Place' animations as I presently do.

This, among other things, allows the animations to be choreographed to fit a scene before being exported and simply replayed within a cut scene. No path finding or direct AI control of movement required. In fact, within cut scenes, where the game engine and designer has complete control over the scene and there is no requirement for collision, I could get away with just placing the model in a static position with no character controller and running the animation if it were not for the fact that the bounding box will remain with the static position and cause issues with culling if it's not in the frustum.

The use of inverse kinematics in a full foot placement system would be really nice, especially given that Esenthel already provides an IK solver. However, having already experienced a colleague coding a solution for this some years back I'm a little reluctant to go down that road as it took him a long time to get 95% of the way there and then seemingly as long again to try to iron out the last 5% without ever quite managing to handle all the situations in a visually acceptable way. The devil really is in the detail!

Esenthel got an ik solver? or support for IK because it uses skeleton? wink

I found this interesting in that regard, haven't actually tested it, but nonetheless
http://www.quelsolaar.com/confuse/index.html
02-16-2015 04:38 AM
Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #188
RE: The Kingdom Of Soul
(02-16-2015 04:38 AM)Zervox Wrote:  Esenthel got an ik solver? or support for IK because it uses skeleton? wink
...

From Esenthel's own features page:

Animation
Inverse Kinematics, Forward Kinematics, Keyframe Animation, Skeletal Animation, Morphing, Facial Animation, Animation Blending

I believe support only extends to two bone joints but to be honest I've never looked at it in detail as I'd not given serious consideration to writing a foot placement procedurally supported animation system due to the complexity involved.

(02-16-2015 04:38 AM)Zervox Wrote:  ...
found this interesting in that regard, haven't actually tested it, but nonetheless
http://www.quelsolaar.com/confuse/index.html

This looks really interesting, I'd be happy to integrate an existing procedural animation system if it works well. Thanks for the link, I'd not come across 'Confuse' before. I'll look into this smile
02-16-2015 09:36 AM
Find all posts by this user Quote this message in a reply
georgatos7 Offline
Member

Post: #189
RE: The Kingdom Of Soul
Imo a full body true IK solution will be really hard to do in order to look acceptable/realistic.
On the other side foot placement might really be worthwhile to implement and will definitely improve the quality and feel of animations.

For a workflow example you might want to check the UDK implementation. Without looking to much into the details i think it splits the IK foot placement into two main cases, the standing and the moving. Especially the standing should be like, 2-bone IK to move the foot ankle to the ground level and align the footpad to the ground normal.

https://udn.epicgames.com/Three/UsingSke...llers.html

Under "SkelControlFootPlacement" title.

Quote:This is a special type of SkelControlLimb that is designed to place the feet of a character properly on the ground. You should attach this control to the foot bone of your character. A line check is performed each frame from the position of the hip bone to the position of the foot bone. If nothing is hit, the leg is not changed. If something is hit, the Effector Location for the control is set to the hit point, so the leg will bend to place the foot on the ground. Because the Effector Location is generated automatically, you cannot modify it using the widget in the control, but you can modify the Joint Target Location to get the legs to bend in the correct direction.

And Under "Foot Placement while moving" title.

Quote:One way to achieve foot placement while moving (and not just when standing still) is to take into account the offset (height) between the foot bone, and the animated ground level (which is usually represented by the Root Bone position). Now instead of moving our Foot Bone to where the ground actually is, we just add an offset to the Foot Bone, being the difference between the animated ground height and the actual ground height. Now the animation will properly lift the foot and follow the world. It will require a bit of interpolation, smoothing, and mesh offsetting love to look good, but it is a fairly simple solution to put in place and works fairly well. That system will also tend to lag a little bit as you are monitoring the ground level just below the feet. One way to improve this would be to look ahead where the foot would land, but that would require a more complex system in place which analyzes the locomotion animations to properly predict where the feet will land. Below are screenshots of the system prototyped using the Gears of War 2 code.

It has many good info in there. Also you might wanna check these as a visual guide, along the many others that can be found on YT i'm sure.
https://www.youtube.com/watch?v=XMzDFphnpEA (This vid especially looks really nice)
https://www.youtube.com/watch?v=XgtCi5Hu6MA
(This post was last modified: 02-17-2015 07:02 AM by georgatos7.)
02-17-2015 03:11 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #190
RE: The Kingdom Of Soul
(02-16-2015 09:36 AM)Pixel Perfect Wrote:  From Esenthel's own features page:

Animation
Inverse Kinematics
Yes, that's only limited to 2 bones smile

For 2 bones it's quite simple, engine's 'TriABAngle' function can be used to calculate the angle needed to set, and then apply it for example to 'skel.bone(..).rot.axis'

You can do a lot with just 2 bones.

This is the code that I'm using in one of my projects:
Code:
// hold two handed weapon
            if(TwoHanded(hand[HAND_R].weapon_type) && hand[HAND_R].hold && !hand[HAND_L].obj && hand[HAND_L].owner_slot)
            {
               if(InRange(sac.arm_lu, skel.skeleton().bones)
               && InRange(sac.arm_ld, skel.skeleton().bones))
               {
                  Vec org   =skel.skeleton().bones[sac.arm_lu].pos*skel.bone(sac.arm_lu).matrix(),
                      target=hand[HAND_R].hold.pos*hand[HAND_R].matrix;
                  flt a_len =skel.skeleton().bones[sac.arm_lu].length,
                      b_len =arm_ld_hand_length,
                      c_len =Dist(org, target),
                      angle =TriABAngle(a_len, b_len, c_len);
                  skel.bone(sac.arm_lu).clear();
                  skel.bone(sac.arm_ld).clear();
                  skel.bone(sac.arm_ld).orn.dir.z=1; // make it straight
                  skel.bone(sac.arm_ld).rot.axis.x+=PI-angle;
                  skel.updateMatrixChildren(sac.arm_lu);
                  Vec cur_dir=hand[HAND_L].owner_slot.pos-org,
                     want_dir=                     target-org;

                  cur_dir.normalize(); want_dir.normalize();
                  Matrix3 transform; transform.setRotation(cur_dir, want_dir, 1, -PI_6+Min(0, anim.strafe_yaw*PI_3));
                  skel.transformInWorldSpace(sac.arm_lu, transform);
               }
            }
that's just to give the general idea, and it's not a full tutorial sorry smile
02-17-2015 03:42 AM
Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #191
RE: The Kingdom Of Soul
Thanks guys for all the input on this. Regarding your comments georgatos7 ... I agree, I'm not really looking for a full procedural animation system (full IK) although I would love to explore and play around with one if I had the time. The 'Confuse' library does look interesting but comes with no documentation!

My main goal is to combine what I have now, which is procedural driven locomotion. with animation driven locomotion so I can use more complex animations and motions effectively.

However, as both you and Greg are pointing out, the introduction of some simpler IK could be very effective.

Thanks for the code example Greg, I'll look at that and experiment a bit. If I can get someway towards better foot placement then that's a goal well worth achieving in addition to my main goal. I'm sure there is a lot that can be done with just two bones and less to go wrong with a simpler system.

What I don't want to do is turn this into a major project that kills my game development for the foreseeable future as I suffer from a lack of available project time as it is!
02-17-2015 10:11 AM
Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #192
RE: The Kingdom Of Soul
I finally have Root Animation Locomotion up and running. I've not had a lot of time to devote to this recently and have also found this quite tricky; so it's been a somewhat frustrating endeavour!

This was something that I felt I really needed to have in my box of tools to handle animations involving more complex motion than just standard walking and running from A to B scenarios; where procedural motion control of statically located animations is quite adequate.

This uses the movement embedded in the animation itself to drive the motion of the character controller and model. The extraction of the animation motion is done in real time and seems to be efficient enough for the usage I'm likely to make of this.

This should be ideal for when I finally get my mocap system and am in a position to start churning out more complex animations. Great for adding detail to cut scenes and also for peripheral model animations where the characters are not expected to interact much with other game characters but perform detailed animations to enhance the realism of the scenes.

I've put a short video together demoing the system below:



04-26-2015 09:39 PM
Find all posts by this user Quote this message in a reply
rstralberg Offline
Member

Post: #193
RE: The Kingdom Of Soul
Looks really good. Wooh.. I have a long way to go smile
04-26-2015 09:45 PM
Visit this user's website Find all posts by this user Quote this message in a reply
RedcrowProd Offline
Bronze Supporter

Post: #194
RE: The Kingdom Of Soul
really neet, any chances you explain a little bit more what you've done here for those locomotion animation ? ( you can pm me if you don't want to spam this post )
04-28-2015 03:12 AM
Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #195
RE: The Kingdom Of Soul
Sure, the steps are basically as follows:

In order to control the motion of a character controller from the data embedded in the animation we need to extract the motion data from the animation.

The rotation is inherently there and can be left as there is no requirement to rotate the character controller. However, the horizontal displacement of the animated character from it's start position needs to be extracted from the animation.

The easiest way of doing this is to advance the animation each frame and using the root bone measure the displacement on the x and z axis from the start position in global space.

Things get a little more tricky as the animation will move physically with the character controller and so will be offset by the time the next frame comes around from the start position by the distance moved. So you need to recalculate the offsets each time and subtract these from the new animated root bone displacement to obtain the real global position for the character controller.

Once the target position is known, you can calculate the distance moved and, using the time delta value, the speed.

Using the current position of the character contoller and the new required position a vector can be constructed and normalised and then multiplied by the speed to obtain the velocity vector required to move the controller.

Prior to updating the CSkeleton matrix you need to reset the root bone position to it's start position in the animation to lock the animation position to the controller.

Once the animation completes then the start position in global space is reset to the current Controller position so that all motion from this point on is relative to the new position.

The vertical motion of the root bone also needs to be considered to deal with jump animations etc and needs to look at changes in the relative distance of the root bone from it's start position. This allows you to apply a vertical velocity component to the character controller if required for better collision control.


There are various alternate ways of extracting the data and utilising it to control the motion. It could all be done in local space and transformed to global space and the data could in theory be extracted once and stored in a lookup table and positional information extracted according to time with interpolation applied where necessary.

Due to complications with trying to do everything with one CSkeleton I was forced to use a second copy for the analysis and extraction and apply the changes to the first.

It may not be pretty but it works wink Hopefully this gives you a bit more insight.
04-28-2015 12:53 PM
Find all posts by this user Quote this message in a reply
Post Reply