Saving maps as XML flat file over database

Need help with an engine or coding not on the list? Need help with a game or the website and forums here? Direct all questions here.
Post Reply
Kada
Posts: 10
Joined: Mon Jun 14, 2010 3:38 am

Saving maps as XML flat file over database

Post by Kada »

Hi everyone,

I was thinking for an hour about whether or not I should save maps as individual cells in a database table or load in a flat-file XML document.

I eventually decided on the database table, until I started actually creating the structure.

It seemed fine until I realized I wanted a 3-layer structure.

My maps will be 11 cells high by 22 cells wide => 242 tiles per layer.

Sure, some tiles may have nothing on layer 2 or 3, but I'll still always need an entry for that cell saying it has no image.

Yes, each user will only need to load this map data once when entering the map, and never again, but still, is 726 records (or rows) in a database table too much, or is that actually a really small amount? I don't have enough database experience to know.

I think I'll be reading in the tilemap using 3 queries:

SELECT * FROM maplayout WHERE id='$map' AND layer='1';
SELECT * FROM maplayout WHERE id='$map' AND layer='2';
SELECT * FROM maplayout WHERE id='$map' AND layer='3';

Each query returning <250 records isnt bad right?


My other concern is that maplayout table is going to eventually have thousands of records, considering 1 map is gonna have 750ish rows, and there will be many maps.
Kada
Posts: 10
Joined: Mon Jun 14, 2010 3:38 am

Re: Saving maps as XML flat file over database

Post by Kada »

Wow... just read online that even 100,000 records in a database table is considered small by todays standards.

"...I have databases with 2+ GB of data, with some tables containing over 1 million rows and I consider that being somewhere between small and medium size."
Falken
Posts: 438
Joined: Fri May 08, 2009 8:03 pm

Re: Saving maps as XML flat file over database

Post by Falken »

Ye you should use a database. XML is not made for data storage, the primary use of XML is to transfer data between different datasystems.
--- Game Database ---
For all your game information needs!
Visit us at: http://www.gamedatabase.eu today!
Post Reply

Return to “Advanced Help and Support”