Go Back   EQEmulator Home > EQEmulator Forums > OpenZone > OpenZone::Tutorials

OpenZone::Tutorials OZ, up to date Tutorials section

Reply
 
Thread Tools Display Modes
  #1  
Old 12-14-2004, 05:43 AM
KhaN's Avatar
KhaN
Dragon
 
Join Date: Mar 2004
Location: France, Bordeaux.
Posts: 677
Default OpenZone : Creating landscape using Heightmaps

OpenZone : Creating landscapes using Heightmaps



Author : KhaN
Credits : WindCatcher

Information
Now that you have a nice big zone with objects laid out just right, you're going to want some interesting terrain on it. Perfectly flat plains may make for easy zone creation but they can turn out to be extraordinarily boring for players. Now, using an option implemented in OpenZone, you can import a grayscale bitmap image into OpenZone, and OpenZone will turn your image into a dazzling terrain. Heightmaps are oftenly used in game industry, and are even used in EQLive to generate some outdoor zones.

Requirement
- OpenZone
- Terragen


Using Terragen to Create a Random Region
It is possible to create a region using a program called Terragen. To create a realistic landscape using Terragen, you will need two programs. First, you'll need to download and install Terragen from the free download site. Second, you will need an image editor capable of importing and converting .RAW data. Adobe PhotoShop and JASC Paint Shop Pro work nicely.

1. Open Terragen. Two windows will open: Rendering Control (in the background) and Landscape, in the foreground. Close Rendering Control, since you won't be needing it.
2. In the landscape window, there are 6 buttons you'll need to know how to use:

- Sculpting mode with 128 x 128 brush: Right-click, hold and drag to lower terrain a lot, left-click, hold and drag to raise terrain a lot.
- Sculpting mode with 64 x 64 brush: Right-click, hold and drag to lower terrain some, left-click, hold and drag to raise terrain some.
- Sculpting mode with 32 x 32 brush: Right-click, hold and drag to lower terrain a little, left-click, hold and drag to raise terrain a little.
- Export: Click here to save a terrain as a .RAW image.
- Generate Terrain: Click here to create a random terrain based on the settings you choose.
- Landscape Dialogue: Click here to adjust the landscape settings.
3. On the left side of the workspace, there is a vertical toolbar with 7 buttons on it. Click the third button down (Water).
4. The Water dialogue box will come up:

In the top right corner an input box labeled "Water Level" will be highlighted. Set this to 50.0m. Select "Update Maps" and close the window. On the Landscape window, the "Plan View of Landscape" should now be blue.
5. Select Button 6, labeled "4000 metres." The Landscape window will open. Here you can change the size and scale of your terrain. In the top-right corner of the window, there are six buttons; 129, 257, 513, and three grayed-out buttons. Click on "513," select "Yes" on the next window, and "No" on the one after that. Above "Meters Point Spacing" make this number 16. Hit "OK" to close the window. Now button 6 should be labeled "8192 metres."
6. Now you begin making a terrain. Click Button 1 on the image above. This tool allows you to raise and lower terrain over a very large area. Right-click to lower the terrain, and left-click to raise the terrain. The other two tools (2 and 3) in that space work the same way, only on a smaller scale. Take a few minutes to get the hang of raising and lowering parts of the terrain.
7. While it's certainly easy to make a terrain using the sculpting tools, if you want something more realistic you'll want to generate a random terrain. Click on "Generate Terrain" (button 5). The Terrain Genesis window will open:

Here you can adjust the settings for the Terrain Generator. To make your terrain, you'll want to set the Realism and Smoothing sliders to maximum (100) and the Glaciation and Canyonism sliders close to the minimum. Adjusting these sliders will give you a rougher or smoother terrain; keep adjusting these settings until you get a terrain that you like. Leave the "Size of Features" slider where it is, unless you plan to make a very large region (8 or more Large Maps on a side). If that's the case, turn it down one notch. Click "Generate Terrain." The Landscape Window will now look something like this:

