Page 1 of 1

Best way to load and display an art intensive game

Posted: Fri Mar 16, 2012 10:36 pm
by teh8bits
I've been throwing around the idea of making a city themed rpg/platformer (similar to Scott Pilgrim vs The World: The Game). I want to have two (three with front/interactive portion of the level) layered parallax scrolling. The game itself would be themed at a pretty low-res, 16-bit-esque, but the actual scenes would be huge with art that couldn't be reused as much as say a tile platformer (which can reuse it's graphics without loading many images).
Urg I'm tired I can't formulate points well.
What I'm trying to ask is what's the most efficient way to load such scenes? Load an entire level image into memory and draw the whole thing every frame, or load tiny pieces of the scene and only draw the ones on screen?

The latter sounds better but I'm not sure if it's better memory wise.

Re: Best way to load and display an art intensive game

Posted: Fri Mar 16, 2012 10:57 pm
by tsturzl
If there actually is a memory and processing problem you could easily generate a distance formula to see which objects should be drawn.

http://www.emanueleferonato.com/2010/07 ... wo-points/

You can also check to see check image if its between both sides of the screen on the x axis then the y axis, make a table of what to draw. Iterate that table in the draw function and draw each one.

It might be best practice to load segments at a time. It'll be hard but it'll be the most efficient. Just make events where if the player reaches past a certain x and y coordinate then load next part of the map.

Re: Best way to load and display an art intensive game

Posted: Fri Mar 16, 2012 11:01 pm
by teh8bits
So load images while the game is in being played? That seems like it would be slow.

Re: Best way to load and display an art intensive game

Posted: Fri Mar 16, 2012 11:07 pm
by Robin
teh8bits wrote:So load images while the game is in being played? That seems like it would be slow.
Actually, as long as you're spending more than a few seconds in a single place, I'm sure it won't be too bad.

Re: Best way to load and display an art intensive game

Posted: Sat Mar 17, 2012 12:01 am
by slime
For non-moving things in your game world you should probably use spritebatches.

Re: Best way to load and display an art intensive game

Posted: Sat Mar 17, 2012 12:20 am
by teh8bits
Thanks, Robin.

@Slime
Sprite batches? I'm assuming thats like making folders for a sprite set in a certain area and loading those? Or is it a LÖVE thing that I should be googling? ;P

Re: Best way to load and display an art intensive game

Posted: Sat Mar 17, 2012 12:29 am
by slime
SpriteBatch

You can create a spritebatch using a spritesheet/texture atlas and then give it information about which parts of the image to draw and where to draw them (the tiles in mari0 do this, for example), and then you call love.graphics.draw on the spritebatch object in your love.draw callback and it will draw the entire thing where you specified previously. It helps because it stores everything in the GPU for later use rather than re-sending drawing information every time you want to draw something, which can be a huge bottleneck.

Re: Best way to load and display an art intensive game

Posted: Sat Mar 17, 2012 12:54 am
by teh8bits
Alright, thanks I'll look into it :)