• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Eric Bizet

Make file unreadable by an external program

21 posts in this topic

Hi,
 
As mentionned in the title, I want to make my resources files (text, images and audio) of my game unreadable from external programs like Word, Photoshop or VLC Media Player...
 
I don't want to make an encryption/decryption algorithm that requires to create a output file (because it could be read easily) or something stored in the memory (don't want to take to much pc resources you see ?). I just want to make them directly readable in SFML through a c++ algorithm, i'm not looking for an extremely complicated process.
 
I saw how resources files were crypted for Terraria (XNB Files) and if you could tell how it works it would be great ^^
 
Thanks for your replies
0

Share this post


Link to post
Share on other sites
Encryption will also slow down your game loader - not much of an issue in a small project, but for a large game it's definitely noticeable. Released games are more concerned about loading something fast then encrypting it - it just so happens that the kinds of things you do to make something load fast, like archiving them, using a custom format, or preprocessing also make them difficult to read by standard programs.
2

Share this post


Link to post
Share on other sites

Thank for your replies

 

 

I find it highly unlikely that Terraria encrypts its files. According to 30 seconds of Googling, it just appears to be a custom format, most likely to make loading and streaming easier. That's not encryption and any user with a bit of technical background can get access to the data even if the specification is not public for easier modding.

If you want to prevent casual opening/modifications of your resources give them a non-standard extension (like .myimage instead of .png). That should prevent opening them by simple double-click in Windows. Of course even a user with a minimum of technical understanding can still just drag the file into Gimp.
Alternatively just store multiple files inside some archive format. I would advise against encryption. It will most likely cause you more problems getting it right than a skilled user to grab the decryption keys from your own executable.

 

I had also the same idea about the custom file extension but that is not enough

 

Encryption will also slow down your game loader - not much of an issue in a small project, but for a large game it's definitely noticeable. Released games are more concerned about loading something fast then encrypting it - it just so happens that the kinds of things you do to make something load fast, like archiving them, using a custom format, or preprocessing also make them difficult to read by standard programs.

 

Ok so i give up the encryption method

 

XNBs are simply files that are generated by the XNA Content Pipeline. They are not encrypted in any way, you can write yourself a viewer without much trouble using XNA or Monogame.

The easiest way that I can think of to "protect" your assets would be to store them in one or multiple archive (7z, zip, ...) and use a custom extension. Then, you change the the archive header so that the files cannot be opened without knowing how to reconstruct the original header.

Somehow I wonder what kind of assets you have that no one must be able to see them. biggrin.png

 

But zipping file will not make them slower to read ?

0

Share this post


Link to post
Share on other sites

But zipping file will not make them slower to read ?


It will make them slower to read.
1

Share this post


Link to post
Share on other sites

But zipping file will not make them slower to read ?


As Sean already said, the decompression will be faster than the IO most of the time. If for some reason you are slowed down by the decompression you can always take a compression algorithm that favors speed over compression ratio (e.g. LZ4).
0

Share this post


Link to post
Share on other sites

For what it's worth, Microsoft uses regular old zipped XML files for it's office documents (.???x files, like .docx). If you convert them from docx to zip, you can extract the XML and see what makes them up.

 

Almost everyone has no idea they are multi-file zip archives, and opening them takes almost no time, even for large files.

 

So if you name them "Tank.content"; which is really Tank.zip; which is an archive that contains Tank.obj, Tank.png, and Tank.wav; then you have already deterred most everyone from opening them up and seeing what's inside.

0

Share this post


Link to post
Share on other sites
It's common to either put content in Zip files or store your content as blobs in a SQLite database.
0

Share this post


Link to post
Share on other sites

Chris hit it on the head, the question is: why? The answer to your question entirely depends on your answer to that question.

1

Share this post


Link to post
Share on other sites

Prison Architect is also just a compressed file with a different name, you can extract it with 7Zip and view all the game files. there's shaders and lua scripts in there.

0

Share this post


Link to post
Share on other sites

I'm looking for a simple process to make my files unaccessible from random people a look at as they wish. Just to discourage dumb people to do it you see ?

 

I think a would try compression with a minimum compression ratio, thank you guys for your precise answers.

 

 

As soon, as the game has loaded, literally all I need to do is Alt-Tab out to Pix/gDebugger/ApiTrace/... select the texture and click "Save As...".

 

 

I'm did not understand this line, could you tell me more about it please ? If you agree ^^

Edited by Reakbyz
1

Share this post


Link to post
Share on other sites


Just to discourage dumb people to do it you see ?

 

Dumb people won't try.  Smart people will look at the files no matter what you do.

0

Share this post


Link to post
Share on other sites

Yes but dumb people who are at ease on computer and could change audio files of a game for exemple

0

Share this post


Link to post
Share on other sites

As soon, as the game has loaded, literally all I need to do is Alt-Tab out to Pix/gDebugger/ApiTrace/... select the texture and click "Save As...".

I'm did not understand this line, could you tell me more about it please ? If you agree ^^


Tools like Pix (for DirectX) or gDEBugger/CodeXL (for OpenGL) are used for graphics debugging. Among others things, they can show you all textures that are loaded by the program that you are debugging.
jcuz8u63.jpg
Even if these tools may not necessarily provide an export functionality, it's still not that hard to save your textures.
2

Share this post


Link to post
Share on other sites

I'm did not understand this line, could you tell me more about it please ? If you agree ^^


Pix, gDebugger etc. are tools for debugging graphical problems. They allow you to record an entire frame (or multiple frames) and look at what's going on, step by step. They also allow you to "inspect" all the resources, including vertex buffers, index buffers and textures. And they usually also include the nice feature, that you can export/save them from the trace. So just by uploading your textures into the rendering API, you pass it to Pix/gDebugger and they expose methods for saving it back to disk.

Pretty much the same applies for all APIs, even if the tools might not be as easily available. If for example you pass a soundeffect to your audio library, which happens to be a DLL, a programmer can write a wrapper around that DLL which intercepts the data. 
 

Dumb people won't try.  Smart people will look at the files no matter what you do.


This! Most people aren't really that interested in UV unwrapped textures. But those that are, and like to look at them at a regular basis, also know how to use Pix/gDebugger to do so.

Besides, everyone who plays the game will (hopefully) look at the textures anyway, inside the game. What "damage" do you expect to arise from people also looking at them outside the game?
2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0