How do you encrypt a game?

How do you encrypt a exe. blender game? I’ve heard of people who have done it. What would be the pros and cons of encrypting a game?

do you have a game done already?

Edit: Also keep in mind that this is an open source program and even though their is commercial work and projects that can be done with blender - that generally when we are doing amateur work we try to share what we’ve learned with one anotherr

Without many of the people here contributing blends and stuff I wouldn’t know what I know today.

It’s okay to encrypt, but people use blender in order to learn how to use it not usually to take what other people have worked on - there really isn’t any point in doing that I don’t think anyway

Not yet. But I still would like to know how to encrypt. (For a Demo).

do you have any screenshots?

I’m not sure that you can encrypt Blender games made with the newer versions (after 2.25). Blender v2.25 was the last version of Blender that was made as a proprietary (non-open source, privately licensed) program. After 2.25 was released NaN (the old company that owned Blender) went bankrupt and the Blender Foundation was formed by users to purchase the code from the shareholders.

Anyway, long story short, Blender 2.25 was freely available, but if you wanted, you could buy a license key. With the key, a few extra options opened up including “Lock File”. The Lock File option would use the license key as a signature so that no one could open the file without your key. That feature was done away with when Blender went open-source. You can still get 2.25, and there is a license key available for download at blender3d.org, but I’m pretty sure it’s the same key for everyone who downloads it, so locking the file would be a bit pointless, since everyone else (except those who bought separate keys before the bankruptcy) has the same key. Of course, it would stop people from opening your .blend in newer versions of Blender.

There are pros and cons to using version 2.25. On the plus side, 2.25 has complete documentation (available for download at blender3d.org) and the Blender GameKit book and demos (which you have to buy) were written for 2.25. Also, since 2.25 was not licensed under the GPL, you don’t have to worry about potential copyright problems if you publish an .exe file. No one even claims that 2.25 games are GPL’ed. On the other hand, many of the newer features are not available for 2.25, and it still uses the old, less realistic “Sumo” Physics system. It does, however, incorporate the fmod sound system, so you can use more than just .wav files for sound.

If you decide to use 2.25, remember that you can still use newer versions to take advantage of new features (like render baking), and then incorporate those into your 2.25 games (e.g. model in 2.25, open the file in 2.43, render bake, then apply the textures in 2.25). Many times you can work back and forth, saving in one version, then the other without any problems. Always keep a backup copy, though, just in case. If you use Python, don’t use any Python that is not in the 2.25 GamePython API listing (for example, GameLogic.getCurrentScene() does not work in 2.25). Also, armatures work differently in 2.25 (unfortunately). Blender 2.25 is still a pretty powerful game engine, so if you’re worried about people stealing your work, but you still want to use Blender, I’d suggest trying that.

All that said, no one really wants to steal your game, and the harder you fight against it, the less desirable your product will become. Many newer games encourage “modding” by players by giving them access to the game engine and setting up forums for fans to share mods on. These games tend to be more popular than un-moddable games, and they develop a much more loyal fanbase.

Anyway, have a great time making games. Don’t take all the fun out of it by making it all about money, and don’t be rude to us by asking questions so that we can help you learn, then locking your games so that we can’t learn anything back from you.

Edit: I hadn’t read what MagicMyshu said before I wrote that last part. Anyway, we’re here to be a community and help each other.

2nd Edit: I almost forgot to mention, Blender 2.25 also has a full-featured web plugin for IE and Netscape, and a non-official plugin for Firefox and some sort of Linux and FreeBSD plugins.

One picture of my game is used for my profile picture. (next to my name). I will also try to upload more pictures now.
I also plan on making my game freeware but I would pefer to keep my game hidden.

Currently my game uses 0% python. But I am making a “true homing attack” script and a “reset rotation of other object” script. I plan on destributing all my python scripts I make and some logic brick. I would, however, like to protect my models and a few bits of logic brick. I don’t really think anyone “currently” on the blender forum would steal my models, but I was more conserned about people in the future or outside the blender forums.

Well think about it, if anyone uses your model, the whole community would know and then we’d all throw feces at him for stealin from you!