If you don't like the look of the landscape you've created, adjust the four top sliders in the Terrain Genesis window and keep clicking "Generate Terrain" until you get one you like.
8. Using the Height Adjustment tools (buttons 1-3), adjust the image to raise and lower the terrain wherever you want. Be careful sculpting the terrain this way, however, since it is very easy to accidentally raise or lower it more than you wanted to.
9. When the terrain looks how you want it, Click on "Export" (button 4). Leave the Save settings where they are and click "Select File and Save." Save your terrain as a .RAW file somewhere you can find it again (the new region's folder is a good place). Close Terragen.

At this point you will have to convert your region Heightmap into a format the game can read before it can be imported. Start PhotoShop (or whatever image editor you use) and open the .RAW file you created (leave the color settings where they are). Select the entire canvas and copy it to the clipboard. Close the .RAW file, and create a new image. Make sure the image is the same size as the .RAW image you made (513x513 pixels, 72 pixels/inch). Set the color setting to Grayscale. In the new image, color the entire background solid black. Then paste the .RAW image you copied into a new layer. You shouldn't be able to see any of the black background behind it; if you can see the background around the edges, check the size of the image to ensure it's correct. Go into the new layer's Blending Options (in PhotoShop), and find the Blend If box. Move the left tab on the top slider to a value of 85 as shown in the image below:

Your Terragen Heightmap will now look something like this:

On the above image, the solid black areas indicate where the water will be. If your terrain's water isn't where you expected it to be (and it probably won't) you'll have to adjust the terrain. Open the Brightness/Contrast window, and change the brightness and contrast settings until the water level is close to where it should be. Changing the contrast will make mountains and valleys steeper, and changing the brightness will raise and lower the terrain. Keep adjusting both these settings until the coastlines are correct and the terrain "looks right." Don't turn the contrast up too high, as this will result in flat plateaus instead of mountain peaks, and don't turn the brightness down too low, as this will flood the landscape. When the image is adjusted just the way you want it, close the Brightness/Contrast adjustment window.

Go back into the top (terrain) layer's Blending Options window, and move the slider you adjusted earlier (the one now set to 85) all the way back down to the Black end of the bar. Close the window, and the background should no longer be visible. Save the image you've created, layers and all, so that if the image doesn't turn out the way you wanted, you can go back and change it. Once the file is saved, flatten the image. Save the resulting Heightmap as an 8-bit Bitmap Image, preferably in the folder your Region is in. You now have a Grayscale Heightmap, ready to import. The above Terragen image yielded this Heightmap:



Using Photoshop to Create a Random Region
While there are as many ways to draw Grayscale Heightmaps as there are programs in which to make them, only a few good image editors will give you a very good, realistic terrain. For demonstration purposes, this article will show how to draw one using Adobe PhotoShop. Many of the features shown here are also available in other advanced image editors, so don't feel like you have to have PhotoShop to make good Heightmaps. Just explore your own software, to find out how to perform these techniques. Also, while it is possible to make a Grayscale Heightmap using Windows Paint, it is extremely time-consuming and tedious (you have to set every shade of gray manually) and in the end you will probably have been better off making your region using the ingame terraforming tools. Finally, the most important tip when designing a region Heightmap: Use your imagination and have fun. That's the whole point of making zones, and once you figure out different ways of making the terrain look the way you want it, you'll be amazed at the terrains you'll be able to create. It just takes practice.

Getting Started
First, create a blank image, of the size you want, it does not matter.
On the blank image you've created, you'll want to outline your coastlines first. Create a transparent new layer, which will serve as your "Land" layer. Select color 85/255, and using a solid pencil tool about 5 pixels in diameter, draw an outline of your region's coastlines on the Land layer. Use squiggly, gently curving lines for Ocean coasts, and use parallel meandering lines for rivers. Draw small rough circles for ponds, and larger ones for lakes. When you have all your coastlines drawn, fill the areas where land is supposed to be with color 88/255. You should now have a dark gray map with white bodies of water outlined on it. This basic drawing will serve as the core of your landscape.


Adding Terrain Variations
Next you'll want to add the hills, valleys, and plains. Using the soft paintbrush tools, draw slightly lighter gray areas for rolling hills or elevated plains, draw much lighter areas for high mountains, and draw darker areas for valleys. Note that the water level is approximately 84/255; this color and everything darker will be underwater, and everything brighter will be above ground.
Some general tips for drawing regions:
- Draw elevation changes in increments, and draw each increment separately. Use large, soft brushes to draw areas of higher terrain in increments of about 10-15 points. For example, first draw all the areas at 90/255, then within these higher areas, draw slightly brighter (95/255) places, and so on until you think the terrain is high enough.
- When building up mountains and gouging deep valleys, consider the way Heightmaps of real mountains look. Try downloading a few to examine, and see how real mountain ridges occur, and what they look like. It will probably take a lot of practice with the Paintbrush, Smudge, and Blur tools to make realistic mountains.
- Keep in mind that the smaller and sharper the brush, the steeper the elevation transition will be.
- Don't be afraid to use the other tools the image editor has to offer; don't limit yourself to the 30 pixel brush and the eraser. Some interesting effects can be created using some of the specialized tools, once you figure out where and how to use them.
- Use the Blur tools often. Terraced landscapes don't occur naturally, so unless that's what you're going for you'll have to smooth off the cliffs and sharp elevation variations. Use both the blur brushes and the image-wide blur tools to accomplish this.
About ten minutes of drawing yeilded this image:


Building Underwater Formations
Once your above-ground terrain and water-filled valleys are finished, you'll need to create the underwater terrain. Since your entire above-ground terrain was drawn on the transparent layer, the background will still be blank white. If you accidentally drew some or all of your terrain on the white background layer, then select the whole thing and cut it out. Paste it into a new layer, and color all the white areas (places where water is supposed to be) black. You'll have to use a fairly sharp brush to do this, since if you blurred your coastlines there will be light-colored edges on it that you'll have to remove. Then adjust the Blending Options just like you would if you had a Terragen image, so that all the water-covered parts of your terrain are transparent. On the Background layer, use a Texture Fill tool to make a mottled black-and-white background. Turn the brightness and contrast of this way down so that the terrain is very deep and very uniform in height. Just don't make it flat, since seabeds and lakebeds are rarely smooth. Then select a very large Paintbrush, and color all the areas near coastlines slightly brighter then the surrounding seabed (78-80/255) to make the shallows near shore. Use darker colors (45-50/255) and very large brushes to make the depths of the oceans.
About ten minutes of drawing yeilded this image:


Putting on the Finishing Touches
Once the mountains have been raised, the canyons have been cut, and the oceans have been filled, it will be time to convert your terrain image into the final Heightmap. To do this:
# Save the Terrain image, layers and all, so that you can adjust it if it doesn't turn out the way you hoped.
# Flatten the terrain image; it is now a Heightmap.
# Apply a final light blur to the whole image, to break up any remaining sharp outlines.
# Save the Heightmap as an 8-bit Grayscale Bitmap. If you set the color to Grayscale when you first created the image, then it should automatically save as a grayscale image. If you had the color settings set to anything other then Grayscale, (in PhotoShop) go to Image\Mode\Greyscale. A pop-up window will ask you if you want to discard color information; select Yes. Then save the image in the correct format.

Result



Importing Heightmaps into OpenZone.


Getting already made Heightmaps.

Simcity fan's make free terrain Heightmaps that are available for download, preformatted and ready to import, into OpenZone. Hundreds of Heightmaps can be downloaded at Rebel 13's SimCity Site and toroca's SimCity 4 Terrains Page. Several other large real-world landscapes are available from the Regions by Rexer page right here in our forums.
__________________

Reply With Quote
  #2  
Old 08-18-2007, 12:17 AM
Sakrateri's Avatar
Sakrateri
Dragon
 
Join Date: Mar 2004
Location: England
Posts: 776
Default

I know this is old but don't want to start another thread up....Heightmaps are not working for me. I am using 8bit greyscales and when I choose one a heightmap it asks which one and I pick one then it just makes a flat world , anyone know whats happening?
__________________
KhepriGames

Game Gallery

My Forums

Reply With Quote
  #3  
Old 08-18-2007, 12:39 AM
Sakrateri's Avatar
Sakrateri
Dragon
 
Join Date: Mar 2004
Location: England
Posts: 776
Default

ok , nevermind . Iv'e been tryin for a week to get it to work and just figured out you need to set the depth lol. Now i can create some truly unique zones
__________________
KhepriGames

Game Gallery

My Forums

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 03:03 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3