cross-platform game engine

49
1 Kiyoung Moon Cross-Platform Game Engines Kiyoung Moon

Upload: kiyoung-moon

Post on 13-Feb-2017

502 views

Category:

Education


0 download

TRANSCRIPT

Page 1: Cross-Platform Game Engine

1

Kiyoung Moon

Cross-Platform Game Engines

Kiyoung Moon

Page 2: Cross-Platform Game Engine

2

Kiyoung Moon

Agenda

• About Computer• Definition of Game Engine.• Definition of Platform.• What is Cross-Platform Game Engines?• Case Study : DeadEngine• Case Study : Unity (If I have time)

Page 3: Cross-Platform Game Engine

3

Kiyoung Moon

History

• When I/you don’t know something about, it is good to have a look at the history.

Page 4: Cross-Platform Game Engine

4

Kiyoung Moon

Computer game is a computer software

• It’s important!– Computer Games = Computer Software

• To make a computer software we should understand about the computer.

Page 5: Cross-Platform Game Engine

5

Kiyoung Moon

Computer

• Computer is a machine to calculate expressions that it is logically described.

• The origin of word ‘Computer’ has come from ‘Computare’ of Latin language.

Page 6: Cross-Platform Game Engine

6

Kiyoung Moon

Where did the computer start?

• Nature.– Nature is just existed.– We can measure it.

• Physics law.– We can measure about it then could get the law.– For example, V = RI(Voltage is multiply of resistance and current)

Page 7: Cross-Platform Game Engine

7

Kiyoung Moon

Abstraction!

• Abstraction is a best tool that human has.– I think

• We can use diagram to express complicate things.

Page 8: Cross-Platform Game Engine

8

Kiyoung Moon

Analog, Digital

• I’m going to talk about the Digital world only.• We can use gate!

Not And OrAmplifier

Page 9: Cross-Platform Game Engine

9

Kiyoung Moon

Combinational, Sequential Logic.

• With the gate, we can make more complicate things.• For example, 4 bits adder.

– 0101 + 0011 = 1000

Page 10: Cross-Platform Game Engine

10

Kiyoung Moon

Full adder

• Take 3 inputs and 2 outputs.

Page 11: Cross-Platform Game Engine

11

Kiyoung Moon

Full adder is complicated!

• Let’s make full adder like this.

Page 12: Cross-Platform Game Engine

12

Kiyoung Moon

Let’s compare these.

• Easy to use, remember.

Page 13: Cross-Platform Game Engine

13

Kiyoung Moon

4 bits adder

0 01 10 0 11

1 0 0 011

11

1

1

0

0

Page 14: Cross-Platform Game Engine

14

Kiyoung Moon

4 bits adder is still complicated.

• Let’s use abstraction!

Page 15: Cross-Platform Game Engine

15

Kiyoung Moon

Instruction Set

• x86, i4004• We can use Computer language to make a computer software.

Page 16: Cross-Platform Game Engine

16

Kiyoung Moon

Computer Language

• Assembler is machine specific.• What does it mean?

– Have to write machine dependent assembler for machines.– Programmer is lazy! Don’t like this.

• So computer language has been invented.– C, C++, C#– Java– Basic and so on...

Page 17: Cross-Platform Game Engine

17

Kiyoung Moon

Software

• OS, Games, Applications are all software.

Page 18: Cross-Platform Game Engine

18

Kiyoung Moon

Big picture

Nature Physics Law

Circuit Abstraction.

Digital World

Analog World

Combinational Logic

Instruction Set

Computer Languages. Software

... ...

Page 19: Cross-Platform Game Engine

19

Kiyoung Moon

Where we are

Nature Physics Law

Circuit Abstraction.

Digital World

Analog World

Combinational Logic

Instruction Set

Computer Languages. Software

... ...

Page 20: Cross-Platform Game Engine

20

Kiyoung Moon

Again. What is game?

• Games are computer software– Computer Games = Computer Software

Page 21: Cross-Platform Game Engine

21

Kiyoung Moon

Computer game is a computer software.

Nature Physics Law

