Bundles are still loading after progress bar is completes

Hi ,
I can see the load bundles logs after the progress bar is completed and page is loaded the game scene

Seeking help on above mentioned point.

It is possible that the logs are printed with a lag, can you show the details?

Hi Linrm,
Thanks for your response!

So what happens , bundles are loaded before progress , we reached to lobby , we move to game scene and we scene bundles are loading again

Is bundles are loaded according to scene?

If yes can’t we forcefully download all bundles together and then complete the progress!

Attaching logs for your reference…

Also It would be helpful if you can let me know how to contact your V.I.P tech support


Hi friend, thank you for supporting cocos. If you want to get V.I.P tech support, please contact this email yaqiong.liu@cocos.com and let us know some information about you, thanks.

Which version of creator are you using? Could you show your code of load bundle and progress bar?

I am using 2.4.7 version of creator

And we are just creating build by choosing web build on build type
And Please check the below code attached for the code you asked

window.boot = function () {
var settings = window._CCSettings;
window._CCSettings = undefined;
var onProgress = null;

var RESOURCES = cc.AssetManager.BuiltinBundleName.RESOURCES;
var INTERNAL = cc.AssetManager.BuiltinBundleName.INTERNAL;
var MAIN = cc.AssetManager.BuiltinBundleName.MAIN;
function setLoadingDisplay () {
    // Loading splash scene
    var splash = document.getElementById('splash');
    var progressBar = splash.querySelector('.progress-bar span');
    onProgress = function (finish, total) {
        var percent = 100 * finish / total;
        if (progressBar) {
            progressBar.style.width = percent.toFixed(2) + '%';
        }
    };
    splash.style.display = 'block';
    progressBar.style.width = '0%';

    cc.director.once(cc.Director.EVENT_AFTER_SCENE_LAUNCH, function () {
        splash.style.display = 'none';
    });
}

var onStart = function () {

    cc.view.enableRetina(true);
    cc.view.resizeWithBrowserSize(true);

    if (cc.sys.isBrowser) {
        setLoadingDisplay();
    }

    if (cc.sys.isMobile) {
        if (settings.orientation === 'landscape') {
            cc.view.setOrientation(cc.macro.ORIENTATION_LANDSCAPE);
        }
        else if (settings.orientation === 'portrait') {
            cc.view.setOrientation(cc.macro.ORIENTATION_PORTRAIT);
        }
        cc.view.enableAutoFullScreen([
            cc.sys.BROWSER_TYPE_BAIDU,
            cc.sys.BROWSER_TYPE_BAIDU_APP,
            cc.sys.BROWSER_TYPE_WECHAT,
            cc.sys.BROWSER_TYPE_MOBILE_QQ,
            cc.sys.BROWSER_TYPE_MIUI,
            cc.sys.BROWSER_TYPE_HUAWEI,
            cc.sys.BROWSER_TYPE_UC,
        ].indexOf(cc.sys.browserType) < 0);
    }

    // Limit downloading max concurrent task to 2,
    // more tasks simultaneously may cause performance draw back on some android system / browsers.
    // You can adjust the number based on your own test result, you have to set it before any loading process to take effect.
    if (cc.sys.isBrowser && cc.sys.os === cc.sys.OS_ANDROID) {
        cc.assetManager.downloader.maxConcurrency = 2;
        cc.assetManager.downloader.maxRequestsPerFrame = 2;
    }

    var launchScene = settings.launchScene;
    var bundle = cc.assetManager.bundles.find(function (b) {
        return b.getSceneInfo(launchScene);
    });
    
    bundle.loadScene(launchScene, null, onProgress,
        function (err, scene) {
            if (!err) {
                cc.director.runSceneImmediate(scene);
                if (cc.sys.isBrowser) {
                    // show canvas
                    var canvas = document.getElementById('GameCanvas');
                    canvas.style.visibility = '';
                    var div = document.getElementById('GameDiv');
                    if (div) {
                        div.style.backgroundImage = '';
                    }
                    console.log('Success to load scene: ' + launchScene);
                }
            }
        }
    );

};

var option = {
    id: 'GameCanvas',
    debugMode: settings.debug ? cc.debug.DebugMode.INFO : cc.debug.DebugMode.ERROR,
    showFPS: settings.debug,
    frameRate: 60,
    groupList: settings.groupList,
    collisionMatrix: settings.collisionMatrix,
};

cc.assetManager.init({ 
    bundleVers: settings.bundleVers,
    remoteBundles: settings.remoteBundles,
    server: settings.server
});

var bundleRoot = [INTERNAL];
settings.hasResourcesBundle && bundleRoot.push(RESOURCES);

var count = 0;
function cb (err) {
    if (err) return console.error(err.message, err.stack);
    count++;
    if (count === bundleRoot.length + 1) {
        cc.assetManager.loadBundle(MAIN, function (err) {
            if (!err) cc.game.run(option, onStart);
        });
    }
}

cc.assetManager.loadScript(settings.jsList.map(function (x) { return 'src/' + x;}), cb);

for (var i = 0; i < bundleRoot.length; i++) {
    cc.assetManager.loadBundle(bundleRoot[i], cb);
}

};

if (window.jsb) {
var isRuntime = (typeof loadRuntime === ‘function’);
if (isRuntime) {
require(‘src/settings.07d9b.js’);
require(‘src/cocos2d-runtime.js’);
if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) {
require(‘src/physics.js’);
}
require(‘jsb-adapter/engine/index.js’);
}
else {
require(‘src/settings.07d9b.js’);
require(‘src/cocos2d-jsb.js’);
if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) {
require(‘src/physics.js’);
}
require(‘jsb-adapter/jsb-engine.js’);
}

cc.macro.CLEANUP_IMAGE_CACHE = true;
window.boot();

}

Do you have this option checked? This option will cause the resource to load only after the scene has switched.

No this option is not checked.

Hi!
Any Help!

Can you show me a demo? I can’t reproduce your question.