|
From: <fli...@go...> - 2011-10-01 19:16:12
|
Comment #2 on issue 424 by bre...@gm...: AI objects in scenarios re-loading far too often without unloading, cmdarg().getPath() becoming corrupted. http://code.google.com/p/flightgear-bugs/issues/detail?id=424 Upon further investigation, this happens when using main aircraft that have submodel weapons (machine guns, etc) that put out a high number of submodels, and when using AI scenarios or playing over MP. The problem seems to happen when the main aircraft's weapon (machine gun, typically) has fired, and so has created numerous (dozens, at least) ballistic submodels. At this point, any of the AI or MP models that are even momentarily out of sight, seem to be dropped from the models cache, even if they are still very close to the main aircraft and/or just out of it's view. When they reappear, either because the main aircraft has turned or just viewing in a different direction, the model is first invisible and then there is a major pause in framerate as the model re-loads, and then it becomes visible. This is annoying/non-ideal behavior and it seems that it would be better to prioritize AI and MP models above ballistic models in the model caching algorithm, especially since ballistic models and usually small and essentially invisible at a distance where the AI and MP model might be plainly visible. However, as mentioned in the main bug report above, the main problem is that when the model re-loads to become visible again, it re-runs any Nasal code in the <load> section of its XML file. Since the <unload> nasal code has never been called this results often in duplicate listeners, loops, and other similar problems. The end result is often massive slowdown in the framerate after this happens a few times. |