2D Side Scroller Background

I’m working on a game with a 2D background that borders the level. The border is very high res, so we are using numerous planes with portions of the background image on them snapped together. the result is this:

8108-planes.jpg

So my question is… is there a better way to do this? The planes and extremely high res textures are resource consuming and extremely messy. I’m looking for a cleaner method to draw the background throughout the whole level.

Thank you in advance for any solutions or suggestions.

  • xmcdeath

This sure is one of the dirtiest method possible. there are different ways to do it ,

Make a plane by yourslef in maya or max, that has only 2 tris and 4 veritices. like the one in this image


and apply texture over it. If you take an alpha blended png, you dont have to worry much about empty space!! The whole bg will now have mesh data size of 4 verts.

you can download the plane I used from this link

Ok, one more suggestion, but I don’t think you are going to like it… Scratch the idea of drawing your entire level as a single massive image, and switch to a set of small reusable tiles for the background. Make detail bits that you can place separately from the repeating parts, and overlay low-detail, enlarged transparent images for things like the shadows.

From your picture, you’ve got so many megabytes (gigabytes?) of pixels used to get an effect you could have achieved in so much less, if assembled with more cleverness and care. Study how they did things back when a whole game had to fit into a SNES cartridge.
Of course you don’t have to take it that far, but a megabyte saved is a megabyte earned and you could easily save enough space to use true-color textures instead of ugly compressed ones.

Your game may be brute-force playable on a PC as it is, but it will never port to mobile, which you may soon find yourself wanting to do.

Here are three strategies I would consider:

  • Do the texturing in a 3d editor. (This maps well with what the GPU needs to do).
  • Use some mesh building tool to build you world pieces within Unity (Autotile, Ex2D etc…)
  • Build your own tool and generate a mesh based on a single or a few textures

If you’re doing a small project, you’re already doing what you should be doing. Optimizing these things might be very time consuming.