Background

Started by the2bears, November 22, 2003, 23:00:55

Previous topic - Next topic

the2bears

Since I'm slways looking for free tips...

What's the best way to do backgrounds?  An open question I know.

Here's a few scenarios and maybe we can (we?) can discuss alternatives given what feature is wanted.

How about a static background in a non-scrolling game, like the maze in Pacman?

What about scrolling backgrounds, where I assume there would be some tiling going on.  Like R-Type?  By the way a favourite game of mine.

Seems I'm only interested in how a background relates to 2D games but 3D must have need for the same techniques.

Cas, awhile ago I saw you mentioning using quadtrees for AF... I've not had much luck finding out exactly what they are let alone how this would relate to the backgroungs I've described.  Hmmm... might as well just send me the source code;)  Kidding, I realize we need 900+ more sales to get that!

Any links to 2D tutorials?  I'm interested in techniques for how the classics were programmed - what data structures were used, how they interacted etc.

Bill
the2bears - the indie shmup blog

princec

Well, there's two ways I could have done the background in Alien Flux and I chose a slightly more complicated way that's just a bit more flexible which was quadtrees.

The reason I chose quadtrees was actually a bit of an accident, because I was experimenting with actual 3D backgrounds (i.e. heightmaps and such) but gave up on them because they looked crap. In truth they might be overkill but I'm also doing some clever stuff with dynamic lighting that isn't so easy any other way.

The other way is standard tile maps, which are dead easy to do and draw. Just find out what the bottom left tile is that's visible according to your scroll location, and draw all the tiles, every frame, that are visible. If your map is designed to fit 20 tiles across the screen you will at most be drawing 21 tiles across when it starts to move.

Cas :)