Also, you can set up your blend to close as soon as you exit playing the game. That would make it a bit more difficult to modify - maybe not to append though…

Ok, I finally got some pics uploaded. Here they are:
The game ran (on my bad 1Ghz prossesser) about 15 fps. I tried it on one of the schools 1.8 Ghz prossesser and it ran about 30 fps.
http://www.freewebs.com/c106delta/mcp5.jpg
http://www.freewebs.com/c106delta/fffff.jpg
http://www.freewebs.com/c106delta/grind.jpg

whoa, looks like you can teach me more than a few things about blender lol

nice - people would know it was your model and so they really -couldn’t- get away with stealing it.

I’m not sure if this is copyright violation though - someone may sue you lol

Sonic the Heghog is legal to use in fan games as long as I don’t sell the game.

There is an even bigger reason that I need to encyript the game. Have you ever heard of Sage? It stands for “Sonic Amateur Game Expo” Dozens of Sonic fan games (mostly 2D) are entered in the competion every few years, not for money but for the people.
The next competion will go down in history as the next generation of fan games. Because of the new 3D fan games being made. If I complete “Sonic Action” (name of my game) It will become the first 3D Sonic Fan Game in history.
This competion will also help blender greatly. Two other games Sonic games I am competing with are Sonic GL and Sonic Origens(Links are below). Both of these games are using the new 3D Studio Max. If Sonic Action can keep up with Sonic GL, or even beat Max Studios, Blender will be declared the best Game engine of the year for beating with some of the strongest $600 game engines.
http://www.bosser-jerome.com/
http://www.sonicbr.net/

This is why I kept my game secret for 5 mouths. This is why I need to Encrypt my game. This is no longer a simple game engine, it is a part of history that will effect the world.

lol I knew you were hiding something bwhaahahaha

Hey that looks pretty good! I’m a huge fan of Sonic games, especially the old ones. If you need some help, I’ll be available after March 1st =) Send me a pm if you’re interested.

Wow nice!

The texturing on the models is good, also the models are great, but the texturing on the landscape isn’t so good, it looks to stretched and doesn’t really fit in with the nicely textured models, you should maybe spend a little time touching that up.

This isn’t exactly encrypting, but there are a couple of things that you can do to make your files harder to open and edit.

Keeping people from accessing your .blend file

I dunno if this really will suite your purposes, but what the heck:

NOTE: make sure you do this to a copy of your .blend !

Select your camera and click on the scripts button (looks like a sheet of paper). Enable ScriptLinks and click NEW, then go ahead and hit text.
Go to the text editor and select text as your file. Then type this:


import Blender
Blender.Quit()

Save your file, exit, then open it again, and it should just quit on its own.

The game is still in it’s beta form, and many textures will be redone.
I have tried this script before. The game can easily be appended, or have the script edited.
I need to find a safe way to protect my game and I think my best shot is encrypting it. If I can’t encrypt the game or find a way to protect it, I sadly can’t release it. This is because of “Sage”(Sonic Amateur Game Expo).

C-106 delta, I have one request: delete the part where you reveal the weakness of the script. It is best for only forum members to know the weakness, because any web surfer could come across your post and the usefulness of the code will be rendered totally moot. It’s not that I don’t trust the forum, it’s that I don’t trust the web.

he just doesn’t want his competition to gain access to his models - it’s not us or the Sonic laymen that he is worried about lol

what a conundrum

I guess I can sympathise.

The workaround to that technique is mentioned elsewhere on this board. In fact, when that method was first suggested, it was broken in days. You could also use blender -y, and besides, if you opened the file in a hex editor the scripts would be visible in virtually plaintext anyway.

C-106:
You might want to try encrypting the blend file, and then writing some kind of a bootstrap exe that decrypted it at runtime. Alternatively, you could encrypt the individual objects and scripts etc, and then write some kind of a python script to decrypt them. Something like blowfish encryption may work (there are examples in a bunch of languages). Alternatively, if you moved over to some other game engine like crystal space, that might offer you the protection you need- but that would be potentially a lot of work.