Jump to content

some questions on torque scripting


Zarosath

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Oh yeah i remember hearing about that zip archive fix! I assume that is still on the GG site? I'll have to take a look at that, I wonder if it will be compatible with GNU/Linux and Mac being in zip format.. :) Thanks. Another way going about this could be client-side script checksums from within the c++ part of the engine.


I can definitely see how this open script issue can be a big turnoff to some but with the server/client architecture it does at least offer some level of security benefits combating that which brings up another small issue about the way T3D is presented, It would seem to me that the stereotype of T3D being geared towards making multiplayer first/3rd person type shooters does have some merit in my opinion despite its multi-genre capabilities, I think that was a bit debated in the past by potential torque users? Its just something I've noted.


I suppose the greatest appeal of torque for me is that these things fit my goals almost perfectly except i have a client/server openworld sandbox rpg in mind like a few already here.

Edited by Zarosath
Link to comment
Share on other sites

Well no wonder torque works with scripting, I knew it was based off tribes but i did not realize it has remained quite the same in a sense, According to wikipedia,

Both Tribes and Tribes 2 were designed to be highly modifiable by players. A scripting language built into the Torque Game Engine has allowed prospective "modders" to alter many aspects of gameplay

https://en.wikipedia.org/wiki/Tribes_2#Community



Anyway i'll stop bringing this thread up, I just find it fascinating in knowing more about the engine by knowing its history, its no coincidence torque seems so ideal for my goals now with knowing this, It carries many of the same game philosophies i have in mind. XD

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...