"Console sytem" vs New Engine Export system
by Nathan Bowhay - ESAL · in Torque 3D Professional · 08/09/2010 (10:33 pm) · 5 replies
I noticed when upgrading from alpha to Beta 2 this comment:
What exactly is happening/going to happen. It says from a use standpoint, but what about from the standpoint of someone who makes changes to engine (C++) and script code (TorqueScript). Is there an article about how the old system worked and how the new one does. Why the change is being made... I am guessing for speed and/or usability/organization but not sure.
Any info and/or comments would be much appreciated.
/// Definitions for exposing engine functionality to the control layer. /// /// This file provides a convenience layer around the underlying engine interop system (which at /// the moment still includes the legacy TorqueScript interop a.k.a. "console system"). The /// macros exposed here will automatically take care of all marshalling, value type constraints, /// reflection info instancing, etc. involved in defining engine API call-ins and call-outs. /// /// @note At the moment, this file supplies both the legacy TorqueScript console system as well /// as the new engine export system with the structures and information they need. In the /// near future, the console-based parts will get purged. This will not result in visible /// changes to users of the functionality here except for the string-based marshalling /// functions currently exposed (which will also disappear).
What exactly is happening/going to happen. It says from a use standpoint, but what about from the standpoint of someone who makes changes to engine (C++) and script code (TorqueScript). Is there an article about how the old system worked and how the new one does. Why the change is being made... I am guessing for speed and/or usability/organization but not sure.
Any info and/or comments would be much appreciated.
#2
As I mentioned in the posts I linked above, several side benefits emerged. The two big ones are:
1. True callback system. No longer necessary to use Con::executef(...). You can actually declare and implement callbacks now.
2. True types. You can pass and interpret true types through the new system. Instead of always taking in a Point3F as a string and scanning out the data, you can just take in a Point3F or pass it to script.
There are other subtle improvements, but the system is overall easier to document and work with than the previous ConsoleXXX system.
08/09/2010 (10:51 pm)
The primary reason for the change was for the sake of documentation. We had a huge project to complete (documenting the entire API) and the only way to get that done properly was to implement this new system Rene and Tom worked on.As I mentioned in the posts I linked above, several side benefits emerged. The two big ones are:
1. True callback system. No longer necessary to use Con::executef(...). You can actually declare and implement callbacks now.
2. True types. You can pass and interpret true types through the new system. Instead of always taking in a Point3F as a string and scanning out the data, you can just take in a Point3F or pass it to script.
There are other subtle improvements, but the system is overall easier to document and work with than the previous ConsoleXXX system.
#3
08/09/2010 (10:57 pm)
Thanks for the speedy reply! I will take a look at the links. That is what I figured. The two items you talk about are cool will be interested to see what Rene and Tom came up with and how it all works.
#4
This is a two-part thing. One part is what Michael is describing which is the engineAPI interface that hides the details of how the engine communicates with its "control layer" (TorqueScript) inside the API system and provides a straightforward call-in and call-out interface as well as type system that the engine can use to expose functionality to this layer.
The other part is the interop system itself. What's currently used in Torque 3D is the console system, part of which is responsible for letting C++ code interop with the TorqueScript VM. There are foundational parts for a different interop in the engineAPI contained in Torque 3D but this is not used in the codebase ATM.
Overall, the primary goal with engineAPI was to improve infrastructure for documentation and it only went from there that we used the opportunity inherent in the fact that for this project we needed to go over pretty much any exposed function and method in the engine to separate us from the code's strong dependence on the console interop system.
08/10/2010 (1:48 am)
This is a two-part thing. One part is what Michael is describing which is the engineAPI interface that hides the details of how the engine communicates with its "control layer" (TorqueScript) inside the API system and provides a straightforward call-in and call-out interface as well as type system that the engine can use to expose functionality to this layer.
The other part is the interop system itself. What's currently used in Torque 3D is the console system, part of which is responsible for letting C++ code interop with the TorqueScript VM. There are foundational parts for a different interop in the engineAPI contained in Torque 3D but this is not used in the codebase ATM.
Overall, the primary goal with engineAPI was to improve infrastructure for documentation and it only went from there that we used the opportunity inherent in the fact that for this project we needed to go over pretty much any exposed function and method in the engine to separate us from the code's strong dependence on the console interop system.
#5
@Rene - No doubt I'll be asking you to review the doc before submission, see if anything can be added...for example, what you just posted will be a nice addition to the doc.
08/10/2010 (2:07 am)
He speaks and all should listen =)@Rene - No doubt I'll be asking you to review the doc before submission, see if anything can be added...for example, what you just posted will be a nice addition to the doc.
Community Manager Michael Perry
ZombieShortbus
Rene also uploaded a doc here: EngineAPI.rtf
And I'm converting that doc to be a part of the official documentation, which is going up this week.