| 1 | ''' 0 A.D. basic 3D implementation guide''' [[BR]] In this guide we will be using [http://www.blender.org/ Blender] to create the 3D model, [http://www.gimp.org/ GIMP] for textures, and [http://notepad-plus-plus.org/ Notepad++] for basic coding. All three of these programs are free and opensource, although other programs may be used to achieve similar results. You must also have an Alpha release of 0 A.D. installed on your computer. (SVN versions can also be used) |
| 2 | |
| 3 | To keep things simple, we are going to create a simple crate. |
| 4 | |
| 5 | |
| 6 | [[BR]]'''Actor file setup''' |
| 7 | [[BR]]Lets begin by creating an 'actor' xml file that will link our 3D model with the texture file and crucially make them visible in Atlas (0 A.D.'s Map/Scenario Editor). |
| 8 | |
| 9 | * Navigate to the 'mods' folder in the game's installation directory: binaries\data\mods |
| 10 | |
| 11 | * In the mods folder you will have a 'public.zip' file that needs to be extracted into a folder also called 'public' within the 'mods' folder. |
| 12 | |
| 13 | * Once the public zip is extracted, navigate to the following folder: binaries\data\mods\public\art\actors\props\special\eyecandy |
| 14 | |
| 15 | * Make a duplicate of the actor file called 'crate_a.xml' and call it 'crate_test.xml' |
| 16 | |
| 17 | * Open the 'crate_test.xml' file in Notepad ++ (or any code editor). You will see this:[[BR]] |
| 18 | [[Image(http://i173.photobucket.com/albums/w73/purepics/0AD/actoropen.gif)]][[BR]] |
| 19 | |
| 20 | * We need to change the file locations for 'mesh' and 'texture' to these:[[BR]] |
| 21 | <mesh>props/wrld_crate_test.dae</mesh>[[BR]] |
| 22 | <texture>props/crate_test.png</texture> |
| 23 | |
| 24 | * Save the file (as 'crate_test.xml') and close Notepad ++ |
| 25 | |
| 26 | [[BR]]'''Texture creation''' |
| 27 | [[BR]]Here we will create a basic texture file so that we can skin it onto our model later. |
| 28 | |
| 29 | * First thing we need to do is find a texture we can use for 0 A.D. Remember our textures are released as [http://creativecommons.org/licenses/by-sa/3.0/ CC-BY-SA], so the texture you use must be compatible for it to be released. One of the websites we use is burningwell.org which has many public domain images. Search for 'wood' and I found [http://www.burningwell.org/gallery2/v/textures/buildings/fences/wood966.jpg.html this] texture |
| 30 | |
| 31 | * Download the texture and open it in Gimp. Most of our texture files are square, so we're going to crop the texture and resize it to be 128x128 pixels |
| 32 | |
| 33 | * Save PNG file called 'crate_test.png' |
| 34 | |
| 35 | * Move PNG file to the following location: binaries\data\mods\public\art\textures\skins\props |
| 36 | |
| 37 | |
| 38 | [[BR]]'''3D modeling''' |
| 39 | [[BR]]Here we will go through the basic requirements of creating a textured (UV Mapped) model and exporting it as a Collada DAE format 3D file |
| 40 | |
| 41 | * Open Blender |
| 42 | |
| 43 | * Select cube |
| 44 | |
| 45 | * UV Map cube |
| 46 | |
| 47 | * Export as DAE |
| 48 | |
| 49 | * Move the DAE file to the following location: binaries\data\mods\public\art\meshes\props |
| 50 | |
| 51 | [[BR]]'''Viewing model in Atlas''' |
| 52 | [[BR]]After saving the actor file, creating the texture, and exporting the 3D model, we can now open 0 A.D.'s Atlas Editor to view the crate in-game |
| 53 | |
| 54 | * Run 0 A.D. and in the menu select Tools & Options > Scenario Editor |
| 55 | |
| 56 | * Open Atlas |
| 57 | |
| 58 | * In the Actors(all) list find props\special\eyecandy\crate_test.xml |