Page 1 of 9

Map design software?

Posted: 19 Nov 2006, 19:12
by hughperkins
Are there any existing applications out there for creating maps/missions? At least, height maps? ie, you see a flat plain, and you can push land up or down with left/right mouse button, using a brush of varying sizes, along the lines of SecondLife land editor.

If no, is that because making a map from a texture is easy or because there's other tools that can achieve the same thing (build a mesh in Blender and save as heightmap???) or because making a height map editor is difficult or because noone cares - theres already enough maps - or something else?

Edit: Height map editor created here: http://manageddreams.com/csai/MapDesigner.zip

- Left-click to raise land, right-click to lower
- Change brush size
- Flatten land
- Export as heightmap and /or as slopemap
- Exported slopemap color-coded by movement area, eg infantry, vehicle and extreme (configurable)

User interface:
Image

Generated heightmap:
Image

Exported slopemap:
Image

Posted: 19 Nov 2006, 19:22
by NOiZE
well i make my heightmaps in Photoshop, but making slopes is sometimes rather trouble some, would really love a good program to make nice heightmaps.

Posted: 19 Nov 2006, 19:47
by bamb
Not exactly a response, but you can use L3DT and forboding's tut sticky on this forum to create a small test map really quickly...
L3DT is free for small maps, it's a terrain generation software but takes some heightmap input if you need... and has some kind of an editor too.

Posted: 20 Nov 2006, 03:43
by Argh
The bigger picture, in the longer term, is going to be the need for a visual editor that will allow users to interactively work with SM3 mapping. With splatting, it is technically possible to have a texture that is not distorted on a sheer face, for example... none of the current tools address this.

Posted: 20 Nov 2006, 15:18
by bamb
Could the guy who makes L3DT work with the devs? It's a damn good software... Maybe not a whole solution but something with export at least.

Posted: 20 Nov 2006, 15:59
by BlackLiger
Its in the list of things for people to try and develop. I'm gonna give it a go later this year or early next.

Posted: 22 Nov 2006, 05:06
by hughperkins
Created a prototype map height editor at:

http://manageddreams.com/csai/MapDesigner.zip

To run, run MapDesigner.exe

left click on land to raise it, right click to lower it

ctrl-s to save into heightmap_out.bmp (takes a while)

j or middlemousebutton + move mouse to move around. scrollbutton changes viewing angle. j + move scroll button changes zoom

Mapsize hardcoded at 1025 x 1025 (in Rendering/DrawGrid.cs)

Key configuration in config.xml

The zip contains sourcecode and Windows binaries. Sourcecode is in C#, using SDL.Net and Tao.OpenGl. It's also in SVN at Tools/MapDesigner

Image

Posted: 22 Nov 2006, 06:21
by hydr1x
holly crap that looks cool ima have to try it

Posted: 22 Nov 2006, 13:40
by SwiftSpear
Something we could really use for mapping with the new format is a slopemap generator. Read a height map and spit out a slope map.

For reference a slopemap is a map where the greater the slope the darker the texture in that area. So that is to say, where on a heightmap at the bottom of your mountain you would have black and at the top of your mountain you would have white and the slope would be gradually lightening shades, on a slope map on the bottom it would be white, the top would be white (because both are relatively flat) and the slope would be dark (darker where it is steeper and lighter where it is flatter).

The reason for the need for this is the way the new map format works. it's a little awkward to manually paint mountainsides and what not. In real terrain it's common to have a situation where grass may not grow on steep mountain sides, but it can grow on the flats both at the top and bottom, or snow won't stick to steeps, but it will stick to flats. This really can't be emulated with photoshop for use in mapping at the moment, having a slope map to edit as a second layer would make generating the texture transparency masks much easier from photoshop.

However if you're not looking for feature suggestions ignore this post :P

Posted: 22 Nov 2006, 14:06
by bamb
Really nice!
hmm seems i have NET framework 1.1, gotta dl that 2. something for this to work. I'll test soon.

Posted: 22 Nov 2006, 16:29
by LOrDo
You can already do this with alot of programs out there. Theres terragen, free, but I dunno if it can export as a bitmap. My personal choice, Bryce, i export it as a PGM and open it in GIMP, tweak it, and save it as a .BMP. I have somthing called TGE Terrain Editor that works like hugh perkins but with adjustable brush sizes and types. And textures. The list goes on...

Posted: 22 Nov 2006, 16:56
by Erom
Also, if you want to emulate that effect in photoshop/gimp, run a Find Edges filter on your heightmap, using a Difference of Gaussians type ( I think), then invert it. That wont give you a true slopmap, but it will darken steep areas and leave the rest light. It really only works on cliffs though - shallow ramps get quantized, which makes the terrain look like it has countour lines on it.

But I aggree, a proper slopemap generator would be useful.

Posted: 22 Nov 2006, 19:04
by hughperkins
New version of MapDesigner. File linked to by URL above has been updated. SVN update in progress.

Changes:
*Added slopemap export. ctrl-f2 to export to slopemap.bmp
*Default heightmap filename is now heightmap.bmp
*ctrl-l will load heightmap.bmp
*Cleaned up config.xml:
- added camera translate and rotate speed
- added heighteditor speed and default brushsize
- added default map width and height
- added default heightmap and slopemap filename
- added export slope map, max slope
- added heightmap minimum and maximum

Example slopemap export:

Heightmap:

Image

Corresponding slopemap:

Image

Posted: 22 Nov 2006, 19:12
by hydr1x
hmm intresting

