A day in the C++ life of T2D
by Smaug · in Torque Game Builder · 04/02/2005 (9:09 pm) · 60 replies
So, you're not content with a TScript-driven Torque2D. You want to have code run the show. You want to have TScript as helpers, not masters.
But, of course, the design is working against you. There's no interface for it. If you want to do this, you're going to have to hack the code in order to make it possible.
So, where does this go? That's what we're going to explore; the C++ internals of T2D's initialization and game loop. Note that I have not yet attempted to create a functioning T2D using an alternate initialization sequece or from adding additional elements to the game loop. This discussion is for how the standard T2D loop works with discussion as to which steps load/run scripts and where the user might best insert code.
Obviously, it all starts in main() (found in, if you're using Windows, platformWin32/winWindow.cc). However, this function does rather important initialization (and deinitialization) stuff that you'd probably do well to not touch. The next step is an abstract class (yay!) called "GameInterface".
It is an abstract class, but it is also a class that has functionality. It provides "Journal" functionality; you can read more about this in the comments to "gameinterface.h". It is not important for our needs.
What is important are the virtual functions of GameInterface. Specifically:
The real C/C++ main() function does initialization and then calls the global GameInterface object's (called "Game") main() function. No scripts have been loaded; only the most basic setup has been done. There isn't even a game window yet. It is GameInterface::main() that is expected to handle all the significant initialization, like creating a game window and so forth.
The standard T2D build comes with a derived and fully implemented child class of GameInterface called DemoGame. We will be using this implementation as a basis for user-defined implementations.
DemoGame is declared in game/demogame.h, but the definitions are all in game/main.cc.
The very first thing that DemoGame::main() does is call initLibraries(), a static function that does what it says. If it returns 0, then it failed.
After this, the next big step is running the global function initGame(). It takes the same arguments as main(), and it's job, among a few other things, is to run the user-specified startup script. This is clearly a step that should be avoided/ignored if the user is wanting to build the game from code rather than script. However, initGame() does some other things as well, like calling Sim::init(). I haven't investigated this step, but from a cursory glance, I wouldn't suggest not calling this function. It also creates an action map named "GlobalActionMap". It is up to you whether or not you care about this.
Now, we enter the main game loop. As such, if you want to do some code initialization before this (perhaps something like what your TScript would do in the setupT2DScene() function), feel free. Though the initGame stuff should probably happen first, so that the simulation is ready. In later looks at initializing T2D manually, I'll be walking through TScripts to emulate what they do in C++.
Here's the main game loop code in question:
<Why do we have this silly character limit? Posts with sentences are good.>
But, of course, the design is working against you. There's no interface for it. If you want to do this, you're going to have to hack the code in order to make it possible.
So, where does this go? That's what we're going to explore; the C++ internals of T2D's initialization and game loop. Note that I have not yet attempted to create a functioning T2D using an alternate initialization sequece or from adding additional elements to the game loop. This discussion is for how the standard T2D loop works with discussion as to which steps load/run scripts and where the user might best insert code.
Obviously, it all starts in main() (found in, if you're using Windows, platformWin32/winWindow.cc). However, this function does rather important initialization (and deinitialization) stuff that you'd probably do well to not touch. The next step is an abstract class (yay!) called "GameInterface".
It is an abstract class, but it is also a class that has functionality. It provides "Journal" functionality; you can read more about this in the comments to "gameinterface.h". It is not important for our needs.
What is important are the virtual functions of GameInterface. Specifically:
virtual int main(int argc, const char **argv); virtual void postEvent(Event &event); virtual void processEvent(Event *event); virtual void processMouseMoveEvent(MouseMoveEvent *event); virtual void processInputEvent(InputEvent *event); virtual void processTimeEvent(TimeEvent *event);
The real C/C++ main() function does initialization and then calls the global GameInterface object's (called "Game") main() function. No scripts have been loaded; only the most basic setup has been done. There isn't even a game window yet. It is GameInterface::main() that is expected to handle all the significant initialization, like creating a game window and so forth.
The standard T2D build comes with a derived and fully implemented child class of GameInterface called DemoGame. We will be using this implementation as a basis for user-defined implementations.
DemoGame is declared in game/demogame.h, but the definitions are all in game/main.cc.
The very first thing that DemoGame::main() does is call initLibraries(), a static function that does what it says. If it returns 0, then it failed.
After this, the next big step is running the global function initGame(). It takes the same arguments as main(), and it's job, among a few other things, is to run the user-specified startup script. This is clearly a step that should be avoided/ignored if the user is wanting to build the game from code rather than script. However, initGame() does some other things as well, like calling Sim::init(). I haven't investigated this step, but from a cursory glance, I wouldn't suggest not calling this function. It also creates an action map named "GlobalActionMap". It is up to you whether or not you care about this.
Now, we enter the main game loop. As such, if you want to do some code initialization before this (perhaps something like what your TScript would do in the setupT2DScene() function), feel free. Though the initGame stuff should probably happen first, so that the simulation is ready. In later looks at initializing T2D manually, I'll be walking through TScripts to emulate what they do in C++.
Here's the main game loop code in question:
while(Game->isRunning())
{
PROFILE_START(MainLoop);
Game->journalProcess();
Net::process(); // read in all events
Platform::process(); // keys, etc.
TelConsole->process();
TelDebugger->process();
TimeManager::process(); // guaranteed to produce an event
PROFILE_END();
}<Why do we have this silly character limit? Posts with sentences are good.>
#22
Also, as an FYI, TGE 1.4 starts the new "component" architecture style, and one of the first implementations is exactly what you are talking about: an iTickable component that can be attached to any c++ object and receive ticks.
In any case, I think that this argument has been gone over from both sides many, many times. Feel free to use T2D and the other TAP platforms as you like, but do realize that re-writes of underlying execution flow and style certainly aren't going to be easy to support if/when you run into issues.
04/08/2005 (2:04 pm)
Feel free. Nothing personal, but why spend all this time worrying about inner structure when you could be spending the time making games? :) And to be quite honest, no, what you say isn't true: you can create -anything- in C++. Just mimic the functionality of your script. Think about it: the underlying console has to be able to interpret your byte-code compiled scripts so that they can do what they do, right? Then obviously ALL of the functionality is available at the c++ level.Also, as an FYI, TGE 1.4 starts the new "component" architecture style, and one of the first implementations is exactly what you are talking about: an iTickable component that can be attached to any c++ object and receive ticks.
In any case, I think that this argument has been gone over from both sides many, many times. Feel free to use T2D and the other TAP platforms as you like, but do realize that re-writes of underlying execution flow and style certainly aren't going to be easy to support if/when you run into issues.
#24
Nothing personal, but I'm making a game of size here. This isn't a little tech demo, a primitve side-scrolling shooter, or a Tetris clone; this is a large-scale game here. I'm going to make mistakes, and when I do, I'm going to need to be able to debug them. This means breakpoints, putting watches on variables, sometimes even putting breakpoints on variables. Not having these abilities will merely make the development process take longer.
Also, T2D isn't finished. It has missing functionality and incomplete functionality. Giving a single object multiple collision volumes is not possible, so I have to emulate this functionality, as well as change how collisions are detected (and responded to) among the different collidable pieces. This almost necessitates having a specialized conglomerate object that handles scene object duties, but is not actually a scene object derived class.
I'm quite surprised and baffled by the resistence that GG Associates have towards a non-script driven solution to development.
04/08/2005 (2:33 pm)
Quote:Nothing personal, but why spend all this time worrying about inner structure when you could be spending the time making games? :)
Nothing personal, but I'm making a game of size here. This isn't a little tech demo, a primitve side-scrolling shooter, or a Tetris clone; this is a large-scale game here. I'm going to make mistakes, and when I do, I'm going to need to be able to debug them. This means breakpoints, putting watches on variables, sometimes even putting breakpoints on variables. Not having these abilities will merely make the development process take longer.
Also, T2D isn't finished. It has missing functionality and incomplete functionality. Giving a single object multiple collision volumes is not possible, so I have to emulate this functionality, as well as change how collisions are detected (and responded to) among the different collidable pieces. This almost necessitates having a specialized conglomerate object that handles scene object duties, but is not actually a scene object derived class.
I'm quite surprised and baffled by the resistence that GG Associates have towards a non-script driven solution to development.
#25
implies that Tscrip can only be used for little games or tech demos... quite the contrary... Tribes and Tribes 2 were majorly Tscript... those are far from little tech demos, in fact they're probably at a scale you will never reach, no offense because I probably wont either, not saying you wont, but realistically by yourself you probalby couldn't push the scale of a game like Tribes/ 2 ... plus there are ways to debug script...
I like what you doing, in the fact that you doing what you think is best for you. Though if you make incorrect assumptions they will be commented on and I think Stephen isnt the only one who thinks your are making incorrect assumptions... I'd suggest you re-evaluate some of the statements about Tscript since some are incorrect
04/08/2005 (2:55 pm)
Smaug... so far I have disagreed with what your doing (at least for me) but if its what you want to do then you can, thats why you have the source... thoughQuote:
Nothing personal, but I'm making a game of size here. This isn't a little tech demo, a primitve side-scrolling shooter, or a Tetris clone
implies that Tscrip can only be used for little games or tech demos... quite the contrary... Tribes and Tribes 2 were majorly Tscript... those are far from little tech demos, in fact they're probably at a scale you will never reach, no offense because I probably wont either, not saying you wont, but realistically by yourself you probalby couldn't push the scale of a game like Tribes/ 2 ... plus there are ways to debug script...
I like what you doing, in the fact that you doing what you think is best for you. Though if you make incorrect assumptions they will be commented on and I think Stephen isnt the only one who thinks your are making incorrect assumptions... I'd suggest you re-evaluate some of the statements about Tscript since some are incorrect
#26
Stephen has done a heavy ammount of C++ modifying... he was working on destructable terrain in Torque 3D... from what I understand got it working over the network even...
C++ has a place Tscript can't replace, but vice versa is true...
why fight it :) though you have every right to
04/08/2005 (2:57 pm)
It's not resistence its realization from a lot more experience with Tscript than you have...Stephen has done a heavy ammount of C++ modifying... he was working on destructable terrain in Torque 3D... from what I understand got it working over the network even...
C++ has a place Tscript can't replace, but vice versa is true...
why fight it :) though you have every right to
#27
And I'm quite surprised that someone with less than a month and a half's experience with a platform that has been around (I'm talking TGEScript, not T2D specifically) is so resistant to accepting the fact that if you buckle down and actually look at what we are talking about, you'll see that you can do everything you want to do.
You can implement every single lick of functionality you ever want in C++, and either use the console to simply start up your game and load guis (or hell, if you are that focused on your technique, you can even reimplement the entire gui structure in C++ as well), and then hand execution back to the c++ classes, or simply short circuit the console entirely.
What you don't realize is that we (as a community) have this discussion every 3-5 months, with the exact same questions, critiques, complaints, and hard-headedness that this discussion has had. Every time, the same points are made on both sides, every time the people that want to use Torque as an SDK wind up saying "I'll do it my way", and are then never heard from again.
Meanwhile, those that take the time to look at things from a different perspective, drawing from the experience of the rest of the community, and most importantly follow through on that experience are publishing and selling games. I've yet to see someone treat Torque as an SDK and publish a game in the more than a year I've been in the community, not to mention the past 4-5 years of Torque itself. I've seen dozens of games, some making it all the way to award winning status (Dark Horizons:Lore, Rocketball to name just two) as commercially selling products, that were willing to adapt their design and development methodology to use the strenghs, and balance out the weaknesses of TAP.
04/08/2005 (3:30 pm)
Quote:I'm quite surprised and baffled by the resistence that GG Associates have towards a non-script driven solution to development.
And I'm quite surprised that someone with less than a month and a half's experience with a platform that has been around (I'm talking TGEScript, not T2D specifically) is so resistant to accepting the fact that if you buckle down and actually look at what we are talking about, you'll see that you can do everything you want to do.
You can implement every single lick of functionality you ever want in C++, and either use the console to simply start up your game and load guis (or hell, if you are that focused on your technique, you can even reimplement the entire gui structure in C++ as well), and then hand execution back to the c++ classes, or simply short circuit the console entirely.
What you don't realize is that we (as a community) have this discussion every 3-5 months, with the exact same questions, critiques, complaints, and hard-headedness that this discussion has had. Every time, the same points are made on both sides, every time the people that want to use Torque as an SDK wind up saying "I'll do it my way", and are then never heard from again.
Meanwhile, those that take the time to look at things from a different perspective, drawing from the experience of the rest of the community, and most importantly follow through on that experience are publishing and selling games. I've yet to see someone treat Torque as an SDK and publish a game in the more than a year I've been in the community, not to mention the past 4-5 years of Torque itself. I've seen dozens of games, some making it all the way to award winning status (Dark Horizons:Lore, Rocketball to name just two) as commercially selling products, that were willing to adapt their design and development methodology to use the strenghs, and balance out the weaknesses of TAP.
#28
I don't think it's a TorqueScript VS C++ fight, it's only that we'd lke to have TScript AND C++ ready to make fast game developpements.
Actually, only TorqueScript is really helpfull, but i think it is not enougth.
04/08/2005 (3:32 pm)
Quote:why fight it :) though you have every right to
I don't think it's a TorqueScript VS C++ fight, it's only that we'd lke to have TScript AND C++ ready to make fast game developpements.
Actually, only TorqueScript is really helpfull, but i think it is not enougth.
#29
04/08/2005 (3:36 pm)
Stephen Zepp> Yep, i'll check all that, thanks! ^^
#30
04/08/2005 (3:36 pm)
Completely understood Joel... though you have that already :) the C++ and TorqueScript communicate with eachother quite well... and quite easily... in fact on the T2D functions Melv named the C++ counterpart the same, so very easy to identify
#31
You can implement any functionality you like in C++.
Please, read that again!
People add new c++ classes to Torque applications ALL the time. The entire class ancestry is designed to allow this. What you need to keep in mind is that TAP is a fully developed simulation, not an SDK. It's simply not designed to be used as a library, but if you buckle down and figure out how the simulation works, then you will see that you can do just about anything you want in c++ as long as you operate with the concept of a simulation in mind.
04/08/2005 (3:37 pm)
Guys, please! Listen to what we are saying closely.You can implement any functionality you like in C++.
Please, read that again!
People add new c++ classes to Torque applications ALL the time. The entire class ancestry is designed to allow this. What you need to keep in mind is that TAP is a fully developed simulation, not an SDK. It's simply not designed to be used as a library, but if you buckle down and figure out how the simulation works, then you will see that you can do just about anything you want in c++ as long as you operate with the concept of a simulation in mind.
#32
Admittedly, that was a bit of hyperbole on my part. Though I would point out that Tribes and T2 are both almost entirely multiplayer games. AI decision making simply doesn't exist. The script for the game consists only of responding to events. Which is perfectly fine for a multiplayer game.
However, for single player games, where the experience is dictated by the quality of AI, an event-based strategm isn't entirely appropriate.
I don't see how that is true. Games have been made for years before the advent of TScript.
Yes, TScript has a function; it has a purpose. However, it is hardly indispensible. You can concieve of writing games without a scripting language, though for games of significant complexity, I wouldn't suggest it.
I don't understand where that statement is coming from, because nobody is debating that statement. This is only touched on in the sense that T2D does not make it easy or obvious how to do things like add your own code to the game loop or how to skip the default DemoGame initialization stuff while still initializing the things that T2D needs in order to function.
Which I would call a design flaw. A flaw that I am attempting to correct.
The point of using it as a library is to make it easier to have multiple T2D projects without having multiple T2D installations. Plus, you separate out what are fundamental T2D engine changes from your own code. It's an organizational issue; I'd want T2D as a library even if I were only using C++ to expose objects to TScript. That way, I have a separate T2D engine that I'm not cluttering up with my own code.
04/08/2005 (4:05 pm)
Quote:implies that Tscrip can only be used for little games or tech demos... quite the contrary... Tribes and Tribes 2 were majorly Tscript... those are far from little tech demos
Admittedly, that was a bit of hyperbole on my part. Though I would point out that Tribes and T2 are both almost entirely multiplayer games. AI decision making simply doesn't exist. The script for the game consists only of responding to events. Which is perfectly fine for a multiplayer game.
However, for single player games, where the experience is dictated by the quality of AI, an event-based strategm isn't entirely appropriate.
Quote:C++ has a place Tscript can't replace, but vice versa is true...
I don't see how that is true. Games have been made for years before the advent of TScript.
Yes, TScript has a function; it has a purpose. However, it is hardly indispensible. You can concieve of writing games without a scripting language, though for games of significant complexity, I wouldn't suggest it.
Quote:You can implement any functionality you like in C++.
I don't understand where that statement is coming from, because nobody is debating that statement. This is only touched on in the sense that T2D does not make it easy or obvious how to do things like add your own code to the game loop or how to skip the default DemoGame initialization stuff while still initializing the things that T2D needs in order to function.
Quote:What you need to keep in mind is that TAP is a fully developed simulation, not an SDK. It's simply not designed to be used as a library
Which I would call a design flaw. A flaw that I am attempting to correct.
The point of using it as a library is to make it easier to have multiple T2D projects without having multiple T2D installations. Plus, you separate out what are fundamental T2D engine changes from your own code. It's an organizational issue; I'd want T2D as a library even if I were only using C++ to expose objects to TScript. That way, I have a separate T2D engine that I'm not cluttering up with my own code.
#33
an akwardly enough Melv (before he started on T2D) was working on a game called "Strategem" in Torque... someone is working on an MMORPG in Torque, they're in Alpha... its a Massive Multi and Single player RPG with both identical Multi and Single player modes...
and until you have tested using Tscript to fully test what your saying it isn't appropriate for then you truly cannot make claims...
why can't you do that now...? seperate files... seperate folders even, your own classes off of the base classes... I really don't see this "flaw"...
04/08/2005 (4:12 pm)
Torque was designed with using Torque Script in mind, that is why Tscript has a place... your not coding an engine from scratch, your using an already existing one...an akwardly enough Melv (before he started on T2D) was working on a game called "Strategem" in Torque... someone is working on an MMORPG in Torque, they're in Alpha... its a Massive Multi and Single player RPG with both identical Multi and Single player modes...
and until you have tested using Tscript to fully test what your saying it isn't appropriate for then you truly cannot make claims...
Quote:I have a separate T2D engine that I'm not cluttering up with my own code.
why can't you do that now...? seperate files... seperate folders even, your own classes off of the base classes... I really don't see this "flaw"...
#34
OK. That doesn't really mean anything, in and of itself. What matters is how much TScript are they using, and which things are being done in C++ as opposed to TScript.
Did you miss my point on multiple T2D projects? It creates an explicit distinction between the one or more tool-based executables (perhaps driven by TScript, and loading specific TScripts from specific files on activation. The primary difference between these and unmolested T2D is that these remove the ability for the user use -mod or -game options) and my game's personal executable.
04/08/2005 (5:11 pm)
Quote:someone is working on an MMORPG in Torque, they're in Alpha... its a Massive Multi and Single player RPG with both identical Multi and Single player modes...
OK. That doesn't really mean anything, in and of itself. What matters is how much TScript are they using, and which things are being done in C++ as opposed to TScript.
Quote:why can't you do that now...? seperate files... seperate folders even, your own classes off of the base classes... I really don't see this "flaw"...
Did you miss my point on multiple T2D projects? It creates an explicit distinction between the one or more tool-based executables (perhaps driven by TScript, and loading specific TScripts from specific files on activation. The primary difference between these and unmolested T2D is that these remove the ability for the user use -mod or -game options) and my game's personal executable.
#35
For me, T2D already has way too much C++ in it. I'd prefer the simulation, graphics, and CLR-type interface as the only things in low-level code, and have the simulation call scripting via the CLR so that we could drop any scripting language we wanted into our games without hosing the calls from the T2D core.
I can definitely see why Melv would prefer putting the bulk of the code in c++, though. I can't imagine doing any large-scale work with torquescript. Typeless scripting languages are a sinkhole for development time without strong development tools. Once those tools are in place, though, productivity goes through the roof. I don't have any experience with Lua, but I've written multiple 10K+ line applications in Perl and PHP, and it would have been impossible without the plethora of debuggers, profilers, optimizers, etc. that are out there. Of those two languages, I'd prefer to embed PHP because it was designed to be embedded as an engine controlled by a "higher" application. It's also a lot easier to teach people :-)
Anyway, continue on fighting the good fight. I'm going to crawl back into my hole and continue tinkering :-)
04/08/2005 (6:48 pm)
Very interesting discussion so far :-)For me, T2D already has way too much C++ in it. I'd prefer the simulation, graphics, and CLR-type interface as the only things in low-level code, and have the simulation call scripting via the CLR so that we could drop any scripting language we wanted into our games without hosing the calls from the T2D core.
I can definitely see why Melv would prefer putting the bulk of the code in c++, though. I can't imagine doing any large-scale work with torquescript. Typeless scripting languages are a sinkhole for development time without strong development tools. Once those tools are in place, though, productivity goes through the roof. I don't have any experience with Lua, but I've written multiple 10K+ line applications in Perl and PHP, and it would have been impossible without the plethora of debuggers, profilers, optimizers, etc. that are out there. Of those two languages, I'd prefer to embed PHP because it was designed to be embedded as an engine controlled by a "higher" application. It's also a lot easier to teach people :-)
Anyway, continue on fighting the good fight. I'm going to crawl back into my hole and continue tinkering :-)
#36
It'll probably make me simultaneously a friend and enemy to everyone here but I really don't see how it helps anyone to take this thread much further.
What really matters here is that everyone involved has got a choice to develop their products as they see fit. The source-release has at least enabled that.
Whether any project will result in a win will depend on a combination of so many factors, not least the choice of script/c++. Primarily, the time, motivation and skill for any team or individual is a huge factor in development or products.
The decision of going to a pure C++ approach does have benefits but also comes with major hurdles as the application 'size' gets bigger.
The correct individual/team with the correct tools can get over these hurdles and many applications are created each year without any form of scripting; games are no exception.
With that said, the role of scripting should not be demoted and provides many avenues for the developer that ordinarily would be difficult to go down. Providing configurable aspects to artists, 'mod' abilities for game fan, reducing the need for recompilation/linking, quick turnaround when developing pure game-logic, cross-platform decentralising/modularisation of code and many other aspects.
All this is pretty obvious stuff to everyone here so I'm preaching to the choir but I thought I'd just try to stop the rock from rolling down the hill.
Each to their own for their own purpose.
- Melv.
04/09/2005 (6:45 am)
I don't want to get caught-up in discussions like this because they can become quite time consuming and demotivating in themselves.It'll probably make me simultaneously a friend and enemy to everyone here but I really don't see how it helps anyone to take this thread much further.
What really matters here is that everyone involved has got a choice to develop their products as they see fit. The source-release has at least enabled that.
Whether any project will result in a win will depend on a combination of so many factors, not least the choice of script/c++. Primarily, the time, motivation and skill for any team or individual is a huge factor in development or products.
The decision of going to a pure C++ approach does have benefits but also comes with major hurdles as the application 'size' gets bigger.
The correct individual/team with the correct tools can get over these hurdles and many applications are created each year without any form of scripting; games are no exception.
With that said, the role of scripting should not be demoted and provides many avenues for the developer that ordinarily would be difficult to go down. Providing configurable aspects to artists, 'mod' abilities for game fan, reducing the need for recompilation/linking, quick turnaround when developing pure game-logic, cross-platform decentralising/modularisation of code and many other aspects.
All this is pretty obvious stuff to everyone here so I'm preaching to the choir but I thought I'd just try to stop the rock from rolling down the hill.
Each to their own for their own purpose.
- Melv.
#37
The problem is that when points like that are made, those with lesser experience come along, take everything said as the absolute truth and only way to do things, and get quickly lost, because for them, the decision points are most likely not appropriate.
As long as everyone currently, as well as those that read this post (and others) in the future realize that there is a general implementation/design technique that T2D is put together to support, and then there are other implementation techniques that can certainly be used with T2D with a little work, I think that everyone will be best served!
04/09/2005 (7:51 am)
Amen Melv. Quite honestly, the only reason I participate in discussions like this is for those that come in after the fact and read the discussion all at once. Smaug is obviously an extremely resourceful and experienced developer, and is making educated decisions and observations about how he wants to use T2D.The problem is that when points like that are made, those with lesser experience come along, take everything said as the absolute truth and only way to do things, and get quickly lost, because for them, the decision points are most likely not appropriate.
As long as everyone currently, as well as those that read this post (and others) in the future realize that there is a general implementation/design technique that T2D is put together to support, and then there are other implementation techniques that can certainly be used with T2D with a little work, I think that everyone will be best served!
#38
But to create an entire complex game totally in script is a bit daft. You have the full on debugging/profiling/etc capabilities of whichever ide you're using (say visual studio), why not use it?
If you created a whole game, including game ai, etc etc using script taking up thousands upon thousands of lines, and you have a bug in it, without a decent debugger, way of stepping through source, looking at contents of variables, etc.. yer screwed!
And if your ai routines prove to be a system hog, how the hell do you profile it?
Hell, at the moment if there is a compile error on one of the scripts, its a pain in the backside to find out which line is wrong for starters!!!
I appreciate what has been done in T2D and what is being done, but i want to take what's been written and put my own stuff to it, using proper oo-design.
i.e. by using c++ i can take advantage of inheritence for my baddies, and similar... but no point getting into all that.
I've got maximum respect to smaug for what he's posted above, i've been busy the last few weeks, and now im ready to start coding properly.. Smaug has enabled me to hit the ground running.
Cheers mate! If yer ever in my part of the world, we'll have to grab a beer together... In the meantime i'll see what i can do with the info you've given me and i'll get back to you if i have any questions.
04/09/2005 (8:36 am)
My 2p is that scripting is great for very high end stuff, like triggering a baddie when something happens, etc etc.But to create an entire complex game totally in script is a bit daft. You have the full on debugging/profiling/etc capabilities of whichever ide you're using (say visual studio), why not use it?
If you created a whole game, including game ai, etc etc using script taking up thousands upon thousands of lines, and you have a bug in it, without a decent debugger, way of stepping through source, looking at contents of variables, etc.. yer screwed!
And if your ai routines prove to be a system hog, how the hell do you profile it?
Hell, at the moment if there is a compile error on one of the scripts, its a pain in the backside to find out which line is wrong for starters!!!
I appreciate what has been done in T2D and what is being done, but i want to take what's been written and put my own stuff to it, using proper oo-design.
i.e. by using c++ i can take advantage of inheritence for my baddies, and similar... but no point getting into all that.
I've got maximum respect to smaug for what he's posted above, i've been busy the last few weeks, and now im ready to start coding properly.. Smaug has enabled me to hit the ground running.
Cheers mate! If yer ever in my part of the world, we'll have to grab a beer together... In the meantime i'll see what i can do with the info you've given me and i'll get back to you if i have any questions.
#39
I think this is a bit of a problem right there.
This is fine as long as Smaug is around and willing to answer people's questions about this. But what if he's not? People will start turning to Melv and others asking how to do things in ways the engine wasn't necessarily designed for.
I'd rather not see Melv's time spent on things like that. There are much more important things to be done with T2D (not to mention the guy's got a family :)
[edit]This is pretty good example of the problem[/edit]
04/09/2005 (8:53 am)
Quote:i'll see what i can do with the info you've given me and i'll get back to you if i have any questions.
I think this is a bit of a problem right there.
This is fine as long as Smaug is around and willing to answer people's questions about this. But what if he's not? People will start turning to Melv and others asking how to do things in ways the engine wasn't necessarily designed for.
I'd rather not see Melv's time spent on things like that. There are much more important things to be done with T2D (not to mention the guy's got a family :)
[edit]This is pretty good example of the problem[/edit]
#40
I know what im doing.
Besides, just because it's not waht you want to do with it.. doesnt mean it's not right.
And Im booogered if im gonna try to debug/optimise a game which has been written predominantly in complex script anyhows.
Script is fine for beginners.. it's fine for controlling high level functionality (and indeed you'd be stupid not to), but it's blooming stupid to try to create a whole game in it....
Besides.. as a professional, i'd NEVER take on an engine without knowing roughly how the underlying engine worked at a code level... Who knows, i might want to improve stuff at a later date too (directx 7 .. yuck!)
04/09/2005 (8:59 am)
LOL.. Im a professional programmer..I know what im doing.
Besides, just because it's not waht you want to do with it.. doesnt mean it's not right.
And Im booogered if im gonna try to debug/optimise a game which has been written predominantly in complex script anyhows.
Script is fine for beginners.. it's fine for controlling high level functionality (and indeed you'd be stupid not to), but it's blooming stupid to try to create a whole game in it....
Besides.. as a professional, i'd NEVER take on an engine without knowing roughly how the underlying engine worked at a code level... Who knows, i might want to improve stuff at a later date too (directx 7 .. yuck!)
Torque Owner Smaug
You're not quite understanding what he's asking for. Right now, TScript is the only place where you can do things like create GUI's, setup the initial screen, and so forth. As mentioned above, one of the very first things that T2D does is run some TScript.
Instead, he (among others) wants to be able to override this functionality and instead call client code. He wants to get a global "tick" while the game is running on every frame advance. This functionality exists to a limitted degree, but my plan is to make it a real feature of T2D.