seamless scrolling help plz

Started by
0 comments, last by Bob Janova 16 years, 1 month ago
I have been thinking about ways to do seamless scrolling for the last week and havnt decided on a good way. I know about seperating the world into partitions but thats where im stuck. I dont know what to do or where to start. And cant find help tutorials on google any links would be greatly appriciated plz.
Advertisement
You're on the right lines. The first step is splitting the world up into partitions as you thought. I'll set out a simple technique for a 1D game, but you can extend it to 2 or 3D easily enough.

At any time the player is in one partition. If we imagine a side-scroller with a screen width of 800, I would recommend that partitions are around 1000 to 1500 units wide. Now, often you will be near enough the edge to see another partition, so you will need to have loaded at minimum the current partition and any adjacent partitions. (In 1D that's just the two to either side; in 2D it's the 8 corner-adjacent cells and in 3D it would be the 26 cells touching in any way.) So when entering a partition, load any partitions that you now need and are not cached; if your cache is full, unload the 'oldest' (i.e. last visited longest ago) partitions first.

You will probably want to put the loading of partitions into a background thread so as not to cause the main game to freeze for a moment.

This topic is closed to new replies.

Advertisement