What is the FIRST step for creating TSE solution?
by Eric Fleming · in General Discussion · 08/23/2006 (7:00 pm) · 9 replies
I am a longtime C++ programmer who has recently purchased the Torque Shader Engine. I took the Boot Camp. I understand much of what Torque is capable of.
But man, I'm having a hard time understanding one basic thing: how the heck do you get a new project started? My project will definitely require a bit of a C++ engine (ie, it's not just a bunch of script connected to the existing engine). Do I add my code directly in with the Torque Shader engine?
In the past, I would have an engine that was a big old static library you could link with your code. When an update came, the static libe would change, and you'd link the new libe in with your code, which is kept in a separate place (clean! tidy!). But Torque seems to have its main() in the TSE. There's this class called DemoGame, and my instinct would be to create my own Game class and replace DemoGame with it (the map2dif project does this). But DemoGame seems to do a LOT of stuff, and I don't want to debilitate the entire engine by replacing it. Nor do I want to write a new Game class which dupes a lot of that functionality. I don't even feel comfortable subclassing it, since it has a main() built in, and the Game global is being set in the base class GameInstance constructor (meaning we'd need virtualness to get the proper main()). Of course, I could just use their main(), but that's not what the map2dif project does, which suggests to me it's not what is intended (of course, map2dif does not use much of that complex functionality in DemoGame).
So what do I do? Bite the bullet and add my game code directly to the engine project? Try to get the lib to build, subclass DemoGame and place my game code elsewhere? Leave DemoGame as is and build it along with my game specific source project while using the static lib version of TSE (I've been trying to do this, but am still getting tons of link errors)? What did you all do?
But man, I'm having a hard time understanding one basic thing: how the heck do you get a new project started? My project will definitely require a bit of a C++ engine (ie, it's not just a bunch of script connected to the existing engine). Do I add my code directly in with the Torque Shader engine?
In the past, I would have an engine that was a big old static library you could link with your code. When an update came, the static libe would change, and you'd link the new libe in with your code, which is kept in a separate place (clean! tidy!). But Torque seems to have its main() in the TSE. There's this class called DemoGame, and my instinct would be to create my own Game class and replace DemoGame with it (the map2dif project does this). But DemoGame seems to do a LOT of stuff, and I don't want to debilitate the entire engine by replacing it. Nor do I want to write a new Game class which dupes a lot of that functionality. I don't even feel comfortable subclassing it, since it has a main() built in, and the Game global is being set in the base class GameInstance constructor (meaning we'd need virtualness to get the proper main()). Of course, I could just use their main(), but that's not what the map2dif project does, which suggests to me it's not what is intended (of course, map2dif does not use much of that complex functionality in DemoGame).
So what do I do? Bite the bullet and add my game code directly to the engine project? Try to get the lib to build, subclass DemoGame and place my game code elsewhere? Leave DemoGame as is and build it along with my game specific source project while using the static lib version of TSE (I've been trying to do this, but am still getting tons of link errors)? What did you all do?
#2
The Game Programmer's Guide to Torque: Under the Hood of the Torque Game Engine (GarageGames S.) by Edward F. Maurina III
This book will help alot with TSE eventhow its for TGE alot of the features are the same and the ones that are different are in the TDN.
08/23/2006 (10:19 pm)
Buy the book there are example for Torque Script in it. The Game Programmer's Guide to Torque: Under the Hood of the Torque Game Engine (GarageGames S.) by Edward F. Maurina III
This book will help alot with TSE eventhow its for TGE alot of the features are the same and the ones that are different are in the TDN.
#3
Actually, you don't need to make a new project. Use or Copy the demo. Make a backup of course.
08/23/2006 (11:05 pm)
@Eric FlemingActually, you don't need to make a new project. Use or Copy the demo. Make a backup of course.
#4
So if I'm understanding these responses correctly, when you all create a new project, you simply copy the entire TSE/TGE tree over to a new location and add a new folder for your game specific scripts. No changes to 'DemoGame'? No recompiles of the code? Nothing in C++? That's how they did Marble Blast?
08/24/2006 (10:30 am)
I have the Maurina book and have read it, but it didn't answer this fundamental question to my satisfaction. It focused solely on TorqueScript. I'm still not convinced that I can do everything I need to do simply using script, though.So if I'm understanding these responses correctly, when you all create a new project, you simply copy the entire TSE/TGE tree over to a new location and add a new folder for your game specific scripts. No changes to 'DemoGame'? No recompiles of the code? Nothing in C++? That's how they did Marble Blast?
#5
As has been said, most studios will simply check out a new copy of the base code and modify from there. Any changes you make that seem to be appropriate for other future projects, you could push back into your main branch, but it's rare to be changing things at the fundamental levels of DemoGame, NetInterface/NetConnection and the like--one of the primary reasons it isn't covered even in the Commercial Boot Camps.
08/24/2006 (11:38 am)
@Eric: Yes, it's very very unusual to be down at the level of code you are looking at. Of course, it's possible to subclass DemoGame if you have some very extensive changes to make (things like P2P play, or something similar), but you honestly just need to focus on getting a mission set up and subclassing some of the higher classed objects (player, item, what have you).As has been said, most studios will simply check out a new copy of the base code and modify from there. Any changes you make that seem to be appropriate for other future projects, you could push back into your main branch, but it's rare to be changing things at the fundamental levels of DemoGame, NetInterface/NetConnection and the like--one of the primary reasons it isn't covered even in the Commercial Boot Camps.
#6
So Marble Blast did not have any C++ in it at all? It was done entirely in TorqueScript? Including physics?
If there was C++, where did it go? Was the engine treated like a static libe, or was the C++ compiled into the engine exe directly?
08/24/2006 (1:40 pm)
Hi Stephen,So Marble Blast did not have any C++ in it at all? It was done entirely in TorqueScript? Including physics?
If there was C++, where did it go? Was the engine treated like a static libe, or was the C++ compiled into the engine exe directly?
#7
From there, the engine does the rest--::processTick() is called on the class, with a move struct from the client as appropriate, and the simulation does all the work.
Can't talk about much more in a public forum, but we can continue this conversation in the private forums (and email--I'm working on them tonight!).
08/24/2006 (2:26 pm)
Most projects (including MBU) will simply add new classes to the c++ project, recompile the executable and then instantiate those classes by the normal method. In MBU, the marbles are simply new ShapeBase derived objects (GameBase was skipped due to not needing most of it's functionality), and then instantiated with script via the new command.From there, the engine does the rest--::processTick() is called on the class, with a move struct from the client as appropriate, and the simulation does all the work.
Can't talk about much more in a public forum, but we can continue this conversation in the private forums (and email--I'm working on them tonight!).
#8
Thanks!
08/30/2006 (12:08 pm)
That's what I thought... Is there a preference where to put these files? IE, which folder? I'm currently adding new C++ stuff to engine/game/ in a new folder for my game specific stuff... I realize this is fairly unimportant, but I was just curious...Thanks!
#9
In the future please direct these types of questions to the Private TSE Forums.
08/30/2006 (5:25 pm)
@Eric - yeah, that's what I do.In the future please direct these types of questions to the Private TSE Forums.
Torque Owner Christopher Harris
I'm not sure if TSE users get access to TGE documentation, but you really want to look at the documentation for TorqueScript and using the World Editor to modify your projects, known as 'missions' (In TSE world editor can be accessed by hitting F11).
Uh i hope that helps a little