Results 1 to 9 of 9

Thread: how to save sequences of text files and sound files

  1. #1
    Join Date
    Apr 2007
    Posts
    23
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default how to save sequences of text files and sound files

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to save sequences of text files and sound files

    You can store all the data in a SQLite database, for example.

  3. #3
    Join Date
    Apr 2007
    Posts
    23
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to save sequences of text files and sound files

    wysota, do i have to install a SQLite database in every computer i want to run the game ?

  4. #4
    Join Date
    Apr 2007
    Posts
    23
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to save sequences of text files and sound files

    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

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to save sequences of text files and sound files

    I have no idea what Amalgamation is, but Qt comes with an SQLite driver, so you shouldn't need to copy/compile anything.

  6. #6
    Join Date
    Apr 2007
    Posts
    23
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to save sequences of text files and sound files

    ok, by the way how do we save de sqlite bd in disk?

  7. #7
    Join Date
    Apr 2007
    Posts
    23
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to save sequences of text files and sound files

    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

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to save sequences of text files and sound files

    Quote Originally Posted by nagpalma View Post
    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...

  9. The following user says thank you to wysota for this useful post:

    nagpalma (3rd July 2007)

  10. #9
    Join Date
    May 2006
    Location
    Germany
    Posts
    108
    Thanks
    2
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to save sequences of text files and sound files

    Since you are working on a game you might want to consider using plain .zip files ( .pak files) which Doom used already

    It is a common technique used in game programming.
    "If you lie to the compiler, it will get its revenge." - Henry Spencer

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.