Game Development Community

Scripts Compiled?

by Radgeman · in Torque Game Engine · 05/27/2003 (9:39 pm) · 9 replies

In the category of "As a newbie, I must be missing something..." I know that scripts, by definition, are not usually compiled. It seems that the bulk of a TGE based game/project is written via the scripts. If they are readable by the public, isn't that a bad thing? I mean, even dynamic web pages have server side scripting, which is not available to the public. On the other hand, as a new TGE developer, I think it is great that I can look at the code for Marble Blast. It just seems amazing to me that there is no way to obscure the code once it is ready for publication.

-David

#1
05/27/2003 (9:47 pm)
You can distribute just the compiled script files, the .dso files that are created after you run a game.

All script files get compiled, even the .gui files.
#2
05/27/2003 (9:51 pm)
Also you can put your files into zip files if you want, which keeps casual gamers from snooping and moving their files around so they can't mess stuff up. (There's some discussion of this here: www.garagegames.com/index.php?sec=mg&mod=forums&page=result.thread&qt=10785).
#3
05/30/2003 (7:27 am)
The way I build a "release" (bit of a misnomer, since the game is nowhere near releaseable, heh) of our game is simple:

I run the game, making sure to go to everywhere a script is loaded (this means start a game, load the editors, etc) otherwise not all scripts will be compiled.

Then I run a custom tool that takes the development directory and copies everything to a new directory then zips it. This is config based and will strip out the unneeded stuff (debug builds, uncompiled scripts, psp/psd files, max/ms3d files, etc) resulting in a nice clean copy of the game. The resulting directory will also be zipped up ready for sending to testers. I actually have two configs for it, one builds a release with compiled scripts only, the other builds a release without compiled scripts.

I plan on extending this later to automatically compile all the scripts as well as zip up the mod directories, etc. More important things to work on, first.

It's fairly easy to make a similar system. Basically, it's a recursive copy that ignores certain files based on a config file. I may consider writing a tutorial on it when I have time if there's interest.
#4
05/30/2003 (7:38 am)
@ Radgeman

The scripts are compiled to .dso files, which are not readable (though if you really really want to, you can probably decompile them).

@ Tom

I use a python script for a similar process and a little bit of python code handles execution of the scripts (through the built in telnet-interface of torque) for me, if people are interested in it I can post it in the resources area or on my (currently nonexistant) website. Currently it's a commandline program, but I may give consideration to adding a GUI to it if people would find that usefull.

Jeff Peck
AKA Sanguinus
#5
05/30/2003 (8:07 am)
Jeff,

I hadn't thought of using the telnet interface to do the compiling. I was going to build a command line compiler and run that over each script it comes across. I havent looked into it that much so whether it would work or not I dont know yet.

I used C++ for mine, out of lazyness more then anything. I already had most of the code to do it in my library so it was pretty quick and easy.

Personally, I don't think a GUI is necessary. The command line has the advantage that you can stick it in a Makefile and completely automate the build and release process. Of course its possible to do both a GUI and a command line, but for me its a waste of time. That said, it might help people who arent too used to the command line.

Tom.
#6
07/13/2003 (12:49 pm)
What can one do to prevent hacking of the scripting files? I know you can't really prevent this kind of thing, but how about providing a deterrent?
#7
07/13/2003 (2:36 pm)
Well, decompiling it is pretty tricky - that alone limits the ability of people to modify it sharply.

If you want you can obfuscate it, but basically, there's no point; no matter what you do, people can view it, and even if they can... why is that bad? People read, learn, mod...

It didn't hurt Tribes/Tribes2. Half-life encourages it. Quake and Unreal made businesses off it. Just make it so that people with modded files can't play with others with different files online (which functionality is already in Torque) and you're golden.
#8
07/31/2003 (1:40 pm)
Isn't there a command line arg to make the engine compile ALL scripts? I thought there was...

- Brett
#9
07/26/2006 (6:18 pm)
So,

Has anyone actually created a command-line tool that finds all .cs files in a directory tree and compiles them into .dso files? Any chance they would share?

- Marc