Page 1 of 1

Questions about lag/loading time and huge maps.

Posted: Thu Nov 08, 2012 2:39 am
by Nsmurf
Recently I was thinking about making an exploration/puzzle game. It would have a *huge* open-world style map. The game itself would be quite simple, but that's not the point of this post. The point is how to load maps.

I want to load maps form some external file, probably a image or a text file. The problem I have is this:

I want the game to be reasonably fast. I think it would take a lot of time to load the entire map at one time, and take up a lot of memory (I haven't tested this yet). I also thought about having it load small chunks of the map when they were needed, but that might create lag when you move to the edge or corner of a chunk.

TL;DR: What is the best way to load a large map file without lag or long loading time?

Thanks,
Nsmurf

Re: Questions about lag/loading time and huge maps.

Posted: Thu Nov 08, 2012 4:09 am
by substitute541
Try looking at Orthorobot's level loading code.

Re: Questions about lag/loading time and huge maps.

Posted: Thu Nov 08, 2012 7:34 am
by Roland_Yonaba
Well, you can split the map into subsets. At startn load only the visible area.
Then, according to the moving direction of the player, load the next/following parts.

Also, it seems love.thread would be perfect for that.

Re: Questions about lag/loading time and huge maps.

Posted: Thu Nov 08, 2012 8:30 am
by kikito
What the previous guys say.

Do what google maps does. Don't load the whole thing, divide it in small grids and load them/unload them as needed. You will want to organize the code so that you can use it in both the game and the level editor.