For the game I'm making I would love to be able to load resources in the background. I was wondering if there is a chance for that to happen in the Bennu language? Ideally it would look along the lines of:
//As a property of the function itself
asynchronous function loadResource()
begin
...
end
Or maybe
//As a property of the instance
//To create it asynchronously
&loadResource();
//Regular function
function loadResource()
begin
...
end
Any chance of this being possible?
int completion;
fpg_load("file", &completion)
I didn't know that! GREAT!
Quote from: SplinterGU on November 07, 2011, 09:38:06 PM
int completion;
fpg_load("file", &completion)
So what values does "completion" return? True/false?
fpg_id when it is loaded.
That is pretty cool! I have the feeling there is a lot of neat functionality in Bennu that I'll never use because it's not documented anywhere, which is a real shame. Updated the wiki with this at least.
Any chance of functions running asynchroneously?
What kind of use do asynchonous functions have?
I've never heard of this feature, it sound interessting.
I'm making a top-down game with big sandbox type levels, so I would load the resources like textures, sound and data in the background while the player is moving about to not be limited in level and memory size..
Ahh... I see. You must be loading and unloading stuff on the fly. I'll bet it's very efficient in terms of memory footprint. Must be tricky to keep the loading in sync. Or do you buffer resources in advance depending on the player's position?
It's not in yet, as I just learned of the functionality, but the idea is to chop up the level in blocks and try to keep the loaded area large enough to not notice and not have restrictions on level size(and data/m2).
Quote from: handsource-dyko on November 11, 2011, 02:45:05 PM
What kind of use do asynchonous functions have?
I've never heard of this feature, it sound interessting.
Loading/progress bars springs to mind.