IMPLEMENTASI METODE FORWARD CHAINING PADA GAME DUCK HUNTER
TUGAS AKHIR
Sebagai Persyaratan Guna Meraih Gelar Sarjana Strata 1 Teknik Informatika Universitas Muhammadiyah Malang
Oleh : ALINE MAWARANI 201010370311403
JURUSAN TEKNIK INFORMATIKA FAKULTAS TEKNIK UNIVERSITAS MUHAMMADIYAH MALANG 2014
i
ii
iii
iv
LEMBAR PERSEMBAHAN Puji syukur kepada Allah SWT atas rahmat dan karunia-Nya sehingga penulis dapat menyelesaikan Tugas Akhir ini. Penulis menyampaikan ucapan terima kasih yang sebesar-besarnya kepada: 1. Bapak Eko Budi Cahyono, S.Kom, MT selaku dosen pembimbing I dan Ibu Nur Hayatin, S.ST selaku pembimbing II yang telah memberikan pengarahan dan bimbingannya dalam penyelesaian penulisan tugas akhir ini. 2. Bapak Ir. Sudarman, MT selaku Dekan Fakultas Teknik Universitas Muhammadiyah Malang. 3. Bapak Yuda Munarko, S.Kom, M.Sc selaku Ketua Jurusan Teknik Informatika Universitas Muhammadiyah Malang. 4. Kedua orang tua, Bapak Agus Sumaryono dan Ibu Tatik Pujiani yang telah memberikan dukungan dan peranan pentingnya terhadap pengerjaan tugas akhir ini. 5. Kakakku Ayesta Ajeng dan Kukuh Aji serta adikku Opet dan Tesar yang telah memberi semangat dan hiburan dalam pengerjaan tugas akhir ini. 6. Semua sahabat I-TEC, Rina dan Riska yang selalu memberi semangat dan dukungannya dalam pengerjaan tugas akhir ini. 7. Seluruh teman-teman di Teknik Informatika angkatan 2009 dan 2010 yang selama ini telah membantu.
v
KATA PENGANTAR Dengan memanjatkan puji syukur kehadirat Allah SWT atas limpahan rahmat dan hidayah-NYA sehingga peneliti dapat menyelesaikan laporan tugas akhir yang berjudul: “IMPLEMENTASI METODE FORWARD CHAINING PADA GAME DUCK HUNTER”. Tugas Akhir ini merupakan salah satu prasyarat untuk menyelesaikan studi tingkat strata satu di Fakultas Teknik Jurusan Informatika Universitas Muhammadiyah Malang. Selama penyelesaian tugas akhir ini, penulis telah memperoleh banyak bantuan, bimbingan, motivasi dan saran yang berguna dari berbagai pihak. Oleh karena itu, penulis ingin mengucapkan terima kasih kepada: 1. Bapak Eko Budi Cahyono, S.Kom, MT selaku Dosen Pembimbing I dan Ibu Nur Hayatin, S.ST selaku Dosen Pembimbing II yang telah meluangkan waktu dalam memberikan bimbingan maupun pengarahan dalam pencapaian hasil yang maksimal pada penelitian tugas akhir ini. 2. Bapak Yuda Munarko, S.Kom, M.Sc selaku Ketua Jurusan Teknik Informatika Universitas Muhammadiyah Malang. 3. Seluruh Dosen Jurusan Teknik Informatika Universitas Muhammadiyah Malang. 4. Kedua orang tua, kakak, adik dan seluruh teman-teman yang telah memberikan dukungan dan do’a. Penulis menyadari bahwa dalam penyusunan laporan tugas akhir ini masih jauh dari kesempurnaan, maka dengan segala keterbukaan penulis mengharapkan segala kritik dan saran yang membangun dari berbagai pihak yang dapat membantu dalam proses penyempurnaan di masa mendatang agar tugas akhir ini menjadi lebih baik. Semoga laporan tugas akhir ini dapat bermanfaat bagi penulis dan pembaca. Malang, 2 Juli 2014 Penulis
Aline Mawarani vi
DAFTAR ISI Halaman SAMPUL DEPAN .................................................................................................. i HALAMAN JUDUL ............................................................................................. ii LEMBAR PERSETUJUAN ................................................................................ iii LEMBAR PENGESAHAN ................................................................................. iv LEMBAR PERNYATAAN KEASLIAN .............................................................v ABSTRAK ............................................................................................................ vi ABSTRACT ......................................................................................................... vii LEMBAR PERSEMBAHAN ............................................................................ viii KATA PENGANTAR .......................................................................................... ix DAFTAR ISI ...........................................................................................................x DAFTAR GAMBAR ............................................................................................xv DAFTAR TABEL ............................................................................................ xviii BAB I PENDAHULUAN 1.1
Latar Belakang .............................................................................................1
1.2
Rumusan Masalah ........................................................................................2
1.3
Tujuan ..........................................................................................................3
1.4
Batasan Masalah...........................................................................................3
1.5
Metodologi ...................................................................................................3
1.5
1.5.1
Tahap Pengumpulan Data ................................................................4
1.5.2
Perencanaan Sistem .........................................................................4
1.5.3
Analisis Kebutuhan Sistem .............................................................4
1.5.4
Perancangan Sistem dan Desain Sistem ..........................................4
1.5.5
Pembangunan Sistem ......................................................................5
1.5.6
Pengujian dan Penggabungan Sistem .............................................5
1.5.7
Penggunaan Sistem dan Umpan Balik ............................................5
1.5.8
Pembuatan Laporan .........................................................................5
Sistematika Penulisan ..................................................................................5
vii
BAB II LANDASAN TEORI 2.1
Definisi Game ..............................................................................................7
2.2
Jenis-Jenis Game ..........................................................................................7 2.2.1
Jenis Game Berdasarkan Genre Permainan ....................................8
2.2.2
Jenis Game Berdasarkan Platform ..................................................9
2.2.3
Jenis Game Berdasarkan Teknologi Grafis ...................................10
2.3
Sejarah Perkembangan Game ....................................................................10
2.4
Game Duck Hunter ....................................................................................11
2.5
Kecerdasan Buatan (Artificial Intelligence) ...............................................13
2.6
Sistem Pakar ...............................................................................................14 2.6.1
Konsep Dasar Sistem Pakar ..........................................................15
2.6.2
Struktur Sistem Pakar....................................................................15
2.7
Pendekatan Berbasis Aturan (Rule Based Reasoning) ...............................18
2.8
Konsep Metode Forward Chaining ............................................................19
2.9
Adobe Flash ...............................................................................................23
2.10
ActionScript ...............................................................................................24
2.11
Database MySQL .......................................................................................24
BAB III ANALISA DAN PERANCANGAN SISTEM 3.1
Analisa Masalah .........................................................................................26
3.2
Analisa Sistem............................................................................................27 3.2.1
Analisa Kebutuhan ........................................................................27
3.2.2
Spesifikasi Kebutuhan ...................................................................27 3.2.2.1 Kebutuhan Hardware ......................................................28 3.2.2.2 Kebutuhan Software ........................................................28 3.2.2.3 Kebutuhan Brainware......................................................28 3.2.2.4 Kebutuhan Fungsional ....................................................29 3.2.2.5 Kebutuhan Non Fungsional.............................................29
3.2.3
Analisa Karakter............................................................................29
3.2.4
Skenario Game ..............................................................................30 3.2.4.1 Level Permainan..............................................................31
3.2.5
Analisa Forward Chaining Dalam Game ......................................33
viii
3.2.5.1 Representasi Variabel Rule .............................................33 3.2.5.2 Representasi Kondisi Variabel Rule ...............................35 3.2.5.3 Representasi Hasil Review ..............................................38 3.2.5.4 Representasi Kondisi Review .........................................38 3.2.5.5 Representasi Level ..........................................................39 3.2.5.6 Representasi Cara Kerja Game .......................................39 3.2.5.7 Pohon Kesimpulan (Inference Tree) ...............................40 3.2.5.7.1 Pohon Kesimpulan Rules Kondisi dan Review ...........................................................41 3.2.5.7.2 Pohon Kesimpulan Review dan Level ...........43 3.2.5.8 Aturan Game (Game Rules) ............................................43 3.2.5.8.1 Aturan Game Berdasarkan Review ................43 3.2.5.8.2 Aturan Game Berdasarkan Leveling ..............48 3.2.5.8.3 Aturan Game Berdasarkan Review dan Leveling .........................................................48 3.3
Perancangan Sistem ...................................................................................54 3.3.1
Penggambaran Awal Sistem .........................................................54
3.3.2
Navigation Map .............................................................................54
3.3.3
Model Analisa Sistem ...................................................................56 3.3.3.1 Use Case Diagram ...........................................................56 3.3.3.2 Activity Diagram .............................................................57 3.3.3.3 Sequence Diagram ..........................................................61 3.3.3.4 Statechart Diagram ..........................................................65 3.3.3.5 Class Diagram .................................................................68
3.3.4
Resource Game .............................................................................68 3.3.4.1 Gambar ............................................................................69 3.3.4.2 Suara dan Musik ..............................................................72
3.4
Perancangan Database ................................................................................72
3.5
Perancangan Desain Interface ....................................................................73 3.5.1
Desain Interface Halaman Awal Game .........................................73
3.5.2
Desain Interface Menu Utama ......................................................73
3.5.3
Desain Interface Input User ..........................................................74 ix
3.5.4
Desain Interface Permainan ..........................................................75
3.5.5
Desain Interface Pengaturan Game ...............................................75
3.5.6
Desain Interface Skor Tertinggi ....................................................76
3.5.7
Desain Interface Tentang Game ....................................................77
3.5.8
Desain Interface Review Lanjut Level ..........................................77
3.5.9
Desain Interface Review Ulang Permainan ..................................78
3.5.10 Desain Interface Menang ..............................................................78
BAB IV IMPLEMENTASI DAN PENGUJIAN 4.1
Implementasi ..............................................................................................79 4.1.1
Implementasi Antar Muka dan Kode Program .............................79 4.1.1.1
Implementasi Tampilan Awal Game .............................79
4.1.1.2
Implementasi Menu Utama ............................................80
4.1.1.3
Implementasi Input User ................................................81
4.1.1.4
Implementasi Permainan Level 1 ...................................82
4.1.1.5
Implementasi Permainan Level 2 ...................................83
4.1.1.6
Implementasi Permainan Level 3 ...................................84
4.1.1.7
Implementasi Pengaturan Game ....................................85
4.1.1.8
Implementasi Skor Tertinggi..........................................86
4.1.1.9
Implementasi Tampilan Tentang Game .........................87
4.1.1.10 Implementasi Review Lanjut Level ................................88 4.1.1.1 1 Implementasi Tampilan Ulang Permainan .....................92 4.1.1.12 Implementasi Tampilan Menang ....................................93 4.2
Pengujian Perangkat Lunak Game .............................................................94 4.2.1
Pengujian Fungsional Game .........................................................94
4.2.2
Pengujian Forward Chaining ........................................................95
4.2.3
4.2.2.1
Pengujian Forward Chaining Level 1 ............................95
4.2.2.2
Pengujian Forward Chaining Level 2 ............................97
4.2.2.3
Pengujian Forward Chaining Level 3 ............................99
Pengujian Game Dengan Kuisioner ............................................101
x
BAB V PENUTUP 5.1
Kesimpulan ..............................................................................................105
5.2
Saran .........................................................................................................106
DAFTAR PUSTAKA BIOGRAFI PENULIS
xi
DAFTAR GAMBAR Halaman Gambar 2.1
Struktur Sistem Pakar.....................................................................16
Gambar 2.2
Diagram Pelacakan Kedepan (Forward Chaining)........................21
Gambar 2.3
Diagram Proses Pelacakan Forward Chaining ..............................23
Gambar 3.1
Konsep Kerja Forward Chaining pada Game Duck Hunter ..........33
Gambar 3.2
Representasi Proses Cara Kerja Game ...........................................40
Gambar 3.3
Inference Tree Rules Kondisi dan Review Level 1 .........................41
Gambar 3.4
Inference Tree Rules Kondisi dan Review Level 1 .........................42
Gambar 3.5
Inference Tree Rules Kondisi dan Review Level 1 .........................42
Gambar 3.6
Inference Tree Review dan Level ...................................................43
Gambar 3.7
Navigation Map Game Duck Hunter .............................................55
Gambar 3.8
Use case diagram user akses game ................................................56
Gambar 3.9
Activity diagram user bermain game ..............................................57
Gambar 3.10 Activity diagram level permainan ...................................................58 Gambar 3.11 Activity diagram user melakukan pengaturan game.......................59 Gambar 3.12 Activity diagram user melihat skor tertinggi ..................................59 Gambar 3.13 Activity diagram user melihat tentang game ..................................60 Gambar 3.14 Activity diagram user keluar dari aplikasi game ............................61 Gambar 3.15 Sequence diagram user bermain game ...........................................62 Gambar 3.16 Sequence diagram level permainan ................................................62 Gambar 3.17 Sequence diagram user melakukan pengaturan game ....................63 Gambar 3.18 Sequence diagram user melihat skor tertinggi ...............................64 Gambar 3.19 Sequence diagram user melihat tentang game ...............................64 Gambar 3.20 Sequence diagram user keluar dari aplikasi game .........................65 Gambar 3.21 Statechart diagram permainan level 1 ............................................66 Gambar 3.22 Statechart diagram permainan level 2 ............................................66 Gambar 3.23 Statechart diagram permainan level 3 ............................................67 Gambar 3.24 Class diagram keseluruhan sistem game .......................................68 Gambar 3.25 Background Menu Utama ..............................................................69 Gambar 3.26 Karakter Penembak ........................................................................69
xii
Gambar 3.27 Karakter Target Bebek ...................................................................70 Gambar 3.28 Karakter Burung Penghalang .........................................................70 Gambar 3.29 Karakter Kelinci Penghalang .........................................................70 Gambar 3.30 Karakter Kelelawar Penghalang.....................................................71 Gambar 3.31 Alat Senapan ..................................................................................71 Gambar 3.32 Peluru .............................................................................................71 Gambar 3.33 Koin ................................................................................................72 Gambar 3.34 Desain interface halaman awal game .............................................73 Gambar 3.35 Desain interface halaman menu utama ..........................................74 Gambar 3.36 Desain interface halaman input user ..............................................74 Gambar 3.37 Desain interface halaman permainan .............................................75 Gambar 3.38 Desain interface halaman pengaturan game ..................................76 Gambar 3.39 Desain interface halaman skor tertinggi ........................................76 Gambar 3.40 Desain interface halaman tentang game ........................................77 Gambar 3.41 Desain interface halaman review game lanjut level .......................77 Gambar 3.42 Desain interface halaman review ulang permainan .......................78 Gambar 3.43 Desain interface halaman menang .................................................78 Gambar 4.1
Implementasi Tampilan Awal Game .............................................79
Gambar 4.2
Implementasi Tampilan Menu Utama ............................................80
Gambar 4.3
Kode Program Menu Utama...........................................................80
Gambar 4.4
Implementasi Tampilan Input User ...............................................81
Gambar 4.5
Kode Program Input User ..............................................................81
Gambar 4.6
Implementasi Tampilan Permainan Level 1 ...................................82
Gambar 4.7
Kode Program Permainan Level 1 .................................................82
Gambar 4.8
Implementasi Tampilan Permainan Level 2 ...................................83
Gambar 4.9
Kode Program Permainan Level 2 .................................................83
Gambar 4.10 Implementasi Tampilan Permainan Level 3 ...................................84 Gambar 4.11 Kode Program Permainan Level 3 .................................................85 Gambar 4.12 Implementasi Tampilan Pengaturan Game ....................................86 Gambar 4.13 Kode Program Pengaturan Game ...................................................86 Gambar 4.14 Implementasi Tampilan Skor Tertinggi ........................................87 Gambar 4.15 Kode Program Simpan Skor Tertinggi ...........................................87
xiii
Gambar 4.16 Implementasi Tampilan Tentang Game .........................................88 Gambar 4.17 Implementasi Tampilan Review Gold Medal dan Bonus Skor 200..........................................................................................88 Gambar 4.18 Kode Program Review Gold Medal dan Bonus Skor 200 ..............89 Gambar 4.19 Implementasi Tampilan Review Silver Medal dan Bonus Skor 100..........................................................................................89 Gambar 4.20 Kode Program Review Silver Medal dan Bonus Skor 100.............89 Gambar 4.21 Implementasi Tampilan Review Bronze Medal dan Bonus Skor 50............................................................................................90 Gambar 4.22 Kode Program Review Bronze Medal dan Bonus Skor 50.............90 Gambar 4.23 Implementasi Tampilan Review Bonus Skor 40 ............................91 Gambar 4.24 Kode Program Review Bonus Skor 40 ...........................................91 Gambar 4.25 Implementasi Tampilan Review Bonus Skor 25 ............................92 Gambar 4.26 Kode Program Review Bonus Skor 25 ...........................................92 Gambar 4.27 Implementasi Tampilan Review Ulang Permainan ........................93 Gambar 4.28 Implementasi Tampilan Menang ...................................................93
xiv
DAFTAR TABEL Halaman Tabel 3.1
Variabel Rule ....................................................................................34
Tabel 3.2
Representasi Variabel Rule Level 1 ..................................................34
Tabel 3.3
Representasi Variabel Rule Level 2 ..................................................34
Tabel 3.4
Representasi Variabel Rule Level 3 ..................................................35
Tabel 3.5
Representasi Kondisi Variabel Rule Level 1.....................................35
Tabel 3.6
Representasi Kondisi Variabel Rule Level 2.....................................36
Tabel 3.7
Representasi Kondisi Variabel Rule Level 3.....................................37
Tabel 3.8
Representasi Hasil Review ................................................................38
Tabel 3.9
Representasi Kondisi Review ............................................................39
Tabel 3.10
Representasi Level ............................................................................39
Tabel 3.11 Aturan Game Duck Hunter Berdasarkan Review Permainan Level 1 ................................................................................................44 Tabel 3.12 Aturan Game Duck Hunter Berdasarkan Review Permainan Level 2 ................................................................................................45 Tabel 3.13 Aturan Game Duck Hunter Berdasarkan Review Permainan Level 3 ................................................................................................46 Tabel 3.14
Aturan Game Duck Hunter Berdasarkan Leveling ...........................48
Tabel 3.15
Aturan Game Duck Hunter Berdasarkan Review dan Leveling Permainan Level 1 ............................................................................49
Tabel 3.16
Aturan Game Duck Hunter Berdasarkan Review dan Leveling Permainan Level 2 ............................................................................50
Tabel 3.17
Aturan Game Duck Hunter Berdasarkan Review dan Leveling Permainan Level 3 ............................................................................52
Tabel 3.18
Tabel Data Skor ................................................................................72
Tabel 4.1
Pengujian Fungsional Game .............................................................94
Tabel 4.2
Pengujian Forward Chaining Dalam Game Level 1 .........................96
Tabel 4.3
Pengujian Forward Chaining Dalam Game Level 2 .........................97
Tabel 4.4
Pengujian Forward Chaining Dalam Game Level 3 .........................99
Tabel 4.5
Hasil Kuisioner Pertanyaan Nomor 1 .............................................101
xv
Tabel 4.6
Hasil Kuisioner Pertanyaan Nomor 2 .............................................102
Tabel 4.7
Hasil Kuisioner Pertanyaan Nomor 3 .............................................102
Tabel 4.8
Hasil Kuisioner Pertanyaan Nomor 4 .............................................103
Tabel 4.9
Hasil Kuisioner Pertanyaan Nomor 5 .............................................103
Tabel 4.10
Hasil Kuisioner Keseluruhan ..........................................................104
xvi
DAFTAR PUSTAKA [1] Dwi Tya Mutmainah. SISTEM PAKAR UNTUK DIAGNOSA PENYAKIT ANAK DENGAN METODE FORWARD DAN BACKWARD CHAINING (STUDI KASUS DI POSYANDU-PUSKESMAS MANDALAMEKAR). 2011. http://elib.unikom.ac.id/files/disk1/541/jbptunikompp-gdldwityamutm-27030-7-unikom_d-i.pdf, didownload pada tanggal 30 April 2014. [2] Esperanza. Menggerakkan movieclip dengan Motion Tween pada Event Listener ActionScript 3.0. 2013. http://forum.gardumedia.com/thread/ menggerakkan-movieclip-dengan-motion-tween-pada-event-listeneractionscript-3.0.html, diakses pada tanggal 24 Maret 2014. [3] Ginanjar Wiro Sasmito. APLIKASI SISTEM PAKAR UNTUK SIMULASI DIAGNOSA HAMA DAN PENYAKIT TANAMAN BAWANG MERAH DAN CABAI MENGGUNAKAN FORWARD CHAINING DAN PENDEKATAN BERBASIS ATURAN. 2010. http://eprints.undip.ac.id/26470/1/ginajar_wiro_msi.pdf, didownload pada tanggal 23 Januari 2014. [4] Media Tutorial. Membuat tombol play dan stop untuk memutar file mp3. 2011. http://mediatutorial.web.id/2011/06/flash-no4-membuat-tombol-playdan-stop.html. diakses pada tanggal 25 Januari 2014. [5] STMIK Duta Bangsa. MANIPULASI DATABASE MYSQL. 2014. http://ebookbrowsee.net/modul-praktikum-multimedia-bab-14-manipulasidatabase-mysql-pdf-d683875366. didownload pada tanggal 30 April 2014. [6] Wikipedia. 2014. Duck Hunt. http://en.wikipedia.org/wiki/Duck_Hunt, diakses pada tanggal 24 Maret 2014. [7] Yogie S, dkk. Game Chicken Roll dengan Menggunakan Metode Forward Chaining. 2013. http://jurnaleeccis.ub.ac.id/index.php/eeccis/article/ download/200/173, didownload pada tanggal 23 Januari 2014.
xvii