Resource Loading in RC2

CaseyB

24-04-2006 17:12:23

Has anyone found out for certain what was changed with the resource loading in RC2 and whether it should effect the PLSM config files? Upon building my app with RC2 after making no changes I get this error:-----------------------------------
Details:
-----------------------------------
Error #: 7
Function: PagingLandScapeOptions::load
Description: You need to define a GroupName where to find the map definition file .
File: ..\src\OgrePagingLandScapeOptions.cpp
Line: 263
Stack unwinding: <<beginning of stack>>
11:19:48: An exception has been thrown!

Falagard

24-04-2006 17:30:05

Do a search for:

"You need to define a GroupName"

CaseyB

24-04-2006 18:10:43

:oops: I read that thread this morning and somehow I skipped
tuan kuranes' post!

jacmoe

24-04-2006 19:30:09

If all error messages were that descriptive ... :wink:

CaseyB

24-04-2006 22:12:35

:? Ok, I got the newest PLSM from the OgreAddons CVS repo and I rebuilt it, but I still get the same error, so I verified that It's the latest PLSM, then just to be sure I did a clean build of Ogre (From the source zip), a clean build of the PLSM and a clean build of my app and I still get the same error. Is it amybe an issue with the anonymous cvs server have some latency? Or has it been long enought that it should be up to date?

Lshink

24-04-2006 22:49:42

I had the same error when I tried to compile the new PLSM2 with R2, for me it ended up being the wrong DLLs.

I used the DLLs in /Samples/Common/bin/Release/ and everything for me worked fine, not sure how though :)

Once I also did that, the PLSM2 overlays wanted to use the TrebuchBoldMS (sp?) font and I had to manually add it to the ogrecore.zip -- after that I got into PLSM2 demo without errors.

Hope that helps.

CaseyB

25-04-2006 17:06:28

I am already using the dll's from ogrenew/Samples/Common/bin, but just to be sure I recopied them and I get the same error!

CaseyB

25-04-2006 20:49:17

I still can't figure this out! Am I the only one getting this exception?! :shock:
Here is my terrain.cfg:DefaultMap=Cleveland

# resource group name where to find map definition
GroupName=PLSM2

# Try forbidden textureformat combinations
TextureFormatDebug=no


and my Cleveland.cfg:GroupName=PLSM2

Width=4
Height=4

Data2DFormat=HeightField
LandScapeFileName=Cleveland

FileSystem=../Media/materials/textures

NumTextureFormatSupported=19

TextureFormatSupported0=Image
TextureFormatSupported1=BaseTexture
TextureFormatSupported2=Splatting
TextureFormatSupported3=Splatting5
TextureFormat=Image
ImageFilename=ClevelandTexture

ScaleX=15000
ScaleY=1000
ScaleZ=15000

Deformable=no
VertexProgramMorph=yes
VertexCompression=yes
VertexNormals=yes

NumMatHeightSplat=4
MaterialHeight1=15
MaterialHeight2=50
SplatFilename0=splatting_sand.png
SplatFilename1=splatting_grass.png
SplatFilename2=splatting_rock.png
SplatFilename3=splatting_snow.png


Is there something really stupid that I am overlooking?!

Lshink

25-04-2006 22:50:38

Is that your own config for your own PLSM scene? Cause I don't have a clevelend (sp?).cfg...or a terrain.cfg for that matter.

Maybe I d/led the wrong files?

I only have a maptool, ogre, paginglandscape2, Plugins, and resources.cfg.

Where are your files located?

CaseyB

25-04-2006 23:32:09

Sorry, I created them. I callsceneMgr->setWorldGeometry("terrain.cfg");Then the terrain.cfg file points to the Cleveland.cfg file. The location for the Cleveland.cfg file is referenced in the resources.cfg file under the [PLSM2] group. It's the same setup as using the paginglandscape2.cfg which then goes and points to the TsmTerrain.cfg in ogrenew/Samples/Media/paginglandscape2/terrains.

