TempOcculisPage        

Distribution Problems with PLSM2 That Occulis Would Like to Fix and Document

Purpose

The purpose of this page is to help a development team implement PLSM2 in their own runtime directory with their own media in a minimum amount of time.

As you can see in in the "A Sample Project" section below, we will not be running all of our demos and tools out of \dev\3rdparty\ogrenew\Samples\. This causes problems. Many parts of the PLSM2 setup expect files to run from a certain folder. Even worse, some of them seem to output files into specific folders. I have not documented or fixed all of these issues yet, but this page is a start.

Some of this has been posted to topic: http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=1199

A Sample Project

My team is working on a game called Vitrius. We use a common base folder for everything. On my workstation, this is C:\dev. On another workstation, it is c:\vitrius\ and on yet another it is c:\documents and settings\superdave\projects\omfg

  • It is vital that all tools and configuration files use relative paths for this reason.
  • For all of these examples, let's assume c:\dev\ is where my sub-folders live. So I have:
    1. c:\dev\runtime\vitrius\bin\release - This is referred to as "the bin directory." You will find all necessary DLLs in this folder: Ogre, Novodex, OpenAL, PLSM2 and so on.
    2. c:\dev\runtime\vitrius\media\ - This is referred to as "the media directory." Under here you have all of the fonts, textures,
    3. c:\dev\vitrius\src - Sources (unrelated details omitted)
    4. c:\dev\vitrius\compile - Our scripts, such as solution and project files.
    5. c:\dev\vitrius\include - Headers and such
    6. c:\dev\3rdparty\ogrenew - The Ogre CVS head.
    7. c:\dev\3rdparty\ogreaddons - The Ogre Addons from CVS.

Projects

There are a few "PLSM" projects: PLSM, PLSM2, GOOFEditor.

Problem: Which MapEditor and PLSM2 project is "the right one", who is working on it, and where can contributors help out?
Solution: Use the PLSM2 to generate the correct DLLs. Use the GOOF Editor if you want to. Use the Tuan MapEditor (also known as the PLSM2) if you want to. Use MapSplitter to turn huge image maps into little tiles. There is no known use for PLSM; there is only PLSM2. (Tuan MapEditor is sort of good ancestor, but now dead.)

PLSM

  • PLSM: Original Ogre3D paging landscape scene manager.
  • Q: What are the deliverables? What does this project produce?
  • A: I do not know, because I haven't investigated PLSM1, only PLSM2.
  • Q: Does this project have a maintainer?
  • A: I do not know.
  • Q: Does anyone use this project? Can it be removed from ogrenew?
  • A: I do not know. I suggest it be removed if it has no maintainer.

PLSM2

PLSM2 is the current PLSM.

  • Q: What are the deliverables? What does this project produce?
  • A: Several things:
    • Plugin_PagingLandScapeSceneManager2.dll - for your programs to use
    • MapSplitter.exe - For turning a huge image into many tiled images.
    • Demo_PagingLandScape2.exe - A sample demo which lets you fly around your PLSM world.
    • MapEditor - A map editor. I haven't messed with this yet.
  • Q: Does this project have a maintainer?
  • A: Tuan is the maintainer of PLSM2. His site.
  • Q: What games or other projects are using PLSM2?
  • A: See the Ogre Addons PLSM2 thread
  • Q: Why are there two PLSM packages?
  • A: Different folder structure between OgreSDK and CVS
  • Q: Shouldn't someone remove PLSM if only PLSM2 is used?
  • A: That makes sense to me.
  • Q: Is the map editor at Tuan's page the same as the one in OgreAddons? The main page says, "plsm2 is in OgreAddons CVS", but the two distributions differ.
  • A: As far as I can tell, yes they're exactly the same. Sometimes they're out of synch, though. For instance, when SourceForge explodes or Tuan has released a zip file but not updated the CVS.

GOOFEditor

