Light at the end of the tunnel

I didn’t work on the oil depot shown earlier, but rather tried something new, tunnels. These were not there yet, as normal heightmaps do not support tunnels at all. There are two different possible ways to build tunnels with heightmaps. The first one is reating a static object that looks like mountain on top and putting it in a valley. This will always work, but it requires you to create practically a new static object for every single tunnel if it should look right.

The alternative is to define some areas in the map as “holes”, where you do not apply texture and no collision mesh is created. Then, a tunnel, implemented as a static object, is inserted to connect two of these holes. This enables you to design the space above the tunnel just like the rest of the map and avoid any visual differences between areas above a tunnel and not. I opted for this option and first of all, created a static tunnel.

Tunnel with triangles where quadrangles should be, looking very strange

I quickly realized that my code for loading quadrangles was wrong. After fixing this and implementing what I wanted into the engine (which involved without a few other bugs), I eventually finished the tunnel:

Working, driveable, everything perfect, but it seems like I’ll have to tweak my snowcat further, it somehow has problems driving through this tunnel, which I believe are caused by the fact that it simply sits too low.

I also realised that I have good use for a map editor. At the moment, I’m editing the heightmap with Photoshop and place the objects with Xcode in an XML file.

Written on October 21st, 2005 at 04:14 pm

0 Comments

    New comments can no longer be posted because it got to annoying to fight all the spam.