Game Development Community

T2D.NET : Upcomming Beta

by Jason Swearingen · in Torque Game Builder · 07/28/2005 (9:28 pm) · 76 replies

UPDATED 09/29/2005: Beta1_IGC version released to the T2D community! Check the resource for details/download!

==================================
UPDATED 08/08/2005: Beta1_Refresh has been released, This allows VisualStudio2003 users to use T2D.NET!

Please post a reply to this thread if you'd like to try the beta. I will email you the download URL.
===========================

Wish you could use C# instead of TorqueScript?

Soon, you will be able to.

If you would like to participate in the current beta (beta1) of T2D.NET (A Wrapper for T2D written in C#) please reply to this thread. The beta will be ready for distribution on or before 07/31/2005. (Still Writing installation instructions and a step-by-step tutorial doc)

-----------

Currently, the Wrapper targets VisualStudio 2003 or 2005, and overwrite a few T2D C++ files during install so backup your SDK dir before you install!

If enough people express interest in easing these requirements for the beta, these changes can be made. but currently these changes are not planned for this beta

-------------

Please refer to the next post for details about the technology. Here is a screenshot:

www.taocorp.com/t2dbeta1/t2d.net.gif
#21
08/03/2005 (2:58 pm)
I'm interested... pjludington aaa ttttt yahoo ddoott com.
#22
08/03/2005 (3:13 pm)
@Mr Phil: mail sent.

============

A quick update: I am currently working on backporting the wrapper to work with .NET 1.1. It is a bit of a pain (a lot of sexyness needed to get chopped to make it work with .NET 1.1) but it looks like I'll be done with that by the end of today.

Even though this change should greatly expand the potential audience, I wont release a new beta until I'm at 100% parity with the next T2D update, which should be released soon.
#23
08/04/2005 (7:00 am)
I am interested as well. Although with my real work schedule being very demanding, it may be a while before I can get around to actually doing any testing. But I wanted to show my support for the work you are doing. I also have some questions for you that I will ask off-line.

c h r i s D O T c h i l d s A T g m a i l D O T c o m
#24
08/06/2005 (12:43 pm)
Hey,

I can test it for you if you want... I'm a C# fan, apart from the fact that its mostly win32 only and the DX support sucks.... And some version problems....
Email it me, or better email a link to: ricky[@]7thentertainment.co.uk
#25
08/06/2005 (12:55 pm)
Jason,

Send me a copy (email in my profile), I have been doing C# dev sense 2003 hit the market..

-Ron
#26
08/06/2005 (1:02 pm)
Sure thing Ricky. Emailing to you now.

=============

Another update:

The backport of T2D.NET to .NET 1.1 was successfull... kinda. The C# to C++ marsheling is unstable! So going forward, T2D.NET will only target .NET 2.x I will however remove all .NET 2.x features (Generics, CLI2, etc) so that upon completion, I can revisit the .NET 1.1 Marsheling issues and if possible, offer a .NET 1.1 version of the wrapper.

All beta testers: If you want to try out the .NET 1.1 version, it can be found at the T2D.NET Beta1 URL I emailed you. If you can figure out the marsheling problems, I would love to hear it. (They seem to repro best around the Torque.T2D.ConsoleFunctions.DotNet_Internal_Utilities.GetSimObjectFromID() call.

-Jason
#27
08/06/2005 (3:21 pm)
Ok, Im also a cheepskate...

But I still managed with the Visual Studio Express Products.... except.... (I dont beleive this is caused by the express products by the way)...

..\engine\T2D\fxSceneObject2D.cc(3744) : error C3083: 'T2D': the symbol to the left of a '::' must be a type
..\engine\T2D\fxSceneObject2D.cc(3744) : error C3083: 'EventsHook': the symbol to the left of a '::' must be a type
..\engine\T2D\fxSceneObject2D.cc(3744) : error C2039: 'Trigger_FxSceneObject2D_OnCollision' : is not a member of 'Torque::Internal'
..\engine\T2D\fxSceneObject2D.cc(3744) : error C3861: 'Trigger_FxSceneObject2D_OnCollision': identifier not found

This happens around:
return Torque::T2D::Internal::EventsHook::Trigger_FxSceneObject2D_OnCollision(collisionStatusPointer);
And I cant find where Torque::T2D is defined...?
#28
08/06/2005 (3:40 pm)
Ok, I'd missed the reference to T2D.NET.... (They were all spangled thanks to using 2 express products).

Its compiling now.... After its finished I'll edit this post. :)
#29
08/06/2005 (3:42 pm)
Ricky, it looks to be the same type of issue I ran into when backporting to .NET 1.1

That being:

in addition to adding a project reference to The Interop and Wrapper dlls, I needed to add a #using on the top of FxSceneObject2D.cc and ConsoleFunctions.cc.

#using   <mscorlib.dll>  //TCMOD
#using "..\example\Torque.Internal.Utilities.Interop.TypeConversion.dll" //TCMOD
#using "..\example\T2DDotNetWrapper.dll" //TCMOD

EDIT: I have resolved all .NET 1.1 backport issues. Going forward I will be supporting both versions of the CLR.
#30
08/06/2005 (3:44 pm)
@Ricky: OK, well if you got it working, I dont recomend using my backport code (at least not yet)

Could you post a quick msg outlining the process you took to get the VS express stuff working? I'm assuming you just have to download C++ and C# Express and it should "just work" but if it's more than that, it would be nice to elaborate :)
#31
08/07/2005 (3:00 am)
Update: T2D.NET is 100% working with .NET 1.1 !!!
I spent the last 14 hours tracking down the bugs, fixing them, and porting back to my main code branch, and now I'm happy to say that all known issues with .NET 1.1 are resolved!

So what does that mean?
It means that Mono will most likely work too! I dont have the bandwidth to look into mono at this point, but going forward I am going to be keeping compatability with .NET 1.1 as a top priority.

So what's next?
My next step is to bring T2D.NET up to 100% feature parity with T2D 1.02. ... more updates then!

-Jason
#32
08/07/2005 (3:39 am)
OK I have an outdated PlatformSDK :(.... So no T2D.Net for me yet...

But anyone who has a stupidly fast internet connection can use the express products by:

Visiting here and downloading both C# Express, C++ Express, DirectX SDK* and Platform SDK*.

*These are available from the C++ Express Page.

NOTE: You will need to edit C:\Docs & Settings\Username\Local Settings\Application Data\Microsoft\VCExpress\VCComponents.dat* to include the platform and dx sdk dirs, search google. (* Windows XP Folder, substitute username for your username)

Open the T2D.Net Solution in C# Express. Click OK on all errors.

Compile Solution. Close C# express.

Open the T2D.NET Solution in C++ Express. Click OK on both errors.

Right click on T2D (C++) and click properties. On common settings fix both the broken references to T2D.NET and T2D.NET_COMMON_UTILS. (Which you have just compiled)

On Configuration Properties -> General enable CLR.

On Configuration Properties -> C/C++ -> Code Generation. Set Runtime Library to /MD.

Compile Solution.

Check in example dir for you new T2D.NET DLLs and T2D.EXE*. :) Have fun. (* Remember that if you compiled them as debug it will be T2D_DEBUG.EXE)

@Jason:

How does that sound ^-^.
#33
08/07/2005 (3:48 am)
@Jason:

Do you plan on removing TorqueScript and replacing it with .net languages? It would be a good idea to use both. And I beleive there is a way to do so...
#34
08/07/2005 (6:18 am)
Jason,

what was the issue and the fix? I was going to look into it this afternoon after Soccer

-Ron
#35
08/07/2005 (12:35 pm)
@Ricky: T2D.NET currently lets you:
1) Write your game 100% in .NET
2) Write your game 100% in TorqueScript (same as regular T2D)
3) Write your game 100% in C++ (same as regular T2D)
4) Any mix of 1, 2, or 3. (Everything works together)