Circuit Abstraction.

Digital World

Analog World

Combinational Logic

Instruction Set

Computer Languages.

Software

... ...

Game

Page 22: Cross-Platform Game Engine

22

Kiyoung Moon

What is Game Engine?

• http://en.wikipedia.org/wiki/Game_engine

• A game engine is a software framework designed for the creation and development of video games.

Page 23: Cross-Platform Game Engine

23

Kiyoung Moon

Game Engine

• Games are very complicated software.• For example, Rendering, Physics, AI, Sounds, Input and so on.

Page 24: Cross-Platform Game Engine

24

Kiyoung Moon

Page 25: Cross-Platform Game Engine

25

Kiyoung Moon

Do I need to implement all of those?!?!

• YES– 10 years ago

Page 26: Cross-Platform Game Engine

26

Kiyoung Moon

Again, abstraction.

• Thankfully not anymore.

Page 27: Cross-Platform Game Engine

27

Kiyoung Moon

Game Engine

Nature Physics Law

Circuit Abstraction.

Instruction Set

Computer Languages.

Software

...

Game

Game Engine

Oh! Yes!!!

Page 28: Cross-Platform Game Engine

28

Kiyoung Moon

Game Engine does every dirty/hard works for you.

• To construct every game systems from the start is hard.• Game Engine abstract all of those hard works for gameplay

programmer so programmer have more time to concentrate on gameplay instead of dirty/hard works.– Someone like me still like those dirty/hard works but it’s obvious.– If I can concentrate on gameplay more, then game is getting more fun.

• Believe or not

Page 29: Cross-Platform Game Engine

29

Kiyoung Moon

List of Game Engines.

• Quake• Id software made it.• Open Source

Page 30: Cross-Platform Game Engine

30

Kiyoung Moon

List of Game Engines

• Unreal Engine• Epic Games made it.• Integrated Game Development Tool• Big Companies

Page 31: Cross-Platform Game Engine

31

Kiyoung Moon

List of Game Engines.

• Unity• Integrated Game Development Tool• Support C#, Boo, JavaScript• Small companies

Page 32: Cross-Platform Game Engine

32

Kiyoung Moon

Other game engines.

• Renderware• C4 Engine• GameBryo• Cocos2D• GameMaker• DeadEngine

– This is my cross-platform engine!

Page 33: Cross-Platform Game Engine

33

Kiyoung Moon

What is Platform?

• http://en.wikipedia.org/wiki/Computing_platform

• A computing platform is, in the most general sense, whatever pre-existing environment a piece of software is designed to run within, obeying its constraints, and making use of its facilities. Typical platforms include a hardware architecture, an operating system (OS), and runtime libraries.[1]

Page 34: Cross-Platform Game Engine

34

Kiyoung Moon

Meaning of Platform is very wide.

• For Game Engine, Platform is a machine environment.• For Example

– xbox360– PC– PS3– Web– Android– iOS

Page 35: Cross-Platform Game Engine

35

Kiyoung Moon

What is Cross-Platform?

• Cross-Platform– http://en.wikipedia.org/wiki/Cross-platform

• In computing, cross-platform, or multi-platform, is an attribute conferred to computer software or computing methods and concepts that are implemented and inter-operate on multiple computer platforms.[1] The software and methods are also said to be platform independent. Cross-platform software may be divided into two types; one requires individual building or compilation for each platform that it supports, and the other one can be directly run on any platform without special preparation, e.g., software written in aninterpreted language or pre-compiled portable bytecode for which the interpreters or run-time packages are common or standard components of all platforms.[2]

Simply cross-platform software runs on different machines.For example, Java application generate ‘byte code’ and it compiled on the fly based on the machines.

Page 36: Cross-Platform Game Engine

36

Kiyoung Moon

Cross-Platform Computer Software

• Normally program runs on specific machines such as PC, Mac and so on.

• If we want program runs on every machines(PC, Mac for example) programmer needs to make two programs.

• Some machine’s environment are exactly same but most of cases it is not.

• What’s mean?– Programmer need to make a program per machines.

Page 37: Cross-Platform Game Engine

