Another small task off my plate: utility poles.
After putting together a quick moodboard, I started modeling the basic design and created a few different variations. I quite like the wood texturing on those.
However, when I saw them in the game I realized there was something missing. Wires! The poles look so lonely without them…
- Pre-render sets of poles with wires included. This would reduce variety and the textures would be much larger.
- Pre-render wires separately, place them in the editor. Less memory usage but the size and direction is still fixed. Also extra precision work required for placement.
- Dynamic wires.
I decided to make the wires dynamic.
The first thing I needed was to define anchor points for each pole to attach the wires. I did this in Blender by adding Empty objects and giving them custom names.
The Blender export script then looks for those objects and writes their projected positions into a XML metadata file.
The game loads the metadata, the pole rendering code looks for the nearest neighbour poles, tries to match their anchor points and renders the wires.
All of this took about 3 hours, one of which I spent hunting down a problem with the anchor locations. It turned out I had changed their parent nodes in the Blender hierarchy and the parent inverse offset was wrong.