Quake Map .pk3 Loader

Hey guys I’ve seen a couple of people wanting to load quake maps throughout the forums or blogs and I noticed PhobicGunner had released a parser for .bsp files but it had no rendering, or loading of any other files. Thanks to PhobicGunner and his http://forum.unity3d.com/threads/165611-WIP-Parsing-maps-from-Quake-3 I managed to get the necessary info to do the rendering myself. Now I had to do some changes to allow more than 65535 vertices as a few maps had around 70000. Next was loading textures for which quake maps normally use Jpeg which i had no problem implementing with unity’s Texture2D.Load, but there was also TGA for which I also used aaro4130’s TGA Loader http://forum.unity3d.com/threads/172291-TGA-Loader-for-Unity3D . This loader shows an example of loading a quake map from within it’s pk3 file using the DotNetZip library. So far it loads the map mesh, combines equal textures, loads textures and their coordinates, creates spawn points from the map information and loads sounds from the map. Of course some quake maps use quake’s textures from it’s default pak0.pk3 file for which I added support you just need to put it in Maps folder. But if you want to use alternate textures the debug says textures are missing and you just create a folder of equal path say textures/metal in your Resources folder and it’ll load that up instead. For missing textures theres a default question mark texture. So now, enjoy. I included a custom map for those who want to test immediately.
Here is the link http://www.mediafire.com/download/zqy9g1fta8m1alf/QuakeLoader.rar

That’s really cool.

I don’t have nearly enough time to continue working on projects like this, but it was neat to see some Quake Live maps being dropped in and loaded (with modification - I had to decode them because they were encrypted, and I also had to modify your pk3 loader to be able to load multiple PAK files instead of just the one PAK0 file)

Would mainly like to see lightmap support thrown in there, as well as normals. Possibly even a primitive kind of model loading? I think there’s a model entity type in the Entity lump… perhaps you could add basic support for loading models from a Resources folder via that entity type?