Hi all, wanted to open this up for discussion, see if anyone else has done something similar, that sorta thing.
So, anyone who's used it, will know that AGK's text system is awesome, it's really nicely put together, and I'm nothing but impressed by how nice it can make text look, consistantly. It takes a bit of setting up, but it was that 'complex' setup that got me thinking.
The text system uses a text file with details of each character, and the area of the relevant image that is used for that character. So a standard font, maybe from that font generator (which name escapes me, I do know it has a Russian flavor to it) - will involve a .PNG image with all the characters laid out, and an acompanying text file with each ascii characters position, width, and height.
Now, my point is that it's possible to make a custom text file for a tile sheet, and treat it just like text in AGK. Rather than using several sprites, you would have a text box for a single screen, or several text boxes to cover your whole map. I have tested this idea, and it seems to work pretty sharply, like using a 16x16 tile map, 256 images, it looked just as good as the sprite version. I haven't had a chance to do any speed comparisons, but I'm thinking that having a preset text object is better than having, what, 256 sprites.
There are some limitations that I found - mostly that you'd have to keep your tiles within a safe ascii limit, like mimicking an actual font, starting at char 32 for example. When I tried to be greedy, and used 256 individual tiles, the strange ascii values wouldn't work - so the text object would have random text inbeside the tiles, due to ascii. So the rules would be... maybe an 8x8 grid of tiles instead of 16x16. It can be tricky, because that doesn't give a lot of tiles for say, an RPG game, but would be fine for a platform game. That could be stretched, maybe using 10x10 tiles, to give 100 different tiles. The standard ascii really starts at char 32, so the subimage file would start at 32 as well, and include however many images it can support. I'm not 100% sure, of course.
So, if you want a big map, maybe text objects is an option for you. As long as you don't need hundreds of different tiles, I think it's a pretty workable idea. You'd get a tileset, say a grid of 8 by 8 tiles, then make tile 1 blank, and set the ascii characters on each text object to suit the map data. I'd stick with a text box size of 16x16 tiles, so each text object would hold 256 characters, and each text object would be positioned on the world, so changing the view offset is akin to scrolling the screen. Considering a decent sized 2D map, say 256x256, well that could be 65,000+ sprites, or it could be 256 text objects. If AppGameKit creates the text objects and just leaves them alone unless something changes - well it might just reduce the overhead and make for a fast and efficient tiled map engine. Low maintenance as well - if a map tile changes, just change it in the text object, like re-build the text string based on the map.
When I get a spare hour, I'll see if I can make an example of this - my experiment code is not exactly elegant, really I just wanted to see if anyone else had some ideas, and maybe it's worth having a good look at the text system, who knows what it could make possible with a little hacking and thinking outside the box.
Health, Ammo, and bacon and eggs!