Questions about lag/loading time and huge maps.

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
Nsmurf
Party member
Posts: 191
Joined: Fri Jul 27, 2012 1:58 am
Location: West coast.

Questions about lag/loading time and huge maps.

Post 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
OBEY!!!
My Blog
UE0gbWUgd2l0aCB0aGUgd29yZCAnSE1TRycgYXMgdGhlIHN1YmplY3Q=
User avatar
substitute541
Party member
Posts: 484
Joined: Fri Aug 24, 2012 9:04 am
Location: Southern Leyte, Visayas, Philippines
Contact:

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

Post by substitute541 »

Try looking at Orthorobot's level loading code.
Currently designing themes for WordPress.

Sometimes lurks around the forum.
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

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

Post 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.
Last edited by Roland_Yonaba on Thu Nov 08, 2012 10:33 am, edited 1 time in total.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

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

Post 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.
When I write def I mean function.
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests