Context Navigation

0 A.D. Basic Model Importing Guide

Table of Contents

In this tutorial we are going to create a simple, non-animated, textured crate/box object to demonstrate the process of importing a basic model into 0 A.D. This example can be extended to work with more complex models and animated objects.

Your final result will look something like this:

Requirements

This guide specifically uses the following free, open-source software:

​Blender - to create the 3D model and UV mapping. Any version should work but the layout described on this tutorial is from version 2.6x. Other 3D modelling software supporting DAE/COLLADA export might work, too.

​GIMP - to create the model's texture. Again any version will work but this tutorial uses 2.8.x. Other image editing software will work, the main feature required is saving PNG images.

​Notepad++ - to edit the actor file. Notepad++ is available on Windows, but almost any decent text editor will do, the most helpful feature is code syntax highlighting.

You must also have an Alpha release of 0 A.D. installed on your computer, or you can use the SVN development version.

Actor file setup

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).
Note: this process can also be accomplished with the the GUI-based actor editor tool.

Texture creation

Here we will create a basic texture file so that we can skin it onto our model later.

STEP 1 - First thing we need to do is find a texture we can use for 0 A.D. Remember our textures are released as ​CC-BY-SA, so the texture you use must be compatible with this license if you are planning for it to be released officially with the game. One of the websites we use to source textures is burningwell.org which is an online library of public domain images. Searching burningwell.org for the keyword 'wood' I found ​this texture, which will work well for this quick example.

STEP 2 - Download the texture and open it in Gimp.

STEP 3 - Most of our texture files are square ( ​see here for more info ), so first we're going to crop the texture to make it square.

Open the texture file in Gimp by going to File > Open... and then selecting the image downloaded from burningwell.org. Once opened the editing window should look like this:

STEP 4 - Now we are going to resize the texture so that it is 128x128 pixels. To do this, go to Image > Scale Image and change the Height value to 128 pixels. Make sure the Height and Width dimensions are locked (this changes the width value to 171px) like in the image below:

Select 'Scale' button to perform the scale

STEP 5 - We're now going to edit the canvas to make the texture 128x128. Go to Image > Canvas Size... and there change the Width to 128px. The Offset can also be set similar to how I've done it below:

Select 'Resize' button to perform the resize to 128x128

STEP 6 - Now we're going to save a PNG file called 'crate_test.png'. Go to File > Export... and select the 'PNG image (*.png)' fileformat in the dropdown. Make the Name 'crate_test.png' and then select 'Export' to save the file. Make a note of where you saved the file for the next step.

3D modeling

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

STEP 1 - Open Blender (the latest version of Blender is always recommended)

STEP 2 - We're going to use the cube that appears by default in Blenders 3D View window:

The first thing we're therefore going to do is change from 'Object Mode' to 'Edit Mode':

STEP 3 - Once in edit mode go to Mesh > UV Unwrap... > Unwrap:

STEP 4 - Surprisingly that's all we need to do in this very simple example. So now we can export the 3D model file by going back into 'Object Mode', selecting the cube, and going to File > Export > COLLADA (.dae):