Jump to content

SBX - failed to load .gmfs


njord
 Share

Recommended Posts

Hello all,

 

We have created a LE application that answers our needs, and exported (compiled) it as a "dll" rather than an "exe" executable. Our main simulation.exe loads "OurLeApp.dll" and uses it to visualize the simulation.

 

Very rarely, on some computers and on some projects, LE "fails to load" the resources (mat,dds etc.) of some gmf's that are included in the sbx file (for example, City.sbx, inside of it there is a model referenced as abstract::hospital.gmf). Although it cannot open the gmf models on the sbx, it shows the vegetation layers and the terrain surface.

 

Of course when I move the entire terrain which is the "sbx, dat, raw etc. files, and the models referenced" to "Maps folder" in LESDK everything works, no problems.

 

Our folder system is like : (Bold font indicates files&folders copied from LESDK)

 

out

..simulation.exe

..Scripts

..bin

....ig

......leadwerksrenderer

........OurLeApp.dll

........engine.dll

........other LE related dlls

........shaders.pak

..data

....ig

......leadwerksrenderer

........Materials

........Models

........Sound

........and other necessary folders from LESDK

....entities

......minibus

........minibus.gmf

........minibus.mat

........minibus.dds

........minibus.lua

......airplane

........airplane.gmf

........airplane.mat

........airplane.dds

........airplane.lua

....terrains

......city

........city.sbx

........citymodelfiles

..........hospital.gmf

..........hospital.mat

..........hospital.dds

..........hospital.lua

..........school.gmf

..........school.mat

..........school.dds

..........school.lua

 

First of all my working directory is out. "simulation.exe" is inside the "out folder" and started from there.

At the initialization step of "OurLeApp" I use

 

 

RegisterAbstractPath("./data/ig/leadwerksrenderer"); //(relative folder paths to out folder)
RegisterAbstractPath("./data/terrains");

 

to make sure engine.dll sees both default LE files (out/data/ig/leadwerksrenderer) and terrain models (out/data/terrains) files. I do not register ./data/entities because I add them with LoadModel() and use exact paths (not abstract path).

 

Again, this system works perfectly, but 1 out of 50 times, on some computers models and related files referenced in sbx with abstract paths cannot be found by LE. You have any idea ?

 

One more question : is using RegisterAbstractPath twice correct ?

 

Edit: I have divided the 1800+ files (hospital & school gmf,dds,mat,etc.) of the terrain into 4 folders. And now sbx gets opened. PC is win32bit btw if it helps.

 

Edit2: sbx only fails to load gmf's, since it cannot open gmf's, it never searches for related mats or dds' anyway.

Edited by njord
Link to comment
Share on other sites

If you call registerabstractpath twice, the second file names will overwrite the first. It just stores the file name with no directory, and a link to the full path.

 

You don't need to call it at all though, because it automatically gets called for the current directory when the DLL starts up.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

I don't think that explains why the files are on occasions failing to load! Ken reported a similar issue to this here: http://www.leadwerks...__fromsearch__1

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

OS is Win7 32 bit . There is an sbx file and a lot of gmf's referenced in it. Gmf's and other related .mat .dds etc. files (1800+files) are in a single folder, under LE app working directory. GMF's fail to load, but app does not crash. I do not see any gmf's except LE terrain surface, vegetation layer, atmosphere.

 

For testing, I copy a single gmf to .ModelsEntitiesEnvironmentAtmosphere. Surprisingly LE finds its mat and dds inside the big folder and loads it. However rest of the gmf's, stil not loaded.

 

I copy whole app to a Win7 64 bit pc. Everything opens.

 

OR I divide big folder into 4 folders in 32 bit pc, Everything opens.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...