Jump to content

Heightmap Converter


sheepandshepherd
 Share

Recommended Posts

sheepandshepherd

Heightmap Converter

Beta version

 

 

NOTE: This has been replaced by >GeoTool. The source code got too messy to read, and Unity3d was limiting what I could do with it anyway. GeoTool is better :P

This is a heightmap<->image converter utility to make one of the most annoying parts of creating a Rock Raiders map a bit easier. It can take any JPG or PNG image and save it as a High.map, with lighter pixels representing higher ground. The heightmap was always something I would have liked to do in GIMP with smooth and scaleable brushes.

 

It can also convert existing heightmaps and surf maps to PNG images that you can use as a base when creating a new heightmap in your image editor.

 

Finally, it will give you a quick 3D preview of how the map's terrain will look in-game. You can load up the surf map for a fully textured preview. For now, walls are not accounted for, but that is planned as well.

 

Screenshot of RR level 9 loaded in the converter, with textured 3D preview active:

gallery_337_343_219683.png

 

The Load and Save windows are pretty self-explanatory: type in the path to your file, click "->" to preview the image or map, and then click LOAD/SAVE.

If you enable 3D view, it'll generate a mesh from the heightmap. I currently use the estimate that about 8 height units equal the length/width of 1 tile (assuming flat ground, of course, not walls).

You can also choose the material of the 3D mesh (the screenshot uses the textured surf map as the material). Controls for the 3D view are listed in the help window (the '?' button at the bottom right).

 

You can customize the colors of imported surf maps using the "surfdefs.ini" config file. For convenience, I made the config file similar to the one used by Cyrem's old Map Tool, so if you ever made a custom color config file for that, you can just drop it in the data folder, replace the surfdefs.ini, and it'll load just fine.

 

You can also change the textures used for each terrain type using the "surftextures.ini". This feature isn't very flexible yet and will be expanded in the next version. For now, files must be PNG or JPG and must be 64x64 size.

 

Currently, it's hard-coded that when converting to an image, a height of 64 equals full white and height of 0 is full black. I don't think there's any reason to go above 64 height on maps, since the ground starts to disappear at that point.

 

It's written in Unity C#. I'm still too much of a noob programmer to know how to make all this GUI and rendering stuff in regular .NET, so for now I'll let Unity do all that for me. This was mostly just a practice project for me, since I've just recently started programming.

 

This is the Beta release -- the main features are complete, but I plan on improving and adding more to make it a more useful preview tool.

Planned updates:

Soon (v1.0):

  • Finish the file browser. For now, you have to type the path to your files. (Since Unity uses cross-platform Mono instead of "real" .NET, I can't call up the normal Windows file browser.)
  • Fix that stupid smoothing! It'll be easy though -- just need to separate each tile into its own submesh.
  • Display walls as walls, not all flat.
  • Release the source code! Might be useful to someone.

Future updates:

  • Save user settings and file paths
  • Better surf map display (with textures, not just colors)
  • Upgrade to a full height and surf editor? Maybe? Shouldn't be that hard, but we already have Cyrem's Map Creator for that.

 

Note: Thanks to the various things Unity includes in builds, the full program is a ridiculous 30MB, most of which is unused Unity stuff. Sorry about that -- I guess that's what I get for using a full multi-platform game engine to make a simple file converter. Ehhh. 7zip amazingly gets it down to 5.2MB though.

 

 

Download - Beta version

 

Previous versions

Download - Alpha version

  • Like 10
Link to comment
Share on other sites

You better believe I'm going to use this. I have been waiting for a heightmap preview tool for the longest time. I'll play around with it first but it should be immensely useful. Thank you.

Link to comment
Share on other sites

Wow, I guess this tool will definitely help to fix height problems in your own map! Now you don't have to start the game to see the map ingame if it fits with the surrounding. Good job!

 

 

You can customize the colors of imported surf maps using the "surfdefs.ini" config file. For convenience, I made the config file similar to the one used by Cyrem's old Map Tool, so if you ever made a custom color config file for that, you can just drop it in the data folder, replace the surfdefs.ini, and it'll load just fine.

 

Which value is what color? I could also find it out by creating a map with all terrain styles but if you could write that information here, everyone can see it  ;)

 

