See Torque6 sharply

6 posts Page 1 of 1
LukasPJ
Site Admin
Posts: 361
Joined: Tue Feb 03, 2015 7:25 pm
 
by LukasPJ » Sat Mar 28, 2015 6:16 pm
Torque6 is cool! It's the bee's knees or, as we say in Denmark, knee-high cress! (True story)
But it's also in its infancy, which means it's small and manageable. Which allowed me to write a IJW layer between C# and Torque6!

I did a port of the few scripts in the AnimatedMeshExample, to C# and deleted the TorqueScript files. And it ran just fine! Wooh!

The project consists of 3 parts:
A C-style interface for the most basic calls from native to managed (C++ -> anything).
An IJW-layer for calls and object implementations written in C++/CLI. (CLI -> C++) (Common Language Infrastructure [CLI] is what C#, IronPython, IronRuby etc. uses)
A very small C# framework, easing some of the syntax, removing boilerplate code and implementing attributes.

Which ofc means that the C#-specific stuff is a very small part of the whole implementation, and any of the CLI languages will work.

What's left to do is finishing and polishing the IJW layer, and in the end, port the whole thing to .NET Core and CoreCLR for Mac and Linux support!

Example code:
  • Main entry point for the exe - Loads up Torque6 and starts the engine.
  • C# / TS - The Main.cs implementation (the entry point for the scripts).
  • C# / TS - The AnimatedMeshExample module scripts
  • C# / TS - The ExampleRoom module scripts

It's not completely done yet, I may change some naming conventions etc, but the overall result is pretty good! I haven't benchmarked yet or anything, but I expect it to be faster than TorqueScript (or else I will optimize it). Theoretically it should be faster.

The syntax is pretty smooth, no boiler plate code and a lot of type information in there, as well as hierarchy information. There isn't a clean version of the project on the repo yet, in time it will get up there :P

Well, that's the end of my show-off.. Thanks for reading!
andrewmac
Posts: 295
Joined: Tue Feb 03, 2015 9:45 pm
 
by andrewmac » Sat Mar 28, 2015 6:44 pm
Looking forward to merging this when it's ready. It will take the form of a plugin and will be optional. The C# written modules can be loaded and used alongside the TorqueScript modules so it's not a full conversion, but support of an additional scripting language. Great work @
User avatar
LukasPJ


Also, we need to change the extension of torquescript files to something other than .cs to avoid confusion. What was the last consensus when this came up? .tsc or something?
HeadClot
Posts: 72
Joined: Sat Feb 07, 2015 1:29 am
by HeadClot » Mon Mar 30, 2015 6:33 am
@
User avatar
andrewmac
- Question here - So the C# integration is a plugin? or am I misunderstanding?
LukasPJ
Site Admin
Posts: 361
Joined: Tue Feb 03, 2015 7:25 pm
 
by LukasPJ » Mon Mar 30, 2015 10:46 am
HeadClot wrote:@andrewmac - Question here - So the C# integration is a plugin? or am I misunderstanding?


Yes it is, it's completely optional and seperate from Torque6 itself.
HeadClot
Posts: 72
Joined: Sat Feb 07, 2015 1:29 am
by HeadClot » Wed Apr 01, 2015 10:44 pm
LukasPJ wrote:
HeadClot wrote:@andrewmac - Question here - So the C# integration is a plugin? or am I misunderstanding?


Yes it is, it's completely optional and seperate from Torque6 itself.


So I take it that it is the same with TorqueScript?
LukasPJ
Site Admin
Posts: 361
Joined: Tue Feb 03, 2015 7:25 pm
 
by LukasPJ » Thu Apr 02, 2015 12:15 pm
HeadClot wrote:
LukasPJ wrote:
HeadClot wrote:@andrewmac - Question here - So the C# integration is a plugin? or am I misunderstanding?


Yes it is, it's completely optional and seperate from Torque6 itself.


So I take it that it is the same with TorqueScript?


No, TorqueScript is native to T2D, and ripping it out is a lot of work. So it's not a plugin but rather a native scripting language.
6 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests