Game Development Community

Using the Torque DB resource

by Matthew Langley · in Torque Game Builder · 04/20/2005 (2:44 pm) · 13 replies

Tutorial for Using TorqueDB with Torque 2D

no source changes from the resource are needed for this (in fact you only need to go to the TorqueDB resource to download it, I have full insctructions in the tutorial :)

About the author

Was a GG Associate and then joined GG in 2005. Lead tool dev for T2D and T3D. In 2011 joined mobile company ngmoco/DeNA and spent about 4 years working game and server tech. 2014 joined startup Merigo Games developing server technology.


#1
04/20/2005 (2:50 pm)
That's really cool! Haven't tried it yet, but I'll have a look at it tomorrow. I did read through the resource and it mentioned engine changes, so I just glossed over it tbh. But if this is all done in script, it'll be a great starting point!

Muchos kudos! :)
#2
04/20/2005 (2:51 pm)
.....
#3
04/20/2005 (2:54 pm)
.....
#4
04/20/2005 (2:54 pm)
@Philip: hopefully it can prove to be some use :)

for me I just wanted a centralized data storage for a journal system, lol it grew from there until it was 40 pages =/
#5
04/20/2005 (4:41 pm)
Can you splain this to me a little more from a beginners standpoint. What applications would you have for this?
#6
04/20/2005 (6:44 pm)
@Randy: From what I understand, this will be used in my future RPG to save object info. It would keep the current state of the world and the player persistant between game sessions. If you are making a game that remembers properties after T2D is shutdown and restarted, your gonna need some kind of DB system to do it. Matt's TorqueDB is the way for me since all of the low level grunt work is already done. Now I just have to figure out how to use it :-)
#7
04/20/2005 (11:30 pm)
Actually I found a very small bug... I did this all about three months (give or take... even before the release of T2D) so taking a little bit to familiarize myself with my code from then... I will fix the bug, release the newer versions (should be the only bug since I do remember testing it pretty extensively, also any help in testing would be appreciated)... Then I will release more info on using this... in fact already started a tutorial for it but found the bug in the process, it has something to do with deleting a class, one of the values don't get set correctly, so its probably just one line thats waiting for me to find it :)

Kevin has it right though... any info you want... in the resource I have a full journal system utliziing it... you can store level information, item database, quest database, character info... or just a way to save or centralize all your game data...
#8
05/16/2005 (11:36 am)
Hi,

i notice that the link at the top is broken and i would really like to see this resource. can anyone help?

thnks
Cal
#9
05/17/2005 (8:33 am)
Drop me an e-mail

admin@razedskyz.com

and I'll try and find it and send it your way :)

Note: there is a minor bug in the DB accessor function (one of the internal return functions seems to not work properly, I've nailed it down to that I just need to get an hour or two to work on it, maybe today) ... though the Journal example accesses the DB directly so it works quite well (have tested it with 1,000 entries +).
#10
05/18/2005 (1:28 pm)
I think I just fixed the problem! Did some tests and it works perfectly fine now... btw I've added a save to HTML function, so you can save your database out to html format to view easily :)...

The main thing I designed the core of this around was parsing a file to parse a file... So you can save out the config file as well as the data file to a plain text file and look at the stored data in one, and then look at the config parser in the other. You can make changes to the text file, then reload them back into the Torque DB and it builds the database around that... I'm a fan of editing things through text files (so I'm a Linux fan), so I wanted to ensure that was possible. So far all of the internal accessor functions work as well, I've written new Classes (aka Tables)... added values, deleted them, etc..

Hopefully I can upload a new version today and finish this tutorial where I found the bug lol
#11
05/18/2005 (1:31 pm)
Btw... anyone interested in testing this out for me ? I plan to finish this tutorial and hopefully someone will be willing to test it out, brutal testing is welcome :)
#12
05/18/2005 (3:21 pm)
I'll certainly test the tutorial out :) Le'me at 'em

One question I have: do we still need to modify the source as you have on the resource page or is the explanation in your first post in this thread all that's needed?
#13
05/18/2005 (4:46 pm)
Thanks :)

I just uploaded a new "fixed" version

Nope, don't have to modify the source, only need to do that if you use the journal example, the source modifications make the "messageVector" gui control return a line you click and move over...

though

Quote:
now run T2D.exe... bring up the console with the "tilde" ~ key and type this command in



TorqueDB.setUpEncrypt();

that line will set up the encryption that was generated (I have a command that will generate a new encryption file for you also)

then run



TorqueDB.loadFile();

this will load the included encrypted file... run this line


$debugMsg::journalDebug = true;

those steps aren't needed now, In the newest version I put them in the TorqueDB.cs