[Gdc12] 언차티드3, 배틀필드3의 그래픽과 디아블로 3의 물리를 만들어낸...

Post on 08-May-2015

1.066 views 10 download

Transcript of [Gdc12] 언차티드3, 배틀필드3의 그래픽과 디아블로 3의 물리를 만들어낸...

강연자 소개 박민근(@agebreak)

네오위즈 게임즈 (야구의 신 개발중) NTL-inc - 드래곤볼 온라인 개발 엔씨소프트 – PlayNC 빌링 서버 개발

(http://agebreak.blog.me)

(cafe.naver.com/devrookie)

Diablo 3 Ragdolls

Erin Catto

How to smack a demon

I wanted to give Diablo the most awesome ragdolls ever!

Ragdolls in 3 steps

1. Content pipeline 2. Animation pipeline 3. Tuning

We need a content pipeline to author and tune ragdolls

Artist Tool Game Editor

A ragdoll is a collection of collision shapes connected to bones

Physics joints connect two bones

Cone Joint

Spherical Joint

Revolute Joint

Weld Joint

The ragdoll data is exported with the model

Maya export Intermediate File

(Maya Plug-in)

Ragdoll data is imported by the game editor (called Axe)

Intermediate File cook Run-time File

(Axe Game Editor)

Bones are sorted in parent-child order

struct Bone { int parent; int child; int sibling; }; #define NULL_BONE (-1)

Here’s how we compute model space bone transforms

// MS: model space // PS: parent space for (int i = 0; i < boneCount; ++i) { int parent = bones[i].parent; if (parent != NULL_BONE) transformMS[i] = transformMS[parent] * transformPS[i]; else transformMS[i] = transformPS[i]; }

Bones with bodies are active, the rest are leaf or intermediate bones

#define LEAF (-1) #define INTERMEDIATE (-2) int boneToBodyMap[BONE_COUNT];

Building the bone to body map

Ragdolls are tested and tuned in the Axe game editor

The model viewer has a mouse joint

Parameters and collision flags can be tuned

Animation triggers create ragdoll events

Ragdolls are a form of procedural animation

Inverse Kinematics

Ragdolls

Blending

Parent Space

Cloth

World Space

Interpolation

We use the ragdoll bodies to adjust the pose

model space keyed animation world space ragdoll

Leaf bones retain their relative pose

keyed animation ragdoll

Intermediate bones go to the bind pose

|A-C| = constant

B in bind pose B in animated pose

stretching

Update the actor bounding sphere using the bone transforms

actor transform

Ragdolls are spawned with care

Spawning in-place causes joints to stretch

Obtain the initial velocity from two world-space bone poses

𝑣 =𝑝2 − 𝑝1

∆𝑡

𝜔 =2 𝑞2 − 𝑞1 𝑞 1

∆𝑡

check the polarity!!!

Help, my foot is stuck in the floor!

Using sequential ray casts to get unstuck

Tune your ragdolls to improve quality

Don’t support heavy bodies with small bodies

failure point

Don’t overlap siblings

ouch!

ackkk!

Avoid long skinny bodies

Ragdoll effects add variety

Explosions are physically motivated

radial

linear

Explosions account for distance and facing

Gibbing never gets old

Partial ragdolls add flavor to living characters

Partial ragdolls are stabilized with partial teleportation

𝑥1𝑎 = 𝑥1 + 𝛼 𝑥2 − 𝑥1

𝑣 =𝑥2 − 𝑥1𝑎

∆𝑡

partial transform:

velocity command:

1

1a

2

𝛼

𝑣

풀버전 PT 들은 제 블로그에 올라와 있습니다.

(agebreak.blog.me)