Posted: 22 Nov 2006, 19:22
by NOiZE
hughperkins wrote: Mapsize hardcoded at 1025 x 1025 (in Rendering/DrawGrid.cs)
nice tool, but please don't hardcode that :(

Posted: 23 Nov 2006, 00:48
by SwiftSpear
Also, we can import height maps right? It's kind of useless if it can only work from blank templates...

Posted: 23 Nov 2006, 02:13
by Forboding Angel
ungh

you guys forget so many variables when talking about slope maps.

First there is the issue of height. the map height determines how steep a surface will be.

Furthurmore, you have to consider the lowpass option (which is the closest thing to 16bit heightmaps we are gonna get with mapconv, considering that raw files support is shaky at best.


That said... Hugh, would you consider perhaps writing a better mapconv program? In particular, one that supports, mosaic tiles, and png? Also, the current mapconv has an upper file size limit of 600 megs for texture images. It would be nice to see that disappear.

Posted: 23 Nov 2006, 07:07
by SwiftSpear
Forboding Angel wrote:ungh

you guys forget so many variables when talking about slope maps.

First there is the issue of height. the map height determines how steep a surface will be.

Furthurmore, you have to consider the lowpass option (which is the closest thing to 16bit heightmaps we are gonna get with mapconv, considering that raw files support is shaky at best.


That said... Hugh, would you consider perhaps writing a better mapconv program? In particular, one that supports, mosaic tiles, and png? Also, the current mapconv has an upper file size limit of 600 megs for texture images. It would be nice to see that disappear.
The variance in map height doesn't change the accuracy of the slope map, increasing map height doesn't make only certain slopes steeper, it makes all the slopes steeper, so your slope map is still an accurate representation, just scaled differently. As for lowpass, can you outline exactly what that does to heightmap as it is put in game? It's possible that it's emulatable by the slopemap with certain photoshop filters either way.

Posted: 23 Nov 2006, 07:26
by Forboding Angel
Hmm, that's a good question. Honestly tbh I don't think anyone really knows what the lowpass option does exactly.

It is my personal belief that it basicially does 1 of two things.

1st (and probably the most unlikely): Performs guassian blur (equating to probably about a .5 pixel blur), and converts the image to 16 bit RAW.

2nd: Simply performs a guassian blur on the heightmap.

Imo 2 is probably the most likely. It softens the edges of the heightmap in some way and honestly a blur is about the only sensible solution that I can think of.


See that thing is SS, a slopemap is of no use if it does not tell you certain things. For example. I output slopemap, I need to know what the maxslope value of that slope is at Y height values. Otherwise it is no good to me. You can tell how drastic your slopes are by simply looking at your heightmap. A slopemap without hard values is simply not useful.


As far as emulating with photoshop filters, there is a way (that I can't remember atm), that will basically use rgb values for height representation, and while useful, it's not worth the trouble to make.

We really need something that can translate slopemaps into springs idea of a MaxSlope=x; value. Otherwise the worth of having a slopemap is dubious at best, and would be only useful to newbie mapmakers (which might be reason enough to proceed, just I want something better and us experienced guys can use).

Posted: 23 Nov 2006, 07:54
by hughperkins
Some points:
*the default mapsize is customizeable via config.xml (open with notepad)
*loading an existing map with a different size should change the mapsize
*You can load existing maps. Copy the existing bmp into the MapDesigner directory with the name "heightmap.bmp", then ctrl-l to load map.
*The slopemap is generated with the Spring algorithm, taken from ReadMap.h
*There are some parameters in config.xml to control the slopemap generation. You can open config.xml using notepad.
- exportmaxslope controls how the slopes are mapped to the bmp. 0 slope is mapped to 0. exportmaxslope is mapped to 255. Everything else falls within the two. Higher slopes are mapped to 255.
- you can control minimum and maximum height from the config file. This should affect slope generation.

Edit: just for info, here's the slopemap algorithm, in Mapping/SlopeMap.cs. The original C++ is in ReadMap.cpp.

Code: Select all

        // ported from Spring's ReadMap.cpp by Hugh Perkins
        public double[,]GetSlopeMap()
        {
            HeightMap heightmap = HeightMap.GetInstance();
            float[,] mesh = heightmap.Map;

            int mapwidth = heightmap.Width;
            int mapheight = heightmap.Height;
            
            slopemapwidth = mapwidth / 2;
            slopemapheight = mapheight / 2;
            
            //logfile.WriteLine( "Getting heightmap, this could take a while... " );
            
            double[,]SlopeMap = new double[ slopemapwidth, slopemapheight ];

            for(int y = 2; y < mapheight - 2; y+= 2)
            {
                for(int x = 2; x < mapwidth - 2; x+= 2)
                {
                    Vector3 e1 = new Vector3(-squaresize * 4, mesh[x - 1, y - 1] - mesh[x + 3, y - 1], 0);
                    Vector3 e2 = new Vector3(0, mesh[x - 1, y - 1] - mesh[x - 1, y + 3], -squaresize * 4);

                    Vector3 n = Vector3.CrossProduct( e2, e1 );
        
                    n.Normalize();

                    e1 = new Vector3(squaresize * 4, mesh[x + 3, y + 3] - mesh[x - 1, y + 3], 0);
                    e2 = new Vector3(0, mesh[x + 3, y + 3] - mesh[x + 3, y - 1], squaresize * 4);

                    Vector3 n2 = Vector3.CrossProduct( e2, e1 );
                    n2.Normalize();

                    SlopeMap[ x / 2, y / 2 ]= 1 - ( n.y + n2.y ) * 0.5;
                }
            }
            //logfile.WriteLine("... slopes calculated" );
            return SlopeMap;
        }