Game Development Community

Tgb and databases

by Nic Biondi · in Torque Game Builder · 07/14/2008 (12:17 am) · 3 replies

What is the best-practice for databases? I did a quick search on it and only found this resource:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=9656
Is that where I should be sticking my nose?

thanks!
-nic

#1
07/14/2008 (6:24 am)
I'd say the best practice is to not use them in the clients, at least. If it's a single-player game, I'd try to integrate SQlite (readily available on OS X and Linux distros, a download and compile away otherwise). The ODBC resource is probably good for implementation in a dedicated server.

What would you use the database for?
#2
07/14/2008 (9:55 am)
Thanks for the reply! I might try to use sqlite if I have problems with mySQL.
Here are my requirements:

1. mySQL
2. server-only access for db. (client will send files, and request them)
3.purpose: filestore

What I need is a server that will save and load files. These files will contain "ghosting" data and high-scores. the idea is to be able to compete online with other people without having to be simultaneously linked.

The client will ask the server for a score that is slightly higher then his/her best time. Then the server will provide a ghost for the player to compete with. When that ghost is beat it will send the next best one.. and so on.. so on.

-nic
#3
07/14/2008 (10:20 am)
You should try the resource, then. The player needs to be connected to the server for verification of the score, right?
MySQL or Postgres are both fast and responsive, and good on a shared system. For a system where datastore latency isn't critical, and only one process uses the data, SQlite is an option. There's also less code to implement than ODBC, I think, if you use the SQlite API. (I don't use SQlite directly now, only through CoreData on Mac :)

Note: That resource makes assumptions about what servers are available by platform. This doesn't have to be true if you have a Win32 dedicated server and MySQL on a remote Linux machine.