load objects in background
load objects in background
i want to load the forest of my map while the player walks around, but i have no idea how to do something like this, because irrlicht isn't threadsafe.
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: load objects in background
You can implement content streaming which runs in your main loop, you just load content every frame depending on how big your time budget is
Not an easy task though
Not an easy task though
Re: load objects in background
What is "content streaming" ?
My time budget is high, but i don't know anything about how content streaming works, so i need help there!
My time budget is high, but i don't know anything about how content streaming works, so i need help there!
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
Re: load objects in background
begin()
render()
end()
...
if (needmoredata) loadmoredata()
render()
end()
...
if (needmoredata) loadmoredata()
Re: load objects in background
That is my biggest problem.hendu wrote:oadmoredata()
I don't know how to do this without a very low framerate.
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: load objects in background
That's why I said it's not an easy task804 wrote:That is my biggest problem.hendu wrote:oadmoredata()
I don't know how to do this without a very low framerate.
I'd try to build a system based on so-called loading jobs, you just create a queue of these jobs containing a description of what needs to be loaded. You should be able to split these jobs up into smaller jobs so you can adjust them to your time budget as to avoid any noticeable lag. You could eventually do some kind of priority-based sorting so crucial elements of the scene get loaded first, but this could get nasty if done naively, so really plan this out
Re: load objects in background
Ok, so i load One vertex everything drawcall !
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: load objects in background
Loading one vertex per frame would be an approach I'd call naive804 wrote:Ok, so i load One vertex everything drawcall !

-
- Posts: 56
- Joined: Wed Nov 23, 2011 11:53 pm
Re: load objects in background
It's all about balancing load. I don't know if it has a technical term but I would call it "Time Slicing" If you have played any MMO games they usually have a little stutter depending on the speed of your system when you start to move quickly in one direction. But having worked on a system that stream loads, what I would recommend is that you split your world in the chunks and see what chunk the camera is in and load forward chunks one at a time in the direction they are moving and unload chunks in the opposite direction. From that you can optimize your chink size. As the chunk size is what will cause it to stutter.
Shoot for a target framerate on a low end machine and then use that to determine how much data you can load, and if you use a faster system it will be much more seemless.
Shoot for a target framerate on a low end machine and then use that to determine how much data you can load, and if you use a faster system it will be much more seemless.
-
- Posts: 1010
- Joined: Mon Oct 24, 2011 10:03 pm
- Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d
Re: load objects in background
yes. splitting the scene into chunks would be the preferred way of doing it (Any game with a high load will do that for example minecraft)
First load the chunk the player is in, then load surrounding chunks in a priority system (be it closest to the player or maybe the most important game element... let's say a turret that is designed to attack whent he player is within ten chunks)
Just don't make the chunks to small! (So the player exits the current chunk before the next one is loaded!)
First load the chunk the player is in, then load surrounding chunks in a priority system (be it closest to the player or maybe the most important game element... let's say a turret that is designed to attack whent he player is within ten chunks)
Just don't make the chunks to small! (So the player exits the current chunk before the next one is loaded!)
"this is not the bottleneck you are looking for"
Re: load objects in background
OK, i will take a try and post some detailed questions...
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////