The GOOF Editor by Falagard:

  • Requires: Ogre 1.2
  • Requires: The PLSM2 DLL
  • Benefits from: MapSplitter
  • Provides output which can be used by: Demo_PagingLandScape2.exe

Contributors

  • Q: Are Falagard and Tuan working together on one project, multiple projects, or none at all?
  • A: Falagard is working on his own GOOFEditor. Tuan is working on PLSM2 and the PLSM2 map editor. The GOOFEditor uses PLSM2, but is a separate editor.(as PLSM2 gives many underlying terrain editing and terrain possibilities to Goof, Tuan help as much as possible Goof, implementing things Goof would need in plsm2.)


Q: Who is Occulis and why is he writing this?
A: Occulis is an all-around nice guy. He is working on a game which uses PLSM2 and wants his artists to use a map editor to create PLSM2 terrains. He spent 8 hours simply trying to get the PLSM2 demo running, and would like to save future users of PLSM2 that time. He is also a documentation fiend.

  • Q: I have Ogre HEAD and it claims I have Eihort (v1.3.0). Why?
  • A: Ogre Head IS Eihort. if you want Ogre Dagon, you must get CVS with tag v1-2-X.

Distributions

  • Q: Why are there different distribution methods with different file sets?
  • A: OgreSDK, OgreSource and CVS distritbution doesn't have same folder structure.


For instance:

Method 1: ZIP From Tuan

  • Downloaded http://tuan.kuranes.free.fr/OgreSDK_PLSM2_source.zip
  • Extracted everything into C:\dev\3rdparty\compile\plsm
  • Projects were extracted into C:\dev\3rdparty\compile\plsm\Samples\PagingLandScape2\scripts
  • Loaded C:\dev\3rdparty\compile\plsm\plsm2.sln — It's missing Samples\MapEditor\scripts\MapEditor.vcproj
  • Actually, it's missing the whole Samples\MapEditor\ subdirectory. The only one it has is PagingLandScape2.
  • Ran diffs between unzipped files and the current ogreaddons cvs. Only diffs are that files and directories are missing.
  • (Note that this may be my own misunderstanding, because the zip is for 'OgreSDK' and I believe not necessarily for the CVS)

Method 2: OgreAddons CVS

  • Use cvs to check out ogreaddons
  • Notice relative include directories and link directories do not match the same ones used by other ogreaddon projects. (See below)

OgreAddons Issues

OgreAddon Projects and the default include paths. There doesn't seem to be any consistency here. Some addon projects them assume you have a directory setup like:

  c:\somedir\ogrenew
  c:\somedir\ogreaddons

while others assume:

  c:\somedir\ogrenew
  c:\somedir\ogrenew\ogreaddons

And I can't remember which, but I swear at one point I found an addon which, based on the relative paths in the vcproj files, seemed to expect the directory structure to be set up like:

  c:\somedir\ogrenew
  c:\somedir\ogrenew\Samples\Common\ogreaddons

Which is it? Are all of these project contributors just not talking to each other? Seems likely. Again, maybe I'm simply missing out on some information.

2006 May 14

Get Newest GOOF Map Editor

