Author: | Paul Halliday (aka Lightwave on the Bethesda Morrowind/Oblivion/Fallout3 forums). |
Current Version: | 0.21 (Ninth release): 19-Jan-2009 (First Release 4-Jan-2007) |
Official Homepage: | http://www.projectmanager.f2s.com/morrowind/index.php?menu=TESAnnwyn.html |
TESAnnwyn is a heightmap import/export utility for TES3 (Morrowind) and TES4 (Oblivion and Fallout3) game formats. It can turn the 3D landscape contained in one or more ESP/ESM game files into a single heightmap image, or import a heightmap image back into a 3D landscape for either game. The image formats supported are 8-bit, 16-bit and 32-bit RAW files and 8-bit greyscale, 16-bit and 32-bit BMP files. It can also import and export a 24-bit colour BMP image as a vertex colour map and paste it over the heightmap if desired and it can export a texture placement map for TES3 (multiple layers for TES4) which when reimported will ensure that all the textures are put back in their original places. If you export a TES3 3D landscape to a heightmap and import it to TES4 Oblivion, TESAnnwyn will try and convert all your TES3 textures in to TES4's nearest equivalents (the ones found in Oblivion.esm) so your landscape is fully textured. e.g. You can export the land from Morrowind.esm, Siege at Firemoth.esp and Bloodmoon.esm in to a single heightmap/vertex colour map and texture placement map image and reimport the fully textured lands in to Morrowind or in to a single worldspace in Oblivion. Likewise a TES4 Oblivion textured landscape can be imported to TES3 using the nearest matching textures. With 8-bit greyscale images you can emboss virtually any image on to a 3D landscape with minimal effort and with the vertex colour image you can add photographic quality colour shading. TESAnnwyn can also paste the entire landscape in a base texture of your choosing, for Oblivion this includes the numerous 3D dynamic grass textures. For TES4 you may also define a custom texture on the command-line. Options exist to limit the height-range of imports, limit the maximum and minimum import heights, ignore cells containing land between a specified range, the ability to scale all heights and adjust the vertical height offset. Any exported heightmap image can be additionally processed in a third party image program or heightmap tool for further modification. With a tool such as Adobe Photoshop for example, it is possible to scale up, miniaturize or rotate the entire landscape. When the same is done with the vertex colour map and texture placement map(s), the imported landscape will be an exact translated scaled version, including all the original textures. Heightmap images and vertex colour map images can also be exported with cell-grid lines if desired, which is useful for getting an idea of scale and for producing Claims maps. For TES4 imported landscapes, TESAnnwyn will generate a unique (time based) FormID number for the worldspace which means that any generated LOD (distant land) files will always be displayed in the game regardless of the load order of your mod, saving a lot of testing and redistribution headaches. TESAnnwyn can also generate cell-sized NIF files from a TES4 landscape, though currently these only contain the heightmap and normals (for shading). This system is still in development but is part of the LOD2: Distant Land replacement system which gives full quality in-game distant land without the bugs in the original game's system, at a notable cost to performance. When TESAnnwyn exits, it will also display the highest and lowest points recorded during import or export and the cell co-ordinates in which these were occur. These heights are shown in THU (TES Height Units), Game units and real world metres. The south-west cell location is also displayed during heightmap exports which is helpful to use when re-importing so the cell co-ordinates match the same land position they did before export. This program has been written entirely by myself as has the method of reverse engineering the landscape, vertex colour map and texture format (and various TES3/TES4 record formats). When I wrote it, little data of any use seemed to exist on the net regarding how the TES landscaping works, other than that which I've added myself to the TES4 Wiki since. I always intended to release the source code eventually too, but I still have a few things left I wanted to add in the meantime (mainly a GUI, but this can be a wrapper). The code has evolved in a sometimes hacky fashion and is far from my best, another reason I am hesitant to let it out for public consumption. ;) Currently TESAnnwyn is Command-line based (a shortcut to the standard Windows XP command console is provided, which should work with most people's setups). But I eventually hope to put a GUI on this utility which will make it simpler for the less technically inclined to use. TESAnnwyn gets its name from Annwyn, the Welsh word for the Celtic OtherWorld. And TES, obviously, The Elder Scrolls. :) INDEX1. What TESAnnwyn can do: a. Export a TES3 Morrowind Landscape to a RAW/BMP heightmap image and vertex colour and texture placement BMPS. a. Height points per cell. a. 8-bit Greyscale BMPs. a. Options for importing a landscape from an image. 6. Some Examples a. Export a 16-bit BMP image from Morrowind.esm 7. Additional Credits 1. What TESAnnwyn can do:
a. Export a TES3 Morrowind Landscape to a RAW/BMP heightmap image: f. Import a RAW/BMP image containing heightmap data and create a TES3 Morrowind 3D landscape: The Morrowind, Oblivion and Fallout3 Game engines share the same landscape size and detail restrictions as each other.
The smallest height unit (TES Height Unit = THU) equates to 8 Game Units (GU) which is about 11.4cm. Each height
point on the landscape has a base size of 128x128 game units (1.8m x 1.8m). No finer detail is possible with the
existing standard. One has to resort to texturing and meshes and vertex colouring to give the landscape an even finer feel.
Note however, that at heights greater than about 69km, both TES games start to exhibit jittery rendering problems, so the usable limit is actually much lower.
3. Choosing between RAWs or BMPs Both RAW and BMP file formats are very similar. The only difference is that a BMP has a header at the beginning (at least 54 bytes in size) which includes the
image size and bit-depth and that the image inside a BMP is up-side down compared to a RAW. So you can double-click on a BMP in Windows Explorer and it'll
instantly display the image. RAWs and greyscale BMPs are better suited for modifying the heightmap in 3rd party tools, but 16/32-bit RAWs can hold a lot more
detail than an 8-bit greyscale BMP.
TESAnnwyn will be easier to use when I make a GUI front-end - of all my TES utilities, this one would benefit the most due to the large number of
command-line options. Presently it must be run from the command line. This means typing opening a command prompt that
contains the tesannwyn program (one is distributed with this program which should work for most people's needs) and typing in tesannwyn with
some text after it (e.g. see the examples section). The format is essentially: tesannwyn options filename1,filename2,filename3 ... The options are described below. Many options require an additional parameter. This parameter should always be a whole number, with the exception of the scale option '-s' which can be a floating point decimal, and the Worldspace
option '-w' should always be text (e.g. "Tamriel").
These are the currently available options:
Please note that the '-h' height option is applied before the '-s' scale value.
Again please note that the '-h' height option is applied before the '-s' scale value.
5. Automatic Base Texturing of a Landscape in a single textureIf you don't have a texture placement map (normally created from a heightmap export of an exisiting TES3 terrain),
TESAnnwyn includes a '-t' option which can paste the entire imported landcsape in a texture of your choosing.
This is optional, but provides a much more appealing landscape than the default rock that both games use.
Two files are included with TESAnnwyn: tes3ltex.txt and tes4ltex.txt. The format of the TES3 texture file is: Number, Name, Filename This file is best viewed with Wordpad (notepad can't display it properly).
The last few textures in this file are Bloodmoon textures, which can't be used if you only have Morrowind.esm.
You may add your own textures to the end of this list, but be careful not to damage the ones before since
they are loaded in to the ESP as LTEX records.
FormID, Name, Filename This file is not needed by TESAnnwyn to create textures, it's only provided to help you find the FormID for your desired texture. I think it's possible to find them in the CS somehow too, but I can't remember where atm. iii. Applying a single texture when importing a TES3 landscape. Just specify a '-t number' option as one of the command line parameters. e.g. '-t 0' will apply Sand everywhere, or '-t 35' cobblestones. To turn it all in to snow for example (e.g. texture 117): TESAnnwyn -i 3 -t 117 Myfile.bmp
The tes3ltex.txt file MUST be in the same directory as TESAnnwyn for TES3 textures to be applied. iv. Applying a single texture when importing a TES4 landscape: Just specify a '-t FormID' option as one of the command line parameters. e.g. '-t 00034808' will apply snow everywhere, or '-t 0002ae87' will apply one of the many types of cobblestone textures available. To make everywhere grassy for example (with one of the many 3D grass textures, e.g. 0009c719): TESAnnwyn -i 4 -t 0009c719 Myfile.bmp The output ESP (tesannwyn.esp) will automatically require Oblivion.esm as a master if you use the '-t' option. The tes4ltex.txt file is not necessary to make textures work: Tesannwyn does not use it. Make sure you type the FormID correctly. Case does not matter, but it must be 8 digits long or the TES4 CS will not be able to locate the correct texture when you load the file (and the landscape will be a hideous jet black!). You may also use your own custom texture across the entire landscape if you can't find what you want in Oblivion or Shivering Isles' offering. For example, if you want to paste the entire landscape in a new texture called mysnow.dds, and would like it to be called mysnow in the Construction Set, do: TESAnnwyn -i 4 -u mysnow,mysnow.dds Myfile.bmp You must copy your texture mysnow.dds to the Oblivion\Data\Textures\Landscape directory in order for the game and CS to display it. You may also specify a sub-directory if you wish. v. Applying a single texture when importing a Fallout3 landscape: Just specify a '-t FormID' option as one of the command line parameters. e.g. '-t 00034808' will apply snow everywhere, or '-t 00032c86' will apply Fallout3's only really grass-like texture. TESAnnwyn -i 5 -t 00032c86 Myfile.bmp The output ESP (tesannwyn.esp) will automatically require Oblivion.esm as a master if you use the '-t' option. Make sure you type the FormID correctly. Case does not matter, but it must be 8 digits long or the TES4 CS will not be able to locate the correct texture when you load the file (and the landscape will be a hideous jet black!). As with oblivion, you may also use your own custom texture across the entire landscape if you can't find what you want in Fallout3's standard offering. For example, if you want to paste the entire landscape in a new texture called mysnow.dds, and would like it to be called mysnow in the GECK, do: TESAnnwyn -i 5 -u mysnow,mysnow.dds Myfile.bmp You must copy your texture mysnow.dds to the Fallout3\Data\Textures\Landscape directory in order for the game and CS to display it. You may also specify a sub-directory if you wish. 6. EXAMPLESThese examples illustrate many of the different things you can do with TESAnnwyn and at some point or other, cover just about
every option available.
a. Export a 16-bit BMP image from Morrowind.esm TESAnnwyn -p 2 -b 16 morrowind.esm Since a 16-bit BMP is the default export for TESAnnwyn anyway, for the above example you could achieve the same just by doing: TESAnnwyn morrowind.esm This will export a BMP (picture type 2) with a bit-depth of 16-bits per pixel. The file will be called tesannwyn.bmp. b. Export a 32-bit RAW file of the Tamriel Worldspace landmass in Oblivion.esm, increasing the height of all points by a factor of 1.5: TEAnnwyn -p 1 -b 32 -s 1.5 -w Tamriel Oblivion.esm The output file will be called tesannwyn.raw.
TESAnnwyn -p 2 -b 8 -r morrowind.esm The output BMP will be called tesannwyn.bmp. d. Export the Vertex Colour Map from the Tamriel Worldspace in Oblivion.esm and mark it with a grid of cell-lines. TESAnnwyn -c -g -w Tamriel Oblivion.esm The Vertex Colour Map will be a 24-bit BMP file called tesannwyn-vclr.bmp. The heightmap will be automatically exported to an image at the same time (tesannwyn.bmp), currently there is no way to export only the vertex colour map, but since they'll both be separate files, that won't matter. II. Import Examples e. Import (emboss) a greyscale BMP to a TES3 landscape.
TESAnnwyn MyFace.bmp The output file will be called tesannwyn.esp. Remember that a MW cell is 64x64 points. The embossed image will be very large and is better viewed from high up in the CS or from a mountain! Combined LOD effects available for Morrowind (with the MGE mod) and Oblivion you could create some cool effects. High contrast pictures which go suddenly from black-to-white (screenshots of black text on a white background are an example) can cause overflows in the way height is displayed in the CS & game (remember this is a TES limit - no point can be higher than 127 THU from the point to its west). These overflows appear as dramatic spikes and strange formations on the landscape. To fix this, you can use a scale factor of around 0.495 or less. This scale will reduce the worst possible case, a height increase from 0 to 255 to a height increase of 0 to 126 which will prevent all overflows. e.g. TESAnnwyn -i 3 -s 0.495 MyFace.bmp f. Import a RAW heightmap and a BMP image containing a Vertex Colour Image at the same time to a TES3 landscape: The Vertex Colour Map BMP must be the same size as the RAW import image, or it will probably end up skewed. Your Vertex Colour Map image must be a 24-bit BMP called 'tesannwyn-vclr.bmp'. TESAnnwyn will automatically look for this file to include (-c specifies that a Vertex Colour map should be imported). If your RAW file was a 16-bit file called MyRaw.raw and of size 4096x2048: TESAnnwyn -i 3 -c -d 4096x2048 MyRaw.raw The output file will be called tesannwyn.esp. If you're scaling a heightmap, you can export the Vertex Colour Map, scale that image by the same amount and reimport it so it'll line up correctly on the original land. g. Import (emboss) a greyscale BMP and a colour photograph (Vertex Colour Image) on the same TES4 landscape This produces a neat, if gimmicky effect. If you have a colour photograph, save one copy as a 24-bit colour BMP and call that tesannwyn-vclr.bmp and another copy as an 8-bit greyscale, called, say, MyPhoto.bmp: TESAnnwyn -i 4 -c MyPhoto.bmp This will produce a TES4 file called tesannwyn.esp which you can load in the CS. Remember that without a '-x' and '-y' option the bottom left of the image starts at (0,0) so you must look in positive numbered cells to find it. If you zoom back to a great height you can see the photograph emblazened across the embosses landscape. h. Import a TES4 Construction Set Heightmap Editor formatted file called q2.raw (size 1024x1024) to a TES4 Worldspace called MyWorld. These options also apply to heightmaps produced in GeoControl using Gibbo912's presets - these presets are also designed to
export the heightmap in the same form that the TES4 heightmap utility expects. TESAnnwyn -i 4 -w MyWorld -p 1 -b 16 -d 1024x1024 -h -8192 -s 0.25 q2.raw The output file, as always for importing is tesannwyn.esp. You can actually just type this: TESAnnwyn -i 4 -w MyWorld -h -8192 -s 0.25 q2.raw Because '-p 1 -b 16 -d 1024x1024' are already TESAnnwyn's import defaults. i. Import a BMP heightmap (MyBMP.bmp) to TES4 but do not import cells whose height is all -2048 units (i.e. sea-bed wilderness): TESAnnwyn -i 4 -o -2048 MyBMP.bmp This prevents TESAnnwyn from importing useless and wasteful cells. Without the '-o' option a square/rectangular grid of cells will be created. You can also specify a range with '-o' such as '-o -8192--1024' will ignore all cells only containing land between -8192 and -1024. The default Worldspace created (if you don't specify -w) is called TESAnnwyn. The output file as usual is tesannwyn.esp. j. Import a BMP heightmap (MyBMP.bmp) to TES4, apply a grass texture (e.g. FormID 00017843) to add a bit of character. TESAnnwyn -i 4 -t 00017843 MyBMP.bmp You can choose any FormID you like. There is a text file included called tes4ltex.txt which you may open in Wordpad or
Excel (it's commar delimited) to find the FormID of your favourite texture. k. Import a BMP heightmap (MyBMP.bmp) to TES4, applying your own custom texture (e.g. MySnow.dds): TESAnnwyn -i 4 -u MySnow,MySnow.dds MyBMP.bmp Make sure there are no spaces in the editor name or filename. In this example, your texture will show up as MySnow in the CS. l. Import a 32-bit 4096x4096 RAW in to TES3 and paste the whole landscape in a texture, say, number 123 (Grassy snow, a Bloodmoon texture). TESAnnwyn -i 3 -p 1 -b 32 -d 4096x4096 -t 123 MyRAW.raw You can choose any texture number you like - choose one from 'tes3ltext.txt' (best opened in Wordpad, notepad doesn't display it properly). As usual, the output file is tesannwyn.esp. There is no need to load Morrowind.esm to display these textures, the texture list is written in to the ESP. You may add your own textures to this file, just follow the existing format (number, texture name, texture DDS filename). The texture details will automatically be added to the ESP. m. Make a fully textured duplicate of the Fallout3 Wasteland worldspace, and put it in a worldspace called Wasteland2. TESAnnwyn -T 5 -c -w Wasteland Fallout3.esm This will create a heightmap image called 'tesannwyn.bmp' and vertex colour map image (-c) called 'tesannwyn-vclr.bmp' and several Fallout3 texture layer placement maps (-T 5) with names like 'tesannwyn-vtex4-n.bmp' from the Wasteland (-w) worldspace. TESAnnwyn -i 5 -T 5 -c -w Wasteland2 -x -99 -y -99 tesannwyn.bmp This command will now import those images you created back in to a new worldspace called Wasteland2 (-w). The vertex colour map will be included (-c) and all the Fallout3 texture layers recreated (-T 5). The '-i 5' option tells TESAnnwyn to create a Fallout3 ESP. The -x and -y options will create the new worldspace with an offset of (-99, -99) cells so the world centre of your new worldspace is identical to the original Wasteland worldspace (these offset values are given to you when TESAnnwyn finished exporting the worldspace when you ran the first command III. Scaling Examples n. This is a multi-stage example showing how to scale up a TES3 textured landscape to either TES3 or TES4: We'll scale up Bethesda's Solstheim (the island in Bloodmoon) to double it's original scale. i.) Make a quick visual overview of the landscape. This is an unnecessary step, but useful to see: TESAnnwyn -p 2 -b 16 Bloodmoon.esm This will create a 16-bit BMP (-p 2) file called tesannwyn.bmp with which you may quickly view the topography of the island in Windows explorer or any image viewer. It will also tell you that the lowest point on the land is -2136 game units. ii.) Export a 16-bit RAW file of the landscape. We must increase the height by at least 2136 game units so no exported heightmap points are below 0, or this confuses 3rd party image applications such as Photoshop. We must also double the height of each point (since Photoshop/Gimp will only scale and interpolate the image in 2D, not 3D). To be able to scale the vertex colour map and land textures, we should specify '-c' and '-T 3' to export both these images. TESAwnnyn -c -T 3 -p 1 -b 16 -h +2136 -s 2 Bloodmoon.esm This will create a file called tesannwyn.raw. The dimensions of the file are shown at the end of TESAnnwyn's output. e.g. In this example, Bloodmoon.esm creates a 832x896 RAW file. iii.) Load this file (tesannwyn.raw) into Adobe Photoshop, or Gimp or your favourite image processing program (which can handle raw RAW files).
When prompted for details, select the correct bit-size for the file (16), the correct dimensions (832x896), a header of size 0, IBM-PC byte order
(not Mac) and, if prompted, a channel count of 1. These are the same parameters you would use on a TES4 CS RAW export
except that the dimensions of those are always 1024x1024). Now double the image size. In Photoshop this is from the menu: Image->Image Size. Double the number of each dimension. iv.) Scale the Vertex colour map: Load the file called tesannwyn-vclr.bmp into your favourite image processing program (Photoshop, Gimp etc) and change its image size from the original 832x896 to 1664x1792. Then save it back to the original file (tesannwyn-vclr.bmp). v.) Scale the texture placement map. Load the file called tesannwyn-vtex3.bmp into your favourite image processing program (Photoshop, Gimp etc) and double its image size using nearest neighbour 'interpolation'. Nearest neighbour is simplest and most primitive way of expanding an image and ensures the numbers for each texture placement position are accurately preserved. Using a more fancy interpolation method can introduce false texture numbers along the borders and look weird in the game. vi.) Import the scaled up file to a TES3 landscape. We must remember to decrease the overall height back to sea level so everything is the correct scaled height (sea level is twice as deep as before at -4096 game units). Since there is little point in importing really deep ocean sea-bed wilderness cells that contain only land between, say, -5000 and -2048 game units we can ommit this with the '-o' option: We have to specify the geometry of the raw file too (using the -d option, the new file is 1664x1792). Finally, to avoid the new land conflicting with any existing land, such as Vvardenfell (Morrowind.esm) we can move this landscape using a specified number of cells from (0, 0) using the -x and -y options, Lets say 70 MW cells west, 20 MW cells south, i.e. (-70, -20). TESAnnwyn -i 3 -p 1 -b 16 -c -T 3 -h -4272 -o -5000--2048 -d 1664x1792 -x -70 -y -20 tesannwyn.raw You're done. The output file is called tesannwyn.esp and can be loaded in to the TES3 CS or in to the Morrowind game and visited. Alternatively if you want to import the scaled up landscape in to TES4 (Oblivion), change the '-i 3' option to '-i 4': TESAnnwyn -i 4 -p 1 -b 16 -c -T 3 -h -4272 -o -5000--2048 -d 1664x1792 -x -140 -y -40 tesannwyn.raw Without a worldspace (-w) option, the land is placed in to a worldspace called TESAnnwyn. You can also modify this afterwards in the CS. o. This is a multi-stage example showing how to scale up a fully textured TES4 landscape We'll scale up Bethesda's Tamriel Worldspace (the entire exterior landscape in TES4: Oblivion) to double it's original scale. i.) Export a 16-bit RAW file of the landscape. We must increase the height by at least 2136 game units so no exported heightmap points are below 0, or this confuses 3rd party image applications such as Photoshop. We must also double the height of each point (since Photoshop/Gimp will only scale and interpolate the image in 2D, not 3D). To be able to scale the vertex colour map and land textures, we should specify '-c' and '-T 4' to export both these images. TESAwnnyn -c -p 1 -b 16 -T 4 -h +2136 -s 2 -w Tamriel Oblivion.esm This will create a heightmap file called tesannwyn.raw, a vertex colour map called tesannwyn-vclr.bmp, some texture placement maps called tesannwyn-vtex4-*.bmp (* is each texture later) and a FormID lookup file for the texture placement maps called tesannwyn-ltex4.dat. The dimensions of the files are shown at the end of TESAnnwyn's output; the heightmap and vertex colour maps are 4288x4128 and texture placement maps 4556x4386. ii.) Load the heightmap file (tesannwyn.raw) into Adobe Photoshop (sadly I cannot find another program that can process RAW files properly)
When prompted for details, select the correct bit-size for the file (16), the correct dimensions (4288x4128), a header of size 0, IBM-PC byte order
(not Mac) and, if prompted, a channel count of 1. These are the same parameters you would use on a TES4 CS RAW export
except that the dimensions of those are always 1024x1024). Now double the image size. In Photoshop this is from the menu: Image->Image Size. Double the number of each dimension. iii.) Scale the Vertex colour map: Load the file called tesannwyn-vclr.bmp into your favourite image processing program (Photoshop, Gimp etc) and change its image size from the original 4288x4128 to 8576x8256. Then save it back to the original file (tesannwyn-vclr.bmp). iv.) Scale the texture placement maps. Load each file named like tesannwyn-vtex4-0.bmp, tesannwyn-vtex4-1.bmp etc into your favourite image processing program (Photoshop, Gimp etc) and double the size of each one using nearest neighbour 'interpolation'. Nearest neighbour is simplest and most primitive way of expanding an image and is vital to ensures the numbers for each texture placement position are accurately preserved. Using a more fancy interpolation method can introduce false texture numbers along the borders and look weird in the game. In our example the size should double from 4556x4386 to 9112x8772. v.) Import the scaled up file to a TES4 landscape. We must remember to decrease the overall height back to sea level so everything is the correct scaled height (sea level is twice as deep as before at -4096 game units). Since there is little point in importing really deep ocean sea-bed wilderness cells that contain only land between, say, -5000 and -2048 game units we can ommit this with the '-o' option: We have to specify the geometry of the raw file too (using the -d option, the new file is 8576x8256). Finally, to place the land back in it's original relative position to the world-centre we can move the land south-west using by doubling the original south-west cell position of the heightmap - this is given by TESAnnwyn when we exported the heightmap originally (it is -69, -64). We need to move it by (-138, -128) cells: TESAnnwyn -i 4 -p 1 -b 16 -c -T 4 -h -4272 -o -5000--2048 -d 8576x8256 -x -138 -y -128 tesannwyn.raw You're done. The output file is called tesannwyn.esp and can be loaded in to the TES4 CS or Oblivion game and visited. If you want to swap textures for any reason before you reimport, you can open the tesannwyn-vtex4.dat file (in wordpad - it's a simple commar delimited text file) which is created when you export a textured TES4 worldspace. This lists the FormID to use for each colour in the texture placement maps, so if you know the FormID of the texture you want to swap, look for the old FormID in this file and change it to the new one. When you import the landscape using the TESAnnwyn command above, the new texture will be used instead. p. This is a multi-stage example showing how to create a miniature (scaled down) landscape. We'll scale down the entire Tamriel worldspace stored in Oblivion.esm (includes Cyrodiil and a lot of outlying landscape you can't normally reach in the game) to 1/16 scale. i.) This isn't necessary, but you can get an overview the landscape we'll be scaling by exporting it to a BMP first: TESAnnwyn -w Tamriel Oblivion.esm You can view the resulting BMP (tesannwyn.bmp) in any image viewer. ii.) Using a similar command, we can export the worldspace to a RAW file. But we'll also need to make sure all the land is above sea level (so there's no negative land height) by raising it 2048 game units. We also want to scale down the height to 1/16 (this is 0.0625 in decimal). We'll also export the vertex colour map ('-c'): TESAnnwyn -p 1 -b 16 -c -h 2048 -s 0.0625 -w Tamriel Oblivion.esm TESAnnwyn will report that the output file is called tesannwyn.raw and is of size 4288x4128. iii.) Load the tesannwyn.raw file just produced in to your favourite image program (e.g. Adobe Photoshop or Gimp) and when prompted, set the image size to the correct dimensions (4288x4128), the correct bit-depth (16-bit), IBM-PC byte order (not Mac) and if prompted a channel count of 1. Now all you need to do is reduce the file size to 1/16 of it's original scale: 268x258. In Photoshop this is done by selecting: Image->Image Size from the menu. The resample image box should be ticked (it is usually set to bicubic, which is fine). Then save the new RAW file. You can use a new name or relace the original, tesannwyn.raw. iv.) Load the vertex colour map tesannwyn-vclr.bmp into your favourite image editor and decrease it's image size by 16. The orginal image was 4288x4128 so the new image size should be 268x258. v.) Now we need to reimport the RAW to either a TES3 or TES4 landscape. We also have to decrease the height of all points by (2048 * 1/16) 128 game units so the sea level is correct. And tell TESAnnwyn the dimensions of this file (268x258). It's optional, but we could also tell it to not import any landscape cells that would all be the same height (sea level) using the '-o' option. To import the RAW in to TES3: TESAnnwyn -i 3 -p 1 -b 16 -c -d 268x258 -h -128 -o -128 tesannwyn.raw This will produce a TES4 landscape ESP called tesannwyn.esp. TESAnnwyn -i 4 -w Tamriel16 -p 1 -b 16 -c -d 268x258 -h -128 -o -128 tesannwyn.raw As usual, this will produce a TES4 landscape ESP called tesannwyn.esp. 7. LOD2: Experimental Replacement DistantLand system.
This is pretty much a shelved project. I've left this in the current version of TESAnnwyn, just in case you're interested. The NIF exporting function might be of use to people; TESAnnwyn will generate single-cell sized NIFs
for each cell from any TES4 Oblivion worldspace heightmap.
This distant land replacement system uses Visible When Distant (VWD) static meshes which are perfect copies of the landscape mesh. The near meshes are excluded and only the _far meshes are rendered. TES4qLOD can be used (with the same
style -L option) to generate the corresponding cell sized NIFs that the game engine uses. The in-game performance will be notably less, because of the many files that need to be loaded
and the greater level of detail in these meshes - the original TES4 Distant Land system approximates the entire heightmap in to at most 3% of the data,
but this leaves lots of problems on many heightmaps (mis-joins between quads, gaps in landscape, dammed rivers and blocked valleys, cut-off mountains, meshes that you have to walk through to
see the landscape neyond etc), hence why LOD2 was developed. TESAnnwyn -L -w Tamriel Oblivion.esm As well as exporting the heightmap to a BMP, TESAnnwyn will create lots of .NIF files under the LOD2 folder. There will be two levels of sub-folders, the first being
the worldspace name and then four directories numbered 1 to 4. These 4 directories contain cells in the (+ve, +ve) quadrant, (+ve, -ve) quadrant, (-ve, +ve) quadrant and (-ve, -ve) quadrant
respectively; these divisions help in-game loading performance since there are less directories to seek in. LOD2\Tamriel\1\17.3_far.NIF The entire LOD2 folder needs to be moved in to the Oblivion\Data\Meshes folder in order to work in the game. TESAnnwyn will also generate two ESP files: TESAnnwyn_lod2_cs.esp The first file (TESAnnwyn_lod2_cs.esp) is only meant to be loaded in to the Construction Set so the modder can run the World->World Testing->Update Distant LOD option to generate the VWD data. This ESP contains
all the STAT records for the heightmap meshes (in modindex 00 so there are no load order LOD issues) and a land-less worldspace which contains cells with the respective single VWD mesh in each. Two problems have prevented me from finished LOD2; the NIFs have shading problems along the edges (and my mesh overlaps for each cell have not solved this) and the game engine appears to have a unique LOD mesh cache limit - after approx 3-4 quads of meshes it refuses to load any more for that worldspace game session, something I haven't managed to overcome in the Oblivion.ini file. 8. Known Bugs or Issues to understand i. Erratic jumps in an imported landscape: As described earlier, the TES3 & TES4 landscape standards have some limitations, the most common
problem is overflows/underflows where one landscape point is +127 THU or -128 THU different to the point to its west. Either fix the problem in the
original data, or use the scale option '-s' with TESAnnwyn to reduce these dramatic changes. For 8-bit greyscale imports, a scale of 0.495 should
prevent all overflow/underflows from occuring, as in example d. above.
TESAnnwyn includes automatic over/undeflow trapping of imported landscapes so hopefully you should never see really severe spikes or rebellious landscape.
If any landscape is trapped however, there is the likelyhood that part of that cell will not join to the north or east neighbouring cell.
TESAnnwyn will report how many (if any) overflows or underflows were corrected at the end. Affected cells can be quickly reshaped and rejoined in
the CS render window.
vi. No GUI:Yes, I know. I will write one for this program though, there quite a few options to learn otherwise and not everyone is comfortable using a command line. vii. No Fallout3->Oblivion/Morrowind texture conversion: I haven't spent the time to create a conversion list like for Morrowind->Oblivion and Oblivion->Morrowind. Going from Morrowind/Oblivion to Fallout3 is currently possible using the freely available (and better) Oblivion landscape textures in Fallout3. I doubt there's much serious call for Morrowind<->Fallout3 conversion. If someone has a serious need, let me know, but it's a tedious job comparing textures and trying to guage which is the best alternative. viii. When copying a Fallout3 worlspace, there is no elavted water, it's always at height 0: If someone wants this, I will add the ability to export and import a 'water heightmap' so the height of water in individual cells can be duplicated. This is a feature available only in TES4, it was used occasionally in oblivion, but is much more common in Fallout3. 9. Additional Credits1. Thanks to Timeslip for pointing out that my large and complex height offset calculation code was gross overkill. The offset is actually just a standard IEEE 32-bit float! Woops ... My email: Ocean_Lightwave@yahoo.co.uk |