Welcome to tridi game development

In this blog, i'll try to explain how to create game, tips and tricks to develop game, especially using my 3D engine, tridi - in English and Indonesia.

Game Database

Do we really need database in game ?

Of course we do. Although maybe we not using a database engine such MySQL, Access, we still use "database" in our game. Database is needed to hold data that can easily modified such as save game, status, items in game, characters.

In RPG game, database is used extensively. RPG game itself is like a database program. We can have stats, we can interact with NPC that can pop some dialogs. We can buy or sell items, use items, etc.

The question is, do we need Sql database on our game ?

The answer is depends on our needs. But using Sql database has advantages and disadvantages.

Advantages:

  1. We can query data easily using SQL
  2. We can edit data using external available data manager (such Microsoft Access, Navical Mysql)
  3. Well, we dont create a new engine, so can be integrated easily, and (i hope) no bug in database engine

Disadvantages:

  1. Slow
  2. Addition file (engine) or maybe server

If we create our own database engine, well maybe:

  1. Fast, we only make something we need.
  2. Small file (maybe)
  3. No file addition (engine)

But:

  1. We must deal with buggy engine.
  2. We must make data manager too to edit database.
  3. We can't use Sql query to easily filter data or join some table/data

In my game, i use Sqlite database engine. Its small footprint (200kb) and we can use Sql Query to get data easily. But in my game, i cant save BLOB type data yet. Because in my game i create a bridge between Python and Sqlite using Delphi, so - some feature are not included yet.

To edit data, i use FireFox Sqlite plugin at first. But in the end, i make a specific data editor for my game, so i can edit things easily.

Indonesia:

Apakah kita membutuhkan database di game ?

Tentu kita membutuhkannya. Meskipun mungkin kita tidak menggunakan database seperti Mysql, Ms Access, kita tetap membutuhkan "database" di game. Database digunakan untuk menyimpan data yang bersifat permanen ataupun status yg harus disimpan di file.

Di game RPG, database digunakan sangat intensif. Karena game RPG ini sendiri seperti sebuah program database, bayangkan item yg bisa anda gunakan, jual atau beli, karakter yang bisa anda ajak komunikasi, dan lain-lain.

Pertanyaannya: apakah kita membutuhkan database SQL di game ?

Jawabannya tentu tergantung kebutuhan kita. Memakai SQL database memiliki keuntungan dan rugi sebagai berikut:

Kelebihan:

  1. Bisa mengambil data dengan query filter
  2. Mengedit data menggunakan tool yg sudah ada
  3. Engine yg kita pakai setidaknya sudah teruji dan bebas bug

Kekurangan:

  1. Lambat
  2. File tambahan yg harus disertakan

Jika kita membuat sendiri engine databasenya keuntungannya:

  1. Cepat, karena kita pasti membuat sesuai kebutuhan saja
  2. Ukuran file datanya kecil (mungkin)
  3. Kecil ukurannya, tidak menambahkan file lagi diluar

Tapi:

  1. Bagaimana kalau engine kita ada bugnya ?
  2. Harus membuat data editor sendiri
  3. Tidak bisa menggunakan SQL query untuk filter

Di game yg saya buat, aku menggunakan Sqlite, ukuran engine cukup kecil, 200kb. Fiturnya lengkap, meskipun beberapa fitur belum bisa saya manfaatkan.

Untuk mengeditnya saya menggunakan Firefox Sqlite Plugin. Namun pada akhirnya saya membuat sendiri editor yg khusus untuk game yang saya buat.

Tidak ada komentar: