Kings Can Fly

by Firedroid

Archive for July, 2011

About tilesets and repetition

Posted by Willem On July - 28 - 2011

Our first mountain tileset was actually pretty good. It looked cute and did convey the message: “I’m a mountain, don’t bump into me.”
It had it’s problems however. First off, it did not tile correctly in every situation. And placing several straight tiles in a row to create a wall resulted in a hideous repetition.
Rachel tried to solve both with several re-texture attempts, but all of them had the same problems, or were to bland.

So, we tried to solve it with new mesh.
Willem made a new tileset, that featured the solution: Several alternate straight tiles that were different in length (next to a length of one unit, we now have a piece for two, three and four units long).
Since, this elevated the tiling-repetition problem, Rachel could now make a texture that had contrast. It still has to tile nicely with even more combinations however.

The way the UV map is made has changed too.

The first mountain UV was fragmented. Every tile was separated from the other. This made it hard to create a tileable texture. So in the second gen. it was connected. Although this made it easier, all the angeled lines made texturing as a whole a pain.

So the third generation, that we currently use, is horizontally straight. Makes texturing a breeze.
But: as any UV-mapper out there knows. This makes the texture distort enormously, since the UV is not a accurate representation of the actual mesh. We were surprised with the distortion, it’s not really noticable.

Clouds and skirts

Posted by Willem On July - 7 - 2011

Sadly for us, the iPad 1 is very weak at rendering alpha (semi-transparent surfaces). So using clouds is a bit of a problem, seeing how they’re a significant part of the game’s look and feel.

Performance-wise we can get a single alpha-rendered plane covering the entire map, and then only when the mesh below is flat and has just one solid texture. We get about 28 fps when the alpha plane is covering 2/3 of the screen, which gets better when more solid mesh is visible (rendering alpha is fill-rate bound on the iPad).

Instead of going for a single solid plane with clouds painted on it, and a similar cloud filled alpha plane above it, we opted for loose 2d clouds. The “semi-alpha planes” are cut in half, the center part does not contain an alpha shader. This to reduce the amount of alpha drawn.

Because all the clouds are flat they clip though the mountains, which breaks the illusion and looks weird.
Our answer to this are “skirts”. This is a mesh around the side of the mountains containing a texture with alpha that has a gradient to transparency at towards the mountain and towards the cloud-layer. This gives the illusion that there are clouds around the mountains and blends it together to look smooth and natural without a big performance penalty.

Lowland Fan

Posted by Rachel On July - 1 - 2011

We’ve added a new feature, where players can now also place fans on the ground, instead of just on the mountains. We’ve given the new fan more body and made them look cuter. The current model has 292 triangles.

The original designs for this fan:

Balloon Brothers and Tiled

Posted by Roy On July - 1 - 2011

As our development progresses we’re closer and closer to a version that supports puzzles and can be played as a game (although it’ll be a work-in-progress). So we’ve had to think about how we’re making those puzzles and how to feed them into our game. Now we already stumbled upon the Tiled Map Editor, which is a free and opensource mapping tool for games that are based on tilemaps. We filed it away as a great tool for later use, while we focused on the basic elements of the game.

Recently that core has become complete enough to warrant a second visit to Tiled and see how we could use it to build our puzzles. We made a tileset and set to work!

First up is handling rotation. The tileset has four different versions for straight lines and corners, as they can go up, down, right or left. We only have one 3d model for such things, so they needed to be mapped to the tileset. We thought about building fancy and complicated solutions but in the end we simply used an array with objects that contain information about the tile. Each tile in the tileset is coupled with such an object, which holds information like rotation, direction, height, etc, everything the engine needs.

Tiled outputs an XML file containing the information about the map size, layers and tiles in it and after fiddling with some Unity scripts people wrote we decided to just use C#’s native XML functions. In the end this works really neat and we’re very happy with Tiled as our tool for building levels since it’s a good map editor for our needs.