Game Development Community

Need help with choosing a database and a resource for it..

by Jan-Reinald Viardo · in Torque Game Engine Advanced · 10/07/2009 (5:13 am) · 7 replies

Hi everyone. Can anyone please redirect me to a resource or help me use a database that would actually work with TGEA 1.8.1 and Visual Studio 2008. I have tried some MySQL resources but I think it's built for older versions of either TGEA or VS? A little help would be much appreciated. Is using Microsoft Access as database possible? If it is. I much prefer Access than MySQL. I have no experience yet using MySQL and I still need to study it unlike Access. Thanks

#1
10/07/2009 (5:45 am)
Hello.

I think the best choice is making http connections to a web server in which you can have the database you prefer.


You have to take into account:

If you want to send "&" character, you must do the changes explained here:

Quote:

The second engine modification is really a hack. At around line 143 in httpObject.cc you will find the following:

if(asciiEscapeTable[c])
      {
         dest[destIndex++] = '%';
         dest[destIndex++] = getHex((c >> 4) & 0xF);
         dest[destIndex++] = getHex(c & 0xF);
      }
      else
         dest[destIndex++] = c;


Change it to:

if(asciiEscapeTable[c])
      {
		 if(c == 9)
		 {
			dest[destIndex++] = '&';
		 }
		 else
		 {
			dest[destIndex++] = '%';
			dest[destIndex++] = getHex((c >> 4) & 0xF);
			dest[destIndex++] = getHex(c & 0xF);
		 }
      }
	  else
         dest[destIndex++] = c;



What this does is allows you to use the text tag \t as & in your get variable strings allowing you to send multiple variables in a single query. (TGE normally dosnt support this and & get turned into its hex equivalent)

These changes are from: http://www.garagegames.com/community/resources/view/4085


In /common/serverscripts/Clientconnection.cs you can find how to connect via http.


Hope this helps.
#2
10/07/2009 (6:32 am)
Vincente is right, it's good practice to include a middleware between your app and your data provider.

The database that would fit you the most depends on what you want to use it for. If you need it to store single player data, you should go with SQLite.

If you're planning to make a persistent multiplayer game, but it is not likely that you will need more database servers in a cluster, you could choose MySQL. If you need clustered databases, PostgreSQL is a better choice.

As far as Access goes, I wouldn't really recommend it for a game due to its slow data retrieval for larger datasets, but it might not be an issue for your game.

If you'd like to use Access, you could use ODBC to connect with your Access database from your app. I'm not a huge fan of ODBC, but it could be the most ideal solution to your problem. Check out this and this resource and see if they can be of any help.
#3
10/07/2009 (7:37 am)
Ok guys, thanks for the help. Might try it later. Got to go do something important first. I was kinda thinking of studying MySQL. It would benefit me if I study it. I am choosing either MySQL and Access because I would be using Visual Basic as the back end of the game Ill be making. So I could make changes to it using a program. Any MySQL resources out there that is compatible with VS 2008 and TGEA 1.8.1? I am having trouble finding one. Ive tried some but it's not just working right for me. Thanks.
#4
10/07/2009 (10:15 am)
I'd advise to never use MS Access it has a whole range of problems when trying to use in a multiuser situation or for a server backend, it's ok for a single user system but that should be it.

You're choices probably fall into the mySql, sqlite or postgres.

Sqlite being the lightest footprint of the three and my personal preference unless I need more features where I'd use mySQL.

The resources on here for mysql and sqlite all still work with TGEA so I'd check the instructions and steps but like others I'd suggest that rather than integrating them directly into the torque binaries that you interface to the database through something else i.e. php web page or python, again my personal preference would be python as it's a faster approach than running php via httpobject.
#5
10/10/2009 (3:21 am)
Hi, I chose of using this resource http://www.garagegames.com/community/resource/view/9656/3#comments

I have followed the instructions. And I have ran it well. I also downloaded MySQL 5.1 Community Server. Am I in the right track? Can anyone help me? I am new to this. Any resource or how to use the resource? Codings for Torque to access Database and how to create Database? Thanks.. I am only developing a single player RPG.
#6
10/10/2009 (5:30 am)
It's so hard to self study mySQL. Any help pls? Or I might just use MS Access. It is written that the above resource I've stated can be used on several types of database. Can anyone help me configure that resource to work on MS Access? Thanks.
#7
10/10/2009 (7:40 am)
It is not very difficult to combine TGB/TGE/TGEA and Torque3D with Microsoft Access. What you have to do is to create a DLL with some wrapper functions.

The workflow would be: Engine -> DLL -> MS Access -> DLL -> Engine

Some time ago i did it and it worked very well.

But i would only use Access on the local machine. If you want to store data over the internet ( highscore system, inventory for a MMO, whatever...), MySQL or PostgreSQL would be the better choice.

In the last week i wrote some functions to connect TGE also with PHP/MySQL over the internet because i had some issues with HttpObject.