Documentation/Tutorials/Creating a Simple Map
From NeoAxis 3D Engine Wiki
|Language:||English • Russian||Status:||Approved|
Maps, or worlds in NeoAxis 3D Engine represent the space where objects are located. Terrain, environment, sky, buildings, vegetation, animals, equipment and characters are considered as map objects. In order to create or edit a map, you need to use the Map Editor.
In this tutorial you will learn how to create a simple map, add terrain and light sources to it, etc. At the end of tutorial we will launch the simulation and play the map, controlling a character.
For more info about importing 3D models you can check Import Content section in Articles.
Creating a New Map
After launching the Map Editor select File -> New menu item.
In the window popup, specify the path to the folder where the new map will be located. The path is relative to the Data folder. Let's say our new map will be located in the Maps\SimpleMap folder. In addition, in this window, you can choose the objects that will be automatically created on the map. Leave the default settings and press the Create button.
The map has been created. You are now ready to fill it with objects! In order to move across the map, use the W, A, S, D keys (to move in horizontal directions) and Q, E keys (to move in vertical directions). You can also rotate the camera view by holding down the right mouse button. For more information you can read Map Editor.
Your terrain object has been created automatically when you have created the map (as you have checked the heightmap based terrain box).In order to start editing it, you first need to select it in the object panel.If you haven't created the heightmap terrain during map creation, you can create it now by selection Base\Types\HeightmapTerrain in the object creation window.
Now that the terrain is selected, simply click the edit button at the bottom of the properties panel.
In the edit window, you can edit the terrain's geometry and textures. Geometry allows you to control the terrain's shape(create mountains, hills or plains). The texture painting tools allow you to paint the texture you want to have on your terrain, in order to represent the various materials it can be made of: grass, rock, sand, etc.
Sky is used in a majority of maps. The most simple kinds of skies are SkyBox and SkyDome. SkyBox is a cube with 6 textures applied on it's interior faces. SkyDome is a hemisphere with a texture on it's inner surface. A sky is automatically added when you are creating a new map if you tick Sky box in the map creation menu. There are several methods of making skies in the engine as described in making sky tutorial.
Editing of Sun and Light Source
Light sources in the engine act as the ones in real life. The type representing a light source is called Light.type. in addition to the standard light source, Neoaxis also have a type that is representing the Sun:Sun.type. It differs from the ordinary light source on certain characteristics and is also displayed as a billboard (a plane image representing sun, always facing the camera). If you need to create the sun for your map, not a simple source of light (a light bulb, for example), it is more convenient to use Sun.type.
Editing a Spawn Point
A spawn point is a place on the map where the character will appear after a map is loaded. A spawn point is automatically created on the map, if the Spawn point checking is tick in the new map creation window. If you want to create spawn points when your map is already created, select Types\Special\SpawnPoint in the objects creation window and put it on the map.
If you want to place 3D models on the map, it's important to know that it can be done in two ways. The first way is to place a static 3D model using the type StaticMesh.type. The second method involves the creation of an object type in the resource editor and then to create it on the map. This method is needed to create complex and interactive objects. Click here to read more about the different methods of creating objects.
Let's start with the addition of a rock static mesh (StaticMesh.type). First, go to the 3D Model tab in the object creation window and select the Maps\RTSDemo\Models\RockBig\RockBig.mesh file.
Place this big rock on the map. Use your mouse to put it where you want on the map. Then click the left mouse button to place it.
Now, the editor offers you to place another similar object, but since we only need one, press Escape, to complete the object creation process.
The stone has been created. If you need to edit it, you can change it's position, rotation or scale with the transformation tools, set new properties or clone it (edit -> clone or shift + drag with the object selected).
Our next step is to add a box on the map, which is a type that have been previously created in the Ressource Editor. To do this, in the Object Creation window, select the type Types\Dynamic\Box.
Place the box on the map as you have done it with the stone.
Read more about how to edit created objects here Overview of Map Editor.
Map Compositor Manager Setup
Map Compositor Manager controls full-screen effects. The engine includes a large set of post-effects, such as for example depth of field, color correction or SSAO. You can find the full list of available post-effects in overview of Full Screen Effects. The Map Compositor Manager is automatically added to the map if you select Compositor manager in the new map creation window. If you haven't created it when you have created your map, you can add it by going to the Object Creation window, selecting it and clicking one the map to create it
As an example let's add the post effect DepthOfField on the map. Firts, select the MapCompositorManager in the map objects list.
In the Properties window, click the "..." button, on the Items property line.
The popup window allows you to edit the list of post-effects used on the map. Add the DepthOfField post-effect, by selecting it from the menu that appears when you click Add, and press the OK button.
Now if we focus our attention on closest objects - cube and rock, we can notice that they look sharp, and that the distant objects are blurred
More details the Map Compositor Manager can be found here Setting post effects in Map Editor.
Starting of the Map
It's time to test our newly created map. To do this, click Run Simulation in the main panel.
Starting the map, you can run through it and evaluate the result of the work.