Using Heightmaps
Since it seems a few people are back to making maps, I thought I'd finally detail how to import
heightmaps into Legions. Since the editor doesn't have a functioning heightmap import tool I had to find a workaround. It's time consuming and annoying, but it works. The first thing you'll need is an older version of Torque (Torque 1.5 or 1.8 for example). Since you can't legally purchase older versions of Torque/TGEA anymore, use your imagination. You'll preferably want one from around 2007 or so, though earlier ones should work as well. The one in Blockland
might work, I haven't tested it yet. If it does, then that's probably one of the only legal ways of getting this to work.
Once you've found and installed an older version of Torque, next you'll need a heightmap to work with. You can either create your own in something like Photoshop, or find one on the internet. For the sake of simplicity I'll just use one I found on Google:
The lighter parts of the image represent terrain height, while the darker parts represent the lower parts of terrain. Note that this image is 256x256. I'm quite certain that this is the only dimension that will work properly. I've tried 512x512 but it got cut-off when importing. Save this file to your terrain_imports folder, which for me is located at Torque\SDK\example\creator\terrain_imports. Now, open Torque. For me I opened torqueDemo.exe in Torque/SDK/example.
Once opened, select World Editor at the top. A screen like this should appear:
If you've used the Legions editor before some of this might look familiar to you. Go to Window and select Terrain Terraform Editor. Within the Operation list, select Bitmap.
Once you select Bitmap a new window should appear. Navigate to where you stored your heightmap, then press Load at the bottom of the window.
After pressing Load, you should see the heightmap in the white box at the bottom left of the screen. It will appear in green and black, which is fine. Next you must press Choose at the top right of the screen and select the heightmap once more, and press Load again. Press Apply. You'll note that nothing appears to happen. This is because you haven't set the terrain height yet. Select the General option, which should be above Bitmap on the right hand of the screen. Put in a Height Range of 150 or so, and press Apply. If you don't see any hills you'll probably have to click on Bitmap then General again,
then press Apply. For some reason it doesn't always want to register the number you put it. It should look something like this:
Now go up to File, Save Mission As, and save the map. I simply saved this one as heightmapTest.mis. By saving the map you've created a new mission file, but more importantly a new terrain file. Both of these files are (probably) located in Torque\SDK\example\tutorial.base\data\missions. All you need to work with is the new terrain file you created (.ter). Find it and copy it to your legions/data/missions folder.
Now, find a mission file in your Legions missions folder and make a copy of it. Again, for the sake of simplicity I'll just make a copy of Frosbyte and rename it to heightmapTest.mis. Open this new mission file and scroll down to the terrain section, and make the following changes:
};
new TerrainBlock() {
canSaveDynamicFields = "1";
Enabled = "1";
rotation = "1 0 0 0";
scale = "1 1 1";
doDistanceFade = "0";
startFadeDistance = "10";
endFadeDistance = "500";
teamIndex = "-1";
detailTexture = "legions/data/terrains/details/snowdetail256.png";
terrainFile = "legions/data/missions/heightmapTest.ter";
squareSize = "8";
tile = "0";
detailDistance = "42";
detailScale = "512";
detailBrightness = "0.95";
texelsPerMeter = "4";
clipMapSizeLog2 = "9";
bumpOffset = "0.01";
bumpScale = "1";
TypeBool locked = "true";
Position = "-1024 -1024 0";
zeroBumpScale = "8";
};
Now, open Legions and host a game. Once the game has started, open the console and type server::loadmission("legions/data/missions/heightmapTest.mis", "CTF"); and press Enter. You should see something like this:
Go ahead and open the map editor (F11) and do a Full Relight. While the objects will look correct, the terrain will still be black. Go up to Window, Terrain Texture Painter, and change the first texture box to whatever you want. I changed it to grass.
Now, lets compare this to the original heightmap image we used:
Pretty close, eh?
Now, before doing ANY terrain edits your MUST do something very important first. Open Terrain Terraform Editor and delete the Bitmap instance. If you don't, any changes you make will simply flatten the entire map.
That's pretty much all there is to it. Yes, it's annoying and time consuming. But hey it's also pretty damn cool. I used this to create Whiteout. Have fun!