The Daily Click ::. Forums ::. Klik Coding Help ::. 3 million tiles?
 

Post Reply  Post Oekaki 
 

Posted By Message

Darkstar



Registered
  27/01/2002
Points
  12
24th June, 2004 at 07:26:44 -

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.

 
-]Darkstar[

Ashman

Possibly Insane

Registered
  12/06/2002
Points
  3974
24th June, 2004 at 07:29:48 -

Holy Crap... that's one big bathroom.

 
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.


"Outshined" - SoundGarden

Tigerworks

Klik Legend

Registered
  15/01/2002
Points
  3882
24th June, 2004 at 07:44:18 -

Don't ask why I need 3 million tiles

Why do you need 3 million tiles?

 
- Tigerworks

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
24th June, 2004 at 08:00:13 -

Mmm, 12mb of tiles... I recommend you go down the C++ or assembly route if you want to do that in under a minute

 
n/a

Darkstar



Registered
  27/01/2002
Points
  12
24th June, 2004 at 08:39:57 -

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)

 
-]Darkstar[

Tigerworks

Klik Legend

Registered
  15/01/2002
Points
  3882
24th June, 2004 at 08:41:45 -

What are you doing this for? It sounds VERY inefficient. If you tell us what you are trying to do, we can suggest more efficient ways to do it.

 
- Tigerworks

Darkstar



Registered
  27/01/2002
Points
  12
24th June, 2004 at 08:58:45 -

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

 
-]Darkstar[

Cazra

Crazy?

Registered
  24/07/2002
Points
  4472

Game of the Week WinnerVIP Member
24th June, 2004 at 09:19:32 -

You could try a quick backdrop

 
n/a

Muggus

Possibly Insane

Registered
  31/07/2002
Points
  2958
24th June, 2004 at 10:33:52 -

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!!!

Darkstar



Registered
  27/01/2002
Points
  12
24th June, 2004 at 10:52:47 -

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.

 
-]Darkstar[

Shen

Possibly Insane

Registered
  14/05/2002
Points
  3497
24th June, 2004 at 12:17:15 -

What sort of stuff will go in these tiles? It shouldn't be too hard if you only need to store 5 different values, more so if you need to store 255

 
gone fishin'

Cazra

Crazy?

Registered
  24/07/2002
Points
  4472

Game of the Week WinnerVIP Member
24th June, 2004 at 13:05:41 -

Why not make the tiles from a quick backdrop and then use a grid-based coordinate system?

 
n/a

Kramy



Registered
  08/06/2002
Points
  1888
24th June, 2004 at 13:22:48 -

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...

01|02|03|04|05
06|07|08|09|10
11|12|13|14|15
16|17|18|19|20
21|22|23|24|25

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:

TileNum = 43;
XCoord = TileNum%12; // 12 = XSize/Tilesize
YCoord = TileNum/12;

Then copy XCoord*10,YCoord*10 to the screen.

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.

Image Edited by the Author.

 
Kramy

Mr Icekirby



Registered
  18/12/2003
Points
  846
24th June, 2004 at 16:38:39 -

have fun trying though!

 
Mr Icekirby says so!
OBEY ME!

Teapot

Does he even go here

Registered
  02/10/2003
Points
  2631

VIP Member
25th June, 2004 at 21:05:24 -

"Holy Crap... that's one big bathroom."

Ashman is back...probably not though...

 
n/a
   

Post Reply



 



Advertisement

Worth A Click