The MapEditor is a program for editing terrain.
This application allows you to paint the surface of the terrain and to place objects on it.

Video: http://youtu.be/6UJ1R9wrwaE (quality 720p and fit to full frame).
Or avi file (96Mb). (XVid codec).


Concept.
Surface of the terrain can be displayed using several layers of images (grass, gravel, etc.).
These layers are mixed with a special mask. The mask is a texture, each channel (RGBA) which represents
the contribution of each layer in the final image of the terrain.



In the picture you can see the three layers (grass, rock and leaves) are mixed with an alpha mask.
Red value translucent rock. Green value translucent leaves.
Black does not translucent, and we see the first layer (grass).
This is done using multitexturing and blending in the pixel shader.

We can draw on the terrain surface with a brush or with the help patterns (grid, spray, etc.).



Terrain is divided into tiles. To optimize resources and reduce the amount of work,
you can copy and paste the image tiles on different parts of the map.

You can also set the water fog to each tile separately.




The second part of the MapEditor is the Land elements Editor.
It allows you to set the game objects on the game map. There are units, trees, boulders, bushes and much of anything.


The Land elements Editor saves their location in a simple text file. Example.
In this file are unit layouts (coord and Y-angle), name of the parent class and unique name of the unit.
"LandEditData:" field is the description of the object class, and how to keep its children in a file:

LandElement "Robot2"
{
     

Unit: Robot2
Nation: Enemyes
Icon: "Textures\LandElemsIcons.dds"
IconRect: [ 184 46 229 91 ]
SaveFileName: "Robots2"
CountNames

// class in your project
// nation of units (can be skipped)
// icon on the panel
// in editor
// where to save Robot2 units
// for each unit of Robot2 generate unique name
   

}

     

For the MapEditor have the source code in C++ for VisualStudio 2008, DX9.

My contacts:
email: alexey.nosenko@gmail.com
icq: 123737014
skype: antilopka2011