To Elaborate on 4) : An example: You can write your game in .NET, but then if you find an interesting resource (written in TorqueScript) that you want to incorporate, that's 100% doable.

You can do this by using the Torque.T2D.ConsoleFunctions.MetaScripting.Exec() function (to execute TorqueScript files) or by using the Torque.T2D.DotNetSDK.TorqueScript.Execute() function to execute a particular block: (such as
....Execute("echo(\"Hello\");");
this will echo "Hello" to the console.

Disclaimer: I am not at my dev machine now, so I might have the function names slightly wrong, but it is in principle accurate.

===================

@Ron: I sent you an email last night outlining the fix.

I'll paste it again here for everyone's info:
Quote:
it was failing because of a marsheling problem, if I passed a string from c# into C++, and then immediatly converted it into a .NET string, it wouldnt get allocated properly 10% of the time. (weird problem!) I fixed that by creating a temp copy of the string on the stack before creating the .NET string, and also removed the C# to C++ to .NET call entirely, as it was inefficient.

What I meant is:
1) There is a problem with marsheling strings, which I "fixed" by creating a local copy (C++ on the stack) before creating a Marsheling copy (.NET).

2) This particular issue was manifesting most of the time in a function (GetSimObjectFromID()) where i was unnessicarily creating a .NET object the moment I entered the (C++) function. It's a stupid rookie move (IMNSHO) and I should be punished for doing it in the first place :)
#36
08/07/2005 (4:10 pm)
Hmmm... I should have worded that differently... :-/

