PDA

View Full Version : how to save sequences of text files and sound files



nagpalma
29th June 2007, 10:09
Hello,

My job is to do a game where i must have sequences of text and sound files inside the event loop. I already use QTimer's to program actions (graphicitems animations, show sentences, play sounds) that will happen in the event loop.
Now i'm using as many text and wav/ogg files as the sentences i need in the game.
But i will need thousands of sentences and sounds and it seems to me that this isn't the better way. Is there a way keep this information all together?
Any help would be appreciated.

Thanks,
Palma

wysota
29th June 2007, 10:59
You can store all the data in a SQLite database, for example.

nagpalma
29th June 2007, 11:37
wysota, do i have to install a SQLite database in every computer i want to run the game ?

nagpalma
29th June 2007, 12:44
Thanks a lot wysota,
i took a look at http://www.sqlite.org/cvstrac/wiki?p=TheAmalgamation and all we need to do is copy the amalgamation into your source directory and compile it together with your other source files

Palma

wysota
1st July 2007, 20:35
I have no idea what Amalgamation is, but Qt comes with an SQLite driver, so you shouldn't need to copy/compile anything.

nagpalma
2nd July 2007, 09:45
ok, by the way how do we save de sqlite bd in disk?

nagpalma
2nd July 2007, 17:10
i already know one way : The SQLite library includes a simple command-line utility named sqlite3, and we can use it to create a new database

wysota
2nd July 2007, 21:25
ok, by the way how do we save de sqlite bd in disk?

I don't understand the question... Create a database and fill it from within your application...

Methedrine
3rd July 2007, 00:06
Since you are working on a game you might want to consider using plain .zip files ( .pak files (http://wiki.xentax.com/index.php/GRAF:ZipArchive)) which Doom used already ;)

It is a common technique used in game programming.