I just found it out myself and I noticed that the color of the ground isn't listed in surfdefs.ini. The value for ground color is 5!

 

Here are all the values with their wall and ground types:

 

Value 0 = Unknown

Value 1 = Solid Rock

Value 2 = Hard Rock

Value 3 = Loose Rock 

Value 4 = Dirt

Value 5 = Ground

Value 6 = Lava

Value 8 = Ore Seam

Value 9 = Water

Value 10 = Energy Crystal Seam

Value 11 = Recharge Seam

 

 

And I just wanted to make the surf maps look like the radar map. So I "extraced" the colors from the radar (Paint is your friend :P).

If you also want it to look like the radar map, then click here.

Just put it into the same folder as sheepandshepherd said.

Link to comment
Share on other sites

Excellent work.  This is exactly the sort of innovative and original work the community needs more of.  Well done.

Link to comment
Share on other sites

Value 0 = Unknown Value 1 = Solid Rock Value 2 = Hard Rock Value 3 = Loose Rock  Value 4 = Dirt Value 5 = Ground

0 is ground and 5 is "dirt".
Link to comment
Share on other sites

0 is ground and 5 is "dirt".

 
No, as far as I can see value 0 doesn't change anything. I tried it with several maps and dirt was always 4 and ground was 5 (I had to add this to the ini file).

 

It might also be possible that here's another difference between english and german computers (just like the decimal numbers)...  :S

Link to comment
Share on other sites

0 is ground and 5 is "dirt".

 

No, as far as I can see value 0 doesn't change anything. I tried it with several maps and dirt was always 4 and ground was 5 (I had to add this to the ini file).

 

It might also be possible that here's another difference between english and german computers (just like the decimal numbers)...  :S

5 is dirt in every single vanilla RR map. Ground is defined in Dugg.map, not the surf.map.

Link to comment
Share on other sites

5 is dirt in every single vanilla RR map. Ground is defined in Dugg.map, not the surf.map.

 

But you should only import height and surf maps into the Heightmap Converter. And because of that you can't import the dugg.map (at least you shouldn't because that would mess the viewed parts of the map up). And I saw that an addition of Value 5 in the .ini file makes the yellowish ground look like the radar map ground (when using the rgb code of that ground color). The dirt color stays the same and I also checked the value for dirt in the surf.map several times (with different colors, on maps where I definitely know where to find dirt walls). 

So all in all, (at least) if I use the .ini file I uploaded, the map looks just the way it should look like (==> RR radar style).

Link to comment
Share on other sites

Yes, but with these values I mean the values in surfdefs.ini from this Heightmap Converter to change the style it shows the maps. I'm not talking about changing anything ingame! 

Link to comment
Share on other sites

sheepandshepherd

I forgot how complicated the "ground" thing was. I just assumed it was value 0 in the surf map. But alan is right, the vanilla maps seem to use surf value 5 as empty ground (see below). So if the Dugg map actually defines ground, how does that work? Does its "01 00" hex value overwrite whatever is in the surf map and make it into ground in-game? Or does the surf map value actually also have to be 5?

Here's level 12's surf map in human-readable form, if you're curious:

Compare it to the original screenshot -- all the ground (lightish brown) has "5" value, nothing has "0".

 

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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value and not have to load the Dugg map. It is just a simple preview, after all, loading the surf map does nothing else.

 

Question for you guys: do you want this tool to be a full, accurate map preview tool, with ground and walls all shown correctly (not just all flat) like in-game? I don't mind (trying to) implement that if it'll be useful, but I mostly just needed this as a heightmap converter for my levels.

Link to comment
Share on other sites

So if the Dugg map actually defines ground, how does that work? Does its "01 00" hex value overwrite whatever is in the surf map and make it into ground in-game?

