RANCANG BANGUN GAME TOWER DEFENSE “THE LEGEND OF KEBO IWA” BERBASIS ANDROID MENGGUNAKAN ALGORITMA A STAR TUGAS AKHIR Diajukan guna memenuhi sebagian persyaratan dalam rangka Menyelesaikan Program Sarjana Strata Satu (S1) Program Studi Teknologi Informasi
I MADE ADI PALGUNA NIM.1104505042
JURUSAN TEKNOLOGI INFORMASI FAKULTAS TEKNIK UNIVERSITAS UDAYANA BUKIT JIMBARAN - BALI 2015
PERNYATAAN
Dengan ini saya menyatakan bahwa dalam tugas akhir ini tidak terdapat karya yang pernah diajukan untuk memperoleh gelar kesarjanaan di suatu perguruan tinggi dan sepanjang pengetahuan saya juga tidak terdapat karya atau pendapat yang pernah ditulis atau diterbitkan oleh orang lain, kecuali yang secara tertulis diacu dalam naskah ini dan disebutkan dalam daftar pustaka.
Denpasar, Juli 2015
I Made Adi Palguna
ii
iii
iv
KATA PENGANTAR Puji syukur penulis panjatkan kepada Tuhan Yang Maha Esa, karena atas berkat dan rahmat beliau penulis dapat menyelesaikan laporan tugas akhir yang berjudul Rancang Bangun Game Tower Defense “The Legend of Kebo Iwa” Berbaris Android Menggunakan Algoritma A Star pada waktu yang tepat. Dalam penyusunan Tugas Akhir ini, penulis mendapatkan petunjuk dan bimbingan dari berbagai pihak. Sehubungan dengan hal tersebut pada kesempatan ini penulis menyampaikan ucapan terima kasih kepada : 1.
Bapak Prof. Ir. Ngakan Putu Gede Suardana, MT, Ph.D selaku Dekan Mahasiswa Fakultas Teknik Teknologi Informasi Universitas Udayana.
2.
Bapak Dr. Eng. I Putu Agung Bayupati, S.T., M.T. selaku Ketua Jurusan Teknologi Informasi Fakultas Teknik Universitas Udayana.
3.
Bapak A. A. Kt Agung Cahyawan Wiranatha, ST., MT. selaku dosen pembimbing I yang telah banyak meluangkan waktu memberikan dorongan, bimbingan, tuntunan dan kesabaran selama penyusunan Tugas Akhir ini.
4.
Bapak I Ketut Adi Purnawan, S.T., M.Eng. sebagai Dosen Pembimbing II yang memberikan saran dan ide untuk perbaikan aplikasi
5.
Keluarga dan teman-teman yang selalu memberikan motivasi, dukungan moral dan materi dalam menyelesaikan tugas akhir. Penulis memohon maaf atas kesalahan dan kekurangan yang terdapat
laporan ini, baik dari materi maupun penulisan. Penulis berharap laporan ini dapat bermanfaat untuk penelitian lain yang terkait. Bukit Jimbaran, Juli 2015
I Made Adi Palguna
v
ABSTRAK Kebo Iwa adalah salah seorang panglima militer Bali pada masa pemerintahan Prabu Sri Asta Sura Ratna Bumi Banten pada awal abad ke-14. Beliau sangatlah terkenal karena kesaktiannya sehingga patih Gajah Mada kewalahan untuk mempersatukan nusantara apabila Bali masih belum bisa dikuasai. Ilustrasi mengenai kekuatan dari tokoh Kebo Iwa dapat diangkat menjadi sebuah permainan yang menarik. Game tower defense merupakan salah satu game yang berjenis RTS (Real Time Strategy). Game dengan genre ini biasanya lebih memberikan kecanduan kepada user untuk memainkannya karena membutuhkan strategi serta kecepatan berpikir. Perancangan game tower defense membutuhkan algoritma yang cocok agar permainan tersebut lebih menarik. Penggunaan Algoritma A Star (A*) dengan jenis heuristik Manhattan Distance sebagai pencari jalur diharapkan dapat membuat game tower defense yang dirancang ini lebih menarik. Perancangan game tower defense dengan bantuan Corona SDK berbasis Android yang mengambil tokoh Kebo Iwa sebagai tower diharapkan dapat memberikan pengetahuan kepada pengguna dalam mengetahui informasi mengenai Kebo Iwa. Kata Kunci: Algoritma A Star, Android, Corona SDK, Kebo Iwa, Tower Defense
vi
ABSTRACT Kebo Iwa is one of Bali's military commander during the reign of Prabu Sri Asta Sura Ratna Bumi in the early 14th century. He is best known for his power so that the duke of Gajah Mada overwhelmed to unite Nusantara when Bali still can not be controlled. Illustration of the strength of character Kebo Iwa be appointed as an interesting game. Tower defense game is one game that type of RTS (Real Time Strategy). Games with this genre usually give more addicted to the user to play because it requires strategy and speed of thought. The design of the tower defense game requires matching algorithm so that the game more interesting. The use of A Star Algorithm (A*) with the type of heuristic Manhattan Distance as the search path is expected to make a tower defense game that's designed more interesting. The design of the tower defense game with the help of Corona SDK based on Android that takes Kebo Iwa figures as the tower is expected to provide knowledge to the user in knowing information about Kebo Iwa. Keywords: A Star Algorithm, Android, Corona SDK, Kebo Iwa, Tower Defense
vii
DAFTAR ISI
JUDUL .................................................................................................................... i PERNYATAAN ..................................................................................................... ii LEMBAR PENGESAHAN TUGAS AKHIR .................................................... iii BERITA ACARA TUGAS AKHIR .................................................................... iv KATA PENGANTAR ........................................................................................... v ABSTRAK ............................................................................................................ vi ABSTRACT .......................................................................................................... vii DAFTAR ISI ....................................................................................................... viii DAFTAR GAMBAR ............................................................................................ xi DAFTAR TABEL .............................................................................................. xiii BAB I PENDAHULUAN ...................................................................................... 1 1.1 Latar Belakang Masalah .............................................................................. 1 1.2 Rumusan Masalah ....................................................................................... 2 1.3 Batasan Masalah.......................................................................................... 2 1.4 Tujuan Penelitian ........................................................................................ 3 1.5 Manfaat Penelitian ...................................................................................... 4 1.6 Luaran yang Diharapkan ............................................................................. 4 BAB II TINJAUAN PUSTAKA........................................................................... 5 2.1 State of the Art............................................................................................. 5 2.2 Sejarah Kebo Iwa ........................................................................................ 6 2.2.1 Senjata Kebo Iwa .................................................................................. 8 2.3 Game ........................................................................................................... 9 2.3.1 Sejarah Perkembangan Game ............................................................. 10 2.3.2 Elemen Dasar Game............................................................................ 12 2.3.3 Jenis-jenis Game ................................................................................. 13 2.4 Tower Defense........................................................................................... 14 2.4.1 Sejarah Game Tower Defense ............................................................. 14 2.4.2 Elemen pada Tower Defense ............................................................... 15 2.4.3 Karakteristik Tower Defense ............................................................... 15 2.5 Artificial Intelligence ................................................................................ 16 2.5.1 Latar Belakang AI ............................................................................... 16 2.6 Algoritma A Star (A*) .............................................................................. 16 2.7 Fungsi Heuristik ........................................................................................ 20 2.7.1 Manhattan Distance ............................................................................ 20 2.8 Metode Collision Detection ...................................................................... 21 2.9 Android ..................................................................................................... 22 2.10 Corona SDK .............................................................................................. 23 2.11 UML (Unified Modeling Language) ......................................................... 24 BAB III METODE DAN PERANCANGAN SISTEM .................................... 25 3.1 Waktu dan Tempat Penelitian ................................................................... 25 3.2 Data ........................................................................................................... 25 3.3 Alat Penelitian ........................................................................................... 26 3.4 Perancangan Gambaran Umum................................................................. 26 viii
3.4.1 Gambaran Umum Sistem .................................................................... 26 3.4.2 Gambaran Sistem Algoritma A Star ................................................... 28 3.5 Perancangan Sistem .................................................................................. 29 3.5.1 Diagram Use Case............................................................................... 29 3.6.1 Diagram Activity.................................................................................. 29 3.6.1.1 Diagram Activity dari Play Game ................................................. 30 3.6.1.2 Diagram Activity High Score ........................................................ 31 3.6.1.3 Diagram Activity Option ............................................................... 32 3.6.1.4 Diagram Activity Wave Enemy ...................................................... 33 3.6.1.5 Diagram Activity Tower ................................................................ 34 3.6.2 Diagram Sequence ............................................................................... 38 3.6.2.1 Diagram Sequence Play Game Scene ........................................... 39 3.6.2.2 Diagram Sequence Tutorial .......................................................... 39 3.6.2.3 Diagram Sequence High Score...................................................... 40 3.7 Perancangan Antar Muka .......................................................................... 41 3.7.1 Perancangan Tampilan Main Menu .................................................... 41 3.7.2 Perancangan Tampilan Play Game Scene ........................................... 41 3.7.3 Perancangan Tampilan Option ............................................................ 42 3.7.4 Perancangan Tampilan Tutorial dan About Scene .............................. 43 3.7.5 Perancangan Tampilan Tutorial dan About Scene .............................. 43 3.7.5.1 Perancangan Tampilan Peta Permainan pada Level Satu.............. 43 3.7.5.2 Perancangan Tampilan Peta Permainan pada Level Dua .............. 44 3.7.5.3 Perancangan Tampilan Peta Permainan pada Level Tiga ............. 45 3.8 Perancangan Desain Permainan ................................................................ 45 3.8.1 Perancangan Button pada Main Menu................................................. 45 3.8.2 Perancangan Button pada Option Scene ............................................. 46 3.8.3 Perancangan Button pada Tutorial Scene dan About Scene ................ 47 3.8.4 Perancangan Button pada Play Game Scene ....................................... 48 3.8.5 Perancangan Button Kondisi Menang/ Kalah ..................................... 49 3.8.6 Perancangan Start Point dan End Point .............................................. 49 3.8.7 Perancangan Desain Tower ................................................................. 50 3.8.7.1 Perancangan Desain Keris Tower ................................................. 50 3.8.7.2 Perancangan Desain Pecut Tower ................................................. 50 3.8.7.3 Perancangan Desain Batu Tower .................................................. 50 3.8.8 Perancangan Desain Enemy ................................................................ 51 3.9 Metode Analisis ........................................................................................ 52 3.9.1 Analisis Aplikasi Permainan Sejenis .................................................. 52 3.9.2 Analisis Masalah Aplikasi Permainan Sejenis .................................... 53 3.9.3 Analisis Perancangan Game “The Legend of Kebo Iwa” ................... 53 3.9.3.1 Analisis Alur Cerita (Storyline) .................................................... 53 3.9.3.2 Analisis Kelebihan Game “The Legend of Kebo Iwa” ................. 54 3.9.3.3 Analisis Algoritma A Star pada Peta Permainan Level Tiga ........ 55 BAB IV PEMBAHASAN DAN ANALISIS SISTEM ...................................... 58 4.1 Konfigurasi Hardware .............................................................................. 58 4.2 Konfigurasi Software ................................................................................ 58 4.3 Hasil Perancangan ..................................................................................... 58 ix
4.3.1 Tampilan Splash Screen ...................................................................... 59 4.3.2 Tampilan Main Menu Scene................................................................ 59 4.3.3 Tampilan Tutorial Scene ..................................................................... 60 4.3.4 Tampilan High Score Scene ................................................................ 61 4.3.5 Tampilan Option Scene ....................................................................... 62 4.3.6 Tampilan About Scene......................................................................... 62 4.3.7 Tampilan Credit Scene ........................................................................ 63 4.3.8 Tampilan Play Game Scene ................................................................ 64 4.4 Uji Coba pada Device................................................................................ 68 4.4.1 Simulator Corona (Samsung Galaxy S3) ............................................ 69 4.4.2 Asus Zenfone 5 ................................................................................... 74 4.5 Analisa Sistem........................................................................................... 76 4.5.1 Metode Pengambilan Data .................................................................. 77 4.5.2 Kriteria Variabel.................................................................................. 77 4.5.2.1 Aspek Pengalaman User ............................................................... 77 4.5.2.2 Aspek Grafis Game ....................................................................... 77 4.5.2.3 Aspek Rekayasa Perangkat Lunak ................................................ 77 4.5.2.4 Aspek Gameplay ........................................................................... 78 4.5.2.5 Aspek Pemahaman Tentang Game ............................................... 78 4.5.3 Penetapan Skor .................................................................................... 78 4.6 Perhitungan dan Penyajian Data ............................................................... 78 4.6.1 Aspek Pengalaman User ..................................................................... 79 4.6.2 Aspek Grafis........................................................................................ 81 4.6.3 Aspek Rekayasa Perangkat Lunak ...................................................... 83 4.6.4 Aspek Gameplay ................................................................................. 85 4.6.5 Aspek Pemahaman Tentang Game ..................................................... 87 4.7 Kelebihan dan Kekurangan Sistem ........................................................... 89 4.7.1 Kelebihan Sistem ................................................................................ 89 4.7.2 Kekurangan Sistem ............................................................................. 90 BAB V PENUTUP ............................................................................................... 91 5.1 Simpulan ................................................................................................... 91 5.2 Saran .......................................................................................................... 91 DAFTAR PUSTAKA .......................................................................................... 92
x
DAFTAR GAMBAR
Gambar 2.1 Ilustrasi Kebo Iwa ............................................................................... 7 Gambar 2.2 Keris Kebo Iwa ................................................................................... 9 Gambar 2.3 Patung Kebo Iwa ................................................................................. 9 Gambar 2.4 Tennis for Two .................................................................................. 11 Gambar 2.5 Mesin Arcade Pong ........................................................................... 12 Gambar 2.6 Contoh Kasus Algoritma A* ............................................................. 18 Gambar 2.7 Ilustrasi Closed List ........................................................................... 18 Gambar 2.8 Ilustrasi Nilai F .................................................................................. 19 Gambar 2.9 Penentuan Kotak Berikutnya ............................................................. 20 Gambar 2.10 Pencarian Poin Akhir ...................................................................... 20 Gambar 2.11 Tiga Tipe Collision ......................................................................... 22 Gambar 2.12 Logo Android ................................................................................. 23 Gambar 2.13 Logo Corona SDK........................................................................... 24 Gambar 3.1 Gambaran Umum Game Tower Defense “The Legend of Kebo Iwa” ............................................................................................................................... 27 Gambar 3.2 Gambaran Sistem Algoritma A Star.................................................. 28 Gambar 3.3 Diagram Use Case pada Game Tower Defense “The Legend of Kebo Iwa” ....................................................................................................................... 29 Gambar 3.4 Diagram Activity Menyelesaikan Semua Misi .................................. 31 Gambar 3.5 Diagram Activity Gagal Menyelesaikan Misi.................................... 32 Gambar 3.6 Diagram Activity High Score............................................................. 33 Gambar 3.7 Diagram Activity Option.................................................................... 34 Gambar 3.8 Diagram Activity Wave Enemy .......................................................... 35 Gambar 3.9 Diagram Activity Membeli Tower ..................................................... 36 Gambar 3.10 Diagram Activity Memperbarui Tower ............................................ 37 Gambar 3.11 Diagram Activity Menjual Tower .................................................... 38 Gambar 3.12 Diagram Activity AI Tower ............................................................. 39 Gambar 3.13 Diagram Sequence Play Game Scene.............................................. 40 Gambar 3.14 Diagram Sequence Tutorial ............................................................ 41 Gambar 3.15 Diagram Sequence High Score ........................................................ 41 Gambar 3.16 Rancangan Tampilan Main Menu ................................................... 42 Gambar 3.17 Perancangan Tampilan Play Game ................................................. 43 Gambar 3.18 Perancangan Tampilan Option ........................................................ 44 Gambar 3.19 Perancangan Tampilan Tutorial dan About Scene .......................... 45 Gambar 3.20 Perancangan Peta Permainan Level Satu ........................................ 46 Gambar 3.21 Perancangan Peta Permainan Level Dua ......................................... 46 Gambar 3.22 Perancangan Peta Permainan Level Tiga ........................................ 47 Gambar 3.23 Perancangan Desain Keris Tower ................................................... 52 Gambar 3.24 Perancangan Desain Pecut Tower ................................................... 52 Gambar 3.25 Perancangan Desain Batu Tower..................................................... 52 Gambar 3.26 Perancangan Wave Enemy ke -1...................................................... 53 Gambar 3.27 Perancangan Wave Enemy ke-2....................................................... 53 Gambar 3.28 Perancangan Wave Enemy ke-3 dan ke-4 ........................................ 53 xi
Gambar 3.29 Perancangan Wave Enemy ke-5....................................................... 53 Gambar 3.30 Game Viking vs Trolls .................................................................... 54 Gambar 3.31 Analisis Penerapan Algoritma A Star ............................................. 57 Gambar 3.32 Perhitungan Nilai F ......................................................................... 57 Gambar 3.33 Pergerakan Enemy ........................................................................... 58 Gambar 3.34 Perhitungan Nilai F ......................................................................... 58 Gambar 3.35 Jalur Enemy ..................................................................................... 58 Gambar 4.1 Splash Screen .................................................................................... 61 Gambar 4.2 Tampilan Main Menu Scene.............................................................. 62 Gambar 4.3 Tampilan Tutorial Scene ................................................................... 63 Gambar 4.4 Tampilan High Score Scene .............................................................. 63 Gambar 4.5 Tampilan Option Scene ..................................................................... 64 Gambar 4.6 Tampilan About Scene ....................................................................... 65 Gambar 4.7 Tampilan Credit Scene ...................................................................... 65 Gambar 4.8 Tampilan Level 1 ............................................................................... 66 Gambar 4.9 Penempatan Tower ............................................................................ 67 Gambar 4.10 Meningkatkan Kekuatan Tower ...................................................... 67 Gambar 4.11 Menjual Tower ................................................................................ 68 Gambar 4.12 Tampilan Level 2 ............................................................................. 68 Gambar 4.13 Tampilan Level 3 ............................................................................. 69 Gambar 4.14 Tampilan Kondisi Menang .............................................................. 69 Gambar 4.15 Tampilan Kondisi Kalah ................................................................. 70 Gambar 4.16 Tampilan Splash Screen .................................................................. 71 Gambar 4.17 Tampilan Main Menu Scene ............................................................ 71 Gambar 4.18 Tampilan Tutorial ........................................................................... 72 Gambar 4.19 Tampilan Option Scene ................................................................... 72 Gambar 4.20 Tampilan About Scene ..................................................................... 73 Gambar 4.21 Tampilan Credit Scene .................................................................... 73 Gambar 4.22 Tampilan Level 1 ............................................................................. 74 Gambar 4.23 Tampilan Level 2 ............................................................................. 74 Gambar 4.24 Tampilan Level 3 ............................................................................. 75 Gambar 4.25 Tampilan Kondisi Kalah ................................................................. 75 Gambar 4.26 Tampilan Kondisi Menang .............................................................. 76 Gambar 4.27 Tampilan Splash Screen .................................................................. 76 Gambar 4.28 Tampilan Main Menu ...................................................................... 77 Gambar 4.29 Tampilan Tutorial ........................................................................... 77 Gambar 4.30 Tampilan Option ............................................................................. 78 Gambar 4.31 Tampilan Kondisi Menang .............................................................. 79 Gambar 4.32 Aspek Pengalaman User ................................................................. 82 Gambar 4.33 Aspek Grafis.................................................................................... 85 Gambar 4.34 Aspek Rekayasa Perangkat Lunak .................................................. 86 Gambar 4.35 Aspek Gameplay ............................................................................. 89 Gambar 4.36 Aspek Pemahaman Tentang Game ................................................. 91
xii
DAFTAR TABEL Tabel 3.1 Button Main Menu ................................................................................ 48 Tabel 3.2 Button Option Scene.............................................................................. 48 Tabel 3.3 Button Tutorial Scene dan About Scene ................................................ 49 Tabel 3.4 Button Play Game Scene ....................................................................... 50 Tabel 3.5 Button Kondisi Menang/ Kalah............................................................. 51 Tabel 3.6 Start dan End Point ............................................................................... 51 Tabel 4.1 Penilaian Responden Terhadap Pengalaman User .............................. 81 Tabel 4.2 Penilaian Responden Terhadap Grafis ................................................. 83 Tabel 4.3 Penilaian Responden Terhadap Rekayasa Perangkat Lunak ............... 85 Tabel 4.4 Penilaian Responden Terhadap Gameplay........................................... 87 Tabel 4.5 Penilaian Responden Terhadap Pemahaman Game ............................ 89
xiii