37

Kiyoung Moon

You know programmer is lazy!

• We are lazy.– We like to make things– But we don’t like to do same thing again and again.

Page 38: Cross-Platform Game Engine

38

Kiyoung Moon

Concept of Cross-Platform Software

• Concept is simple

ProgramPC

Mac

Environment

Environment

Program

Page 39: Cross-Platform Game Engine

39

Kiyoung Moon

Program

PC

Mac

CommonEnvironment

Page 40: Cross-Platform Game Engine

40

Kiyoung Moon

Example : Endian mode difference.

• PC uses little-endian mode.• PS3(PowerPC) uses big-endian mode.• What is a problem?

– Tool and Game• I choose big-endian mode

– I don’t want to waste of time for game.– PC(For developer) version is ok to be slow.

• Support MemoryStream Class– Programmer don’t need to care about the file format.– Just use MemoryStream’s interface (read, write) and MemoryStream

class does all dirty/hard works.

Page 41: Cross-Platform Game Engine

41

Kiyoung Moon

Case Study : Dead Engine

• DeadEngine is a cross-platform game engine.• Support PC, iOS, Android Platforms.• Games with DeadEngine.

– DressUpBaby, Attack of the pig• Animation Tools

– DeadAnimation

Page 42: Cross-Platform Game Engine

42

Kiyoung Moon

Case Study : Dead Engine

• Full C++ Game Engine.• Provides Rendering, Physics(Box2D), Sounds, Math, Script

systems so on.

Page 43: Cross-Platform Game Engine

43

Kiyoung Moon

How to support PC/Android/iOS?

• I had experiences PC/Android/iOS games.• I could use C/C++ for PC platform. (Yes!)• Android uses Java but there is a way to use C/C++! (Yes!)

– NDK(Native Development Kit)• iOS uses Objective C/C++ but still can use C/C++ (Yes!)• For Rendering, I could use OpenGL ES (PC/Android/iOS)• It was really simple!

– I could use same language for 3 platforms which is really good sign.• Of course, some functions I had to implement more than 2

implementation.

Page 44: Cross-Platform Game Engine

44

Kiyoung Moon

Rendering

• Fortunately OpenGL runs on Android/iOS/PC• Unfortunately some interface were different.

– So I made a common interface class for client programmer and internally has 3 classes.

Client Gameplay

Programmer

PC

Android

iOS

KRendering

PC specific rendering

code

Android specific

rendering code

iOS specific

rendering code

EngineGameplay

Page 45: Cross-Platform Game Engine

45

Kiyoung Moon

Audio(Sound)

• There are Open source audio library but the performance wasn’t good enough so I had to implement 3 audio classes.– Same as rendering... now you know cross-platform is not free. Some

one have to do this dirty/hard works.

Page 46: Cross-Platform Game Engine

46

Kiyoung Moon

Case Study : Unity

• Unity is a cross-platform game engine.• Unity is not source based game engine.• Gameplay programmer can use C#, Boo, Java Script for

gameplay logic.• Support all kind of platforms such as pc, android, iOS, web,

console and so on.

Page 47: Cross-Platform Game Engine

47

Kiyoung Moon

Case Study : Unity

• Good Things– It support many platforms and easy to change platforms.

• Fact• Many Korean game companies (include small studio) uses Unity Engine for

their games.• Bad Things

– Performance issue can be raised.– With my experience native app is 6 times smaller than the app with

Unity Engine.– More than 2 times slower than native app.– Source is not available (we can buy it if we have money)

• Can’t do anything if there is a problem happen. Have to wait for next update.

Page 48: Cross-Platform Game Engine

48

Kiyoung Moon

Summary

• Computer game is equal to computer software.• Abstraction is the best tool.• Cross-platform is must have features of recent game engines.• Game Engine has trade offs.

– Compare to native program.– Normally native program is faster/smaller than the program use game

engines.• Cross-platform is not free.

– If you are making an engine yourself you have to implement all of those features!

Page 49: Cross-Platform Game Engine

49

Kiyoung Moon

Q/A

Thank you