Game Development Community

How to release game - delete what?

by Andy Hawkins · in Torque Game Engine · 05/26/2007 (6:55 pm) · 6 replies

I want to submit the skeleton level to a games comp. What do I need to delete or rather what should remain to make it exportable/playable and not possible to edit without some sophisticated level of knowledge.

Basically what are the steps required to release a TGE game to the public?

#1
05/26/2007 (9:03 pm)
In my opinion, there are 3 levels of distribution differentiated by levels of security. In other words, how air-tight do you want to make your game so as to not allow modification.

Files to Keep:
  • Any .dll files compiled from the engine (OpenAL.dll, etc)[li]Executable (demo.exe)[li]Assets for game (textures, .dts, .mis, etc)[li]Game scripts depending on your folder hierarchy and level of security
Lowest, quickest level:
  • Compile all scripts to .dso format[li]Delete the .cs files and keep the .dso files[li]Delete the example\creator folder[li]Remove the keybindings for F11 and F10
Medium Level:
  • Perform all the steps listed in Lowest Level[li]Remove the engine files associated with the editors (ie WorldEditor.h/.cc, GuiEditor.h/.cc[li]Recompile engine for an editor free executable
High Level, more work
  • Perform all the steps from Lowest and Medium level[li]Secure archive your assets and implement compression/decompression of said archives to protect them
Highest Level, most work
  • Perform steps from Medium and High Level[li]Port scripts back into engine, thus removing all possibility of scripting and hacking[li]Recompile engine with all game play and scripts added in

One other thing I might recommend is packaging your game using an install maker or MSI. Not only does this make distribution easier, but also more professional looking. When my company releases its games, we are most likely going to go with the Medium or High Level, because performing the Highest Level requires a serious amount of work and knowledge of the engine inner workings.
#2
05/26/2007 (9:28 pm)
Great write-up Michael.

I'd like to add something for the sake of educating people as to the dangers of taking short cuts.

One problem with the "Lowest, quickest level" is that even when scripts are compiled in the DSO format it's still possible to easily reverse engineer some things - because of the save/load system.

For example, let's say I downloaded a demo of someone's game that included the FX pack. They secured their game with the "Lowest, quickest level". All I'd need to do is open any of the related DSO files with a text editor and look for names of all the components that make up the particle effect.

E.g. here's a small portion of the bulletImpact_dirt.dso
ParticleData
[b]BulletDirtSpray[/b]
dragCoefficient
0.997067
windCoefficient
1
gravityCoefficient
3.49939
inheritedVelFactor
0
constantAcceleration
lifetimeMS
800
lifetimeVarianceMS
32
spinSpeed
spinRandomMin
-120
spinRandomMax
120
useInvAlpha
animateTexture
framesPerSec
textureName
~/data/textures/effects/dirt
Great, I've got the texture path and name and more importantly the name of the first particle datablock. Now all I have to do is run the game and type this into the console:
bulletDirtSpray.save("stolen/bulletImpact_dirt.cs");
Keep repeating those steps for all particle data and eventually you end up with the complete .cs script for bulletImpact_dirt.dso. If their game doesn't have the console enabled, I can simply move the DSO file into my Torque environment, execute it in the usual manner and add a function to my scritps:
function steal(%filename)
{
   %path = "stolen" @ "/" @ %filename @ ".cs";
   %filename.save(%path);
}

One problem with the "Medium Level" final step is that someone can just replace the executable with a default one - meaning the editors are back in town. Some functions (custom source code) will be lost but usually not enough to stop you from entering the game and running the editors.

To keep a long story short, if you really need to protect your assets and code take the steps Michael points out in the higher levels of security.
#3
05/27/2007 (12:33 am)
Great thanks guys. I will go with medium to high security. Nice work :)
#4
05/27/2007 (3:02 am)
I would also mention that you might want to disable the console.

Not many games are going to need it and it does give the user a lot of power as Tim pointed out.
#5
05/27/2007 (2:25 pm)
Just to let you know - if you are "into" Torque - and if you can gain the access to Console or "modifying" key-bindings - it's easy to perform one single operation - to call:
rootGroup.save("./dumpOfGame.cs",false);
This command will save EVERYTHING loaded in engine, includeing all GUI's, all datablocks, etc. So.. If you release a game you need to be sure to remove (from engine / EXE):
1. script compiling functionality ( .cs -> .dso )
2. anything related with editors/console
And, another suggestion - try to get intro DSO compilation and saving of DSO files. Change the structure of DSO file a bit. So, even someone will try to replace config.cs.dso (or similar file with binding to "forbidden" command) ) with their own "Torque"-compiled DSO file - your version will not load it and fail.

There are many other options, but all of them requires a knowledge of c++ and TAP basics.
#6
05/27/2007 (3:47 pm)
In some ways this dumpOfGame is a stupid thing to put in the engine, but I guess it's good for the originator it they lost all their source.