This post summarise the requirements for models used within Planetary Annihilation. This is not dealing with the technical aspects of the model format; rather this is about how to properly build a model for use in game. A model requires the model file itself, which has the extension .papa. Each model also has three .png texture files. The particulars of these two components are explained below. While testing, it is helpful to take advantage of the fact that Planetary Annihilation will re-load files if it detects a change, so you do not need to exit and restart to see changes. Models: Models are made up of a mesh and an underlying bone structure. There are four default bones for each model: "<unit name>_mesh" "Solid" "DiffuseColor" "bone_root" The actual name of the <unit name> bone doesn't seem to matter (the anti-air tower has "laser_defense_mesh", for example). The purpose of "Solid" and "DiffuseColor" are not clear. Finally, "bone_root" is the parent bone for all subsequent bones. These four bones all reside at coordinate {0,0,0}. Further bones are used for weapons & animations; whenever a "point" on the model is required (such as where to aim from). The Model and Bone structure of the Spinner AA vehicle. Note the multiple bones at the origin {0,0,0}. Click for a larger version. Note the directions of the arrows in the above picture so that your model is correctly oriented. The red arrow is X, the Blue arrow is Z and the green arrow is Y. Models should face towards negative Y, with the Z axis up. Models can be imported using the Blender importer, available from this thread: viewtopic.php?f=72&t=47964. The tool papatran.exe can be used to create .papa files (see viewtopic.php?f=72&t=48386). Textures There are three texture files that accompany each model: <model_name>_diffuse.png <model_name>_mask.png <model_name>_material.png Diffuse, Mask and Material Textures for the Spinner AA vehicle. Diffuse is the standard texture, except where it intersects with the mask. The mask and material textures alter the diffuse based on the values of the RGBA channels as follows: Mask Texture (#FF0000) Red: Player Primary Colour Shown (based on greyscale) (#00FF00) Green: Player Secondary Colour Shown (based on greyscale) (#0000FF) Blue: Emissive mask (final diffuse color * 2, ignores lighting) [see this post] Alpha Channel: Approxmated distance field [see this post] Red and Green areas will use the same area on the diffuse to determine how much of the player colour to show. White and black will appear white and black, but in between will show a gradient, such that half way (Red = 128) will show the team colour as expected. Material Texture (#FF0000) Red: Specular Mask (#00FF00) Green: Specular Sharpness (#0000FF) Blue: Unused Alpha Channel: Unused
The mask blue areas do not receive lighting. They stay 100% the diffuse texture color no matter if they are in light/highlight/shadow. These are used for lights, and anything glowing (green areas on factories/constructors). I can confirm there is specular going on, so I assume this is the alpha channel on the diffuse. I'm not sure what the material map is for, but my guess is it has something to do with the under-construction shader. I think the green channel might color the faces when the faces fill in green. The red channel also has info on it, and I have no idea what that is for. The blue channel appears empty (all black). Edit: Maybe this entire map is just the diffuse map for the construction shader? If the green they chose isn't 0,255,0 then that would explain the tiny bit of info on the red channel and empty blue channel.
in that case the blue mask is an emissive mask, although the difference between unlit and emissive is not huge.
Yeah I couldn't remember the right word for it. Edit: Ok I got it mostly figured out. Diffuse alpha affects the building material. Fully opaque (255/white) on the alpha channel is what paints the wireframe on the building. I painted some fully opaque pink on the diffuse (bottom right) and you'll see it reflects on the in-progress model (top center). Material red & green are some sort of specular/gloss map. If the blue channel is being used I couldn't see any changes from it. Red alone places a light checker across the entire building (even in shadows). Green alone does nothing. Both together results in gloss and some sort of edge detection which may or may not be intended.
Alpha of the diffuse is an approximated distance field created with a photoshop edge glow from the model's UVs used for the wireframe rendering. I'm hoping this will be generated by the game instead of approximated in photoshop by the time the game is finished. Also, that diffuse example shown in your thread has the alpha modifying the color (treating it as premultiplied). This is default behavior for several programs when handling PNG files, and is wrong for the way we're using alpha and why I suggested using SuperPNG for Photoshop or importing Alpha as a separate channel if using something like Gimp. Mask texture is as described by those in the channel. Red = Primary color mask Green = Secondary color mask Blue = Emissive mask (final diffuse color * 2, ignores lighting) Primary and secondary colors are blended with the diffuse texture by way of an equivalent to the Photoshop overlay blend mode. ie: Whites stay white, blacks stay black. 50% grey = color. You can do team colored emissive by having areas of purple (red & blue) or teal (green & blue). Material texture: Red = Specular mask Green = Specular sharpness Blue = Unused (for now)
Why are you reading the forums on a Sunday? Go drink beer! Thanks for explaining; it all makes sense now.
Ok... Let's say hypothetically I want to create a new vehicle (and the server tools are available) What do I do? Where do I start?
First you have to create a model. This should have a base bone and a tool bone at the very least Make a unit info json file. This file follows the json format. Look at another units file and it will pretty much make sense. Unit tool: The thing on the unit that performs actions, on a fabber this us the fabber arm. On a tank its the gun. I would just find a pre-existing tool and use that. In your model you will have to name your tool bone a certain name for the tool in the json file to bind to it.
1. Ok. So what does that have to entail. Does the JSON contain all the degrees of freedom, or are all of that contained in the bones. What tool is used to create the bones - some kind of CAD software yeah? Any kind, or specifically one programme?
Use a modeling software like Blender to create the model. In modeling the term bones is used to represent an object that has vertices bound to it. These are created in a program called blender. If this doesn't make any sense than check out the tutorials at Blender Cookie. The JSON holds the game information about the unit. Like how much it costs, how much it uses, movement, the 3d model to display. I would recomend learning how to use blender and be farmiliar with 3d modeling. Be able to model household items.
Done, I work with CAD as part of my degree. Odd terminology that appears specific to Blender. You create the model using Papa. And then you apply constraints right? So it's just normal CAD. Sweet alright. So model controls the way a model looks and JSON controls the model, right? If you swapped the ant and dox models the dox would roll like a tank and the ant would walk like a dox.
Bones are common terminology for games and skeletal animation (which is preferred over per-polygon animation by just about everyone). The Blender-specific version is an armature.
May be a little out of date: https://forums.uberent.com/threads/reference-unit-composition.48310/ https://forums.uberent.com/attachments/unit-png.10733/
Quick question. I have practically no experience with creating texture and just wanted to ask how did you achieve the gradients in the diffuse layer (Preferably in photoshop)?
As a industrial designer and a guy that knows his way around 3d software etc pretty well, how easy is it to start adding in own units and testing them in pte mode? I absolutely love the game, the style, low poly modelling and just pure adrenaline rush of fighting off one battle just to be blind-sided by another attack. So I obviously want to start tinkering around and building and designing my own units and buildings and textures and effects. Any good advice, tuts , links, anything would be greatly appreciated Thanks in advance