Best way to load and display an art intensive game

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
teh8bits
Citizen
Posts: 52
Joined: Fri Mar 09, 2012 9:18 pm
Location: The Matrix
Contact:

Best way to load and display an art intensive game

Post 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.
User avatar
tsturzl
Party member
Posts: 161
Joined: Fri Apr 08, 2011 3:24 am

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

Post 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.
User avatar
teh8bits
Citizen
Posts: 52
Joined: Fri Mar 09, 2012 9:18 pm
Location: The Matrix
Contact:

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

Post by teh8bits »

So load images while the game is in being played? That seems like it would be slow.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

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

Post 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.
Help us help you: attach a .love.
User avatar
slime
Solid Snayke
Posts: 3132
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

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

Post by slime »

For non-moving things in your game world you should probably use spritebatches.
User avatar
teh8bits
Citizen
Posts: 52
Joined: Fri Mar 09, 2012 9:18 pm
Location: The Matrix
Contact:

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

Post 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
User avatar
slime
Solid Snayke
Posts: 3132
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

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

Post 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.
User avatar
teh8bits
Citizen
Posts: 52
Joined: Fri Mar 09, 2012 9:18 pm
Location: The Matrix
Contact:

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

Post by teh8bits »

Alright, thanks I'll look into it :)
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 74 guests