Replacing TorqueScript with CSharp
by Vince Gee · in Torque 3D Professional · 02/02/2012 (4:54 am) · 11 replies
I've been spending a lot of time converting Torque to use cSharp instead of TorqueScript as the language used for scripting. (Actually, it doesn't completely replace it, but real close.)
I'm going through the start.fps demo in t3d 1.2 and converting the scripts one by one to csharp, I'm making engine DLL calls for engine function like the ClientGroup object, etc.
Our goal is to get the game down to a point where you would have 2 dll's and a exe. One dll would be torque.dll, yourgamelogic.dll and the torque.exe file. You would also have your artwork folder, but that would be it. Everything else would be rolled into cSharp.
I guess, the point of my post is to ask, if someone made a "Tool" which not only connected cSharp and Torque, but also provided an SDK, documentation etc. as well as the starter.fps completely converted over to cSharp, what would you be willing to pay for it.
What would be a "happy" price that you would be willing to pay for this type of functionality?
(For those linux users out there, yes I plan to have a mono build.)
I'm going through the start.fps demo in t3d 1.2 and converting the scripts one by one to csharp, I'm making engine DLL calls for engine function like the ClientGroup object, etc.
Our goal is to get the game down to a point where you would have 2 dll's and a exe. One dll would be torque.dll, yourgamelogic.dll and the torque.exe file. You would also have your artwork folder, but that would be it. Everything else would be rolled into cSharp.
I guess, the point of my post is to ask, if someone made a "Tool" which not only connected cSharp and Torque, but also provided an SDK, documentation etc. as well as the starter.fps completely converted over to cSharp, what would you be willing to pay for it.
What would be a "happy" price that you would be willing to pay for this type of functionality?
(For those linux users out there, yes I plan to have a mono build.)
About the author
www.winterleafentertainment.com
#2
To answer the question, if I was a C# programmer and had to learn TorqueScript but your product was available instead I'd probably be willing to pay $100~$150 to save myself some of the learning curve. And, as a side note - there are probably a lot more C# programmers than TorqueScript programmers....
02/02/2012 (6:15 am)
If you're going to charge for it, might want to check with the Mono guys.... Recently saw a project turn away from Mac because of Mono license issues.To answer the question, if I was a C# programmer and had to learn TorqueScript but your product was available instead I'd probably be willing to pay $100~$150 to save myself some of the learning curve. And, as a side note - there are probably a lot more C# programmers than TorqueScript programmers....
#3
My goal is to make it where if you know TorqueScript, learning the CSharp mode will be cake since the objects, console functions etc are named the same.
But... just knowing CSharp without any knowledge of how Torque works, would still prove to be a learning curve.
02/02/2012 (6:44 am)
You still need to understand the basic's of TorqueScript, like variable naming constraints, what the object types are etc. I've just basically extracted most console functions you use in torquescript over to a csharp equiv. I also wrote a math helper which gives the same calculations that torque does etc.My goal is to make it where if you know TorqueScript, learning the CSharp mode will be cake since the objects, console functions etc are named the same.
But... just knowing CSharp without any knowledge of how Torque works, would still prove to be a learning curve.
#4
as a student my preferable price will be 30$.
question:
which one will be first c# or torque script?
and
any negative side of using c# over torque script?
02/02/2012 (8:08 am)
that will be nice.i was thinking to try this one(http://www.csscript.net/).but it seems u are going to relief me from that.as a student my preferable price will be 30$.
question:
which one will be first c# or torque script?
and
any negative side of using c# over torque script?
#5
C# will be first (and maybe last)
No negatives yet, in fact I find It runs faster since I'm off loading strings and logic into a separate thread from the actual torque dll.
02/02/2012 (9:33 am)
@Ahsan,C# will be first (and maybe last)
No negatives yet, in fact I find It runs faster since I'm off loading strings and logic into a separate thread from the actual torque dll.
#6
Good luck with it though, and nice job so far!
02/02/2012 (1:13 pm)
I can see the advantages of this, but it kind of defeats the purpose of mod support in games (seeing that most people like to have that now-a-days). I like the concept, but I don't see my development team taking part in it (seeing as mod support is one of the things we hope to implement at a future point).Good luck with it though, and nice job so far!
#7
Did you see this blurb inside of SWIG about C#?:
Not sure it applies to your approach or not, but it sounded like they found some issues with the Microsoft approach of attaching to C# from other code like C++. This right out of the SWIG manual. If you saw or it know about it forget I mentioned it. Can't wait to see what you come up with!
02/02/2012 (1:34 pm)
@Vince,Did you see this blurb inside of SWIG about C#?:
Quote:
18.1 Introduction
The purpose of the C# module is to offer an automated way of accessing existing C/C++ code from .NET languages. The wrapper code implementation uses C# and the Platform Invoke (PInvoke) interface to access natively compiled C/C++ code. The PInvoke interface has been chosen over Microsoft's Managed C++ interface as it is portable to both Microsoft Windows and non-Microsoft platforms. PInvoke is part of the ECMA/ISO C# specification. It is also better suited for robust production environments due to the Managed C++ flaw called the Mixed DLL Loading Problem. SWIG C# works equally well on non-Microsoft operating systems such as Linux, Solaris and Apple Mac using Mono and Portable.NET.
To get the most out of this chapter an understanding of interop is required. The Microsoft Developer Network (MSDN) has a good reference guide in a section titled "Interop Marshaling". Monodoc, available from the Mono project, has a very useful section titled Interop with native libraries.
Not sure it applies to your approach or not, but it sounded like they found some issues with the Microsoft approach of attaching to C# from other code like C++. This right out of the SWIG manual. If you saw or it know about it forget I mentioned it. Can't wait to see what you come up with!
#8
My implementation supports mod'ing. There is the technique in which I connect the two, and then their is the architecture of the solution. The way I architected it, yes you could mod it :)
02/02/2012 (4:34 pm)
@robert,My implementation supports mod'ing. There is the technique in which I connect the two, and then their is the architecture of the solution. The way I architected it, yes you could mod it :)
#9
They are kinda different animals.
02/02/2012 (4:36 pm)
Frank, I'm strictly going CSharp to Torque, (C# to C++) not (C++ to C#)They are kinda different animals.
#10
Maybe I am just daft:
02/02/2012 (5:03 pm)
@Vince,Maybe I am just daft:
Quote:Isn't that what that says? So, does your C# call C++ functions? Or is it the other way around?
The purpose of the C# module is to offer an automated way of accessing existing C/C++ code from .NET languages. The wrapper code implementation uses C# and the Platform Invoke (PInvoke) interface to access natively compiled C/C++ code.
#11
02/02/2012 (5:11 pm)
Oh yeah, sorry kinda deep inside some code atm, we are in the same ballpark :)
Torque Owner Jonajoint
Default Studio Name
as for a happy price.. dunno :p
But generally if something is $50 or less i'll just buy it.
if its more I generally um and ah about it then think nah i'll leave it till next month.. then usually next month never comes.
Not that I don't think it would be worth more, just if it was it would get pushed into the queue of wants.