• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
TheComet

Physics and Animation (3D)?

5 posts in this topic

I've little experience with physics simulation, and was wondering what the best approach is to mixing skeletal animation with physics along with some procedural animation.

 

It occurred to me that animations aren't bound to the physical limitations a ragdoll (for instance) would enforce. That is, an animation can very easily create infinite amounts of energy, which basically ends up destroying any purely physically simulated object on contact. An example of this behaviour can be observed in Skate 3.

 

I'm trying to simulate something like what Nintendogs did, where you can pet an animal with the mouse cursor. I want to support things such as moving an arm into a certain position, then have the pet stay like that, all while having the pet react to other physical objects. On top of that, the pet plays various animations blended together with procedural animation.

 

My approach would have been to use some form of PID controller to generate force inputs for the physics engine, depending on what the skeleton should be doing, and what it actually is doing. This would mean the pet would be a full ragdoll, and the animation would only influence the way it moved.

 

Would this be the best approach? Is there a library that already handles this? Can someone perhaps point me to some useful articles on the subject?

Edited by TheComet
1

Share this post


Link to post
Share on other sites

That's a very interesting subject and I'd also like to know more.

I tried a very similar approach, but the results weren't satisfactory. For chain of joints, it was either lagging behind animation or oscillating too much, depending on how I tuned the (kindof) pid controller. I tried Bullet's joint targets, applying impulses and applying forces and it just didn't feel right.

I believe you have to fake the effect using something simpler. My idea would be: for non-ragdoll modes, have some sphere sensors in physics world and then use them to modify the pose with some inverse kinematics. For example if a wall is pushing the character from the right, detect how far it is and move the arm accordingly, while applying a pushing force to the bodies. This is NOT really a generic solution for what you want, but many effects could be faked this way.

Another thing is having ragdolls smoothly transitioned from animation. Of course it's important to sample not only anim positions, but also velocities of the bones. And to make the transition smooth, I'd keep both animation and ragdoll simulated at the same time and lerp between them. If the transition is fast, this should look good.

Looking forward to more ideas! 

 

0

Share this post


Link to post
Share on other sites

In my experience it's very hard to get nice looking procedural animations. For something like a pet simulator, I don't know that you would even want to use physics outside of solving joint constraints.

 

In general the way you would do it would be to generate an animation driven pose (from mocap or hand keyed data), use IK to retarget some joints (like a puppy reaching his paw to shake where you touch the screen), physics would then generate a second pose solving for collisions and constraints as best as possible. You could then blend between these poses when it makes sense.

 

I'm not sure that Nintendogs would have even used physics at all (It's been a while since I played it, so I'm speculating). You could probably achieve everything they did using IK. Obviously you need some logic to prevent overextending IK, but generally this is better than relying on physics to solve it for you anyways.

 

In cases where physics is important (solving collisions between two animated characters) physics would solve the poses as a second pass (after generating the animation pose). While colliding you probably want to blend fully into the physics pose, if the pose becomes too deviated from the animation pose you can trigger the actor to fall down, and once actors are no longer colliding, you can blend back to the animation pose. Physics generally runs after IK.

 

The physics solver itself and collision handling is a huge topic in an of itself though. It's not a simple task, and even now, most games (even AAA) don't do animation driven physics on articulated figures (powered ragdolls), instead having either fully animated, or fully simulated (ragdoll) states.

0

Share this post


Link to post
Share on other sites
Agreed with the animation + IK approach.

I have used such systems on several games. (Used them, never written the IK systems, they seem like a massive undertaking.) Modelers build the IK constraints into their rigs, since that helps out everybody. Animators build the animations they want, and since constraints were added to the rig they can more quickly position the characters where they want. Animators then modify the joints they need.

Then when it comes to the game, you can specify an IK goal for a specific joint (such as the paw you described) and allow the IK solver to do the magic. Every engine I've worked with has allowed a weighted IK solver, so you blend the IK from 0 to 1 (moving from the animated paw position to the animation+IK position), then do your IK work, then blend back from 1 to 0 returning to the animated position.
0

Share this post


Link to post
Share on other sites

Oh, I forgot to mention, on my post about using Blender for games I gave links to some animation plugins I use. One of them is called BEPUIK, and the other is realtimeAnimation. 

 

http://www.gamedev.net/topic/653352-blender-for-making-games/

 

Seems like you want a mix of these two types of things, as well as rag-doll physics (rigid bodies). You'd have to use drivers.

 

http://www.youtube.com/watch?v=jHW7SwMVojs

 

I think you can bake physics animations to frames. 

 

http://cgcookie.com/blender/lessons/1-creating-rig/

Edited by Tutorial Doctor
0

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0