Game Development Community

.zip Files

by Robert Fritzen · in Torque Game Engine Advanced · 05/05/2011 (7:27 am) · 8 replies

I know that torque is loaded with a .zip decompiler in TGE/TGEA, but I'm not sure how to use it, or if changes need to be made to the source code to get it to work.

I noticed there was a "T3D Fix" for the .zip reader, but I could not find an equivalent for TGEA.

How do I go about making these fixes, and using the .zip format in files.

#1
05/05/2011 (4:54 pm)
That's very easy.

Open the folder you want to zip, highlight all the contents of that folder and zip. Name the zip the same as the folder. Delete the folder as you won't need it. tgea will read directily from the zip.
Problem....tgea has a problem reading object or texture files from the zip. (can't remember which). I don't believe there was ever a fix for that one.
#2
05/06/2011 (7:27 am)
adding onto this, would it be possible for me to:

1. Encrypt the .zip files, and decrypt them before the game loads (Level of security for the files)

2. Do a .zip based structure (thinking for patches and expansions):

IE: I would have the clients download a .zip file that would store in the game's main dir. and would the zip be able to push files to other dirs through it?
#3
05/06/2011 (4:10 pm)
Encrypt/decrypt would take source code changes. I think... there is a resource for encrypt/decrypt. (can't remember for certain)

As for #2, that would take a good programmer. I don't know if torque will do that. Someone with more programming experience than I would have to answer.
#4
05/23/2011 (3:13 am)
Possible? Of course. But you'll have to get your hands dirty. We went with making a layer above the ResourceManager that handled zips transparently. I don't think the end user should have to worry about what type of structure his game is talking with, outside of packaging up his game into zip files.

Encryption isn't difficult either, but remember that it won't stop the determined.
#5
05/23/2011 (1:56 pm)
I'm wondering if I was mis-interpreted there.

I basically want to do this

Game Structure
game
   client
      scripts
      ui
   data
      missions
      assets
      ect.
   server
      scripts

for #1, I mean something like this

Zip
Patch.zip
   game 
      client
         scripts
            someUpdate.cs

where someUpdate.cs is then interpreted to be a part of the scripts folder of the client folder ... ect.

======

The encryption part should be self explanatory, I do agree with the determined part, but some file security is better than none :).

For the encryption, I can already do the code for, I'm just wondering how I can get it to encrypt/decrypt before the files are loaded.
#6
05/24/2011 (7:27 am)
No misinterpretion at all. :)

That's exactly what it is, a transparent way to handle ZIP files. Ie, you can just pack all your game data up into a ZIP and place it there. As long as it follows your usual directory structure, the game loads it just like if it was a normal directory. Transparently.

I can't remember how the Torque Zip-Reading stuff was laid out, but there are certain points where you can hook into the data reading and encrypt/decrypt as needed. It's really quite easy.

But, you have to handle this somewhere on the tool-side too. Do you want ZIP encryption? Or just your own? If the latter, you'd have to make a tool that encrypts your zip. At that point, you can no longer open it in WinRAR or WinZIP anymore. But if you want to use their encryption, that's a bit more work - but not nessecarily safer.
#7
05/24/2011 (12:02 pm)
Ok, so #1 is handled by the engine already... good.

For #2 I was just looking to see where the .zip is loaded at, I would simply apply a decryption layer before it is loaded. The encryption would be pre-handled by another program when the package is made.
#8
06/01/2011 (1:52 pm)
Is this available in T3D?

I tried zipping the contents of the "scripts" folder into a ZIP file called "scripts" (with and without the .zip).

T3D won't read it. Am I doing something wrong?