Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to make not repeating background for platformer. I can't find any description of implementation and I developed algorithm but I'm not sure that it's right.

I can't load one big texture per level, because many devices don't support textures more than 2048x2048 pixels and my levels require 4096 pixels at least on the one side. Therefore I have to cut big texture into smalls(512x512, 1024x1024), load them using separate thread and render. Picture shows it:

enter image description here

Green rectangle is screen(for example Nexus S with display 800x480)


  1. In case 2 layers I have to keep in memory 4 big textures.
  2. I have to constantly load and unload big textures.
  3. Additional thread.

If it's not problems then ok :) But it seems that I'm doing something wrong.

share|improve this question

closed as not a real question by Trevor Powell, Josh Petrie, bummzack, Le Comte du Merde-fou, Byte56 Feb 20 '13 at 14:55

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Canonically: rather than chopping up your texture into a 2x2 block of 1024^2 textures, chop it up into e.g. a 4x4 grid of 512^2 textures, or even an 8x8 grid of 256^2 textures, and keep a small 'buffer' around the player, preemptively loading the next textures in the direction the player is currently moving. – Steven Stadnicki Feb 19 '13 at 19:26
What is your question? – Trevor Powell Feb 19 '13 at 23:02

I think what you're looking for here is a classical example of tile-mapping which allows you to create levels and the like without consuming a LOT of resources. This is how Mario Bros was written along with other countless side-scrolling games are designed. You simply use a map editor such as Tiled (or a home-brew solution) to design your level from a chunked texture such as this:

enter image description here

(Thanks to OpenGameArt for the graphics!).

The background can be done in a similar fashion, just on a separate layer which scrolls slower (see: parallax) or just by ripping parts off the tile sheet. Say, those birds... you can place them in the sky randomly or clouds. However, if your level is to be the same every playthrough it's best to just build them on a separate parallax layer.

share|improve this answer
Did you miss the part where he said "not repeating"? – Junuxx Feb 20 '13 at 17:17
@Junuxx No, I made it quite clear that you could design the background using tile-maps... that is not at all repeating. – Vaughan Hilts Feb 21 '13 at 3:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.