Path & Resource Hell

zeus

20-10-2006 13:21:44

Hi,

I have been trying to get the PLSM2 to work but I am running into a lot of problems. I know there are similar posts as I have been searching through the forums for a good few hours now but cannot find a solution.

I will try to provide as much information as possible.

Firstly, my setup is as follows :

1) Installed : OgreSDK (Dagon 1.2.3)
2) I can compile my own programs and other samples that come with the SDK.

Then, I have downloaded the following :

1) OgreSDK_PLSM2_source.zip
2) OgreSDK_PLSM2_binary_demo.zip
3) datasrcs.zip

I first tried to install from source. The Wiki says :

"Extract it so that paginglandscape is in the same directory as OgreSDK."

The OgreSDK_PLSM2_source.zip file does not contain this directory. Anyway, I decided to just try to build the source. All 3 projects in the solution build 100% and copy the .exe files to the OgreSDK bin directory (as indicated by the build event).

If I run the exes, I get path problems such as the following :

../../../../../ogreaddons/paginglandscape/Samples/Media/paginglandscape2
../../../paginglandscape/Samples/Media/paginglandscape2

I have seen that these are hard-coded in the source. I would like to specify my own location which I gather can be done in a .cfg file. Should this already be done or do I have to do this manually?

I eventually gave up with the source version and tried the binaries but I still get similar problems.

Thanks a lot. Any help would be greatly appreciated.

Please let me know if I need to provide any more information.

Cheers,
Grant

kungfoomasta

20-10-2006 17:16:38

The first path is related to using OGRE and PLSM Source:

../../../../../ogreaddons/paginglandscape/Samples/Media/paginglandscape2

The exe should be placed in [X:]\ogrenew\samples\common\bin\[debug/release]

and it is looking for media placed in [X:]\ogreaddons\paginglandscape\Samples\Media\paginglandscape

So it looks like this won't work well with SDK... but I could be wrong.

KungFooMasta

zeus

20-10-2006 17:46:20

Hi,

Thanks for the reply.

It is odd that the source file is named OgreSDK_PLSM2_source.zip.

The problem is that I do not want to run this from [X:]/ogrenew/ogreaddons.

Enforcing this would basically mean that I cannot use it in my own program.

Anyone else know if these can be overridden with .cfg files?

Thanks again,
Grant

kungfoomasta

20-10-2006 19:45:21

Are you trying to use the demo in your own program? It is the demo that has been hardcoded this way.

If you want to use PLSM2 in your own program, I think there are no problems. The demo is hardcoded so that people can see some of the features of PLSM2, and is targeted at people who use PLSM2 CVS ([X:]\ogreaddons module) and OGRE Dagon Source or CVS ([X:]\ogrenew module). There is probably a way to run it with SDK, but I didn't do it that way.

So to restate, the resource problems you have encountered are problems with the demo, and not the plugin itself. It shouldn't require too much work to make use of resources.cfg or resources_plsm2.cfg or whatever equivalent file. If you want to run the demo inside your program, just open up the demo project and modify the portion of code that sets up the resources.

It takes a little digging, but once you understand how resources work; how to load them, how they are used, etc. You can choose to use resources.cfg file, or code them into your program.

Hope this helps any.

KungFooMasta

zeus

20-10-2006 20:01:02

Hi,

Thanks, that makes sense.

I am actually trying to just use the PLSM2 in my own program, not the demo but I was hoping to run the sample that comes with the PLSM2 source. I'll see if I can modify the source to point to other locations.

Thanks for the help.

Cheers,
Grant

zeus

21-10-2006 13:50:39

Hi,

I got it working!

If anyone is interested, I did the following :

1) Installed Ogre SDK. Remember to have OGRE_HOME set.

2) Unzip OgreSDK_PLSM2_source.zip anywhere. I unzipped mine so that the plsm2_vc8_SDK.sln is in $(OGRE_HOME)/Addons/PLSM2/

3) I modified the Tool_MapSplitter sourcecode to make use of the *_plsm2.cfg files rather than the standard configs. ie.


mRoot = new Root("plugins_plsm2.cfg", "ogre.cfg", "MapSplitter.log");
// Load resource paths from config file
ConfigFile cf;
cf.load("resources_plsm2.cfg");


4) Compiled all projects in solution (this automatically copies built exes and dlls to your bin dir)

5) Added the following to the bottom of my resources_plsm2.cfg file (below the [General] section :


[PLSM2]
FileSystem=../../Addons/PLSM2/Samples/Media/paginglandscape2
FileSystem=../../Addons/PLSM2/Samples/Media/paginglandscape2/datasrcs
FileSystem=../../Addons/PLSM2/Samples/Media/paginglandscape2/materials/programs
FileSystem=../../Addons/PLSM2/Samples/Media/paginglandscape2/materials/scripts
FileSystem=../../Addons/PLSM2/Samples/Media/paginglandscape2/materials/textures
FileSystem=../../Addons/PLSM2/Samples/Media/paginglandscape2/models
FileSystem=../../Addons/PLSM2/Samples/Media/paginglandscape2/overlays
FileSystem=../../Addons/PLSM2/Samples/Media/paginglandscape2/terrains


obviously this would be different depending on where you extracted the package.

6) Extracted the datasrc.zip file into the PLSM2/Samples dir.