Compiling PLSM

  • Start at page http://www.ogre3d.org/wiki/index.php?title=Paging_Scene_Manager
  • First step it says is, "Get sample Maps from linkhere and extract into PLSM/media/paginglandscape2 directory". The link gets you datasrcs.zip.
  • I renamed datasrcs.zip to PLSM_media_paginglandscape2.zip, so hopefully I'll remember what the directory it's supposed to go into without re-reading the wiki.
  • Extracted and removed all CVS directories from the extract files, ("find ./ -type d -name CVS -exec rm -rf {} \;"). Note that I'm doing this under Windows by using Cygwin.
  • The wiki says, "Once you extracted them you can enable those terrains in paginglandscape2.cfg and maptools.cfg if needed (CVS at least need this.)", but paginglandscape2.cfg and maptools.cfg don't exist anywhere in the provided zip file.
  • Added comment to wiki page, cleaned up the wiki page itself a little.

  • Copied IPLSceneManager, paginglandscape and PagingLandScape2 from C:\dev\3rdparty\ogreaddons\paginglandscape\PlugIns to C:\dev\3rdparty\ogrenew\PlugIns
  • Copied C:\dev\3rdparty\ogreaddons\paginglandscape\Tools\MapSplitter to C:\dev\3rdparty\ogrenew\Tools\MapSplitter
  • There were some SVN conflicts so I did this from the /cygdrive/c/dev/3rdparty/ogreaddons/paginglandscape/Samples directory: find ./ -type d -name ".svn" -exec rm -rf {} \;
  • Loaded up c:\dev\3rdparty\ogrenew\Ogre.sln.
  • Did a Release build of OgreMain, just to make sure everything still works. :P
  • Added Plugin_PagingLandScapeSceneManager2.vcproj from C:\dev\3rdparty\ogrenew\PlugIns\PagingLandScape2\scripts to the solution
  • Did a release compile. I don't believe it! Plugin_PagingLandScapeSceneManager2 - 0 error(s), 0 warning(s).
  • Added Demo_PagingLandScape2 project from Samples\PagingLandScape2\scripts to Ogre solution. Built with no warns, no errs.
  • Added and built MapSplitter from Tools\MapSplitter\script and rebuilt.

Copying Files

Next, we copy all the files over.

  • Copied Demo_PagingLandScape2.exe from C:\dev\3rdparty\ogrenew\Samples\PagingLandScape2\bin\Release to C:\dev\runtime\vitrius\bin\release
  • Copied Plugin_PagingLandScapeSceneManager2.dll from C:\dev\3rdparty\ogrenew\PlugIns\PagingLandScape2\bin\Release to C:\dev\runtime\vitrius\bin\release
  • Copied folders paginglandscape2 and paginglandscape from C:\dev\3rdparty\ogrenew\Samples\Media to C:\dev\runtime\vitrius\media
  • copy "C:\dev\3rdparty\ogrenew\Tools\MapSplitter\maptool.cfg" "C:\dev\runtime\vitrius\bin\release\maptool.cfg"
  • Added these lines to "C:\dev\runtime\vitrius\bin\release\resources.cfg":

[PLSM2]
  FileSystem=../../Media/paginglandscape2
  
  FileSystem=../../Media/paginglandscape2/gui
  FileSystem=../../Media/paginglandscape2/models
  FileSystem=../../Media/paginglandscape2/overlays
  FileSystem=../../Media/paginglandscape2/materials
  FileSystem=../../Media/paginglandscape2/materials/scripts
  FileSystem=../../Media/paginglandscape2/materials/textures
  FileSystem=../../Media/paginglandscape2/materials/programs
  
  FileSystem=../../Media/paginglandscape2/datasrcs
  FileSystem=../../Media/paginglandscape2/terrains
  FileSystem=../../Media/paginglandscape2/terrains/alpes
  FileSystem=../../Media/paginglandscape2/terrains/hf129_3
  FileSystem=../../Media/paginglandscape2/terrains/TsmTerrain
  FileSystem=../../Media/paginglandscape2/terrains/ps_height_1k
  FileSystem=../../Media/paginglandscape2/terrains/terragen16bits
  FileSystem=../../Media/paginglandscape2/terrains/gcanyon_height_4k2k

  • I tried running mapsplitter, but it fails with:
20:56:54: Added resource location '../../Media/paginglandscape2/terrains/gcanyon_height_4k2k' of type 'FileSystem' to resource group 'PLSM2'
  20:56:54: An exception has been thrown!

  -----------------------------------
  Details:
  -----------------------------------
  Error #: 8
  Function: ResourceGroupManager::openResource
  Description: Cannot locate resource ps_height_1k.png in resource group PLSM2 or any other group.. 
  File: \dev\3rdparty\ogrenew\OgreMain\src\OgreResourceGroupManager.cpp
  Line: 583
  Stack unwinding: <<beginning of stack>>

  • Copied C:\dev\3rdparty\ogrenew\Tools\MapSplitter\Tool_MapSplitterFontEnd.exe to C:\dev\runtime\vitrius\bin\release
  • Tried setting up some useful parameters and running it. Clicking run produced no output or warning boxes. It was as useless as a Hello World button in a visual basic tutorial. Giving up on this tool for now. It provides no feedback as to whether or not an operation succeeded.

