Wow, amazing how fast time goes by.
by Vince Gee · 03/28/2011 (11:31 am) · 4 comments
Well,
I know I haven't posted in a long time, so to bring ya all up to date, I have been working on a MO(multiplayer Online) engine using the torque engine. It's been under wraps for about a year now and finally the team and I are making progress.
I think it's time to start talking about some of the tech we have invented to make this thing work. The team is quite talented and I believe we will actually finish this one. God knows, we haven't killed each other in a year and we are all still working around the clock on it.
I'm slowly going to start blogging about some of the tech we created to make this thing possible. This blog is going to be about our business layer application programming.
We all know that MOM was light years ahead of everyone when they released their engine that used Python. It allowed a good bit of programmers to seriously shorten their development cycle by simply making calls to Python Dll's.
Well, this was great and all, but I don't know python, I'm a Microsoft junkie. I kept telling my guys, boy this would be so much easier if I could write this routine in CSharp or Vb.net. So after a good bit of work, I figured out how to make Com calls from the engine to managed CSharp DLLs.
But, then I started having problems with matching Type libraries and such up and it became a total nightmare in synchronizing everything.
Then came something I call "DotNetConnect".
Q: So what is this "DotNetConnect"?
A: It's a Out-Of-Process Com+ Handler which allows linkage of UnManaged (Torque) code to interact with Managed Code(VB/CSharp/ETC)
DotNetConnect Allows:
1) write my logic (And database access) in any Dot Net language,
2) handles compiling all of it to DLL's
3) Provides a uniformed method making the objects available to Torque.
So, our game implementation uses MySql, so I built the Dot Net Native Sql Drivers, added them to the references used in "DotNetConnect" and now my scripts can make calls to MySql using MySqlConnection, MySqlCommand etc objects.
To call a dot net program, you simply type : $returnXML = $dnc.CallProgram("Name Of Script","Function",.... up to 20 parameters)
I implemented an XML structure for the return values so I could return complex objects from the Dot Net code. I just use the TinyXML implementation inside the engine to take the data out of the xml and load it into objects inside of torque.
One of the nice things about this is that you can recompile your scripts without restarting the Torque Server. So, if I need to adjust how a script does something, i.e. combat logic etc, I can actually change the script, recompile the script using the $dnc.CompileProgram("Name Of Program"); and then test the process again.
But, as I continued to play with this, I also discovered other goodies this let me do! First, all of the scripts and such can be called using a classic asp call of CreateObject() or using the DotNet version of such.
So my GM Website for managing the database is able to share components used for calculating stuff with the game engine, I don't have to re-write the logic or anything!
Objects can be created in one of three ways,
The first way is a static shared object, all callers of this object will wait in line (Singleton) for the object to become available. Properties set on this object will continue to carry to future calls to the member functions.
The second way is an instanced call. The DotNetConnect will create a new instance of the object you requested and then call the function. You can assign the handle of the object to a object inside torque and re-use it for future calls.
The last way is via Static member functions, where an object doesn't have to be created to call the function.
I'm not sure if anyone else would be interested in this thing, but it was a major accomplishment for me, and really put us on the fast track of development here at Winter Leaf Entertainment!
I know I haven't posted in a long time, so to bring ya all up to date, I have been working on a MO(multiplayer Online) engine using the torque engine. It's been under wraps for about a year now and finally the team and I are making progress.
I think it's time to start talking about some of the tech we have invented to make this thing work. The team is quite talented and I believe we will actually finish this one. God knows, we haven't killed each other in a year and we are all still working around the clock on it.
I'm slowly going to start blogging about some of the tech we created to make this thing possible. This blog is going to be about our business layer application programming.
We all know that MOM was light years ahead of everyone when they released their engine that used Python. It allowed a good bit of programmers to seriously shorten their development cycle by simply making calls to Python Dll's.
Well, this was great and all, but I don't know python, I'm a Microsoft junkie. I kept telling my guys, boy this would be so much easier if I could write this routine in CSharp or Vb.net. So after a good bit of work, I figured out how to make Com calls from the engine to managed CSharp DLLs.
But, then I started having problems with matching Type libraries and such up and it became a total nightmare in synchronizing everything.
Then came something I call "DotNetConnect".
Q: So what is this "DotNetConnect"?
A: It's a Out-Of-Process Com+ Handler which allows linkage of UnManaged (Torque) code to interact with Managed Code(VB/CSharp/ETC)
DotNetConnect Allows:
1) write my logic (And database access) in any Dot Net language,
2) handles compiling all of it to DLL's
3) Provides a uniformed method making the objects available to Torque.
So, our game implementation uses MySql, so I built the Dot Net Native Sql Drivers, added them to the references used in "DotNetConnect" and now my scripts can make calls to MySql using MySqlConnection, MySqlCommand etc objects.
To call a dot net program, you simply type : $returnXML = $dnc.CallProgram("Name Of Script","Function",.... up to 20 parameters)
I implemented an XML structure for the return values so I could return complex objects from the Dot Net code. I just use the TinyXML implementation inside the engine to take the data out of the xml and load it into objects inside of torque.
One of the nice things about this is that you can recompile your scripts without restarting the Torque Server. So, if I need to adjust how a script does something, i.e. combat logic etc, I can actually change the script, recompile the script using the $dnc.CompileProgram("Name Of Program"); and then test the process again.
But, as I continued to play with this, I also discovered other goodies this let me do! First, all of the scripts and such can be called using a classic asp call of CreateObject() or using the DotNet version of such.
So my GM Website for managing the database is able to share components used for calculating stuff with the game engine, I don't have to re-write the logic or anything!
Objects can be created in one of three ways,
The first way is a static shared object, all callers of this object will wait in line (Singleton) for the object to become available. Properties set on this object will continue to carry to future calls to the member functions.
The second way is an instanced call. The DotNetConnect will create a new instance of the object you requested and then call the function. You can assign the handle of the object to a object inside torque and re-use it for future calls.
The last way is via Static member functions, where an object doesn't have to be created to call the function.
I'm not sure if anyone else would be interested in this thing, but it was a major accomplishment for me, and really put us on the fast track of development here at Winter Leaf Entertainment!
About the author
www.winterleafentertainment.com
#2
All joking aside, I am torn on which way to release it. Part of me wants to get something for the endless hours of time I put into it, say X amount dollars, so we can use the money to fund our game.
And the other half of me wants to release it as a free resource so that the community can improve it.
My question is more on the lines of, would it be worth paying for the package if I include sample scripts, a mysql example, XML, etc?
03/28/2011 (1:21 pm)
To be honest I wasn't sure if anyone would even be interested in it, I mean really... who wants to write all their business logic and number crunching and database work in Dot Net when you got Python and TorqueScript?All joking aside, I am torn on which way to release it. Part of me wants to get something for the endless hours of time I put into it, say X amount dollars, so we can use the money to fund our game.
And the other half of me wants to release it as a free resource so that the community can improve it.
My question is more on the lines of, would it be worth paying for the package if I include sample scripts, a mysql example, XML, etc?
#3
03/28/2011 (3:00 pm)
Hey good work!
#4
Well Vince if you want a bit of profit from your labor then expect to support it. A creator will drive his product until the town fool can use it reasonably well. :)
I mean the stuff that survives the GG store purges are additions that are solidly built and maintain. At least the ones I have plunked money into are heh.
But releasing it as free resources has its own rewards. But you know what your work is worth. And there have been some great resources releases lately. But I know that I (personally) don't expect the creator of a free resources to cater to my beck and call if I can't understand something beyond my knowledge or skill set.
that's my two cents.
03/28/2011 (6:57 pm)
IMHO and you did ask :)Well Vince if you want a bit of profit from your labor then expect to support it. A creator will drive his product until the town fool can use it reasonably well. :)
I mean the stuff that survives the GG store purges are additions that are solidly built and maintain. At least the ones I have plunked money into are heh.
But releasing it as free resources has its own rewards. But you know what your work is worth. And there have been some great resources releases lately. But I know that I (personally) don't expect the creator of a free resources to cater to my beck and call if I can't understand something beyond my knowledge or skill set.
that's my two cents.

Torque Owner Chris Labombard
Premium Preferred