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.

Exporting blender files

The object we created before must be exported to a file format that tridi understand. I have make a special exporter, you can download here.

Extract the file, you'll get export_obj3.py. You will need to open this file using blender. But you'll need to edit it first (using text editor, like notepad).

You must delete oexport definition from line 43 to 74. And replace it with:

oexport = {'wall':(),'pad':(),'ball':(),'brick':()}

That will tell that it should export those three object that dont have animation. After you edit it. Now time to open in blender. Open the models (bricksmodel.blend) and then change the desktop template to Scripting. And then on the editor press right-click and select "open", then you must open export_obj3.py.




Make a folder in your C:\ name it MODELS. The exporter will export the file to that folder. And then when tridi engine load the file it will create a copy of the object to its cache folder. The copy is converted to binary format by tridi, to ensure fastest loading time.

To start export the models, select all models by press "a" while not in editing mode and mouse cursor in 3D window. All object should have pink outline. And then move cursor to the script editor window and then press "Alt"+"p".

Now take a look in the C:\MODELS folder. You should see 3 files. Now the texture you create before must be copied here too.

So our objects now ready to use in our game. If you make change to the blender model, you must re-export the models.


Indonesia

Objek yang sudah dibuat sebelumnya harus dikonversi/ekspor ke format yang dipahami oleh tridi. Untuk melakukannya kami telah membuat script khusus, silahkan download disini.

Buka file zip tersebut dan simpan export_obj3.py. Anda akan membukanya dengan blender (nanti) tapi sebelumnya harus diedit dulu (dengan notepad juga bisa).

Hapus baris 43 to 74. Ganti dengan:

oexport = {'wall':(),'pad':(),'ball':(),'brick':()}

Baris tersebut kan memberitahu script kalo kita hanya perlu mengkonversi 3 objek, tanpa animasi. Untuk membuka dengan blender, buka file anda (bricksmodel.blend) kemudian ganti model desktopnya ke scripting (default adalah SR2:Model). Kemudian di editor (sebelah kanan), klik kanan dan pilih menu "open", arahkan ke file export_obj3.py yang anda edit tadi.




Buatlah folder di C:\ denga nama MODELS. Program konversi akan menyimpan disitu. Anggap sebagai gudang. Nantinya tridi akan mengambil dari situ dan mengkonversinya ke format biner yang lebih cepat diload dan disimpan di folder CACHE (folder game anda).

Untuk mekonversi, pilih semua objek anda, tekan tombol "a" di 3D editor (kiri), tapi pastikan anda tidak sedang di mode edit dan kursor mouse berada disitu. Kemudian geser cursor mouse ke window Editor, tekan "Alt"+"p".

Sekarang C:\MODELS adak berisi 3 file. Kopikan juga file tekstur yang anda simpan ke sini.

Nah objek sudah siap digunakan di game anda. kalau anda melakukan perubahan model, harus diekspor ulang.

Tidak ada komentar: