Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and...

35
Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, Melaka Computer Game Programming [BITE 1513] Semester 1 2014/2015

Transcript of Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and...

Page 1: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Bachelor of IT (Game Technology)Faculty of Information and Communication Technology

Universiti Teknikal Malaysia MelakaDurian Tunggal, Melaka

Computer Game Programming[BITE 1513]

Semester 1 2014/2015

Page 2: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Computer Systems

Page 3: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Computer System

• A computer is a system made of two major components: hardwareand software

• Computer hardware: physical equipment's

• Computer software: the collection of programs that allow hardware to do its job (e.g. : display text, video on monitor, print out the MS Word documents)

Page 4: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Computer Hardware

• The computer hardware consists of five parts: Input devices (mouse / keyboard)Central processing unit (CPU)Primary storage of main memory (RAM)Output devices (Monitor / speaker)Auxiliary storage devices or secondary storage (Pen-drive) I.P.O.S

Now, name one example for each parts of the components.

Page 5: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Computer Software

• Computer software is fall into two broad categories:•System software•Application software

• System software manages the computer resources; i.e. OS & system utilities (Windows XP / AVG anti-virus)

• Application software is responsible for helping users solve their problems; i.e. Microsoft Office (MS Word)

Page 6: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Computer Software

• Software Program(s) + Data (input)

• Program Set of instruction in programming language.Deal with computer / hardware to solve the problem /

make a calculation

• Data Refer to input / source that will be process by computer

• AlgorithmA set of procedure or step by step process to solve the

problem

Page 7: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Computer Programming

Page 8: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Computer Programming

• Programming is used to create the application / software you use everyday (e.g. ; to calculate your BMI)

• Application software is the result of the efforts of computer programmers.

• Knowing at least the basics of the history & practices of the programming will help you to better understand what goes on inside computer.

Page 9: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Computer Programming

Important keywords:• Computer programming / programming

• is a multi step process for designing or creating instructions or solution.

• Programming language• is a set of words (or symbols) & rules used to create

instructions for computer to perform.• Program / Application

• is a list of instructions that the computer must follow in order to perform specific assigned task.

Page 10: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Computer Programming

Important keywords:

• Syntax - set of rules to create program

• Code - computer instructions

Page 11: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Computer Programming

Example :

• Programming languageE.g. : C, C++, HTML, PHP, Java, Basic, Fotran

• Program / ApplicationE.g. : MS Word, S.M.M, S.M.A, Attendance Record.

• Syntax –cout<<"\n\t Skor purata = ";

cout<<purata;cout<<"\n\t Enter for release";

cout<<endl;• Code - <html><head><body></body></head></html>

Page 12: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Computer Languages

Page 13: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Computer Languages

• To write a program for a computer, you must use a computer language.

Basically, What is a computer language?

• A computer language is an artificial language that tell the computer what to do.

• It has the same meaning with programming language .

Page 14: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Computer Languages

• Over the year, computer languages have evolved.

1940s 1950s 1960s

Page 15: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Machine Language

• 1st generation of programming language.

• The only language understood by a computer without translation.

• It is a language consists of 0s and 1s – that directly correspond to the computer’s electrical states.

• Also known as binary or machine code.

Page 16: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Machine Language

• Advantage:Very fast in processing data. WHY?

• Disadvantages:Machine (or hardware) dependentTime-consuming Difficult to create program (less user friendly)

(100110101011001)

Page 17: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Example: Machine Language Program

11110010 01110011 1101 001000010000 0111

11110010 01110011 1101 001000011000 0111

11111110 01100010 1101 001000010010 0111

11110000 01000101 1101 001000010011 0000

111110011 01000011 0111 00000101000 1101

10010110 11110000 0111 000001010100 1100

Page 18: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Assembly Language

• 2nd generation of programming language.• Also known as symbolic language.• Assembly language is a language that allows programmers to

use symbol or mnemonics (abbreviations), to represent the various machine language.

• It uses assembler to translate assembly code into machine code.

Page 19: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Assembly Language

• Advantage: fast in processing data Program can be write more quickly than in machine language

• Disadvantages:Machine (or hardware) dependentTime-consuming

Page 20: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Example: Assembly Language Program

Page 21: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

High-Level Language

• 3rd generation of programming language.

• Also known as procedural language.

• High-level languages use an English-like language instead of symbols and abbreviations.

• High-level languages are designed to relieve the programmer from the details of the assembly language.

Page 22: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

High-Level Language

• Example of high-level languages are C, Fortran and COBOL.

• Advantage:Easy to programMachine independent

• Disadvantages:Requires translator (compiler or interpreter)

Page 23: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Example: FORTRAN Program

Page 24: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Very High-Level Language

• 4th generation of programming language.

• Also known as object-oriented or non-procedural language.

• It is much more user-oriented and allow programmers to develop programs with fewer commands.

Page 25: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Very High-Level Language

• Some of very high-level languages are also called RAD (rapid application development) tools.

• The use of visual in programming was also introduced in very high-level language.

• Example of very high-level languages are C++, Java and Visual Basic.

Page 26: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Example : C++ Programming Language

void main(){

int jumskor, x, skor, purata;jumskor=0;cout<<"\n\t ATURCARA MENGIRA PURATA SKOR PELAJAR\n";for (x=1; x<=5; x++){cout<<"\n\t Taipkan skor(nombor bulat sahaja): ";cin>>skor;jumskor+=skor;}purata=jumskor/5;cout<<"\n\t Skor purata = ";cout<<purata;

cout<<endl;getch();

}

Page 27: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Example: Visual C++ Program

Page 28: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Example: Visual C++ with OpenGL Program

Page 29: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Natural Language

• 5th generation of programming language.

• Natural languages use human language to give people a more natural connection with computers.

• Natural languages allow questions or commands to be framed in a more conversational way.

Page 30: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Natural Language

For example:I WANT THE LIST OF BITE 1513 STUDENTS TO BE PRINTED AT 2.00 PM 09/09/2014

• Natural languages are part of the field of study known as artificial intelligence (AI).

• AI are technologies that attempt to develop machine to emulate human-like qualities.

Page 31: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

What is Game Programming

• Where you program something with a C++ to create great games!!• Used to be programmers created games

• But many great programmers not great game makers

• With budget shift, emphasis has shifted• Game content creators are artist and designers

• Programmers can be thought of as providing services for content• But fate of entire game rests in their hands

Based on Chapter 3.1, Introduction to Game Development

Page 32: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Programming Areas – Game Code

• Everything directly related to game itself• How camera behaves, score is kept, AI for bots, etc.

• Often in scripting language (rest is in C++, more on languages next)• Produce faster iterations• Allow technical designers/artists to change behaviors• More appropriate language for domain (ex: AI probably not easiest in C++)

Based on Chapter 3.1, Introduction to Game Development

Page 33: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Programming Areas – Game Engine

• Support code that is not game specific• More than just drawing pretty 3d graphics (that is actually the graphics

engine, part of the game engine)• Isolate game code from hardware

• ex: controller, graphics, sound• Allows designers to concentrate on game

• Common functionality needed across game• Serialization, network communication, pathfinding, collision detection

Based on Chapter 3.1, Introduction to Game Development

Page 34: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Programming Areas – Tools

• Most involve content creation• Level editors, particle effect editors, sound editors

• Some to automate repetitive tasks (ex: convert content to game format)

• These usually have no GUI• Sometimes written as plug-ins for off-the-shelf tools

• Ex: extensions to Maya or 3dStudio or Photoshop• If no such extension available, build from scratch

Based on Chapter 3.1, Introduction to Game Development

Page 35: Bachelor of IT (Game Technology)...Bachelor of IT (Game Technology) Faculty of Information and Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, MelakaComputer

Programming Team Organization

• Programmers often specialize• Graphics, networking, AI

• May be generalists, know something about everything• Often critical for “glue” to hold specialists together• Make great lead programmers

• More than 3 or 4, need some organization• Often lead programmer, much time devoted to management

• More than 10 programmers, several leads (graphics lead, AI lead, etc.)

Based on Chapter 3.1, Introduction to Game Development