2006 May 15

  • MapSplitter fails with:
  Cannot locate resource ps_height_1k.png in resource group PLSM2 or any other group
  • Searched C:\dev\runtime\vitrius\media for it. Non-existant.
  • Same for c:\dev\ogrenew
  • Looks like I didn't extract Tuan's "datasrcs.zip" file properly.
  • Extracted it into C:\dev\runtime\vitrius\media\paginglandscape2\datasrcs and mapsplitter ran fine.
  • Now when I run the Demo_PagingLandscape2.exe it (correctly) fails with:

  Description: Cannot open requested directory ../../../Media/paginglandscape2/terrains/hf129_3. 
  • Media is in ../../Media not ../../../Media and I don't know where it got that path.
  • Just as a test, I try changing the line in resources.cfg from this:
  FileSystem=../../Media/paginglandscape2/terrains/hf129_3

To this:

  FileSystem=../Media/paginglandscape2/terrains/hf129_3
  • But that throws a correct exception, because the dir doesn't exist at all.
  • Now, let's try something even more dumb and just copy ../../Media to ../../../Media
  • It works! Just kidding.
  • Now it's failing because BlueHighway is missing. This is from DebugOverlay.overlay.
  • Created C:\dev\runtime\vitrius\media\gui\fonts\bluehighway.font with this:

<?xml version="1.0" ?>
  <Font Name="BlueHighway" Filename="../../media/fonts/bluehigh.ttf" Type="Dynamic" Size="12" NativeHorzRes="800" NativeVertRes="600" AutoScaled="true"/>

  • But that's completely useless.
  • Tried changing all the references from font "BlueHighway" to "Tahoma-12" in C:\dev\runtime\vitrius\media\paginglandscape2\overlays\DebugOverlay.overlay
  • It's reading from C:\dev\runtime\vitrius\media\paginglandscape2\overlays and not C:\dev\runtime\media\paginglandscape2\overlays
  • Note that when the ogre.log says:
  17:56:21: Parsing script Ogre.fontdef
  • It is referring to the Ogre.fontdef stored in a zip file as referenced in the Bootstrap group in resources.cfg. In this case:
  Zip=../../Media/core/VitriusCore.zip
  • Checked that file. It only references TrebuchetMSBold
  • Changed all overlay files (PagingLandScape2.overlay, PagingLandScape.overlay and DebugOverlay.overlay) in both media directories to refer to TrebuchetMSBold instead of BlueHighway.
  • Cool! Now it gets past that part. Fails with
  18:00:50: PLSM2 : Cannot find map named hf129_3.0.0.png
  • This file exists nowhere on my PC.
  • Moved OgreCore.zip out of runtime/vitrius/media/core. If everything runs fine without it (as they all should), since VitriusCore.zip does the same thing, I'll remove OgreCore.zip from the repository too.
  • Oh, guess what! MapSplitter put the files in C:\dev\Samples\Media\paginglandscape2\terrains. Why? No clue.
  • Copied all of them over, and now the Demo_PagingLandScape2.exe works with the grand canyon map.
  • Video is at http://www.vitrius.net/downloads/videos/PLSM_2006-05-15.wmv


Please note that, as verbose as this journal / document is, there is still a lot of detail missing. I did not document, for instance, how I got map splitter working and my surprise to find it storing files nowhere in any of my resource directories, but rather in ..\..\..\..\ogrenew\Samples\ (or somewhere like that). I'll get to all of that in time.