In this article, I explain our workflow of creating a model for OpenClonk at the example of the lorry originally created by Mimmo. Also, I list things that are important to consider when modelling for use in OpenClonk.
Guidelines for Modelling
- Model on the Y/Z view-plane. Models in OpenClonk appear as they do on the Y/Z plane in blender. The X-Axis goes 'into' the screen. Make sure you model with regard to these axes (The Y/Z plane is the default side view in Blender).
- Do not use Mesh Transformations. Mesh transformations are not handled properly by the OGRE exporter, and will cause deformation in game. If you have transformations applied to an existing model, you can remove them (select the model and press alt+g, alt+s, alt+r). Caution: Avoid animating before removing transformations!
- 3D Model must be Three-Dimensional. The 3D mesh must have length on all axes. Making a perfectly flat object on only two axes will cause it to not appear in-game. To fix this, move a vertex so the mesh has length on all axes.
- Avoid edges with more than two faces connected to them. Edges with more than two faces will cause shading errors in game. An easy way to circumvent this is to separate the third face from the edge, so it is close to the original edge, but not connected.
- What features work with the OGRE format? Not all of the features listed in Blender will affect an exported 3D OGRE mesh. For a full list of compatible features, visit: http://code.google.com/p/blender2ogre/#Blender_to_Ogre_Exporter_Features
Every good modelling process starts with a sketch or some other image as a pattern. For the lorry, Mimmo used a picture from wikimedia commons.
This is the low-poly model of the lorry from Mimmo. If you plan to create both low- and high-poly models, always create the low-poly model first. I assume that you know how to model ;-)
The guideline on how low-poly the model should be is: The model with texture still needs to look good when displayed 3x the size as in Clonk Rage - there is no fixed number on how many polygons are good since it depends strongly on the model.
Details which can be displayed on the texture can be deleted. As you can see in the images, I deleted the bottom and top of the thing where the wheels are attached and replaced the top by a simpler geometry. This is actually all small shit and doesn't matter too much. You don't need to overdo this step as thanks to backface culling, faces that face away from the camera are not drawn anyway.
The lorry here is just a simple example of this removing-the-polygons step because of
- geometric details in the texture that go into the texture rather than in the model
- polygons that are inside other objects and thus never visible or hidden from any view to the object
When I first wrote this tutorial I suggested to delete the faces that face away from the camera. However, this is unecessary as noted above.
After having created the final low-poly model, create a good and clear UV map. The quality of the texture map (, normal map etc) strongly depends on the quality of this work, do not underestimate this step. However, I assume that you know how to unwrap a model (Tutorial for Blender). However, here are a few tips that are especially valid for OpenClonk:
- Mark the seams preferably on the backside of the model. E.g. if there is a cylinder, mark the seam on the side that is not seen ingame. Then the texturer doesn't need to worry (so much) about tileability.
- Regions of the model which are connected in the model should be connected in the uv map too as long as the uv mapping doesn't distort the whole thing (too much).
- Try to arrange the uv regions in a way that regions in the model which are upright are upright and not distorted in the uv map too. This helps the texturer a lot when he want to apply textures with a regular pattern like bricks.
- You can map faces that should look the same - like for example each of the 4 front wheels of the lorry - to the same position in the UV map.
If you don't plan to texture your model right away by yourself, be so kind and create and label a uv-map template and save it as an image. This helps the person who does the texturing work big deal; because the work of the texturing can be done (better) by 2D-artists and doesn't have to be up to the person who did the modelling. Depending on the actual size of the model ingame, you can save the UV map template in different sizes. For the lorry, I chose 256x256 because it is a very tiny model.
As the model and texture for the lorry is already completed, I can show it to you here:
Note that PNG textures can contain alpha. This is how transparency (imagine leaves on trees) is realized in OpenClonk.
Animation and normal maps
After you created a UV map, you can add the animations if there are any. Additionally, if the model is egible for having a normal map, you can create a high-poly model of the lorry where you actually do model even the little geometric details. But keep in mind, to be able to bake a normal map with a high-poly model, the high- and low-poly model must have the same geometry (Tutorial for Blender). In Blender, there is a option called "multires" which allows you to create several models in different detail levels based on one low-poly model and it's geometry.
So when is a model egible of having a normal map. First there is to say that at this point of development we can not even say if we will be able to use normal maps. In general, creating normal maps for models only makes sense for those which have organic, round parts where too many polygons would need to be used. So, for blocky buildings it's normally not necessary - more for living creatures with one (Blender: example) enclosing mesh.
Here is also a free to use tool with which easily all kinds of maps can be created: CrazyBump