Hey,
I am developing a Tile Based 2D map editor for my game (Zelda style). So far, all is going well except I am noticing rather slow FPS in some scenarios. I have a few questions regarding this, and would appreciate any help
1. To store the sprites for each tile, I have been declaring an array like this in the globals:
sf::Sprite TileSprite[MaxXTiles][MaxYTiles][MaxZTiles];
My assumption with this was that this wouldnt slow down performance unless the sprites were being drawn, which only happens when they are textured. Is this a correct assumption to make? if not, should I be using another system such as dynamic arrays?
2. This is more of a general RPG game theory question.. At the moment, when a tile is selected from a tileset, that tile's texture rectangle, texture pointer and tileset filename are stored. When placed, I set the new tile's rectangle and texture equal to the one on the tileset. When saving, I save the rectangle and the tileset filename. Is this is the best way to do things? If not, how should I be doing it?
3. What is the usual way to save map data for this kind of game? I have seen other projects use XML, but I am unfamiliar with XML, so I am wondering whether it is viable to use the fstream commands included with C++?
Matt