Using SQL tables for storing user created level stats. Is there a better way?

Posted by Ivan on Game Development See other posts from Game Development or by Ivan
Published on 2013-10-25T16:08:37Z Indexed on 2013/10/25 16:12 UTC
Read the original article Hit count: 286

Filed under:
|
|

I am developing a racing game in which players can create their own tracks and upload them to a server. Players will be able to compare their best track times to their friends and see world records.

I was going to generate a table for each track submitted to store the best times of each player who plays the track. However, I can't predict how many will be uploaded and I imagine too many tables might cause problems, or is this a valid method?

I considered saving each player's best times in a string in a single table field like so:

level1:00.45;level2:00.43;level3:00.12

If I did this I wouldn't need a separate table for each level (each level could just have a row in a 'WorldRecords' table). However, this just causes another problem because the text would eventually reach the limit for varchar length.

I also considered storing the times data in XML files. This would avoid database issues and server disk space can be increased if needed. But I imagine this would be very slow. To update one players best time on one level, I would have to check every node in the file to find their time record to update.

Apologies for the wall of text. Any suggestions would be appreciated.

© Game Development or respective owner

Related posts about databases

Related posts about Xml