The ludiloom platform provides a pretty good terrain edition graphical tool - the Terrain Editor. In this tutorial we will show the basis steps required to create a terrain, while pointing to the most important aspects to take into consideration. Let's start!
Contents |
Configuring the Terrain
The first thing to is to open the Terrain Editor. Open the ludiloom menu (ESC) >> Tools >> Terrain Editor:
To enable the terrain, press Terrain >> Enable.
There is more info about this menu here. The functionality to load/save the terrain is particularly useful. It allows to export all terrain configurations to a file (use the extension .mtf) so you can import it back to the system as a Media Item.
Open the Terrain Properties Editor:
The Terrain Properties Editor looks like this:
The first part of the editor (Basics) is where the scale of the terrain is defined. By themselves, these values have no real meaning or impact on the overall performance. What really matters is the detail of everything else there is on the game scene. You can use this value to help keeping distance proportions when composing the game scene and even programing the game, e.g. have 1 unit representing 1 meter. Take also in consideration that your terrain should be big enough so that players will never see the edges of the terrain. That said, make your terrain as small as possible.
In the second part of the editor (Advanced) is where you set a lot of parameters that will affect the level of detail of the terrain as well as the performance. Check this for more information about each parameter. The goal is to reach an adequate level of detail while keeping the number of polygons in the terrain to a minimum. You might want to switch to wireframe view by pressing Ctrl+F1 and Alt+F1 to see the triangle count and frame rate in order to have a better idea on what happening with the terrain. The terrain system is ludiloom adapts and makes several optimizations to improve the performance, and that's why you should also deform the terrain a bit and move the edit camera to a position similar to the view of the player.
Deform
You can see more info about the deformation tools here, but the basics is that you have four tools: raise, lower, flatten and smooth. You can pick a size and strength of your tool. It's not that hard to get the hang of it:
If you follow these instructions, you'll have a better visual feedback of the terrain deformation:
Paint
Again, you will find detailed information in here. Start by the main covering for the scene. Click on the texture button to select a pattern. In the Default Media Library, which you can subscribe for free, there are some textures. Write grass0003 in the Library Explorer to find a grass and its normal map:
After applied to the terrain and adjusting the tilling it will look like this:
If you set the brush size to a value small enough, you can use the painting tool to draw a path:
Add some rocks to the hills:
You can lower the oppacity to mix textures. We added a little dirt to the green of our scene:
Ludiloom API
The ludiloom API enables full control over the terrain through scripting. The class Terrain contains all the functions related to the terrain. The next code snippet creates and configures the terrain if there Arena doesn't have a terrain yet:
-- activate terrain!! if not Terrain.isEnabled() then Terrain.init(); Terrain.setEnabled(true); Terrain.setWorldSize(5000); Terrain.setWorldHeight(500); Terrain.setAlphamapSize(128); Terrain.setHeightmapSize(129); Terrain.setHeightmap(MediaItem.newMI("0000000000000132")); Terrain.setTiling(0,0.035); Terrain.setNormalMappingActive(false); Terrain.setTexture(0,MediaItem.newMI("000000000000007F")); Terrain.commit(); end