7) Modified maptool.cfg in PLSM2/Samples/media/paginglandscape2/ by uncommenting new maps. ie.


# 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


8) Modified paginglandscape2.cfg in same directory by setting DefaultMap=European_Alpes

Hope this helps anyone that is having problems.

Cheers,
Grant

albino

11-11-2006 18:07:06

HI!

I have done those steps but now after running mapsplitterer program running
the demo program i get following errors
What could be the problem.

-----------------------------------
Details:
-----------------------------------
Error #: 6
Function: ResourceManager::add
Description: Resource with the name Ogre/Compositor/StdQuad_Tex3_vp already exists..
File: e:\projects\ogrecvs\branches\dagon_vc8_clean\ogrenew\ogremain\src\ogreresourcemanager.cpp
Line: 89
Stack unwinding: <<beginning of stack>>
19:57:56: An exception has been thrown!

-----------------------------------
Details:
-----------------------------------
Error #: 6
Function: ResourceManager::add
Description: Resource with the name Ogre/Compositor/StdQuad_Tex4_vp already exists..
File: e:\projects\ogrecvs\branches\dagon_vc8_clean\ogrenew\ogremain\src\ogreresourcemanager.cpp
Line: 89
Stack unwinding: <<beginning of stack>>
19:57:56: Error at line 59 of StdQuad_vp.program: Could not create GPU program 'Ogre/Compositor/StdQuad_Tex4_vp', error reported was: An exception has been thrown!

-----------------------------------
Details:
-----------------------------------
Error #: 6
Function: ResourceManager::add
Description: Resource with the name Ogre/Compositor/StdQuad_Tex4_vp already exists..
File: e:\projects\ogrecvs\branches\dagon_vc8_clean\ogrenew\ogremain\src\ogreresourcemanager.cpp
Line: 89
Stack unwinding: <<beginning of stack>>
19:57:56: An exception has been thrown!

-----------------------------------
Details:
-----------------------------------
Error #: 6
Function: ResourceManager::add
Description: Resource with the name Ogre/Compositor/StdQuad_GLSL_vp already exists..
File: e:\projects\ogrecvs\branches\dagon_vc8_clean\ogrenew\ogremain\src\ogreresourcemanager.cpp
Line: 89
Stack unwinding: <<beginning of stack>>
19:57:56: Error at line 64 of StdQuad_vp.program: Could not create GPU program 'Ogre/Compositor/StdQuad_GLSL_vp', error reported was: An exception has been thrown!

-----------------------------------
Details:
-----------------------------------
Error #: 6
Function: ResourceManager::add
Description: Resource with the name Ogre/Compositor/StdQuad_GLSL_vp already exists..
File: e:\projects\ogrecvs\branches\dagon_vc8_clean\ogrenew\ogremain\src\ogreresourcemanager.cpp
Line: 89
Stack unwinding: <<beginning of stack>>
19:57:56: Parsing script BaseTexture.material
19:57:56: An exception has been thrown!

-----------------------------------
Details:
-----------------------------------
Error #: 6
Function: ResourceManager::add
Description: Resource with the name Base already exists..
File: e:\projects\ogrecvs\branches\dagon_vc8_clean\ogrenew\ogremain\src\ogreresourcemanager.cpp
Line: 89
Stack unwinding: <<beginning of stack>>
19:57:59: *-*-* OGRE Shutdown
19:57:59: Unregistering ResourceManager for type Compositor
19:57:59: Unregistering ResourceManager for type Font
19:57:59: Unregistering ResourceManager for type Skeleton
19:57:59: Unregistering ResourceManager for type Mesh
19:57:59: Unregistering ResourceManager for type HighLevelGpuProgram
19:57:59: Unloading library .\Plugin_PagingLandScapeSceneManager2_d
19:57:59: Unloading library .\Plugin_ParticleFX
19:57:59: Unloading library .\Plugin_CgProgramManager
19:57:59: *** Stopping Win32GL Subsystem ***
19:57:59: Unloading library .\RenderSystem_GL
19:57:59: Render Target 'OGRE Render Window' Average FPS: 0 Best FPS: 0 Worst FPS: 999
19:57:59: D3D9 : Shutting down cleanly.
19:57:59: Unregistering ResourceManager for type Texture
19:57:59: Unregistering ResourceManager for type GpuProgram
19:57:59: D3D9 : Direct3D9 Rendering Subsystem destroyed.
19:57:59: Unloading library .\RenderSystem_Direct3D9
19:57:59: Unregistering ResourceManager for type Material
19:57:59: Unloading library OgrePlatform_d.dll

zeus

11-11-2006 18:51:39

Hi,

Are you using the ogre build from CVS.

I did the above with the latest stable SDK 1.2.3.

Cheers,
Grant

albino

12-11-2006 06:41:12

I used the SDK version 1.2.3 i think

wierd is that the mapsplitter works but the demo gets those errors
list of errors is longer than that, but its basically the same error, only different file name.

do i have to get it working before i can use PLSM in my own works?

tuan kuranes

29-11-2006 15:43:36

you're including same resources twice.
demo is not mandatory, mapsplitter is.