Turning gfx and sounds into 'resources'?

Started by
2 comments, last by Drew_Benton 19 years, 2 months ago
Hey guys. I've downloaded a couple of games now to see how others are handling their textures and sounds for their games and some seem to have no actual texture pics or sound files! I've heard that you can turn those things into 'resources', but I don't know a whole lot about that. Do the textures and sounds get compiled into the game executable? Or do they get consolidated into a dll? Or something else? I know the pros about consolidating sounds and textures (can't accidently NOT install textures and sounds, hard to pirate sounds and textures, makes the installation cleaner, etc.), but are there any cons to turning sounds and textures into resources? Most of all, how do I do it? I'm still pretty new to C++ and DirectX coding, so you'll have to forgive me of my ignorance about 'resources'... But if somebody could teach me how to turn my sounds and textures into resources, that would be very cool! Thanks in advance for the explanation and help, guys!
"The crows seemed to be calling his name, thought Caw"
Advertisement
Sounds and textures ARE resources. So are fonts, meshes, data files, and anything else that isn't in the core game mechanics. You don't turn them into "resources". Because of the terminology confusion, I'm not sure what it is you are asking.

You can hide resource files in a variety of ways: You can pack them into a single file and just read off the file at a certain memory address, you can zip them into a compressed file, often with the extension renamed (.zip -> .mob for instance), you can hide them in the executable (messy but doable), you (i think) can tack them onto the end of the executable, and you can also produce them procedurally in some instance (dynamic generation of graphics and such).
Thanks for the reply, leiavoia! Yeah, I know enough to be dangerous but I don't quite understand what all the terminology means (I just realized a couple months ago that I was using 'pointers' for over a year and didn't know that's what they were called - sheesh!).

I think the route I'd like to take for my game is the 'zip the files' idea... That's what Quake and a bunch of other games use, so I think that would be pretty cool for me to do too. Are there any tuts out there that teach how to pack stuff into a zip and then get your C++ game to use those files as thy're needed?

Thanks again!
"The crows seemed to be calling his name, thought Caw"
There is a great GameDev article here that you should take a look at. Also take a look at this SDL tutorial made by Ryan Clark for custom resource files. Basically what you can do is take a whole bunch of media content and turn it into one file. Hope this helps some.

- Drew

This topic is closed to new replies.

Advertisement