Uhfgood
09-29-2009, 10:45 PM
I'm wondering if you could add a simple map import. I'm thinking a Tile-based map that has, width and height, tile indexes into a tile set (where the tile ids are the location in the tile set based on this y * width_of_map_in_tiles + x), and would also include the file name to the image so that you could bring the map and the tiles into a layer in Novashell. The map file to import would be a single text file, and the indexes (tile ids) would be comma delimited.
For example.
Map="simple map";
TileWidth="16";
TileHeight="16";
MapWidthInTiles="400";
MapHeightInTiles="225";
Tileset="c:\mapfolder\MyTileset.png";
Layer="1,3,213,4";
Obviously the Layer parameter would be a lot larger... You could sort of dictate the exact text format for the map so I could save maps this way (my maps at the moment are only 1 layer, so it only needs to do one layer at a time). So let's say that there were 20 tiles across in the tile set image. That 213 would translate into getting the location backwards... ie X = 213 % 20 = 13, Y = 213 / 20 = 10, so the position in the tile set image would be 13, 10. (And you can of course check this backwards... x = 13, y = 10, y * 20 + x or 10 * 20 + 13 = 200 + 13 or 213).
So you would know where in the tile set image to grab the image from... if tiles were 16x16, and 20 tiles wide that's 20 * 16 which is 320 pixels wide. So to get a tile at position 13,10 you would multiply by 16, so tile 13 is actually an x position of 208, and tile 10, would be position 160...
Anyways, like I said, you could pretty much come up with the exact format I would have to write out, then I could output a simple text version of a particular layer, and it would help me when porting my game over.
You probably won't do that, but maybe you could if I ask real nice, like Please and all... Please write a simple map layer import in novashell!
For example.
Map="simple map";
TileWidth="16";
TileHeight="16";
MapWidthInTiles="400";
MapHeightInTiles="225";
Tileset="c:\mapfolder\MyTileset.png";
Layer="1,3,213,4";
Obviously the Layer parameter would be a lot larger... You could sort of dictate the exact text format for the map so I could save maps this way (my maps at the moment are only 1 layer, so it only needs to do one layer at a time). So let's say that there were 20 tiles across in the tile set image. That 213 would translate into getting the location backwards... ie X = 213 % 20 = 13, Y = 213 / 20 = 10, so the position in the tile set image would be 13, 10. (And you can of course check this backwards... x = 13, y = 10, y * 20 + x or 10 * 20 + 13 = 200 + 13 or 213).
So you would know where in the tile set image to grab the image from... if tiles were 16x16, and 20 tiles wide that's 20 * 16 which is 320 pixels wide. So to get a tile at position 13,10 you would multiply by 16, so tile 13 is actually an x position of 208, and tile 10, would be position 160...
Anyways, like I said, you could pretty much come up with the exact format I would have to write out, then I could output a simple text version of a particular layer, and it would help me when porting my game over.
You probably won't do that, but maybe you could if I ask real nice, like Please and all... Please write a simple map layer import in novashell!