Announcement: Be excellent to each other.


Caravel Forum : Caravel Boards : Development : Packing text, graphics and sound into a single file
New Topic New Poll Post Reply
Poster Message
DGM
Level: Master Delver
Rank Points: 202
Registered: 06-16-2006
IP: Logged
icon Packing text, graphics and sound into a single file (0)  
DROD can have multiple kinds of media for a hold in a single file. Having never done that sort of thing myself, I'm looking for a little guidence. How do you do combine graphics, sound and text in a way that's platform and language-independent?

____________________________
My gaming blog is at http://dungeon-games.com/blog/
04-15-2007 at 04:21 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
trick
Level: Legendary Smitemaster
Rank Points: 2580
Registered: 04-12-2003
IP: Logged
icon Re: Packing text, graphics and sound into a single file (+2)  
Well, DROD does it by using a database, but you can just use a regular archive such as zip for storing multiple files as well. PhysicsFS is nice for that. You can even merge your executable and the archive into one file, if you want (just cat a zip to the end of an executable and then have the executable open itself as a zip).

Anyway, how you do it doesn't really matter, as long as the things you use for handling the files -- image loader, sound player, etc -- is able to take a memory buffer or stream data, so that when you want to load a file from the storage (whatever it is), you can either load it into ram and pass the buffer to the handler, or if you want to get fancy, you can stream the data from the storage on demand (nice for larger files since you don't need the entire file in ram at once).

04-15-2007 at 04:52 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Briareos
Level: Smitemaster
Avatar
Rank Points: 3516
Registered: 08-07-2005
IP: Logged
icon Re: Packing text, graphics and sound into a single file (+1)  
DGM wrote:
DROD can have multiple kinds of media for a hold in a single file. Having never done that sort of thing myself, I'm looking for a little guidence. How do you do combine graphics, sound and text in a way that's platform and language-independent?
Well, the easiest way is probably using ZIP as the format of your single file, as there's a library for almost anything to read (and write) ZIP files.

That's how a lot of games do it, so it can't be that bad... :)

EDIT: Yeah, what trick said... :)

np: Richie Hawtin - Minimission (DE9 - Transitions)

____________________________
"I'm not anti-anything, I'm anti-everything, it fits better." - Sole
R.I.P. Robert Feldhoff (1962-2009) :(

[Last edited by Briareos at 04-15-2007 04:58 PM]
04-15-2007 at 04:57 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts Quote Reply
coppro
Level: Smitemaster
Rank Points: 1308
Registered: 11-24-2005
IP: Logged
icon Re: Packing text, graphics and sound into a single file (0)  
I think he was referring to what I said about putting multiple hold files or such into the same file.

Step 1: Download DROD source code (2.0 works fine)

Step 2: Compile drodutil (may require some hoop-jumping, I don't feel like explaining it here)

Step 3: Have your two files, and run "drodutil uncompress Filename Destination" for each.

Step 4: Open the resulting XML files, and copy everything between the "drod" tags from one into the other.

Step 5: Recompress by running "drodutil compress Filename Destination".

There you go.

EDIT: Do not upload any such file to any special CaravelNet systems - Schik says that the forum doesn't like those.

EDIT2: Ooops. I completely missed the question. That was dumb.

Anyway, what DROD does is simply stores the data in raw format into the database files. DROD uses a data storage library called Metakit which works on any platform. I have played around with it myself, and once you get used to the API, it's pretty good. Another good way to store data files is in base 64. This is the format used by DROD in the XML hold, demo, and other files. Once again, the data is not converted into any particular format - it's stored in a pristine original state, then read back into a buffer which can then be passed to an apropriate library handler. However, this involves direct byte-by-byte manipulation - if you are using a higher-level language, you may not have the same power. Zipfiles are supported by nearly everything these days, though, and they work fine.

EDIT3: I might as well leave the instructions up, as they're good instructions.

[Last edited by coppro at 04-15-2007 10:49 PM]
04-15-2007 at 10:40 PM
View Profile Show all user's posts Quote Reply
DGM
Level: Master Delver
Rank Points: 202
Registered: 06-16-2006
IP: Logged
icon Re: Packing text, graphics and sound into a single file (0)  
Thanks, guys. I was actually able to find a user-made GM tool that should accomplish what I need for now, but I'll definitely remember your recommendations in case I need them when I jump platforms.

____________________________
My gaming blog is at http://dungeon-games.com/blog/
04-17-2007 at 05:43 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
New Topic New Poll Post Reply
Caravel Forum : Caravel Boards : Development : Packing text, graphics and sound into a single file
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.