Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Game Programming Pertemuan 11 Matakuliah: T0944-Game Design and Programming Tahun: 2010.

Similar presentations


Presentation on theme: "Introduction to Game Programming Pertemuan 11 Matakuliah: T0944-Game Design and Programming Tahun: 2010."— Presentation transcript:

1

2 Introduction to Game Programming Pertemuan 11 Matakuliah: T0944-Game Design and Programming Tahun: 2010

3 The Component of Game Programming Initialization Game Loop Retrieve Player Input Perform AI and Game Logic Render Next Frame Synchronize Display Shutdown

4 The Component of Game Programming Initialization –Memory allocations, resource acquisition, loading data from disk, etc. Enter Game Loop –This is where the action begins and continues until user exits the main loop. Retrieve Player Input –Retrieve player input from keyboard, mouse or joystick. Perform AI and Game Logic –This section contains the majority of the game code. Render Next Frame –This section draws the image on an off-screen buffer area, and then copied very quickly to the visible display. Synchronize Display –Manage the frame rate. Usually 30 fps is considered to be optimal. Shutdown –Indicates the end of the game. This section perform cleanup and exit to operating systems.

5 Windows Programming Model Multitasking –Windows allows a number of different applications to be executed simultaneously an a round robin fashion, where each application gets a small time slice to run in and then the next application takes its turn. Game Program Paint Program Word Processor Print Spoiler CPU

6 Windows Programming Model Multithreading –Programs are really composed of a number of simpler threads of execution. –These threads are scheduled just like heavier-weight processes, such as programs. Process 0 CPU Thread 0Thread 1Thread 2 Process 1 … Process n Thread 0Thread 1Thread 0Thread 1Thread 2

7 Windows Programming Model Event-Driven Model –Windows programs sit and wait for the user to do something, which fires an event, and the Windows responds to the event an takes action. Message 1 Message 2 … Message n System Event Queue WinMain(){ … } WinProc() Local Even Queue WinMain(){ … } WinProc() Local Even Queue

8 API (Application Programming Interface) Is a programmatically implemented interface provided in the form of a library. This interface provide a certain number of services for use by an application program. Common APIs: –Windows 32 API. int MessageBox(HWND hwnd, LPCTSTR lptext, LPCTSTR lpcaption, UINT utype) DWORD GetTickCount(void); –Windows GDI BOOL LineTo(HDC hdc, int xEnd, int yEnd) BOOL Rectangular (HDC hdc, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect) –OpenGL graphic API –Microsoft DirectX API –Sun Microsystem’s Java Platform –Xbox 360’s XInput API

9 Introduction to DirectX Basically a system of software that abstracts video, audio, input, networking, installation, and more. DirectX technology is many times faster and more robust that GDI and/or MCI (Media Control Interface) Windows Win32 Application Hardware: Audio, Video, Input, Storage GDI Windows Device Driver Interface Hardware Abstraction Layer Hardware Emulation Layer Direct Draw Direct 3D Direct Input Direct Play Direct Setup Direct Sound Direct Sound 3D Direct Music Direct Show

10 Introduction to OpenGL Is a procedural-based 3D graphics API explicitly designed by Silicon Graphic for the standardized development of 3D and 2D graphical applications. OpenGL is also designed for the creation and execution of graphical applications over networked computing enviroment. Example: –glColor(), glVertex(), glBegin()

11 Game Programming Topics Algorithm, Data Structure, Memory Management –Arrays, Linked List, Recursion, Tree, Multiple Player Management Artificial Intelligence –Deterministic Algorithm, Patterns and Scripts, Behavioral state system, Memory and Learning, Path-finding, Neural Network, Genetic Algorithm, Fuzzy Logic. Physic Modeling –Fundamental laws of physics: Mass, Time, Position, Velocity, Acceleration, Force, Momentum. –Gravity, Friction, Collision response, Forward kinematics, Particle system.

12 Game Programming Resource Game Programming Website –http://www.gamedev.nethttp://www.gamedev.net –http://www.gamesdomain.comhttp://www.gamesdomain.com –http://www.gdconf.comhttp://www.gdconf.com Game Development Magazine –http://www.gdmag.comhttp://www.gdmag.com –http://www.gamasutra.comhttp://www.gamasutra.com


Download ppt "Introduction to Game Programming Pertemuan 11 Matakuliah: T0944-Game Design and Programming Tahun: 2010."

Similar presentations


Ads by Google