Pointer in the right direction

Could I get a vague pseudo code if the field of 2d (side-scrolling) chunk loading?
I just need to figure out how and when to load chunks, I understand the concept, but don't exactly understand how to do it.
-Chunks are larger than the screen's display

I figured since the maximum amount of chunks on the screen is four, if they are at a 4-Way Border, so the idea was see if the chunk at the four corners of the screen is loaded, if it is not then load it...?

Lastly, what sort of device would I use to keep the chunks loaded?
I figured just to use something like an array with four slots, of I guess type chunk.

Any help is appreciated, thanks in advanced!
(Does not involve pointers!!!)

Anyone?
It's hard to give and answer you'd find useful, as your problem is pretty vague.

Are these tile based maps?
Multiple layers with parallax scrolling or just one layer?
Do chunks contain just graphic/drawing info or the actual map data or both?


Assuming tile based....

Unless maps are extremely big, it isn't worth it to split it into chunks. Just have the whole map loaded. Tile based maps typically do not use very much memory. (the entire world map in Final Fantasy 1 was 256x256 tiles at 1 byte per tile that is only 64K of memory to keep it stored uncompressed. 64K is nothing).

For drawing.... just draw the tiles that are "on screen"... rather than trying to put tiles into chunks and drawing on-screen chunks (which would draw a bunch of unnecessary tiles anyway). This can also easily be done with parallax scrolling.
Sorry for the vague question,

It would be tile based,
As for parallax: Would It matter? It is not related to the grid, just kind of a scrolling background image there for depth.
The chunks would contain sets of individual tiles.

The idea is that generating tiles by chunks as you go, would use less memory than just generating a large map.

I was just wondering how I might go about figuring out which chunks to load based off what you can see on the screen.
Topic archived. No new replies allowed.