====== Making the heightfield and texture for Spring ====== ^ << [[tutorials:ta_spring:aaron|back to tutorial]] << ^ ===== Getting started ===== There are many ways to make a map in L3DT, but I shan't cover all of them in this guide. In fact, I'm only going to cover the "well-travelled path" of using L3DT's //Design/Inflate// algorithm. If you'd like to experiment with other ways to make your map, you may find the following reading useful: - The official userguide for [[bundydocs>l3dt:userguide:newmap|making new maps]]. - The official userguide for importing [[bundydocs>l3dt:userguide:io:import:hf|heightfields]] or [[bundydocs>l3dt:userguide:io:import:dm|design maps]]. - My tutorial on designing a fjord-esque map ([[tutorials:l3dt:fjord|see here]]). - Forboding's tutorial on making a map using an heightmap image drawn in Photoshop ([[tutorials:ta_spring:forboding:heightmap|see here]]). - Monk's tutorial on making a map from a topographic map of Middle Earth ([[tutorials:me-dem:intro1|see here]]). Anyway, back to making the map. First, click on the 'New map' button on the toolbar. This will open the //algorithms// wizard (below), where you get to choose how L3DT will make your map. {{ :tutorials:ta_spring:aaron:wizard_algorithms.png |:tutorials:ta_spring:aaron:wizard_algorithms.png}} As you can see, there are five algorithms listed in the wizard. The first is the one we're going to use, so click 'next' to proceed. ===== The heightfield and design map ===== The next pane in the wizard is the //heightfield map size// pane (below). {{ :tutorials:ta_spring:aaron:wizard_hf_size.png |:tutorials:ta_spring:aaron:wizard_hf_size.png}} As you should already know, Spring's map sizes are quoted in units that are 1/64th the size of the heightfield. Thus, a 1024x1024 pixel heightmap will produce a map that is 16x16 in Spring units (1024 / 64 = 16). The table below lists some common Spring map sizes along with the heightfield sizes required to make them: ^ Spring map size ^ L3DT heightmap size ^ | 2x2 | 128x128 | | 4x4 | 256x256 | | 6x6 | 384x384 | | 8x8 | 512x512 | | 12x12 | 768x768 | | 16x16 | 1024x1024 | | 24x24 | 1536x1536 | | 32x32 | 2048x2048 | | 48x48 | 3072x3072 | | 64x64 | 4096x4096 | | 128x128 | 8192x8192 | The default size is 1024x1024 pixels (16x16, in Spring units), which is a good size for the purposes of this tutorial. Let's click 'next' to continue. The next pane is the //design map size// wizard. The [[bundydocs>l3dt:reference:maps:dm|design map]] is a low-resolution map that is used as the template to produce your high-resolution heightfield. This wizard allows you to choose the resolution of the design map. The default setting is 1/64th the size of the heightfield, which is a good size. Click next to continue. {{ :tutorials:ta_spring:aaron:wizard_dm_size.png |:tutorials:ta_spring:aaron:wizardpane_dm_size.png}} The next pane is //design map parameters//, where you can set the general shape of your map using some "high level" controls (flat/steep, sea/land, etc). The only setting I'm going to change here is the //climate//. The climate ultimately determines whether your map will look like a desert or a jungle (or otherwise), and L3DT includes a number of climates to suit different occasions. [[user>Forboding_angel|Forboding Angel]] has created, and generously donated, a collection of climates that are suitable for Spring maps, and these are included with the installer. In this guide, I'm going to choose the 'Spring Greenworld' climate, as shown below: {{ :tutorials:ta_spring:aaron:wizard_dm_params.png |:tutorials:ta_spring:aaron:wizardpane_dm_params.png}} Following the //design map parameters// wizard is the //calculation queue//. In this pane you can queue-up several calculations to run back-to-back. Here I suggest you enable both the design map and heightfield calculations: {{ :tutorials:ta_spring:aaron:wizard_autocalc1.png |:tutorials:ta_spring:aaron:wizard_autocalc1.png}} After some flashy eye-candy, we should arrive at the heightfield, which will look something like that shown below. {{ :tutorials:ta_spring:aaron:map_hf.png |:tutorials:ta_spring:aaron:map_hf.png}} The red contour line is sea-level, the green contour is +100m, the blue is -100m, the like grey contours are every 100m, and the dark grey are every 20m. If you don't want contours, you can disable them using the '//View->Display effects->show contour lines//' menu option. To visualise the terrain in 3D, you can click on the '3D' toolbar button to open the [[bundywiki>plugins:sapphire|Sapphire]] 3D renderer plugin. At this stage, Sapphire will present you with a scene such as that below, consisting of the heightfield rendered in green. Later, once we've completed the texture, we'll come back to //Sapphire// to see what the complete map looks like. {{ :tutorials:ta_spring:aaron:hf_3d.jpg |:tutorials:ta_spring:aaron:hf_3d.jpg}} To move around in Sapphire, press the W/A/S/D keys to move forwards/left/backwards/right, and E/R for up/down. Also, you can edit the heightfield using brush tools by pressing the 'h' key ([[plugins:sapphire:userguide:hf_edit|see user guide]]). ===== The water, attributes, normals, light and texture maps ===== To make the texture map, we'll first need to make some other maps, including: * The water map. * The attributes map (the 'mask' used to generate the texture map). * The normals map (used for lighting). * The light map. Fortunately, we can make all these maps in one go using the calculation queue wizard. To open the calculation queue, click on the 'Calc >>' toolbar button. In the calculation queue, enable the options show below: {{ :tutorials:ta_spring:aaron:wizard_autocalc2.png |:tutorials:ta_spring:aaron:wizard_autocalc2.png}} When you click next, you will be taken to the water map wizard pane. On this pane, enable the 'flood water-plane' option, disable the auto-flood seas/lakes options, and enable the 'flood water table' option, like so: {{ :tutorials:ta_spring:aaron:wizard_wflood.png |:tutorials:ta_spring:aaron:wizard_wflood.png}} Once you click next, you will go through to the water table wizard. You shouldn't need to change any settings here, so click next. {{ :tutorials:ta_spring:aaron:wizard_wtable.png |:tutorials:ta_spring:aaron:wizard_wtable.png}} Now we're at the attributes map wizard. As I mentioned before, the attributes map is the 'mask' used for the texture blending. Because we'll want to make a high-resolution texture, we'll also want to make a high-resolution attributes map mask. Thus, we'll enable the 'make high-res attributes map' option, and set the AM/TX ratio to 4. You can also enable the 'Use disk-drive paging' option if you want to reduce the amount of RAM needed for the calculation. {{ :tutorials:ta_spring:aaron:wizard_am.png |:tutorials:ta_spring:aaron:wizard_am.png}} Clicking 'Next >>' will bring you to the normals map wizard. Here, enable 'Apply bump mapping', enable 'Make high-res terrain normals', set 'TN/HF ratio' to 8, and enable 'Use disk-drive paging', like so: {{ :tutorials:ta_spring:aaron:wizard_tn.png |:tutorials:ta_spring:aaron:wizard_tn.png}} Next is the light map wizard, where you can change the lighting direction and colours. If you would like to tinker with the settings, please consult the [[bundydocs>l3dt:userguide:ops:lm#the_light_mapping_wizard|light mapping wizard guide]]. In this tutorial I'm going to leave everything as default and click 'Next >>'. {{ :tutorials:ta_spring:aaron:wizard_lm.png |:tutorials:ta_spring:aaron:wizard_lm.png}} The second pane of the light mapping wizard is where you set some of the lighting effects. In this wizard, disable 'water effects' and 'apply bump mapping', then enable 'make high-res light map', set 'LM/HF ratio' to 8, and enable 'split light map into mosaic'. Finally, click 'next >>' to proceed. {{ :tutorials:ta_spring:aaron:wizard_lm2.png |:tutorials:ta_spring:aaron:wizard_lm2.png}} The last pane in the wizard is the texture wizard, Here we'll enable anti-aliasing and set it to to 4x (or 8x, if you prefer), enable 'make high-res texture map' and set it to 8, and finally enable 'split texture into tiles', like so: {{ :tutorials:ta_spring:aaron:wizard_tx.png |:tutorials:ta_spring:aaron:wizard_tx.png}} After you click OK, L3DT will go away and make all the maps requested. When done, the map will look something like this: {{ :tutorials:ta_spring:aaron:map_tx.jpg |:tutorials:ta_spring:aaron:map_tx.jpg}} Don't worry about the white dotted lines; they indicate the size of the tiles into which L3DT has chopped the texture map. The white lines are only for display purposes in L3DT, and won't be on the final texture when exported to Spring. At this point, it is a Very Good Idea™ to save the map project using the 'save' button on the toolbar. Okay, let's return to the [[tutorials:ta_spring:aaron|main tutorial page]] to continue with the task of exporting the map to Spring's SD7 format.