| |
This project aims to provide a way for map builders to start a new map using terrain data from a DEM (digital elevation map) instead of starting from a flat surface. Currently, DEM data can take the form of an 8-bit grayscale BMP image, or a Terragen TERRAIN map.
Here is an example 8-bit grayscale DEM bitmap of Mars. Next are two screens from World Builder showing the resulting map after CkMp/DEM processing. |
| |
|
| |
 |
Download v1.0.2 for Windows.
Download v1.0.0 source and i386 Linux binary.
|
|
| |
The general method for importing custom elevation data into a World Builder map file is:
- Start with the elevation map.
Create either an 8-bit grayscale elevation image or a Terragen TERRAIN map. Remember the size you choose here, it will be used to size your C&C map.
- Start a new map in World Builder.
Choose a border_size first, or use the default in World Builder (70).
Set the initial height value to 16 (0x10). Use the width and height of the BMP image (or Terragen map) in the following formula to determine the width, height, and border size of your new C&C map.
| map_width | = | dem_width - (border_size x 2) |
| map_height | = | dem_height - (border_size x 2) |
| |
| For example, if... |
| border_size | = | 70 |
| dem_width | = | 513 |
| Then... |
| 373 |
= |
513 - (70 x 2) |
The example map is square, so 373 would be the width and height used for the new map.
Again, I stress that the initial map height must be set to 16 (0x10). The CkMp/DEM tool will check to see if the entire C&C map is at 16 (0x10) elevation, if it isn't, the elevation import will fail. The reason for this is simply to ensure we're working on a new map, and that we won't mess up a work-in-progress.
The final step is to disable map compression. By default, World Builder will compress the map when saved. So, under the Edit menu, select Edit Map Settings..., change Compression from RefPack to 'No compression'. Save your new blank map and then exit World Builder.
- Merge in the new elevation data.
Windows: [Updated, Feb. 18, 2003] Due to many requests, I've built a version of CkMp/DEM for Windows. The output below is the same, so the Linux stuff below is still relevant in the Windows version.
Linux / FreeBSD (non-GUI): Copy the C&C map and the elevation map (BMP image or Terragen ter file) to your unix system if you need to. Run CkMp/DEM with the first parameter being the C&C map file (GWB) and the second being the elevation map (DEM) file (BMP or Terragen):
# ckmp CC.map dem.bmp
ckmp: CkMp: CC.map
ckmp: 1 (0x00000001): ?
ckmp: 4 (0x00000004): ?
ckmp: 263197 (0x0004041d): ?
ckmp: 513 (0x00000201): data width.
ckmp: 513 (0x00000201): data height.
ckmp: 70 (0x00000046): border size.
ckmp: 1 (0x00000001): ?
ckmp: 373 (0x00000175): map width.
ckmp: 373 (0x00000175): map height.
ckmp: 263169 (0x00040401): data size.
ckmp: verifying 263169 bytes of 0x10 height data... ok.
ckmp_load_bitmap: bitmap header: dem.bmp
ckmp_load_bitmap: (0x0000f6c0): size.
ckmp_load_bitmap: (0x00000001): bit planes.
ckmp_load_bitmap: (0x00000008): bits per plane.
ckmp_load_bitmap: (0x00000000): compression.
ckmp_load_bitmap: (0x00000000): data size.
ckmp_load_bitmap: (0x00000b12): X resolution.
ckmp_load_bitmap: (0x00000b12): Y resolution.
ckmp_load_bitmap: (0x00000000): used colors.
ckmp_load_bitmap: (0x00000000): important colors.
main: writing elevation data (dem.bmp -> CC.map)... ok.
# ckmp CC.map dem.ter
ckmp: CkMp: CC.map
ckmp: 1 (0x00000001): ?
ckmp: 4 (0x00000004): ?
ckmp: 263197 (0x0004041d): ?
ckmp: 513 (0x00000201): data width.
ckmp: 513 (0x00000201): data height.
ckmp: 70 (0x00000046): border size.
ckmp: 1 (0x00000001): ?
ckmp: 373 (0x00000175): map width.
ckmp: 373 (0x00000175): map height.
ckmp: 263169 (0x00040401): data size.
ckmp: verifying 263169 bytes of 0x10 height data... ok.
ckmp_load_bitmap: not a bitmap image: dem.ter
ckmp_load_terragen: size: 512
ckmp_load_terragen: xpts: 513
ckmp_load_terragen: ypts: 513
ckmp_load_terragen: scal: x: 30.000000, y: 30.000000, z: 30.000000
ckmp_load_terragen: crad: 6370.000000
ckmp_load_terragen: crvm: 0
ckmp_load_terragen: height scale: 18
ckmp_load_terragen: base height: 7
ckmp_load_terragen: elevation words: 263170 (526340 bytes)
main: writing elevation data (dem.ter -> CC.map)... ok.
Provided that you don't get any strange errors, you should see "writing elevation data..." as the last line of output if successful. The CC.map file will have been modified to include elevation data from the provided DEM source. You can now load the map back into World Builder and have a look at the result. You most certainly will need to touch-up sharp peaks and valleys with the Smooth tool.
|
| |
If you think you've found a bug, please let me know! Check Known Issues and/or the TODO List first. If the problem isn't described there, send me a short email describing the situation. Please include the type of DEM input (BMP or Terragen), and the dimensions of it (ie: 513 x 513). Output (errors, messages) from CkMp/DEM would also be very helpful, include any if possible.
|
| |
Here is a list (in no particular order) of out-standing issues with the CkMp/DEM tool.
- Terragen to CkMp/DEM quantization.
The conversion from 16-bit signed words to 8-bit unsigned bytes tends to flatten terrain details a bit (or a lot, depending on the scale). I'm looking into a better (more precise) way to do the conversion. If you know of a better way, please let me know. A work-around is to use the very good algorithm in Terragen; export the terrain model as an 8-bit graysale bitmap.
|
| |
Here is (in no particular order) my tenative TODO list:
- Support reading/writing to/from compressed map files.
- Documentation.
|
Copyright © 2000-2003 Darryl Sokoloski. All rights reserved.