Like how could i hide my game assests when i upload it to say mediafire or something i dont want anyone to steal my stuff when they download it, how could i hide it from other people who download the game?
Everything that is read-able can be copied. Its a simple fact. Digital Rights Management which is used for certain music and videofiles, only works because the player supports it too. But the code can still be removed with proper skills/tools. So no digital readable data can be protected 100%.
But you can make it hard to get it.
I have posted this kinda answer regarding development for mobiledevelopment before, but its still the same answers (most of them).
1) Load your data in multiple steps
Many flash games utilizes this. They have a quick splash screen that dynamically loads the rest from the server. but with proper tools, its still possible to copy/save the data
2) Encrypt your assets/data
When saving your data on the server, you encrypt the data with some sort of encryption algoritm. Once you download the data you need to make sure that you can also decrypt inside your client. So inside Unity you cannot use the normal way of loading a scene/unity file. The encryption can still be broken as someone skilled can open your first Unity file and see how the encryption works, but its harder
3) Make some sort of login/session
Use the login to let specific user get a special version of the data. This data should be logged on a server, so that if you ever find the copied data somewhere else, its possible to look up who took it and when. (this is mostly if you are going to hire a lawyer)
4) Keep the game in small bits
If you dont let them have every piece of the game from the start and only loads small amounts through the game, it can be rather annoying to try to download every bit and piece of the game. This might be impossible if you use the free Indy license model.
5) Use a script for protection
Inside the Unity file, you put some scripts that check what domain/www address is using this file. If its not allowed then show some wrong data. Dont deny them to use it, just add a little error here and there. Make it buggy/unprecise, so their full usage is destroyed or more evil. Let some sort of copyright sign popup randomly once its on another domain (not localhost where they do the test)…
6) If its a stand-alone
If its a mobile or standalone game, keep pushing new updates out for the game. Make it useless after some weeks/month so they will come back to get the new version. You could put these scripts in the client or assets so if used after a certain date, then they will be rejected usages. Ofcause a clever programmer can remove such, but if they can, they dont steal your code anyways. Then they build something far better by themselfs.
7) Dont be paranoid - be clever and proud
yes, people steal. Not everyone, but a lot of kids and freeriders do. You cant really stop them, but who says your program or assets are good enough to be worth stealing? perhaps you should see this from another perspective, which is: I did something so good that they actually have spend time stealing it + if they go on a public server with it, contact the admin and have them banned/removed.
One fun thing to do, is create your own encryption model. This can be VERY simple.
For example, if you want a 3D model to be imported, let your loader in unity first decrypt it. Your encryption code could even be: invert all normals
. When someone downloads your 3D model, the guy thinks: “Ah no! My UV’s are all smashed! It’s useless to me!”.
So, when saving your 3D model, you can simply encrypt it with some code that makes it too ugly or somewhat invisible. Someone else should then first crack your model my checking how it should actually look like.
You can do this with images as well. Just invert the colors or do somethings strange with it. It does cost you extra loading time, but it is even more annoying for thieves.