Yes.

00 is Wall, 01 is ground, 02 is hidden, 03 is Slug, 04 is hidden slug. Putting 02 or 04 on a wall will make it drop no rubble when you mine it. It's complicated in vanilla maps but the Map Creator merges it into an easy layout.

Also, hi. You haven't posted in two years. Glad you're back.

Link to comment
Share on other sites

sheepandshepherd

Thanks. Yeah, I tend to get tempted away by other games. But I've been wanting to play Rock Raiders without replaying the original levels -- so, time to do some modding :P

Link to comment
Share on other sites

Question for you guys: do you want this tool to be a full, accurate map preview tool, with ground and walls all shown correctly (not just all flat) like in-game? I don't mind (trying to) implement that if it'll be useful, but I mostly just needed this as a heightmap converter for my levels.

 

It would be incredibly useful, and it would save a lot of time since we wouldn't have to keep moving files and starting the game to get an eye on what the map will look like. But from what I can tell so far, your tool uses the bottom-left corner of each tile as the height point, but it seems like LRR uses the top-left. I noticed inconsistencies between how some of my levels looked in your tool so I wanted to bring that up, and it seems to make sense as LRR uses the top-left corner of each map as the origin, with +x being east and +y being south.

  • Like 2
Link to comment
Share on other sites

sheepandshepherd

But from what I can tell so far, your tool uses the bottom-left corner of each tile as the height point, but it seems like LRR uses the top-left. I noticed inconsistencies between how some of my levels looked in your tool so I wanted to bring that up, and it seems to make sense as LRR uses the top-left corner of each map as the origin, with +x being east and +y being south.

Yep, that's exactly right. I'm storing the loaded map as a texture, and Unity's textures use the bottom left as the origin, so that's probably where the inconsistency starts. I noticed it too, but I wasn't sure what the issue was. Thanks for letting me know.

I'll fix the 3D view in the next update, it was hastily written anyway. And I'll start storing the map as an array of ints instead of a texture -- dealing with the vertical flipping was messy. That should improve performance too (generating the mesh was always really slow, at least for me.)

 

Edit: I switched over to an array for storing the map. The mesh now correctly uses the top-left corner as the height like in LRR, as well as generating the mesh about 10 times faster than before. I also now have the two triangles of each tile facing the way they would in LRR, based on heights of neighboring tiles, rather than all the same way (no more weird jagged edges in certain areas). Progress is good :)

  • Like 2
Link to comment
Share on other sites

  • 3 weeks later...
sheepandshepherd

Beta version has been released. Here's a download link. Also updating the first post now.

 

Main changes from alpha version:

-The heightmap is now stored as an array of ints, speeding everything up by about 10 times and fixing a minor misalignment issue.

-Full camera controls.

-Textured mode for surf maps. For now only the rock biome is included (low res versions of in-game textures). Next version will let you load your own textures.

-A help screen with all controls listed.

-Slightly improved preview mesh, but it still shows walls as flat.

  • Like 2
Link to comment
Share on other sites

I just tested the beta version. It's much improved over the alpha! The heightmap matches up to what I see in-game and it loads so much more quickly too. The only things you would really need now are a proper file browser and raising adjacent rock walls by 7 units to create an entire map terrain previewer.

 

This tool is a keeper.

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
sheepandshepherd

I've started working on the next release, which will properly display walls. Here's a screenshot of what I've got so far:

gallery_337_343_682572.png

 

Still unfinished, of course. The texture still doesn't match the specific shape, a few corners still "fold" wrong, and non-visible walls aren't their usual dark-blueish texture.

 

Other things that are almost complete:

 - The file browswer

 - Autoloading of the surf map (ex: if you load "High_12.map", it'll automatically also load "Surf_12.map" if it exists.)

 - Biome selection, including custom biomes

 

I may also add loading the Dugg.map, since its extra information would be super easy to implement. Then again, for a full-map preview, it's not particularly useful.

  • Like 3
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.