I believe at the moment T2D.NET doesn't compile .net languages on run-time... It would be nice to have a main.vb or main.js or main.css (New extension to avoid conflicts) or any other .net script file, that is compiled and run during execution.

I say this because of "Automatic Updates". If you were to incorporate an auto updater on 2 large files plus resources it would use unnecessary bandwidth/time. Whereas if it were lots of small files it would be quicker for end users.

======
Also

Has anyone seen T2D.NET crash around these two lines?
glGenTextures(1, &to->texGLName);
   glBindTexture(GL_TEXTURE_2D, to->texGLName);

I keep getting an error about read/write in protected memory :S.
#37
08/07/2005 (4:19 pm)
@Ricky:

For your Scripting question:
I plan on including ".NET Scripting" as an addition, however that's going to be quite a bit further into the future, (like a month or 2) and I will have to make sure certain aspects of the engine are not exposed (legal issues, similar to how you are not supposed to distribute Torqe-specific Torquescript with your games)

But I definatly have that planned.

For your crash question
Are you getting that crash with the CLR1 version of the beta? If so, I already know that it is unstable, and have fixed the problems (but have not distributed it yet). I would strongly recomend sticking with the .NET2 version until I have a chance to square this stuff away (I am still in the process of testing to make sure the .Net 1 interop changes i introduces have more buggy behavior)

If you are getting this problem on the .NET2 version, I would be interested in knowing if you changed anything.. etc.

-Jason
#38
08/07/2005 (4:36 pm)
Firstly, yes, I am using .Net 2.0, and no, I dont *think* I have changed anything. :)

A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
First-chance exception at 0x00000000 in T2D_DEBUG.exe: 0xC0000005: Access violation reading location 0x00000000.
A first chance exception of type 'System.AccessViolationException' occurred in T2D_DEBUG.exe
An unhandled exception of type 'System.AccessViolationException' occurred in T2D_DEBUG.exe

Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

@Jason:

Also, its defaulting to managed code? Except in your files.
#39
08/07/2005 (6:05 pm)
Well I have a sneaking suspicin on this, that what's occuring on your computer is the bug that manifested when I ported to .NET 1.1

What's the bug? The bug is that Pin_Ptr sucks! And marsheling in general is BUGGY. ugh.

So I am modifying my marshel code to manually allocate the memory space needed, rather than trusting .net to do it for me. It looks like this is the answer, but I will post an update later today with more details.

If this proves to be the problem, then I'll update the install binaries and email everyone informing them that the update is available.

-Jason
#40
08/07/2005 (6:23 pm)
I'm quite interested in trying this out (jec at nekocode dot com) as I'm several magnitudes faster at programming in c# than torquescript. I use the latest VS2005 beta btw.