[angelscript] Re: One-time compile

  • From: Dennis Bollyn <gyrbo@xxxxxxxxx>
  • To: angelscript@xxxxxxxxxxxxx
  • Date: Thu, 4 Mar 2004 09:46:33 -0800 (PST)

Speed isn't very important, but every bit helps of course. The main thing is 
that I almost always
need to execute a script right after I compile it. This basically means that I 
have to compile and
execute a script in less then 40ms (25fps), which isn't a lot.

It doesn't really have to be secure, I just don't want people to open the file 
and change
something easily. I'm making my game opensource, so exposing the source isn't 
really the problem.
The main issue with encryption is that it's fairly easy to remove once you know 
the key, plus it
slows down the proccess. I'm basically looking for a one-way, non-reversible 
method.

Decompiling a piece of code is pretty much always possible, even for C(++) 
code. The good thing
is, not all information will be reconstructed. I don't know exactly how 
compilation goes, but I'm
thinking variable names will be lost, etc.

I'll look into the TEA encryption, it might be useful for some other things. 
Thanks for the link.

--- Andreas Jonsson <angelcode@xxxxxxx> wrote:
> I think that you will find the compilation speed quite adequate. Unless you=
>  compile scripts each frame I don't think you'll even notice the time it =
> takes.=20
> 
> You would best protect the script code using encryption instead of relying =
> of compiled byte code. With the source code for AngelScript anyone can ea=
> sily write a decompiler to see and modify your code. One encryption algor=
> ithm that I particularly like is the TEA. I have some sample code showing=
>  how to encrypt and decrypt data with it here:=20
> 
> http://www.angelcode.com/dev/tea/
> 
> Of course there are still reasons for wanting precompiled bytecode, such as=
>  file size for example. Saving and loading compiled byte code will be imp=
> lemented one day (by me or another programmer), but it is not very high o=
> n my priority list at the moment.
> 
> Regards,
> Andreas J=F6nsson
> www.AngelCode.com
> 
> -----Original Message-----
> From: Dennis Bollyn <gyrbo@xxxxxxxxx>
> To: angelscript@xxxxxxxxxxxxx
> Date: Wed, 3 Mar 2004 10:35:30 -0800 (PST)
> Subject: [angelscript] Re: One-time compile
> 
> If someone is already working on this, I doubt I could contribute much.
> 
> I'm going to use AngelScript for pretty much all scripting for a game. The =
> funny thing is that the
> current working name is AngelScreams :). The main reason for compilation (b=
> esides speed) for me is
> to hide the actual source and prevent users from modifying scripts.
> 
> Thanks for such a nice scripting language, I was about to use tcl until I f=
> ound this.
> 
> --- Andreas Jonsson <angelcode@xxxxxxx> wrote:
> > It is being worked on by another programmer, and if his solution works to=
>  m=3D
> > y liking I will include it in AngelScript. However, if you are interested=
> =3D
> >  in trying as well that would be ok. Perhaps you and the other programmer=
> =3D
> >  (if he wishes to) can share some ideas or work together.
> >=20
> > For it to work you would have to save the script functions stored in the =
> en=3D
> > gine, and also the system function declarations registered by the applica=
> =3D
> > tion so that at a later time the configuration can be compared with the a=
> =3D
> > ctual configuration at load time. I think it would be suficient to make a=
> =3D
> >  simple check to see if the system functions have been declared in the sa=
> =3D
> > me order (so that call indexes match), and if not the load fails. A more =
> =3D
> > advanced load could try and reorder the call indexes and perhaps check fo=
> =3D
> > r missing functions.
> >=20
> > Regards,
> > Andreas Jonsson
> > Author of AngelScript
> > www.AngelCode.com
> >=20
> > -----Original Message-----
> > From: Dennis Bollyn <gyrbo@xxxxxxxxx>
> > To: angelscript@xxxxxxxxxxxxx
> > Date: Wed, 3 Mar 2004 08:38:02 -0800 (PST)
> > Subject: [angelscript] One-time compile
> >=20
> > Are there are plans for a seperate compiler? Instead of compiling at runt=
> im=3D
> > e, you would compile
> > the script beforehand and only execute the remaining bytecode.
> >=20
> > I have tried looking at the source, but it seems very complex to me. I'm =
> gu=3D
> > essing
> > asCScriptEngine::scriptFunctions has to be dumped to a file?
> >=20
> > I'm willing to work on this, but I need some pointers as where to start.
> > 
> > Thank you,
> > Dennis Bollyn
> > 
> > =3D3D=3D3D=3D3D=3D3D=3D3D
> > 
> > 
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Search - Find what you=3D92re looking for faster
> > http://search.yahoo.com
> > 
> > AngelScript - AngelCode Scripting Library
> > http://www.angelcode.com/angelscript/
> > 
> > 
> > 
> > 
> > AngelScript - AngelCode Scripting Library
> > http://www.angelcode.com/angelscript/
> 
> 
> =3D=3D=3D=3D=3D
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Search - Find what you=92re looking for faster
> http://search.yahoo.com
> 
> AngelScript - AngelCode Scripting Library
> http://www.angelcode.com/angelscript/
> 
> 
> 
> 
> AngelScript - AngelCode Scripting Library
> http://www.angelcode.com/angelscript/


=====


__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you?re looking for faster
http://search.yahoo.com

AngelScript - AngelCode Scripting Library
http://www.angelcode.com/angelscript/

Other related posts: