Hi there folks,
this blog is getting more attention, which, of course, is a good thing. Some of the mails I have ben getting lately have been inquieries concerning our workflow Blender -> Unity, especially concerning the interactive objects and the walkable areas. Well, here it goes, a more detailed description of what we do:
1. The Images
The first image shows the empty scene, in the case of the kitchen these are three planes, UV-Unwrapped and textures with the background, the oven in the middle (tga with alpha-channel) and the stairs to the left and the right (also tga with alphachannel). Another view of the scene can be seen in this article. The planes are Tracked-To the camera, like that they are facing the camera directly. As Unity and Blender have different unit-system, it can be quite difficult to get the camera distances right, including the focal-lenght. So we use an Empty to transfer the position and facing-direction of the camera to unity - the focallength is being adjusted manually using the upper and lower border of the background-planes for guidance.
2. The walkable Area
The second thumbnail shows the walkable area (blue), a simple mesh, which will be hidden in Unity. The character can only walk on this mesh, no matter where the player clicks. A simple pathfinding is done to get to the nearest point possible to the clicked spot.
3. Interactive objects
With interactive objects I mean clickable, static objects (in contrast to other characters). These include objects that can be looked at, objects that can be taken and also doors - in short, everytime you are interacting with the scene, you click on a hidden mesh - these meshes can be seen in the third thumbnail in yellow.
Sometimes, when you take an item you need to display the change in the scene. We do this by placing sprites in front of the textured planes from (1). These can be hidden or displayed, and like that simulate change in the scene. You can see it in the fourth screenshot with an orange outline.
5. Naming Conventions and Import into Unity
As we don't have much possibilities to transfer information from Blender to Unity, we use the names of the meshes to be able to identify the objects and connecting them to our xml-files (see this article). So, for example, an interactive object is called HG_23_Knife_K. These strings can be parsed by unity and result in information: HiddenGeometry - ID 23 - name: Knife - room: Kitchen. Like that, we can not only separate the different kinds of objects (walkable Area, interactive Objects, Sprites, Background-Images), but also automate tasks like importing and setting certain attributes with a simple script in unity.
6. Scripting with the Online-Tool
The IDs of the objects are unique for each object and are handled and generated by our Online-Tool, a php-script communicating with a MySQL-Database. Each interactive object will have an xml-File, generated by the tool and describing for example certain actions to be taken when clicked. Concerning the xml-files we also use a naming convention and Unity hereby is able to connect an xml-File to a certain object in the scene by comparing the IDs.
Well I hope this helps someone understand a little bit more, how we do things. If not, use the comments or the contact-form :-) Happy blending and uniting...