Game Development Community

Kit merging question

by Jonathan Wood · in Torque 3D Professional · 05/05/2009 (1:05 pm) · 20 replies

Well, I own a tard load of Torque resources including ArcaneFX, RTS kit, Tim Aste's stuff combo packs 1 and 2, etc.. Is it possible for me to merge all of my kits into this new Torque 3D thing'a'ma'bob whatcha'jigger so that I can utilize all my neat cool Torque products from one engine?

#1
05/05/2009 (1:13 pm)
possible? Only ones effort and knowledge would be the limiting factor.
#2
05/05/2009 (1:37 pm)
But would I want to apply the effort and knowledge into doing it now while we are still in beta or wait until final? Since I know it will require core code changes.
#3
05/05/2009 (1:53 pm)
If you do not mind re-working multiple times; start now and learn all the tricks involved. After 2 or more times 'porting' code one becomes very skilled at it. It is also a great way to learn the new code base. It can not be stated how much T3D will evolve over the course of time, but that should not stop one from also growing in subject knowledge.
#4
05/05/2009 (2:28 pm)
I totally agree with Caylo. Porting will teach you the most about Torque. Go ahead, and if you're lucky, you don't need to modify stuff again.
#5
05/05/2009 (2:31 pm)
Start now with moving things over and find the potential problem areas. That way you'll have a better understanding of what to look out for when the final release rolls around and you'll spend less time being frustrated then. Content packs will be much easier to port than code kits like AFX or the RTS kit.
#6
05/05/2009 (5:29 pm)
when someone ports teh turret and tank kits please let me know..
#7
05/06/2009 (4:07 pm)
@Edward
Tanks ported


cantanogames.com/misc/storm-tanks-browser.jpg
#8
05/06/2009 (4:08 pm)
@Tim
That's in Torque 3D? Will you be releasing any information on how to port the tank over?
#9
05/06/2009 (4:21 pm)
So we start with the FPS starter kit in Torque 3D and modify that since that is the only projects I can find then right?
#10
05/06/2009 (4:26 pm)
@Jonathan - Press the button which says "New Project" above the Projects pane in toolbox. You might want to implement some of the bugfixes listed here into the "Templates->FULL" directory first.
#11
05/06/2009 (4:28 pm)
@Tek0
Porting was pretty easy, but I've got a heavily modified version of the tank pack that was ported to 1.5, and now to T3D. Additionally, when ported to T3D, I based the thanks off the Vehicle class, instead of ShapeBase, so you can drop everything except tankshape.cc and tankshape.h.

I'll try and figure out everything I had to change from a clean install to give a more detailed description of how to port when I get the chance.
#12
05/06/2009 (5:10 pm)
@Jonathan: The FPS kit is a starter kit more aligned towards a FPS genre type of game. Using the "New Project" generator you can create a project that's a bit more generic in nature by using the Full Template. I think that a barebones "Basic" Template is intended for the final release also.

It's a personal preference to decide from where you want to start your project from. Some people like to build from nothing, others like having a Template in place, most just find a happy medium removing the parts they don't wont and adding others
#13
05/06/2009 (5:30 pm)
Thanks, I will look at each alternative in Torque 3D, I have started to dork with the FPS genre kit that comes with the beta using VS 2008, I have merged in Rakknet trying to get it to talk with Unity at the moment since I own both engines and they use RPC built in from Rakknet. I know Torque has its own network interface but I have a stand alone server built on Rakknet. I would like to see a barebones basic template to start with so that I can put into it what I need and want.
#14
05/06/2009 (5:47 pm)
@Tim
That would be great! I'm wanting to use the tank pack for Torque 3D and would appreciate if you could help me.
#15
05/06/2009 (7:13 pm)
Jonathan,
One of the biggest hurdles you are going to have to overcome with the content packs, (Aste packs) is they were made for tge, so you are going to have to reopen them in constructor and reexport them to tgea or they won't work. (you'll get an error complaining about Invalid st coord)
Good luck.
#16
05/07/2009 (9:53 am)
I have been walking the CPP code in the 2008 project folder and seeing how this thing is laid out when I came across an interesting delima. The way I understand this is that main.cpp in MyProject (name of game for testing), has code for the initial entry way. This is from the Binary for MyProject.exe, so I was like ok where does this go, tracking further it appears that the Torque3D which is a DLL on build has a source/app/net/mainLoop.cpp, now assuming or presuming that this is the actual entry way of the game I see where eventually I have a StandardMainLoop:doMainLoop() now what I would expect this to do is to continue to loop until keepRunning = false, however in the code, the while(keepRunning) is remarked out as such:

// while(keepRunning)
So it never evaluates to anything, so in theory the game will run 1 loop and terminate but it doesn't. Trying to get my kits merged in and not able to find the actual game loop is a pain. I need to have code outside of the main loop that has its own check and balance but I can't find the game loop that itterates until the game is terminated. I thought this would be in the Torque3D source code. Which line in which file is the actual main loop begin point and which line in which file is the actual end of the main game loop?
#17
05/07/2009 (12:26 pm)
Hi Jonathan -

The entry point is in main.cpp, arriving there from the windows shell.

Here is your main loop:

while(StandardMainLoop::doMainLoop());

Regards,
Ken
#18
05/07/2009 (4:21 pm)
Thanks but that is not the contents of main.cpp, the contents of main.cpp is:

#ifdef WIN32
	#include <windows.h>

	extern "C"
	{
		int torque_winmain( HINSTANCE hInstance, HINSTANCE h, LPSTR lpszCmdLine, int nShow);
	};

	int PASCAL WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCommandShow)
	{
		return torque_winmain(hInstance, hPrevInstance, lpszCmdLine, nCommandShow );

	}
#endif

It has taken a while to follow the breadcrumbs of changes in the system core code for the project. the actual game loop from what I can tell is located in:
Torque3D\Source Files\source\platformWin32\winWindow.cpp

In this cpp file is the main loop:
int TorqueMain(int argc, const char **argv)
{
	if (!torque_engineinit(argc, argv))
		return 1;
	while(torque_enginetick()){}
	torque_engineshutdown();
	return 0;
}

From this, the while loop is what runs until the game terminates. I needed to find the real loop. What this does, is through cinterface.cpp returns the result of StandardMainLoop:doMainLoop() which in turn is inside mainLoop.cpp where the original while loop was running. What was apparently happening is at one point that doMainLoop() had the while statement in it for the keepRunning. Now it is just 1 itteration only, in turn returning boolean true back out to cinterface which in turn returns true back out to winWindow.cpp which does the while check so is true, going back through that tick, so there are a total of 4 places to go before we get to the core. main.cpp -> winWindow.cpp -> cinterface.cpp -> mainLoop.cpp

The level that I need is winWindow.cpp, thanks for the info though.
Best regards,
Jonathan



#19
05/07/2009 (9:28 pm)
Doh!

I was looking in the TGEA version of our project...

sorry about that!
#20
05/08/2009 (5:33 am)
Its all good :) They said they rewrote Torque3D from the ground up. I am begining to think this is what TGEA was supposed to be the more I use it.