Original Post
Ive read many threads on this site pertaining to this topic but i think if i could have my own situation responded to it would help me alot more, so here it is.
Im making a 2D RPG. Think SNES style like FF3, EarthBound, secret of something, something of mana (you get the idea). So ok. I know i am going to have to have large maps in this game. These maps must be created out of tiles. And there will be a certain viewable area and only the tiles within the current viewing area will be drawn. I have 2 books for reference, but neither show me as much as i need to get this started.
first off i knwo i need the graphics to begin with, so say i have 1 tile, a grass tile. I want an entire 640x480 screen(viewing area) to be filled up with this grass tile (the tile is 32x32) so that means the viewing area will have 20x15 grass tiles within it. Am i supposed to manually create a matrix specifically saying which tile needs to be placed at every coordinate? for example:
matrix[0][0] = grass tile, matrix [0][1] = grass tile, ...
This is obviously tedious and want to know how i could do this easier.
Second the books i was using mention something about clipping un-used tiles. But so far i find this unecessary. I am already going to be using memory because i have to initialize every bitmap i am going to be using in that map. And if i draw all 20x15 tiles on the screen and move to the right one tile length, I am still drawing 20x15 tiles except the 15 tiles on the right are new tiles. Why would i need to worry about what is left over on the left outisde the viewing area? its not like im re-drawing them even though i cant see them. i only draw whats within the viewing area. I dont even know if that is what they were getting at about the clipping. Any ideas on that?
i was also thinking would it be a good idea to ONLY initialize bitmaps being used in a specific map rather than initializing all the bitmaps at game start? say if im in a desert in the game, when a player goes to the desert map, i initialize all the tile pointers and bitmap pointers used in the desert map then when i leave i delete them all?
Thanks for taking your time to help me, im sure this topic is turning into a broken record by now. But any help or any light shed on this topic for me will be greatly appreciated.