PLSM Starter Questions

kungfoomasta

28-09-2006 17:57:32

Hi All, I have some basic questions before my attempt to use PLSM2 with my app.

:?: Does the mapsplitter tool have to be run for every terrain I want to export into PLSM2?

:?: What does the mapsplitter tool do? Does the mapsplitter tool only split up the heightmap? What about the texture map?

:?: What directory does maptool.cfg need to be in?

:?: maptool.cfg seems a little confusing. What are the basic inputs to this program, and what is the output?

:?: What are .gen files? Where are they located?

:?: Regarding L3DT, are the heightmap and texture map sufficient to create terrain for PLSM2? Can other maps be used to enhance the terrain?

:?: Would the resetScene function be functionally equivalent to clearWorldGeometry? (this function doesn't exist, but would match setWorldGeometry)

:?: What are all the known options regarding the set/getOptions functions?

:?: Why does set/deformHeight take a Vector3 arguement and not a Real value?

:?: when would or should WorldDimensionChange be called?

:?: How do altered terrains get serialized to file? How are these terrains loaded?

Thanks,

KungFooMasta

PatrickB3

28-09-2006 19:25:12

Does the mapsplitter tool have to be run for every terrain I want to export into PLSM2?
Yes. PLSM2 won't work correctly with maps that did not go through map splitter.


What does the mapsplitter tool do? Does the mapsplitter tool only split up the heightmap? What about the texture map?

Mapsplitter does a lot of stuff. At the least it splits the heightmap into the pieces used by the pages. It can also split other files for the terrain.

What directory does maptool.cfg need to be in?

The same folder as mapslitter.exe

maptool.cfg seems a little confusing. What are the basic inputs to this program, and what is the output?
DefaultMap=XXX
This is the first map to split where XXX is the map you define.

XXX=XXX.gen
This is how you define maps. the left side you define a name which is used by default map. The right side is the .gen file which tells mapsplitter what to do with the map.

GroupName=PLSM2
This tells mapsplitter which group it will find the files in. Must match the group in resurces.cfg that the paths are added to. Resources.cfg is the file Ogre apps use to build their path information.

BatchMode=no
If BatchMode is no then only the default map is split otherwise all maps defined in this file are split.

What are .gen files? Where are they located?
.gen files tell mapsplitter what to do. They live in the terrains folder usually. Look at the demo ones. Also look here http://www.ogre3d.org/wiki/index.php/Paging_Scene_Manager_config_files

Regarding L3DT, are the heightmap and texture map sufficient to create terrain for PLSM2? Can other maps be used to enhance the terrain?
L3DT heightmaps mostly work in PLSM2. You have to export as RAW. Also keepin mind that the height map will be upside down when used in PLSM2. ( The top of the map will be the bottom. ). You can flip it in Photoshop before splitting it in mapsplitter if this is a problem. You can use the texture from L3DT on the PLSM2 terrain. It won't be pretty at all but will give you an idea if everything worked. You will have to have mapsplitter split it for you.

Would the resetScene function be functionally equivalent to clearWorldGeometry? (this function doesn't exist, but would match setWorldGeometry)
resetScene well... it resets the scene. As such everything is cleared not just World Geometry. Cameras, scene nodes, lights, etc.

What are all the known options regarding the set/getOptions functions?
see http://www.ogre3d.org/wiki/index.php/Paging_Scene_Manager_Option

when would or should WorldDimensionChange be called?
I never have.

Why does set/deformHeight take a Vector3 arguement and not a Real value?
The Vector3 is used to pass in the position to deform. Get/Set Option only allows one parameter so deforming a terrain takes multiple calls. See the PLSM2 Demo app or the code for GOOF to see how to deform and/or paint terrain.

How do altered terrains get serialized to file? How are these terrains loaded?
When a terrain is deformed PLSM2 will save it on successful exit as a .modif file. They are loaded like anyother terrain. They are saved as the original map from mapsplitter was saved. They are exactly like they came from mapsplitter except they didn't.

kungfoomasta

28-09-2006 19:40:26

From the Wiki example:

puget_sound=puget_1k.gen

Is the puget_1k.gen file provided? (Is it in the datasrc.zip?) I remember extracting the zip in either the ogrenew directory or the ogreaddons directory, but I did a search and couldn't find any .gen files.

Thanks for all the information PatrickB3. For some reason I didn't navigate to the wiki sites you mentioned, they look VERY useful. I will read all those before posting any more questions.

Thanks!

KungFooMasta

tuan kuranes

28-09-2006 20:20:50

What directory does maptool.cfg need to be in?

not necessary, can also be in a ogre resource path, paginglandscape2.cfg too.
when would or should WorldDimensionChange be called?
editing heightmap, adding page afterwards.
network terrain receiving.
etc.

puget_1K.gen.cfg is distributed in cvs and source zip.

kungfoomasta

29-09-2006 04:17:46

So I'm trying to go through the wiki, and I'm a bit confused.

For better understanding, I'm making a directory on my desktop called "PLSM Map Splitter". Basically I want to be able to drop in my heightmap and texturemap, create the required .cfg(s), and run mapsplitter to generate what I need to load up the terrain using PLSM2.

From Wiki:
First you'll want to define a map splitter config file, which defines how you want to split and texture it.

:?: What is the name of the map splitter config file? Can somebody provide an example?

:?: Will each map need a splitter config file, or can the same file be used?

From Wiki:
Then you want to add the map config file name to the maptools.cfg list of maps that your mapsplitter can handle, even adding it as the defaultmap and disable batching so that it splits only that one, and not all the maps you have on the list.

Here is a sample maptool.cfg:


DefaultMap=European_Alpes

European_Alpes=Alpes.gen
TSMTerrain=TsmTerrain.gen
hf_129_3=hf_129_3.gen

# need to download datasrc.zip from http://tuan.kuranes.free.fr/ogre.html for those
#puget_sound=puget_1k.gen
#grand_canyon=gcanyon_height_4k2k.gen
#terragen_genrated=terragen16bits.gen

# resource group name
GroupName=PLSM2

#do you want to run it on all maps listed here
BatchMode=yes


:?: Where do I get these .gen files, I don't see any! How do I go from a heightmap and texturemap to a .gen file?

:?: What is output by running MapSplitter?

:?: What files need to be in the same directory as MapSplitter.exe for it to run properly?

From Wiki:
Once you filled you hard disk with the split map data, you now can make the run time configuration file.
There you are required to define at least where to find files, how to load them, and some default texture mode to apply.


:?: Can anybody provide an example of a run time configuration file?

:?: Are run time configuration files used in the "setWorldGeometry" function call?

Thanks,

KungFooMasta

kungfoomasta

30-09-2006 18:18:08

Correct me if I'm wrong..

First you'll want to define a map splitter config file, which defines how you want to split and texture it.

An example of this file is Alpes.gen.cfg, which I found in E:\ogreaddons\paginglandscape\Samples\Media\paginglandscape2\terrains.

Contents look like this:

GroupName=PLSM2

LandScapeFileName=alpes
LandScapeExtension=raw
RawWidth=960
RawHeight=1200

## for some reason water is 65035 in SRTM files...
SRTM_water=yes

TextureStretchFactor=2.0

OutDirectory=LandScapeFileName


HeightMap=yes

BaseMap=yes
CoverageMap=yes
AlphaMaps=yes

LightMap=yes
Sunx=0.0f
Suny=0.88f
Sunz=0.47f
Ambient=0.5f
Diffuse=0.5f
Blur=0.0f

MiniMap=yes
MiniMapWidth=64
MiniMapHeight=64


NumMatHeightSplat=4

MaterialHeight1=0
MaterialHeight2=7
MaterialHeight3=15

SplatFilename0=splatting_sand.png
SplatFilename1=splatting_grass.png
SplatFilename2=splatting_rock.png
SplatFilename3=splatting_snow.png


The file template.default.gen.cfg is the base template for new map config files that are to be split with the mapsplitter tool.

Then you want to add the map config file name to the maptools.cfg list of maps that your mapsplitter can handle, even adding it as the defaultmap and disable batching so that it splits only that one, and not all the maps you have on the list.

One confusing thing was the fact that ".cfg" was appended to the end of the map name, so Alpes.gen is actually referring toAlpes.gen.cfg

Contents of maptools.cfg:


DefaultMap=European_Alpes

European_Alpes=Alpes.gen
TSMTerrain=TsmTerrain.gen
hf_129_3=hf_129_3.gen

# need to download datasrc.zip from http://tuan.kuranes.free.fr/ogre.html for those
#puget_sound=puget_1k.gen
#grand_canyon=gcanyon_height_4k2k.gen
#terragen_genrated=terragen16bits.gen

# resource group name
GroupName=PLSM2

#do you want to run it on all maps listed here
BatchMode=yes


You launch Mapsplitter. Be warned, depending on the options selected, it can be a VERY long process.

Right now I am trying to run mappsplitter, and trying to find out what modules are needed for it to execute. It looks as if mapsplitter.exe is hardcoded to look in particular folders:

Error #: 8
Function: FileSystemArchive::changeDirectory
Description: Cannot open requested directory ../../../../../ogreaddons/paginglandscape/Samples/Media/paginglandscape2.
File: ..\src\OgreFileSystem.cpp
Line: 141
Stack unwinding: <<beginning of stack>>
10:09:13: An exception has been thrown!


In order for me to use the mapsplitter I would have to replicate the folder hierarchy, or place my new map files in a specific location.

I noticed there is a tool Tool_MapSplitterFontEnd.exe That looks like a very good tool.



:?: Can somebody provide me an example of an Input File, Plugin Cfg file, Search Path, Tile Size, and Pixels to overlap?

KungFooMasta

PatrickB3

30-09-2006 21:17:38

I've never seen nor used that tool so I couldn't tell you, though I would really doubt it works anymore.

Mapsplitter uses a resources.cfg for it's file paths just like any other Ogre app. If it doesn't find a PLSM2 group in resources.cfg then it falls back onto the hard coded paths.

The Demo Souces Zip file contains sample maps, /cfg's, .gen.cfg's. Everything needed to build the demo maps.

tuan kuranes

02-10-2006 16:37:02

Tool_MapSplitterFontEnd.exe is a very old deprecated tool, sorry.