Pre Load Map


Sorry if a repost, but couldnt find with the search box any result, may be my english is not very good.

I would like to know, imagine a RTS game, te map, is there a way to when you click “Start Game” a loading scene that actually pre loads the map so it will get a better fps the in game playing?

Thanks by advance.

There is no “pre-load”. Unless you dynamically load with LibLoad everything gets loaded when you start the scene. So you do not need to worry about missing assets.

Thanks a lot Monster, i will try it when the moment comes, im with some video2brain series learning Python, then will get to blender apliances of the code, but, still organizing the Project in my head, so i can think in advance the funcionalities i will aiming to get in the game.

libload is like hitting a wasp nest with a short stick…It IS a method of loading “on the fly” and is awesome in theory, but ive yet to see an example of it working 100% as it should

Edit: Wasps, Wasps’, Wasp’s.

How can we make a professional game in blender then.
I cant sell my game, or we as blender users cant if the game loads all at once, we need to be able
to have some sort of loading screen while the assets are being loaded in.

Would be great if somebody could help us, i will be posting in the paid area soon for someone too do it with
the right skills :slight_smile:

That would be great if there was something like that, still not into Python, but a code that could load mess assets an textures in for the next scene…will get there! Hoping there was already some idea on how to make it.

LibLoad just does it fine as long as you don’t want it to be asyncronus (then it fails miserably). Anyway for a professional looking game check BGECore (not a game). The template has an example in wich the main player is loaded with LibLoad, making it load a whole level wouldn’t be a problem. Anyway the system stills need a little of improvment on this part.

Also a profesional looking game is well organized (the engine and the data are in deferent places), BGECore also helps with that.

LibLoad should work to some degree. One known bug might not even hinder you if you are not loading mulitple meshes asynchronously if at least one of those meshes is high-poly (T42020). (elmeunick9 beat me to it). You should report other bugs if you find any.

LibNew doesn’t clone physics meshes (T40955), but there’s an elegant solution (Credits to SdfGeoff) for that by using LibLoad to load the same mesh over and over as unique copies, virtually doing the same thing as LibNew does. The physics meshes will also be copied. Here’s an example:

Attachments (218 KB)

What if i need the meshes to load simultaniously… imagine a RTS Map. Practicaly all map low poly, but a considerable number of diferent meshes, would the LibLoad work?

In theory it would. It depends on the size of your game of course, but you should have an efficient system. My approach would be to divide your level into sections, small enough so when the player moves around, the least amount of sections relative to the total amount of sections which make up the visible area, should be loaded over two or three seconds or so.

The idea is to have a viewable area with dimensions of, let’s say 864 by 864 Blender Units (BU), which follows the player. Let’s say the total number of objects in this area would be 2592 objects.

With 3 X 3 sections of 288 BU in size, containing 288 objects each, three or five outer sections, respectively 864-1440 objects would have to be loaded, whenever the player enters a new section. That’s probably to many. A second downside is that the outer sections are 288 BU from the player, so a large number of objects would suddenly appear, with the closest relatively close to the player. Using Mist could solve that, but it’s probably not desirable to have a depth of around 260 in all of your levels (which would probably be needed if you would want to load as many as 864-1440 objects over three or five seconds, if you’re loading in chunks of five per logic tick).

With 9 X 9 sections of 32 BU in size, containing 32 objects each, nine or seventeen sections, respectively only 288-544 objects would have to be loaded. And the next advantage is that the outer sections are 416 BU from the player. So loading isn’t as noticeable. Especially with a Mist depth of 400, which will spare you a few seconds to rebuild the area. An amount of 288 or 544 objects could be loaded in chunks of three per logic tick (approximately one section every 10 ticks), so it can take 96 or 182 ticks (1.6 or 3 seconds) to load.

I hope this helps.

Edit: Sorry, made a miscalculation there. Corrected it.