being slartibartfast...

tonight i felt like being slartibartfast — yep, the urge to create some fjords, mountain ranges, and islands was just overwhelming. unfortunately, the previous routes to scratching that itch were blocked: using L3DT to generate a nice looking landscape (all by just twiddling a couple of sliders) and then loading the resulting terrain map on to the 4x4 island grid running on my trusted X60. that route was blocked because OpenSim’s new terrain module currently doesn’t do multi-region terrain loads :-(

yet — top gear moment! — how hard can it be to split out the terrain map from L3DT into region sized parcels and then just write a nice little script to load them individually?

well, it turns out: not very hard.

step-by-step from scratch to finished grid…

someone on the #opensim-dev IRC channel mentioned the other day, that L3DT would run fine under wine on linux. having bought the professional version (just USD 34.95 or so),1 i took note, as so far i had just been running it under vmware. sure enough, on l3dt’s web site is a HOWTO describing the linux setup.

install wine & then L3DT

so, first install wine (didn’t have a need for it on my box until now):

# apt-get install wine

next, download the development version of l3dt from the bundysoft website, then run the installer through wine:2

# wine /downloads/L3DT_PRO_dev-2.5.3.1.exe

that will install a runable l3dt on your ubuntu box. start it up and we are ready for that slartibartfast feeling.

becoming slartibartfast

either via “file->new project” or by clicking on the “new map” icon, start a new, well, map. you should be faced with the following dialog box:

l3dt-01.jpg

select “design/inflate” and then click on next. on the design map size dialog box which should now be facing enter the desired grid size you want to cover — highlighted below in red — and make sure that the horizontal scale is 1.00 m. note, too, that the one OpenSim region translates to a 4x4 L3DT area; in the screen shot below, i’m aiming for a 4x4 OpenSim grid area, thus, i need to have a 16x16 L3DT area:

l3dt-02.jpg

once you have entered your value, click next and you should get to the design map parameters dialog, which is a bit of a misnomer, i think, it really should be called slartibartfast parameters as this is where we get to be slartibartfast:

l3dt-03.jpg

here, you can muck around and tune your future grid terrain to your hearts content. just pick and choose (you can always restart). once you are done and want to give it a go, click next again — leading you to the calculation queue dialog, where you tell L3DT what maps you are interested in. you absolutely do need the heightfield map (this is going to be what we load into opensim later), i always turn on everything :-)

l3dt-04.jpg

again, click on next and you will get to the water flooding dialog:

l3dt-05.jpg

i like my water levels at 20m and am a huge fan of the sea, thus the entries in the highlighted area. next and we arrive at the texture settings dialog:

l3dt-06.jpg

if you want to, click on the make high-resolution texture check box (i usually do). click through the next dialogs and then watch L3DT do its job.

sooner or later3 your terrain will be ready! my terrain looked like this:

l3dt-07.jpg

exporting our terrain

next, we need to export our newly created terrain. to do so, first save your projects via “file->save->save project” or via the “save project” icon. then, select the heightfield map via the map selection icon…

sel-map.jpg

…and select the heightfield entry…

l3dt-08.jpg

…which should update the display area to show the heightfield map — which looks a bit like an x-ray of our terrain:

l3dt-09.jpg

next, we need to export the map using the RAW format. click on the “export this map” icon…

export-map.jpg

…and in the export map dialog click on split map into tiles (mosaic map) (highlighted in red below) and enter a name for the terrain map in the file name field (highlighted in yellow, i used slartibartfast).

l3dt-9-5.jpg

click next and select the RAW file format (highlighted in red) and adjust the tile size to 256 and click on options

l3dt-11.jpg

select the Mode (ComboSelector) entry by double clicking and change it to 32-bit floating-point (metres)

l3dt-12.jpg

and then click on OK and finish the rest of the dialog by clicking on OK again.

you should end up with a set of files named slartibartfast_x0y0.raw, slartibartfast_x0y1.raw, and so forth.

importing the works into opensim

finally, we are about to import our opus magnus into opensim. to do that we need to

  • rename all *.raw files to *.r32 so that opensim does not mistake them for LindenLab raw files
  • create a command script to load the terrain into each region separately.

first, though, copy the *.raw files to the bin directory of your OpenSim installation:4

# cp *.raw /opt/opensim/bin

next, rename:

# for i in *.raw ; do  r=$(basename $i .raw); mv $i $r.r32; done

now, create a command script for opensim which looks roughly like this:5

change-region Xanadu Blue
script terrain load slartibartfast_x0y0.r32
change-region Shangri-La
script terrain load slartibartfast_x0y1.r32
change-region Torchwood
script terrain load slartibartfast_x1y0.r32
change-region 13th Floor
script terrain load slartibartfast_x1y1.r32
change-region Skybreaker
script terrain load slartibartfast_x2y0.r32
change-region Hyperion
script terrain load slartibartfast_x2y1.r32
change-region Aurora
script terrain load slartibartfast_x3y0.r32
change-region Flotsam
script terrain load slartibartfast_x3y1.r32
change-region Shutdown
script terrain load slartibartfast_x0y2.r32
change-region User Error
script terrain load slartibartfast_x0y3.r32
change-region Core Dump
script terrain load slartibartfast_x1y2.r32
change-region Division by Zero
script terrain load slartibartfast_x1y3.r32
change-region Gondor
script terrain load slartibartfast_x2y2.r32
change-region Misty Mountains
script terrain load slartibartfast_x2y3.r32
change-region Rivendell
script terrain load slartibartfast_x3y2.r32
change-region The Shire
script terrain load slartibartfast_x3y3.r32

save.

start up OpenSim, and once you have the console prompt, issue

Region# :
command-script slartibartfast.cmd

this should result in quite a bit of output by opensim telling you that it’s doing the terraforming!

a new landscape!

login to your opensim grid and explore your new terrain!


  1. the standard, free, version is perfectly fine for generating terrain maps for a single region. to cover larger grid areas, you either need to wait for OpenSim to support it again, or get the professional edition which supports mosaic tiling — that is, you generate the terrain map for the intended grid area and then let L3DT split it into region sized terrain maps. 

  2. in case you are using the standard, free, version, that would be L3DT_SE_dev-2.5.3.1.exe instead. 

  3. that, i’m afraid, depends on the horse-power of your system, but even on a dual-core CPU it will take a couple of minutes. 

  4. on my box, opensim lives in /opt/opensim

  5. adapt the region names to your region names, otherwise this will be a frustrating exercise…