Game Development Community

How to compile game w/o editor?

by amaranthia · in Torque Game Builder · 02/06/2008 (9:18 am) · 12 replies

Well, I'm back again. Grimm's did really well, and I've decided to make my next game w/Torque again. This time around, I want to work directly in the code and not use the level editor. At this point, I can do this pretty easily, but there is one thing that I don't know how to do:

How do I build my scripts without using the game editor? I've seen a project with a "no editor" option, but I'm not sure how to use it...

Thanks!

#1
02/06/2008 (2:49 pm)
Hi Amanda, good to see you're back to using TGB. No editor?! Blasphemy.

So are you asking about building a finished game, or just testing your scripts during development? I'll try to answer both.

All the "build game" feature does is copy your compiled scripts and assets to another directory. So you can simply use your file browser and copy the TGB directory to another directory. Run the game and delete the .cs files, leaving the .DSO files. Also delete the tools folder and other unnecessary files..

To run your game without the editor you can simply copy the exe and dlls from your tgb\gameData\T2DProject to your game root directory. That is, the same directory where your common, game, and resources folders reside. Then you'll have to manually run the exe every time you want to test your scripts.
#2
02/06/2008 (10:51 pm)
Hey Joe, this looks great! I shall test it tomorrow. ^_^
#3
02/10/2008 (11:52 am)
I didn't even know you could build scripts from within the level builder. I use torsion to edit scripts. If you make a 'new project' from the editor, and choose to copy the executable into the project, you can run the game without the editor by opening that executable. Also, from within torsion you can go to debug>debug game or debug>run game without debugging. I do all my development from scripts. Of course I haven't read any documentation on torque for basically 2 years, so I'm going to have to check up on all these newfangled features and "behaviors" :)

If you haven't tried the debugging features of torsion they are really great. You can set breakpoints and check variables or set conditional breakpoints to break when a value reaches a certain amount.

Have fun =)
#4
02/10/2008 (1:17 pm)
I can't agree more on learning how to use Torsion effectively. Personally, I never ever use the "play" button from the level builder unless I am doing a very basic change to an art asset and want a super quick glimpse of what it will look like.

The benefits of breakpoints, precompile of scripts, watches, callstack tracing, and so much more are worth the 45-90 minutes (depending on your expertise and experience) to figure out your own personal workflow with Torsion.
#5
02/10/2008 (3:13 pm)
Curious Stephen, do you use behaviors at all in your TGB projects?
#6
02/10/2008 (8:09 pm)
To be fully honest, I do almost all learning prototypes (hehe..keeping up with all of our engines all of the time takes a lot of practice!) that never make it to completion, and behaviors are best served by well thought out designs and pre-planning (or, as a conversion from existing design that's been fully prototyped) in my workflow.

I'm always thinking to myself, "ok, if I finish this, it would be done as behaviors that did this, that, and this", but I don't normally make it to that stage.

I probably do need to re-engineer my learning workflow and focus on a behaviors oriented approach to be honest!
#7
02/11/2008 (10:28 am)
Thanks for sharing Stephen. I was just curious because my workflow is probably the complete opposite of what you recommended with Torsion. I only use Torsion for the pretty colors it gives my text, the occasional text auto-completion, and the find and replace function.

Then I constantly use the "play" button in the level builder since it automatically recompiles all behaviors I am editing or writing in Torsion to test in game.

I don't know if I should feel bad that I'm not getting full usage out of Torsion but so far I am really enjoying how easy it is to encapsulate simple game logic within different behaviors and to tweak the gameplay in the TGB editor.
#8
02/11/2008 (10:47 am)
It's definitely an integrated process--here's my general workflow:

--prototype out a basic scene in Level Builder
----create some template objects (I'm a big fan of them), mostly setting up class and SuperClass fields in the way I -think- they may work out.

--open up project in Torsion
----this means a couple of things:
------have to have copied the executable when you first created your project in TGB, or copy the exectuable from over to the correct place in
------check to make sure the properties are set for the executable. Should be ok as default unless you may have created a custom exe. The "make project" function in the level builder does a couple of things that the build process itself doesn't, like renaming your executable, and generating a .torsion file to look for that executable.
--test run, just to make sure I see my scene

--pick a particular group of features, create a new TorqueScript file to hold those features, implement.
----refer to the Level Builder to make sure my namespaces (name, class, superclass) are all coordinated, synchronize as appropriate.
--run from Torsion, see what happens (guaranteed to get typos, logic flaws, etc).
----IF I was using behaviors, this is where I'd need to go back, restart Level Builder to load in the new behaviors, and then edit properties as required. Even if I was using behaviors however, I personally would still use Torsion as my primary "runner", since I'm pretty much guaranteed to have code flaws, and Torsion is the best tool for troubleshooting and debugging those flaws.

--enhance scene as appropriate for either fleshing out current feature set, or prepping for next cycle of feature development

Iterate!

To me personally, (and this is not an "official GG position" or anything, it's just my perspective), both the Level Builder and behaviors are best used at the "production" point of your game's life cycle. Neither really allow me to be more efficient or effective creating my first level (which is what a programmer focuses most of his time on in pre-production), but once the programming is out of prototype, the Level Builder, especially with well exposed behaviors, becomes a productivity multipler.
#9
02/14/2008 (10:09 am)
I am *absolutely* loving all of the changes that have been made in the newest versions of TGB and the Torison editor.

Fabulous, fabulous, fabulous!!!
#10
02/14/2008 (11:21 am)
Good to hear Amaranthia :)

Been playing around with it a lot recently myself (prepping for an upcoming boot camp), and liking it a lot myself. A few rough edges of course, but the flow and capabilities are really nice.

If you haven't messed with Behaviors at all, I would highly stress learning them. While they don't necessarily make development of programming logic more efficient, they certainly will make level building much easier :)
#11
02/14/2008 (5:21 pm)
Behaviours are high on my list... as soon as I've cleaned up my auto menu generator. :D
#12
02/14/2008 (7:20 pm)
What's up!?

I'm wanting to use behaviors, but currently I'm working out all the player movement -- functions used only by the player. I can't seem to see the benefit in using behaviors for the player, with more than 500+ lines of code that I have working now. However, I look forward to uses the modular behaviors with creating many different types of enemies and what not.

Amaranthia,

Do you mind letting us in on your upcoming game? I'd totally understand if you want to keep it under wraps, sometimes I have a hard time explaining my future games to random people! ;)