Game Development Community

Moving from TGB to T2D MIT - Free your mind

by Richard Ranft · in Torque 2D Beginner · 02/20/2013 (12:50 pm) · 5 replies

It seems that many problems that people are running into have to do with the physics and asset system changes introduced in T2D MIT.

These changes require a paradigm shift. You must study and understand the new systems before you can use them effectively. At first this will "feel" awkward or unwieldy, but once you learn the new workflow associated with the asset system or the scale and speed limitations of the new physics system and see how to work with them instead of against them you will find that things will go far more smoothly.

Remember; "Free Your Mind" and let go of the old way of doing things.

About the author

I was a soldier, then a computer technician, an electrician, a technical writer, game programmer, and now software test/tools developer. I've been a hobbyist programmer since the age of 13.


#1
02/20/2013 (4:50 pm)
Richard,

Good comment for any game engine or in the game dev industry in general. Let loose the old ways, embrace the new. It will help you grow!

Remember, we are in an industry that moves at the speed of light, changes come quick. Adapt or be frustrated. This sounds cliche but, it's true.

Ron
#2
02/20/2013 (4:51 pm)
I sorta agree. But I like most people I know Learn from example. That was one of TGB greatest strengths for me. I have never been one of those people who was thrown a project and was able to just look at the source and say oh hey that makes perfect sense. Sometimes I was.. Now .. We have all been using TGB for years and years now. It was great it was fun... there was lots and lots of example code to see how things worked in concept and well as practicality. Jump forward to now .. This New T2D is a beast... I am loving it... But at the same time .. I am lost cause there just are not examples for how somethings work. (Well, there are examples for quite a bit but not for some things, which is where you are seeing the hang ups) I know documentation is coming and has been coming.. but until it does all we have to fall back on is past experience.. Where some things are the same and some things are sorta the same but just enough different to trip you and some things are flat out Nightmarishly different.. So... We have to come here and ask questions..

Example is the physics system. Some of it I have come to terms with and some of it we were sorta thrown the Box2d manual and told now make it work with torque script. Mel's Physics Guide on the wiki answered alot but some just kinda said oh and heres a bunch of functions you can use, with no real examples. I have a copy of that guide printed up and pour over it constantly as I am trying to figure out old vs new.
#3
02/21/2013 (1:55 am)
Don't suffer in silence though Michael. Ask direct questions and I'll give you a direct answer. If there are missing pieces in the doco then that too can be addressed. The physics guide is just that, a guide. Documenting each and every function is where it draws the line as that is reference documentation and even that too is on its way (see here, not pretty but it's a WIP). Additional comments including arguments for each are in the code as well and all 2D types have the script-methods in a separate file like this which I believe helps a little.

Examples of collision shapes, joints, the body properties are everywhere on the Internet because it's just Box2D. The properties are identical, they do identical work ... if that helps.

I wish there were more of the physics examples just like the Box2D test-bed but there just ain't enough hours in the day. Showing joints in action and the different collision shapes as well as how to use the "onCollision()" and "onEndCollision()" callbacks and contact gathering would also be a good addition. They'll come but documentation is the focus now and it takes a long time.

Anyway, feel free to ask.
#4
02/21/2013 (4:48 am)
@Melv - Couldn't have said it better myself.

@All - We're here to help. Post whatever questions you have and we will do our best to drill down on the problems until you are satisfied with the solution. Not only can the posted questions help you get past your problem, but it can lead to new docs, new toys, video tutorials, and more.

Richard's point remains true, though. There are old TGB concepts that must be erased from your memory. Awesome community users are porting old tutorials to the new T2D format, which is going to be a huge help for folks who are migrating.

@Michael - That's why your latest toy submission for the Ninja Platformer is fantastic! I know it was a struggle, but I'm sure you learned a lot about the physics system in the process. Now, other community members can look at that example and see how to achieve similar result. It is much appreciated.
#5
02/21/2013 (11:43 am)
Admittedly, "You must study and understand the new systems" is the sticking point. If you're new to programming then this is very difficult since the best reference for these systems is the engine source itself.

I can tell you from extensive experience (ask Melv, he'll tell you) that my first impulse was to simply "translate" the old methods to the new. Melv had to set me straight more than a few times - as the author of many of the new systems it must have been frustrating for him to watch me flail around like that.... lol! But as I started to see how the new things were intended to work it started to feel more natural.

For many this will be the toughest part. Until people (like you, Michael, and others) start to make more tutorials and examples, and until the documentation matures a bit more, this will be what frustrates the majority of the users out there - both new and old.

The main thing is to resist the urge to put stuff in that makes it work more like the old way. This is going down a path to inefficiency, and poor engine performance is not what we want. It will be far better for all if everyone can make the shift to the new.