[Solved, kind of] PLSM2 demo - no terrain, keyboard input

Purrpledone

19-03-2007 00:02:09

Hi all,

I've compiled the plsm2 demo from CVS.... but I don't think it's working as expected :P

My problems:

- When using the TSM terrain, the demo loads, I see the sky, and the name of the map is shown, but I see no terrain. The keyboard also doesn't seem to do anything - even ESC doesn't exit, I have to use ALT-F4. I don't see anything in the logs that points to an error.

- When using the Alps terrain, I get the same as the TSM terrain. However, the log says it cannot find files alpes.0.0.png, alpes.2.0.png, etc. I ran the splitter with no errors, and indeed I don't see those files in the Alpes folder - all I have are alpes.0.0.raw, alpes.Alpha.0.0.0.png, alpes.Base.0.0.png, alpes.Coverage.0.0.0.png, alpes.Light.0.0.png, alpes.Small.png, etc. No "alpes.0.0.png" anywhere.

- For other terrains, the demo just loads to a black screen, and exits after a few seconds... with no error that I can see (in the logs or elsewhere).

What I've done so far (that I can remember :P):

- Successfully compiled Ogre from CVS HEAD using Visual C++ 2005 and the appropriate project file - the demos run and work properly.

- Successfully (? - no errors in the end, anyway) compiled PLSM2 from CVS HEAD with the plsm2_vc8_CVS project.

- I put ogrenew and ogreaddons\paginglandscape in the same folder. Visual C++ seems happy with the paths, since it moved all the PLSM2 executables to ogrenew\Samples\Common\bin\Debug, which is where I'm running them from

- Downloaded and unzipped datasrc.zip to ogreaddons\paginglandscape\Samples\Media\paginglandscape2\datasrcs

- Edited ogreaddons\paginglandscape\Samples\Media\paginglandscape2\paginglandscape2.cfg to set the DefaultMap and uncomment the lines for the terrains in datasrc.zip

- Same for ogreaddons\paginglandscape\Samples\Media\paginglandscape2\maptool.cfg

- Run ogrenew\Samples\Common\bin\Debug\MapSplitterD.exe, which seemed to happily create subfolders and files under ogreaddons\paginglandscape\Samples\Media\paginglandscape2\terrains, with no errors. I don't know what exactly to look for, but each terrain now has a subfolder with lots of .png files in it - which looks OK to me!

- edited ogrenew\Samples\Common\bin\Debug\resources_plsm2.cfg to add a new resource group called "PLSM2" and all the folders under \ogreaddons\paginglandscape\Samples\Media\paginglandscape2 (including the terrain folders created by the splitter)

- run ogrenew\Samples\Common\bin\Debug\Demo_PagingLandScape2.exe and scratch my head at the results

I'm out of ideas, I feel like I've gone through every page in the wiki several times, can't find any other info on the forum, and I would really appreciate any help!

This is my paginglandscape2.cfg and plsm2.log when trying to run with Terrain_Scene_Manager_Terrain. Please let me know if any other information would be helpful.


DefaultMap=Terrain_Scene_Manager_Terrain

Alpes=Alpes
Terrain_Scene_Manager_Terrain=TsmTerrain
hf=hf_129_3

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

#NewWorld2=NewWorld2
#alfons_1k=alfons_1k
#startingIsland=startingIsland

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

# Try forbidden textureformat combinations
TextureFormatDebug=no



And plsm2.log:


(long irrelevant log deleted)

clutch43

19-03-2007 01:10:40

in tsmterrain.cfg change
# where to put camera on load.
BaseCameraViewpoint.x=1000.0f
BaseCameraViewpoint.y=600.0f // original much to high ( 32000 i think)//
BaseCameraViewpoint.z=-432.0f


hit "m" key after load , try Ctrl+w or s to bring in terrain. may have to play with it.

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


Change VertexCompression=no if its on in other "map'.cfg's awell.,
My understanding it should be "yes" if you have hardware to handle it.,and are using compressed textures??.. anyway try these two changes., let me know. assuming everything else ok, this worked for me.

Purrpledone

19-03-2007 02:16:09

Thanks for the reply - I'm making progress!

VertexCompression=no did fix the problem with the maps that were crashing.

The camera position didn't change anything, but it did give me a hint. The first time I ran the demo I noticed that the player position was three coordinates in scientific notation that were changing very rapidly - at first sight it looked like -E013 and such... I noticed they're actually +E013 and climbing rapidly... :oops: which might explain why I can't see anything.

This rang another bell - I have a rogue joystick driver installed which thinks it's always receiving input even when there's no joystick or gamepad connected - that might explain both why the coords are so out of whack, and why the keyboard doesn't work. :evil:

I took a quick look at PagingLandScape2FrameListener.h, and I can't see any obvious joystick/gamepad input... but I'm still a newbie, so that doesn't guarantee anything.

I'll poke around some more tomorrow and post back with results.

Thanks again for the help!

Purrpledone

19-03-2007 03:34:36

Well, I tried a more delicate approach at first, but it's late, so I took a sledgehammer to it... commented out everything in frameStarted and keyPressed.

Lo and behold, it works! For TsmTerrain and puget_sound, anyway - I get a top-down view of the map.

So the problem IS the camera going nuts and ending up nowhere near the terrain. I'm happy for today - I got it to render something, I'll try to figure out what's wrong with the camera/input tomorrow :lol:

Purrpledone

19-03-2007 23:48:20

Well, I solved the first part of my problem (the camera going nuts). It was simple - in paginglandscape\samples\common\include\PagingLandscape2FrameListener.h, the variable mTranslateVector wasn't initialized anywhere and ended up with very large values. I added this line to the constructor:

mTranslateVector = Vector3::ZERO;

I'm surprised no one caught that, I guess it initialized to zero on most people's systems? Maybe someone with CVS access can put the fix in?

I STILL can't get any kind of input. I'm very much an OIS newbie, the code LOOKS right... but I couldn't get any kind of reaction out of it, with either buffered or unbuffered input. The only thing I can think of is if it's not getting the right window handle somehow? Unfortunately that's over my head for now. I'll have to leave the demo as it is, I think I'm at the point where I can try to integrate PLSM2 into my Ogre project :shock: *cross fingers*