What is Asynchronous LibLoad usefull for??

Hi!
The Asynchronous Libload was mentionned here for those not aware of this; http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Game_Engine

So could someone tell me what is AL’s usefullness in the BGE with a example?

Asynchronous LibLoading allows us to load blendfile data without waiting for it to load. At the moment it provides a more desireable alternative to set scene, as well as exploiting previous libload behaviour (which is importing external libraries). In other words, you can now create loading bars without having it freeze, something like this:

import bge

def main(cont):
    own = cont.owner
    
    try:
        loader = own['loader']
    except KeyError:
        loader = own['loader'] = bge.logic.LibLoad('myblend.blend', 'Scene', async=True)
    
    own.localScale[0] = loader.progress / 100

Please do not abbreviate with AL as it is not a common technical term. Otherwise we will not know what you are talking about.

As Agoose already described it simply allows to to load scenes or meshes as background process without disturbing the running scenes.

so you can have a “Bubble” load objects based on there distance compared to bounds?

so big buildings load before tiny bushes?

have a max size?

see what happens?

gonna write a novel ?
see how the plot thickens?

o wait thats stewie…

@monster

Please do not abbreviate with AL as it is not a common technical term. Otherwise we will not know what you are talking about.

I knew you would deduce it because I had already wrote the whole therm in the Thread Header. Otherwise I would’nt have done so. :slight_smile:

Ho and thank you all for your answers. But this brings me to an other question:

import bge
def main(cont): own = cont.owner try: loader = own[‘loader’] except KeyError: loader = own[‘loader’] = bge.logic.LibLoad(‘myblend.blend’, ‘Scene’, async=True) own.localScale[0] = loader.progress / 100

1- I guess this script is attatch to any GameObjet (empty??) inside each .blend files as long as it’s there?

2- I imagine also that I should replace ‘myBlend.blend’ by the name of my blend file and ‘scene’ with the name of my scene. Right?

3- So I should incorporate this script to all my .blend with according ‘.blend’ and ‘scene’ names?

4- Guess I should also code a progress bar ?

5- Is async a Property (boolean to true) that I have to do in the Logic Brick editor with an ‘‘Always’’ sensor and a ‘‘Python’’ controler?

-TheElwolf

As a side note; How do you quote a script without destroying its structure??

It seems you don’t understand what libLoading actually is, even normal rather than Async.
LibLoading is the method of importing external blend files into the current blender game. Uses are things like loading levels, props/assets or any other such model/logic.
Before Async libloading it all had to happen in a single frame, so the game would freeze as it loaded. With async libLoading, the game will keep running as the blend-file loads. This means better LOD scripts, loading bars etc.

As for writing code, use the

 [ /code] tags (without the space before the /)

You start the loading once and keep the status object.

After that you can check the statusobject from time to time how the loading is doing.

You stop that when the status object shows completion.