I have steep through my app and as I thought it's dying on the setWorldGeometry line, which makes sense given ther exception, but when I try to step into that call it dies as soon as I hit the step into button! :?

Lshink

25-04-2006 23:50:52

Ah I see. Well I'm unfortunatly still very "new" to PLSM2, so I may not be able to help as much :)

But the original paginglandscape2.cfg kind of "defines" each terrain, and I see that your terrain.cfg lacks this, kind of like this:

TerrainScene=TsmTerrain
puget_sound=ps_height_1k
grand_canyon=gcanyon_height_4k2k
terragen_genrated=terragen16bits
European_Alpes=Alpes
HorizonTestMap=hf_129_3


Perhaps you need something like Cleveland=Clvland (or where ever it is located). From looking at the files, those are the only discrepencies I've seen.

Also, what does your resources.cfg look like?

CaseyB

26-04-2006 17:36:16

Here is my resources.cfg# Resource locations to be added to the default path
[General]
FileSystem=../Media
FileSystem=../Media/materials/programs
FileSystem=../Media/materials/scripts
FileSystem=../Media/materials/textures
FileSystem=../Media/models

[PLSM2]
FileSystem=../Media/paginglandscape2
FileSystem=../Media/paginglandscape2/models
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
But I am inclined to believe that it's a deeper problem because today I decided to compare the way it's done in the demo to how I do it and when I ran the demo I got the SAME EXCEPTION! :evil: I am getting really frustrated here! My app has been broken for a week now stalling all progress and we're working under a deadline!

Falagard

26-04-2006 18:09:57

Hrm, it should be PagingLandscape2.cfg not Terrain.cfg?

CaseyB

26-04-2006 18:20:08

In the PLSM demo it is, but in my app I callsceneMgr->setWorldGeometry("terrain.cfg"); instead ofsceneMgr->setWorldGeometry("paginglandscape2.cfg");

Falagard

26-04-2006 19:33:27

Ah, gotcha. I can't be of any help because I haven't yet upgraded to RC2 :-(

CaseyB

26-04-2006 19:47:47

So, has anyone other than me and Lshink gone to RC2?

CaseyB

26-04-2006 21:08:36

The fact that I can't step into the scenemanger really bothers me! It leads me to think that it's indicative of a disconnect betweent he dll and my source. I am trying to experiment with this by bringing the PLSM source into my app. I am running into an issue thought because the scenemanager is created from a factory method. Is there any way to instantiate the scenemanager and then register it with Ogre?

Falagard

26-04-2006 22:01:48

I step into the PLM2 all the time even though it's created by factory.

My PLM2 plugin is added to the main Ogre solution, as is my own project.

Do you use environment variables at all? Compiled in debug for both PLM2, Ogre and your project?

Something odd is going on if you can't set a breakpoint and and break into the PLM2 code.

CaseyB

26-04-2006 23:04:52

:oops: Ok, I was building in Release mode!!!
But now that I have ceased being an idiot, I fave found what's wrong! In the PagingLandScapeOptions::load() method it loads the data from the terrain.cfg file, for some reason it loses some letters from the front of the name in the name, value pairs! For example, this is how is SHOULD look
("DefaultMap","Cleveland")
("TextureFormatDebug","no")
("GroupName","PLSM2")

but it actually looks like this
("DefaultMap","Cleveland")
("extureFormatDebug","no")
("upName","PLSM2")

That's why it can't find "GroupName" because the item in the list is"upName"!

Falagard

27-04-2006 02:45:54

Hrm, well as I said in a previous thread somewhere when someone had a problem with group name, Ogre's config parser was updated in RC2 (I read it in the release notes) perhaps that's the problem.

Try opening up in notepad and try retyping the config file from scratch to make sure it's not a wierd problem with that. Not sure what changes have happened in the config stuff in RC2.

CaseyB

27-04-2006 17:26:23

Ok, I have tried retyping it in notepad and got the same results, then I tried running it through dos2unix and that caused it to just hang in PagingLandScapeOptions::load() on line 246 config.load(stream);

All of the other cfg files load fine! Well I load the resources.cfg and I don't use Ogre's iterator wrapper, but the ogre.cfg loads fine when I call root->showConfigDialog(); :?

Lshink

27-04-2006 19:56:48

The "upName" problem was fixed in the latest RC2 release. I had the same problem until I d/led it. Try d/ling the latest one and using it :)

CaseyB

28-04-2006 17:00:13

:( Ok, so I spent the whole day yesterday stepping deep into the PLSM and Ogre's resource loader and I finally found the error, then I saw your message and updated from CVS and *poof* the error was fixed! :roll: I guess that should teach me to try to update more often!

davesh

29-04-2006 00:16:36

or less often!!

:wink:

Dids

04-05-2006 21:39:22

Oh dear, I'm having this same particular problem myself. Using the RC2 source (of ogre) and the latest cvs PLSM2.

Tried copying the cvs-version of paginglandscape2.cfg and then modifying the needed parts with notepad: same result.

If the problem is indeed fixed, why am I getting this error then :?

CaseyB

04-05-2006 21:45:57

If you are using the source from the main Ogre download site, that's the problem. You need to use the CVS version. I am not sure why they are different, but we were having issues with the CVS version as you can see [u]here[/u]. and we were told that the anonymous cvs repo on sourceforge was out of synch with the developer repo and that we should download the zip from the download area, but this issue came back. We decided to go with the cvs version and comment out the line that was causing the font issue.

Dids

04-05-2006 22:01:38

I fixed the font issue, no problems there.

But I'm a bit afraid of changing ogre from the RC2 (somewhat stable) to cvs, since I've had plenty of bad experience there. I wonder if there's a workaround, or if tuan has any idea/fix for this?

Believe me, I've searched and searched :wink:

EDIT: I also tried downloading the latest binary of PLSM on tuan's site, and using the PLSM2 dll. This (naturally) removed this particular problem, but still crashed (for no apparent reason). Of course, this could mean that the binary isn't compatible with RC2. Although, I have a feeling the problem exists in the Plugin dll (of PLSM) and not the config files/etc.

CaseyB

04-05-2006 22:41:01

It's not an issue in the PLSM, it's an issue with how Ogre reads in cfg files.

Dids

05-05-2006 06:15:15

Right, but if the problem would be in how Ogre parses the config files, shouldn't a clean copy of the configs work?

CaseyB

05-05-2006 07:35:52

Didn't for us. As you can see earlier in this thread we tried several things to make our config file work, but the only thing that did the trick was the CVS version of Ogre.

Dids

05-05-2006 08:56:12

My guess is that because of the sourceforge cvs problems (development branches not being in sync with public branches or something like that) the ogreaddons aren't in sync with the RC2. Hope that made any sense hehe.

Basically it would mean that the PLSM in ogreaddons is "too old" to work with RC2, but, it's been updated to a better & working version, but it's not in sync with the public branch, meaning, we can only access the old version (with the problem *not* fixed).

So, either waiting for SF to fix their threads or tuan putting the fix/source (RC2 compatible PLSM) on his site, would propably be the best bet here. Just incase someone doesn't want to use the cvs version of ogre (like me) :wink:

CaseyB

05-05-2006 17:14:49

It's not an issue with the PLSM! The PLSM has been updated to work with RC2, it is an issue with how RC2 loads config files that has been fixed! If you set into the code you will find that it breaks down in OgreDataStream.cpp becasue of faulty stream pointer logic and this has been fixed in CVS long enough ago that if you get the CVS version it will have the change! If getting the version from CVS is not a option for you then you can wait for Ogre to update it's source zip, but bugging Tuan to update his stuff won't do you any good because that is not where it's broken!

Dids

06-05-2006 11:38:57

Actually, I wish I'd realized that a bit sooner. You're absolutely right CaseyB and for now, cvs head works, which is good. Thank you :wink: