some questions on torque scripting

Scripting questions, discussions, etc
  • 1
  • 2
13 posts Page 1 of 2
Zarosath
Posts: 11
Joined: Thu Jun 18, 2015 5:02 am
  by Zarosath » Sun Jun 28, 2015 3:00 am
Edit: i suppose this could have been put into the torquescript section, sorry :) perhaps somebody can move the thread.

Hi! I'm somewhat new to the community, i bought torque3d years back around 2011 when it went on sale for $100 (Excellent value) and have been lurking around since really, I've dreamed of one day making 'that dream game' like many but through age and life problems I've held off on it for all this time.

i don't exactly know why i've been loyal to torque over other engines but i do feel it is a very ideal setup in terms of quick development and of course the scalability involved with the source/licensing, it would also seem to be well suited for beginners who are working on first/third person worlds on the server/client model, unity and other alternatives leave a sour taste in my mouth for some reason.. whether its scalability, licensing or suitability for beginners and indies looking for expandability, I've just avoided them in preference for torque.


the question
see, I'm perfectly content to try torquescript, however, i would like to make my game very extensible/interchangeable by perhaps allowing access to certain parts of the pre-made gameplay scripting but not entire access if possible, not only that, users would probably be far more familiar with a general language like c# than they would torquescript.

DotNetTorque and the 'Omni' engine seem to be decent possibilities at first glance but my dilemma on that is that the main userbase and support seems to be with torquescript.

do you have any tips on how i can go about this and is the torquescript in a released project open like java? to some that would seem to be undesirable.
buckmaster
Steering Committee
Steering Committee
Posts: 321
Joined: Thu Feb 05, 2015 1:02 am
by buckmaster » Sun Jun 28, 2015 7:06 am
@ Zarosath I've moved it for you. While I can't really give you a full answer, here's some reading for you on the subject. In short, it'll be tough.
is the torquescript in a released project open like java?
Not sure what you mean by this. Clarification please?
Zarosath
Posts: 11
Joined: Thu Jun 18, 2015 5:02 am
by Zarosath » Sun Jun 28, 2015 8:18 am
much appreciated for a response so soon.

java source code gets compiled into bytecode for the java virtual machine to run and although this bytecode is not human-readable, there exists decompilers to construct a variation of the code function

i was just wondering if the torquescript portion of the game could be read and altered to the end user as easily as looking in the torque game's install folder and finding the torquescript files the engine reads from.
Duion
Posts: 1319
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Sun Jun 28, 2015 10:29 am
The script part is the harder part of the engine, the editor is very comfortable in comparison.
I've tried the C# implementation, but the performance increase was not that big, in many cases it was even higher. I would not use C# anyway since Torque's advantage is that it is open source and you may get problems with that if you integrate half-proprietary parts.
If you are considering about scripting alternatives think of lua for example it is also MIT license and would be perfectly compatible with Torque.
However scripting alternatives are not in the near future I think, so don't bother too much with it.
Why don't you just start and invenst a few days into Torque, then you can see what you are dealing with.
But I tell you, without prior knowledge in programming it will be a long hard road to make a real good game with Torque if you need a lot of functionality. Visual scenes can be build very fast on the other hand.
buckmaster
Steering Committee
Steering Committee
Posts: 321
Joined: Thu Feb 05, 2015 1:02 am
by buckmaster » Sun Jun 28, 2015 1:43 pm
@ Zarosath TorqueScript can be compiled into bytecode like Java, in the .cs.dso format. You need to enable that by commenting out this line in your project's torqueConfig.h
LukasPJ
Site Admin
Posts: 409
Joined: Tue Feb 03, 2015 7:25 pm
 
by LukasPJ » Sun Jun 28, 2015 3:45 pm
Little unsure about what you're trying to accomplish, actually sounds like you want to run a TorqueScript sandbox, in which only some functionality is available (such that users can't cheat, but can mod) is this correct?
If so, then it can be a little complicated.

If you just want people to be able to alter the TorqueScript, then that is certainly possible, by just releasing the un-compiled script files along with the game.

If you want people to be able to extend the code with new scripts, you should look into the "packages" functionality, and just auto-exec all scripts in some folder. So whenever a player adds a new folder with some scripts, then those scripts will get loaded. You have to get a little creative with doing it in a proper way though.

Also, a pretty good page for learning TorqueScript: http://wiki.torque3d.org/wiki:_scripter-start
Zarosath
Posts: 11
Joined: Thu Jun 18, 2015 5:02 am
by Zarosath » Sun Jun 28, 2015 10:32 pm
Back in the day i used to be a sort of beginner in java with Runescape private servers haha.
Over the years i've also been able to have fair success with minor edits in html/css/php and the blitz basic engine, It is the c++ that seems a bit daunting to me but i am looking forward to seeing how far i can go with a project.

I suppose i was a little vague. Regarding the TorqueScript sandbox that is in a sense what i was aiming for but the package idea does sound viable, Thanks for the tip.

So to clarify, TorqueScripts cannot be 'decompiled' easily? I actually would prefer it not for my purposes, despite my goal of user modifications.

i was also wondering what the possibility of running lua scripts as well along with TorqueScript would be?
buckmaster
Steering Committee
Steering Committee
Posts: 321
Joined: Thu Feb 05, 2015 1:02 am
by buckmaster » Mon Jun 29, 2015 12:50 am
TS is already 'sandboxed' to use only the functions that the engine provides, so if you make a console method to perform some damaging action then that's on your head ;P. TS also prevents you from accessing paths outside the game root folder by default.

I imagine decompiling a DSO isn't the hardest thing in the world, but it's not easy, no.
doc
Posts: 17
Joined: Thu Feb 05, 2015 9:14 am
by doc » Mon Jun 29, 2015 12:51 pm
I didn't tested this out, but seems it can get decompiled: https://github.com/figment/Untorque but you can see how it gets decompiled and make your game "incompatible" with Untorque.
rlranft
Posts: 305
Joined: Thu Feb 05, 2015 3:11 pm
 
by rlranft » Tue Jun 30, 2015 3:21 pm
I think it might be a good idea to split your "core" scripts and your "modifiable" scripts into two folders (sort of like they are now, with game/core and game/scripts - but more along the lines you're discussing). Then apply the zip filesystem fix and place all of your "core" scripts in a zip filesystem, and leave your "modifiable" scripts in the regular filesystem. That way there is just a package that "magically" gets loaded that the end-user doesn't have obvious access to and several scripts that they obviously do have access to (and can modify).

Note - this is not "secure." It's not going to stop a moderately determined person from messing with things. I'm not sure it's worth the time and effort to really try to "hacker-proof" stuff most of the time - I know I don't have unlimited time and resources, so I choose to spend my time making the game fun instead of trying to defeat every possible cheat and hack. Someone who is determined WILL break anything you can create.
  • 1
  • 2
13 posts Page 1 of 2

Who is online

Users browsing this forum: No registered users and 3 guests