Study on Animation & Physics

AI(Attack, Chase, Flee, Formation) and Bullet collision integration


AI system - attack, chase, flee states added.
What is the best option for mobilize humanoid characters. Using forces? or velocities? At the first glance I uses forces to change unit direction and speed but It looked like vehicles. Humanoid characters seem to show better movement with changing velocity directly since they are kinematic. Need to research more. 

Bullet collision integration is done.
Kinematic rigid bodies are hard to handle. At the first try, I was trying to manually modify unit positions when the collision is detected by Bullet for kinematic rigid bodies, but at the end, I changed to combining 'Dynamic rigid bodies' and 'Ghost kinematic rigid bodies' and DOF6 constraints are built between dynamic rigid bodies and kinematic ones.

In the movie, body shaking artifacts are not very noticeable but actually this artifact very annoying to play game. Need to be solved.

Power Shot!


파워샷 구현 완료. 

화살이 관통하는 유닛을  화살에 btPoint2PointConstraint로 연결해 주면 구현 가능합니다. 화살 mass는 약 20.0 으로 설정하고 관성 모멘트도 큰 값으로 설정해 주었습니다. Constraint로 연결 후에 캐릭터의 랙돌을 활성화 하고, 초기 force를 화살이 날아가는 방향으로 크게 넣어 주었습니다. 

화살은 땅에 박히기 전까지(힘이 다하기 전까지) 경로에 있는 모든 유닛을 꿰어서 함께 날아가고 땅에 박히면 멈춥니다. 만약 벽이나 장애물이 존재한다면 그곳에 박히고 유닛들이 대롱대롱 매달려 있겠죠. 리니지 이터널에 보면 비슷한 기능이 있습니다. ( http://blog.naver.com/jungwan82/20148372151 이 페이지의 두 번째 동영상을 참고하세요.)

ToDo
* Getup : 만약 유닛이 사망하지 않았다면 쓰러진 후 일어나는 기능이 필요합니다. 랙돌 상태에서 원래 상태로 돌아오는 기능입니다.(Optional)
* 활쏘기 인공지능 : 플레이어가 컨트롤 하지 않는 인공지능 유닛들도 활을 다룰 수 있도록 하기. 능력치에 따라 명중률을 조정하는 것이 필요.

Ragdoll with Bullet Physics



Smooth Transition / Bone Masking / Dynamic Motion


애니메이션 간에 부드러운 전환.
본 마스킹 - 상하체 분리 동작
다이나믹 공격 모션

Smooth transition between animations.
Bone masking is to display walk/run animation for lower body and attack animation for upper body.
Dynamic Attack Motion is depending on the user input. Top right corner bar shows the user input from xbox 360 controller.
Model is from Mount&Blade released by TaleWorlds Studio.


Additive Animation 


상체 Additive Animation 완료. 오른쪽 스틱의 움직임에 따라서 상체가 회전하는 모습을 볼 수 있습니다. 두번째 컷인 사이드뷰에서 보면 상체를 90도를 회전하더라도 정점들이 비교적 자연스럽게 디폼됩니다. 이는 90도의 회전을 척추뼈와 가슴뼈가 나눠서 소화하기 때문입니다.

Additive Animation은 3D 저작도구에서 만들어진 기본 에니메이션에 부분적으로 추가 에니메이션을 입히는 기법을 말합니다. 추가 에니메이션 데이터는 프로그램에서 생성한 에니메이션 일 수도 있고, 혹은 기본 에니메이션처럼 저작도구에서 미리 만들어 논 에니메이션일 수도 있습니다. 저작도구에서 미리 만들어논 에니메이션을 입힐 경우에는 기본 에니메이션과의 차이를 구하는 과정이 추가로 필요합니다.

위의 동영상에서는 엑박 컨트롤러 오른쪽 스틱의 움직임이 '런타임에 발생하는 데이터'에 해당하고 '추가 에니메이션'은 프로그램이 생성한 상체 회전입니다. 이 방식을 사용하면 상체가 돌아가는 에니메이션을 3D저작도구에서 만들지 않더라도 모든 각도(이 경우 허리 유연성 범위 내)에 대해서 회전하는 에니메이션을 생성할 수 있어서 좋지만 숙련된 에니메이터가 직접 키를 잡아서 만드는 에니메이션 보다는 퀄리티가 낮습니다.

원거리 유닛의 공격 방향을 결정 할 때나 기병 유닛의 상체를 틀어 적을 마주보도록 할 때 혹은 탱크 포신의 움직임을 표현할 때 사용하면 좋습니다.

The left analog stick controls direction of movement and the right one decides the upperbody direction.

Using Ogre.

The model tribesman is from the game Mount&Blade released by TaleWorlds Studio(http://www.taleworlds.com). I love this game.


Animation Blending



엑박 컨트롤러 아날로그 스틱의 움직임에 따라서 이동 속도가 조절되면서 자연스럽게 걷기 / 달리기 에니메이션 전환이 이루어지는 모습입니다. 화면 우측 상단에 HUD가 현재 아날로그 스틱의 입력 상태를 보여줍니다. 

캐릭터의 이동 속도를 모델이 게임 월드로 로딩되는 시점에 걷기와 달리기 에니메이션 데이터를 분석하여 보폭을 구해 결정하기 때문에 풋 슬라이딩(발이 땅위에서 미끄러지는 현상)이 발생하지 않습니다. 또한 런타임에 계산을 함으로써 3D 저작도구에서 에니메이션 동작을 바꾸거나 프레임 수를 조정하여도 그 변화가 올바르게 반영됩니다. 

테스트에 사용된 캐릭터 스킨은 제가 좋아하는 게임인 Mount & Blade(http://www.taleworlds.com)에 등장하는 부족민 스킨이며, 걷기/ 달리기 에니메이션은 직접 제작하였습니다. 

Smooth transition between walk and run animations.
On the top right corner, HUD displays the current position of the controller's analog stick. Each motion is analyzed in run-time to calculate exact foot strides to minimize the foot sliding artifacts.
The used model 'tribesman' is designed by TaleWorlds(http://www.taleworlds.com) which released a successful game series 'Mount & Blade'      


Collision Detection and Ragdoll with Bullet Physics 

댓글

이 블로그의 인기 게시물