Super Powio - August 4, 2005 2:44 pm So after releasing the terrain exporter, I'm pretty sure I heard at least one person ask if there could ever be a terrain importer. Well, I'm finally glad that I can answer that and the answer is 'yes!' Anyways, the Darkstar engine pretty much has its own built-in terrain importer, so doing this won't require any outside scripts besides the one that should be extracted (though doesn't need to be). [i][u]Getting Started[/u][/i] You have two options from the start. You can either A) Open up "scripts.vol" using VXTool and extract "terrain.cs" into your main Starsiege directory, then open it using a text editor. Or B) Create your own script, as importing a terrain requires no more than a few new lines to be written. Once you execute your script, the changes to the editor will be automatic. Starsiege accepts 256x256 pixel, 8-bit grayscale, bitmaps for heightmaps. Do not try to use any other dimensions for the bitmap because the terrain will start to act stupidly. Trust me, I've tried. It really sucks. Just use 256x256. The .bmp should be placed in one of Starsiege's default directories. [i][u]Importing your Heightmap[/u][/i] Assuming that you're looking at "terrain.cs" right now, at the top of the file you should see some variables that look a little like this: [code]$terrainTypes[0, type] = "flat"; $terrainTypes[0, description] = "Flat terrain"; $terrainTypes[0, visDistance] = 3000; $terrainTypes[0, hazeDistance] = 2000; $terrainTypes[0, screenSize] = 90;[/code] These as what define the terrains in the Terrain Editor. Starsiege has a total of six pre-writen terrain configurations. We're just going to add one more, so you may add the following lines (though this is just an example): [code]$terrainTypes[6, type] = "import"; $terrainTypes[6, description] = "Imported terrain"; $terrainTypes[6, visDistance] = 3000; $terrainTypes[6, hazeDistance] = 2000; $terrainTypes[6, screenSize] = 70;[/code] Scroll down and you should see some more, albiet different stuff, which should look a little like this: [code]function Terrain::flat::create(%seed) { if(%seed == "") %seed = $ME::terrainSeed; LS::addCommand("seed " @ %seed); LS::addCommand("terrain 256 .9"); LS::addCommand("normalize 0 100"); }[/code] Those are all commands being given to the landscaper while the terrain is being generated. While the descriptions of these commands may seem a little cryptic, we only need concern ourselves with the "load" (undocumented) and "normalize" commands. The "load" command is what loads the .bmp you're using as a heightmap. Its only argument is the file name. The "normalize" command sets the minimum and maximum height (respectively; in meters) of the current heightmap. Once you've absorbed all that, go ahead and add some more lines using these as an example: [code]function Terrain::import::create(%seed) { LS::addCommand("yourHeightmap.bmp"); LS::addCommand("normalize 0 100"); }[/code] Note the second class in the function's name ("import"). The name of that class must match the string in the variable $terrainTypes[#, type]. This configuration loads "yourHeightmap.bmp" and sets the minimum height (the black areas of the heightmap) to 0m, and the maximum height (the white areas) to 100m. Once you're done with the script, either restart the game or use the "exec()" command and generate your terrain in the mission editor. The terrain will load with your heightmap, and the terrain textures will plot themselves based on the rules of the world your editing on. [i][u]Tips[/u][/i] Take care when using a heightmap. Starsiege's terrain has extremely large verticies, so if your terrain is not smoothed enough it can appear blocky. If that happens, you can always copy the "smooth" command from one of the other terrain configurations. There's also a command called "save" which uses the same arguments, but it only saves the heightmaps of newly generated terrain. When you use it, your game might appear to lock-up, but actually there's a window in the background which you can get to by alt-tabbing that just displays a harmless error that you can bypass. This will also happen if you input your commands wrong. Anyways, have fun with your imported terrains. Starseeker - August 5, 2005 2:23 pm You can only have 100m of relief? Super Powio - August 5, 2005 4:00 pm You can make it as high as you want. MeijinKeiri - May 5, 2006 8:26 am So I could open up photoshop and play around with an image (with acceptable properties) and make it a terrain? Super Powio - May 5, 2006 11:44 pm That's certainly the premise of this article. But it has to be 8-bit grayscale.