Something I'm working on requires storing just over 3 million tiles (1800x1800) and as of yet I can't sort a way of even filling an array that large. I'm sure somehow you could, so if anyone can think of it, add me on MSN conformnow@hotmail.com talk to me on IRC (]Darkstar[, in #K&p, on irc.blitzed.org) or just reply to this message. Don't ask why I need 3 million tiles, because that's irrelevant and perhaps if you help and become more involved you'll find out anyway. Thanks.
Show me the power child,
I'd like to say,
That I'm down on my knees today,
Gives me the butterflies,
Gives me away,
'Til I'm up on my feet again,
I'm feeling outshined.
I guess I'll have to limit the amount, what's the biggest feasible amount? (Only 10,000 or so will be displayed at any one time, but I need the array to store all the information)
I sorted out a way to do it, by storing 9 values in each array, the array can be 200x200 (200*9 = 1800, 1800x1800=3,240,000). It's hard to explain what it's for. Basically, it's a tile engine. Each tile is 10x10, each 'sector' is made up of 12 tiles by 12 tiles, and each 'map' is made up of 150 sectors by 150 sectors. That's the size we wanted and so it looks like it'll work out now
Could you explain in more detail what you want done with so many tiles or whatever?
By the sounds of it you're over complicating something that should be simple.
MUGGUS
Come and annoy me more at
www.muggus69.tk STOUT ANGER!!!
Less a game, more an organizer for a campaign of a tabletop game I play called Micro Armour (WW2 Based). We play it on a map of 4 inch tiles put together to form a 48 inch map, so 12x12. 150x150 of these, 3 million tiles. Although even though I can represent 22,000 sectors that may be a little excessive but atleast I've found a means to do so.
I think I get what you mean. There's a better way though I think. Professional games like Diablo II and Dungeonsiege load the tiles as you move, so they don't need nearly as much memory.
In Jamagic you could do this by the following method:
Tile = 10x10
Sector = 12x12 tiles (so 120x120)
Load 25 arrays of "sectors" (covering a 600x600 zone)
Assuming you're using 320x240 resolution, and assuming that sectors are labeled like this...
As soon as you pass halfway though sectors 02,07,12,17,22, etc., it scraps sectors 05,10,15,20,25, and loads new sectors into memory to the left or 01,06,11,16,21, etc.
In such a way you can avoid having so many tiles in memory at once. Also, only store values in the arrays, then link the values to a tileset.
If you have a 120x40000 tileset, for example, then you would use the following:
Hope this helps. Oh, and if you actually need 3 million unique tiles, then you're screwed. I don't think even C++ would be able to help you with that very efficiently.
dave, i thought you used blitz? that should be able to handle 3m tiles easily
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G
Even assembly would have a tough time with 3 million tiles. Even if they were small, 16x16 tiles (256 pixels), that's 768,000,000 setpixels to draw them all.
Mind you, you wouldn't draw them all at once. Assembly might be able to iterate all the tiles in a reasonable amount of time (<1ms) but something like Darkbasic is going to be way slower, a lot of speed is lost in interpretation.
he's not drawing them all at once. He could just code it to only deal with the tiles on the screen
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G
As I said, you would probably still need to iterate all tiles to check which are on screen. Maybe a short wait in assembly but interpretation really kills the speediness of loops (unless you're using something like Java with compile on-the-fly)
last_blockx = first_blockx+20 // not 19, in case there are blocks that are only just on screen
last_blocky = first_blocky+15
for x = first_blockx to last_blockx
for y = first_blocky to last_blocky
...
next
next
Edit: woo lots of edits
Edited by the Author.
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G
Wow, I'd hate to see how you allocate your memory. Anyway, I thought he wanted to do something with EVERY tile, not just the ones on screen which is easy-peasy to do?