upbge
upbge copied to clipboard
libload from previously libloaded scene - EXCEPTION_ACCESS_VIOLATION (testfiles)
Hi,
I think there's an important bug in the upbge (stable 0.2.5b) libload() function that did not exist in the bge279b.
- I want to libload a file once upbge has started, then add a scene from it, (ok)
- then from an active (or objectAdd'ed) object of this second scene, libload a file that contains assets (random fail is here)
- then from this assets file, add whatever I want in the second scene (ok if success above)
so the first scene can act as an 'overlay', 'game management','ui' scene, and the other below manage the actual game and assets. its for me an important limitation for projects with lots of assets / game screens / level management, be able to reuse assets files as is with no modifications from one project to another etc.
here are the testfiles. see the README and the text block in the main.blend file for more info : several libload with two scenes.zip start main.blend for the fail, or scene2.blend for one scene/no fail
Maybe I forgot something simple, or a whitepaper about it.. but I already fight with this kind of violent fail during years in the bge then finally found something reliable, viable way, and this is sadly appening again.
thanks to give it a look !
here is a (bit) more reliable alternative testfile (0.2.5b) :
several libload with two scenes alt.zip
- 'main' and 'Scene2' scenes are in the same main.blend file. if from 'main', Scene2 is added as background / if from 'Scene2', 'main' is added as overlay
- start main.blend from main scene or Scene2 in the standalone player
- 'main' camera adds Suzanne and a green light from its inactive layer (ok) then add 'Scene2'
- 'Scene2' camera adds an empty ('logic') and a pink light from its inactive layer (ok)
- the 'Scene2' empty libload asset.blend
- the 'Scene2' empty add an object from asset.blend to Scene2
it's ok on my laptop. green monkey, then a pink sphere in the background
but well. Now we want to load two assets files :
- in scene Scene2, object logic : link asset2 sensor to addAssetlib2.py controller
- start main.blend from main scene or Scene2 in the standalone player
- fails a lot
- same, but set Scene2 layer 2 as active (the one with the pink point light) and comment addObject('Point') in addlogic.py :
- more success but still random fail - and one loose the Lamp in Main
- no light in Scene2 : same, unuseful anyway
- start main.blend from scene2 : better. but one loose the Lamp in Main
I added Delays so wait a bit - it seems cant confirm anything, too mush randomness, cant systematically reproduce.., it seems to help for consecutive libload. (asynchronous is default, False)
so far with upbge I got no way :
- to let my asset files as is, apart from the project, it needs to be re-packed/duplicated into a big blend. not flexible, redundant, adds a lot of process
- to avoid failure when working with overlay and/or a background scene
I didn't try to use scene actuator bricks.. yet..