Does anybody experienced huge loading times with jme native binary models (.jme?) sometimes? I recently started having this very anoing issue. All my models are converted from .obj (exported from blender) to .jme. Sometimes the game loads very fast… But sometimes it gets stuck at the loading line:
I've put the sysouts to debug the exact moment of the stuckness... And it's between the 2 and three, at the lines:
Node no = new Node();
no.attachChild((Spatial) BinaryImporter.getInstance().load(br));
Anyway, the most strangest thing is that the load time changes awfully from time to time, without changing a single line of code or any model. I didn't manage to track what were the differences in the computer... I can't find any reason and becoming a bit mad with it already.
It means the problem happens at the loading line...
I forgot to scary people... The time difference is HUGE... Miliseconds when ok, and something like 30 or more seconds/model when not ok. It happens even when I try to load an already loaded model.
I might have the same problem - after updating from cvs today (apparently I hadn't actually compiled the 1.0rc1 yet!) my app seems to hang during startup, possibly during model loading. I'll investigate further and post my results.
SimpleResourceLocator… It tries to traverse the directory tree to find the file… And there's an issue when it gets the Grandpa of the file… It concatenates a "/" at the beggining of the file name, and if that name already starts with a "/", it becomes a "//resourceName", which forces some systems to check for the resource as a NETWORK computer or something… Now I see, It was intermitent because it happened everytime I was connected…
Here is the bad-method-guy (at SimpleResourceLocator):
protected String trimResourceName(String resourceName) {
File f = new File(resourceName);
if (f.getParentFile() != null) {
File grandpa = f.getParentFile().getParentFile();
if (grandpa != null) {
return grandpa.toString().concat("/").concat(f.getName());
} else {
return f.getName();
}
}
return null;
}
To make it correct, just add a test to check if there's need to concatenate the last "/" (sorry, I'm too sleepy to think a better algorithm):
protected String trimResourceName(String resourceName) {
File f = new File(resourceName);
if (f.getParentFile() != null) {
File grandpa = f.getParentFile().getParentFile();
if (grandpa != null) {
String grandpaName = grandpa.toString();
if (!grandpaName.endsWith("/"))
grandpaName = grandpaName.concat("/");
return grandpaName.concat(f.getName());
} else {
return f.getName();
}
}
return null;
}
Am I right? Worked for me... And sorry, I don't know how to make a patch yet.
@SeySayux: Man, I am deeply disappointed Being an outspoken Linux fan, cygwinis not an emulator (it is not an acronym :P) it is an environment implementation.
@duenez: yes I know, but you shouldn't talk with too much tech-talk to newbies… I'm a Linux fan too, you know (maybe it's only because I cannot afford a Mac, and that Mac isn't opensource… hmm… opensource free mac clone… sounds like an idea… meh, that's called baghira )
yes I know, but you shouldn't talk with too much tech-talk to newbies...
Hey, r u calling me newbie? In what sense? Because I didn't know how to make a patch? Hehehe, my mistake, but I' not afraid of any tech-talk. I guess nobody here (except me) already implemented a network distributed fault-tolerant layer for the Ext2 filesystem directly in the Linux kernel. I don't think that was newbie job. :)
yes I know, but you shouldn't talk with too much tech-talk to newbies...
Hey, r u calling me newbie? In what sense? Because I didn't know how to make a patch? Hehehe, my mistake, but I' not afraid of any tech-talk. I guess nobody here (except me) already implemented a network distributed fault-tolerant layer for the Ext2 filesystem directly in the Linux kernel. I don't think that was newbie job. :)
Too much of a noobie to do full Ext3 support? :-p
I don't think there was any negative connotation meant (by him), it's just in general too much should not be assumed to the level of computer competency from other users.
I don't know much people that write extensions to the linux kernel, but that don't know how to use diff/patch or how to read a manpage ;) . Btw, darkfrog is right.