Lika products catalogue for wind generator industry - Japanese version
GameEngineSturctureWithAnarchy_kgc2013
-
Upload
harryhakhyun-kim -
Category
Technology
-
view
1.536 -
download
0
description
Transcript of GameEngineSturctureWithAnarchy_kgc2013
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
김학현
@shuaiharry
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
강연 대상
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
강연자 소개
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
강연 내용
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
시작하기 전에
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
게임 엔진은 뭔가요?
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
게임엔진
게임 엔진은 뭐지?
게임
윈도우 안드로이드 iOS
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
게임과 게임 엔진
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
게임 엔진 내 툴 활용
엔진은거들뿐
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
게임 엔진 툴의 예 – 애셋 변환툴
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
엔진과 프로젝트 성공의 관계
충동구매 X
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
엔진 < 프로젝트
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
게임 엔진은 어떻게 만들어질까?
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
Anarchy 예:IVFile
파일 입출력 엔진을 만든다면?
엔진리소스생성함수
게임
윈도우파일생성함수(CreateFile)
Android 파일생성함수
iOS 파일생성함수
스트리밍을할까?
(추후에변경가능요소)
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
엔진의 리소스 매니저 예시
리소스생성 기존리소스로드
아니요 예
리소스해지
예
리소스가있는가?
리소스요청(예: 3D 메쉬에관련된매터리얼데이타요청)
리소스가사용된지30초가
넘었는가?
특정리소스프레임업데이트(예)
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
엔진의 쉐이더 매니저 예시
HLSL 쉐이더작성
GLSL 자동컨버팅 HLSL 사용
아니요 예
해당플랫폼에서
HLSL 을지원하는
가?
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
실제 쉐이더 컨버팅 예시
float4x4 matWVP : register(c8);
struct VS_IN
{
float3 ObjPos : POSITION;
float2 UV0 : TEXCOORD0;
};
struct VS_OUT
{
float4 ProjPos : POSITION;
float2 UV0 : TEXCOORD0;
};
VS_OUT vs_main( VS_IN In )
{
VS_OUT Out;
Out.ProjPos = mul( matWVP,
float4(In.ObjPos,1.0) );
Out.UV0 = In.UV0;
return Out;
}
precision highp float;
struct VS_OUT
{
highp vec4 ProjPos;
highp vec2 UV0;
};
struct VS_IN
{
highp vec3 ObjPos;
highp vec2 UV0;
};
uniform highp mat4 matWVP;
VS_OUT vs_main( in VS_IN In )
{
VS_OUT Out;
Out.ProjPos = ( matWVP * vec4( In.ObjPos, 1.00000) );
Out.UV0 = In.UV0;
return Out;
}
attribute vec3 position;
attribute vec2 tex0;
varying highp vec2 xlv_TEXCOORD0;
void main()
{
VS_OUT xl_retval;
VS_IN xlt_In;
xlt_In.ObjPos = vec3( position);
xlt_In.UV0 = vec2( tex0);
xl_retval = vs_main( xlt_In);
gl_Position = vec4( xl_retval.ProjPos);
xlv_TEXCOORD0 = vec2( xl_retval.UV0);
}
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
멀티플랫폼을 고려한 개발
아나키 프로젝트 생성 스크립트플랫폼 별 프로젝트 파일 생성
엔진과 플랫폼 간의 레이어플랫폼 관련 코드 최소화
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
Anarchy 예:IVRenderNode
엔진 개발 워크플로우
렌더러인터페이스작성
윈도우렌더러작성 안드로이드렌더러작성
게임에렌더러필요- 엔진을만든다면
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
게임 엔진과 2D control
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
2D Control
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
2D Control
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
게임 엔진과 프로토타이핑
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
프로토 타입 만들기
꼭프로그래밍이필요하진 않음
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
엔진 샘플 분석 부터 시작해보자
© Copyright 1999-2013 Havok.com Inc (or its licensors). All Rights Reserved. All trademarks are the property of their rightful owners.
모바일 실행 vForge 실행
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
프로토타입 확인 요소: 그래픽
© Copyright 1999-2013 Havok.com Inc (or its licensors). All Rights Reserved. All trademarks are the property of their rightful owners.
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
프로토타입 만들기
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
게임 엔진 구현 방식
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
자주 사용 되는 패턴
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
게임 엔진의 한 프레임
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
게임 업데이트
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
아나키 엔진 업데이트 예시
© Copyright 1999-2013 Havok.com Inc (or its licensors). All Rights Reserved. All trademarks are the property of their rightful owners.12
OnUpdateScene
엔티티 별로 PreThink 를 통해 Customizing.
엔티티 별로 애니메이션 처리
애니메이션 업데이트 이후 Callback 호출
업데이트 시작 시 콜백 / 전역 게임 로직 처리
모든 엔티티를 돌면서 PreThink 함수를 호출
싱글 스레드로 물리 옵션을 변경 시 물리 처리
애니메이션 이후 콜백 호출
멀티 스레드(기본옵션)시 물리 시작
업데이트가 끝나면 콜백 호출
Vision::Callbacks.
OnUpdateSceneBegin
VisBaseEntity_cl::
PreThinkFunction
VisBaseEntity_cl::
HandleAnimations
VisionApp_cl::
OnUpdateAnimatonFinished
RunPhysics
FetchPhysicsResults
VisBaseEntity_cl::
ThinkFunction()
VisionApp_cl::
RunPhysics
Vision::Callbacks.
OnUpdateSceneFinished
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
게임 엔진과 개발 워크플로우
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
게임 워크플로우
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
C++ Source
아나키 워크플로우 및 배포:
Game
Plugin Create DLL(plugin)
Create Binary
PostBuildStep:
Copy plugin to
your project
Directory
PostBuildStep:
Bundle together
with resources
and deploy
Compiler’s
task
Compiler’s
task
APK
게임 워크플로우 예 - 아나키
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
게임 엔진 코드 살펴 보기
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
게임 엔진 코드 활용
코드만있으면못할게없다
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok. © Copyright 1999-2013 Havok.com Inc (or its licensors). All Rights Reserved. All trademarks are the property of their rightful
owners.
소스 코드를 어떻게 활용 할까?
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
게임 엔진과 디버깅
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
디버깅
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
게임 엔진 디버깅
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
디버깅 시간 절약
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
게임 엔진과 디버깅
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
비주얼 디버깅
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
테스트 도구
vFileServeAsset 변경시
디바이스에서 바로 확인
vRemoteInput터치 입력 or 가속도값을 PC에서 동작중인
게임으로 전달
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
게임 엔진과 게임 최적화
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
프로파일링 시각화
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
아나키 프로파일링 예
© Copyright 1999-2013 Havok.com Inc (or its licensors). All Rights Reserved. All trademarks are the property of their rightful
owners.
11
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
모바일 실행 파일 사이즈 최적화
© Copyright 1999-2013 Havok.com Inc (or its licensors). All Rights Reserved. All trademarks are the property of their rightful
owners.
12
Libraries .a Size
Vision Runtime 8.00MB
+ Engine Plugin 13.54MB
+ FMOD 15.20MB
+ Physics 36.79MB
+ Backward Compatibility 61.43MB
+ AI & Animation Studio 70.90MB
Libraries .a Size
Vision Runtime 8.00MB
+ Engine Plugin 13.54MB
+ FMOD 15.20MB
+ Physics 36.79MB
Libraries .a Size
Vision Runtime 8.00MB
+ Engine Plugin 13.54MB
+ FMOD 15.20MB
Vision Engine PluginlibVisionEnginePlugin.aLuaAndroid_Release.a
5.54MB
VisionBaselibBase.a3.79MB
Havok Physics Pl 1.73MB
Backward Compatibility(if needed)
libhkCompat.a24.64MB
Physics Utilities(Utils+Vehicle) 2.41MB
Visualize&SceneData 1.07MB
HavokAI
with Physics Bridge
4.17MB
Havok AI Pl
0.19MB
Fmod Engine Plugin 1.66M
Havok
AnimatioStudio(Behavior)
hkaAnimation.ahkbBehavior.ahkbInternal.ahkbUtilities.a
hkbPhysics2012Bridge.a
hkbScriptRelease.a
7.41MB
Havok Behavior Plugin
0.51MB
Common Base used by all ‘traditional’ Havok products.Not all libs are required all the times. That really depends on the customers needs, for Anarchy however we package all together.
Physics is comparable to the base (modular, based on the needs)
VisionlibVision.a4.21MB
PhysicslibhkpInternal.alibhkpCollide.a
libhkpDynamics.alibhkpConstraintSolver.a
libhkpConstraint.a
7.33MB
CollisionDetection 1.15MB
InternallibhkInternal.a
libhkGeometryUtil.alibhkSerialize.a
4.20MB
Havok BaselibhkBase.a
3.70MB
We also need some ‘Base Data’
(eg. shaders) which will
consume a few MB
(flexible size)
¹) The lib sizes together do not represent the real size of the executable, because the linker will just include the
required parts of the static libs. In fact the executables are much smaller! See ‘.so Size' for sample sizes. When
distributed, these .so file getting even more than 2 times smaller with the APK compression.
Offroad Sample
RPG Sample
Libraries .a Size
Vision Runtime 8.00MB
+ Engine Plugin 13.54MB
Libraries .a Size
Vision Runtime 8.00MB
¹) .so Size
5.90MB
7.06MB
11.60MB
17.20MB
¹) .so Size
5.90MB
7.06MB
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
아나키의 실행 파일 최적화 사례
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
게임 엔진과 서포트
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
서포트 변화
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
서포트 활용
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
아나키 서포트 예
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
게임 엔진 수정하기
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
엔진 수정
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
결론
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
끝으로 하나만 더!게임 프로그래밍을 공부를 하고 싶은 분들께
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
Python 기초
자료 구조 및 알고리즘
트레이닝 자료 – 비디오와 문서들
프로그래밍 기초 공부
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
프로그래밍 기초 개념
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
알고리즘 공부
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
참고 1 – 그래픽스 프로그래밍
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
참고 2 – 그래픽스 프로그래밍
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
바이블 책 두 권
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
라이브러리 만들어 보기
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
questions?
http://www.projectanarchy.com/kohttps://www.facebook.com/groups/ProjectAnarchyKR/
© Copyright 1999-2013 Havok.com Inc (or its licensors). All Rights Reserved. All trademarks are the property of their rightful
owners.
14
Havok™ Confidential. © Copyright 2013 Havok.com (and its licensors). All Rights Reserved. Confidential Information of Havok.
http://www.slideshare.net/cagetu/game-engine-2011
http://www.slideshare.net/noerror/engine1a
참고 자료