how can i quickly load all 1,000 of my game's assets (images, sounds)?
i'm using love-loader, so that it's not blocking the main thread. but this doesn't make it any faster.
love-loader itself is loading files 1 by 1 in a very slow, synchronous loop.
is it possible to send a request to the OS to load all 1000 files at once? this should make the harddrive load the assets a lot faster.
fast async load all assets?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: fast async load all assets?
Reading from disk is inherently a synchronous operation. Also, many game assets (anything that will live on the GPU, such as textures) actually have to be initialised on the thread that owns the OpenGL context. The best you can do is separate reading the data from disk into one thread and initialising the GPU representation on the Opengl thread, which from what I can tell is what love-loader already does.
You might be able to speed up loading at the expense of memory consumption by using some kind of custom blob file format to hold all your assets, but maybe not. I've never really gone down that rabbit hole so my only idea is "reduce it all to a single HDD read then do the rest in memory". You'd really have to write the whole thing yourself if you were gong to try that route though.
You might be able to speed up loading at the expense of memory consumption by using some kind of custom blob file format to hold all your assets, but maybe not. I've never really gone down that rabbit hole so my only idea is "reduce it all to a single HDD read then do the rest in memory". You'd really have to write the whole thing yourself if you were gong to try that route though.
-
- Party member
- Posts: 548
- Joined: Wed Oct 05, 2016 11:53 am
Re: fast async load all assets?
You could only load the essentials (ex: code, config files), and then load the the rest when you actually need them (ex: textures, audio, video). Having everything in memory at once might help with any loading during gameplay, but it may not be a scalable solution, or asks for a decently big upfront load time.
You may also find benefits from combining assets, like combining textures to texture atlases or the like.
You may also find benefits from combining assets, like combining textures to texture atlases or the like.
Re: fast async load all assets?
You can use "dead" parts of the game for loading, e.g. such as intro, logo screens, story displayed before game start etc. Also, merging multiple assets can help with speed, i.e. larger files are quicker to load than hundreds of small, individual files.
These are all tips on how to cope, not on how to load. Loading is just an operation as any other and players are used to seeing loading screens.
These are all tips on how to cope, not on how to load. Loading is just an operation as any other and players are used to seeing loading screens.
My boat driving game demo: https://dusoft.itch.io/captain-bradley- ... itius-demo
Who is online
Users browsing this forum: Bing [Bot] and 6 guests