Game Development Community

Stupid Newbie Questions... volume 1.

by Joseph England · in Torque Game Engine Advanced · 06/23/2004 (9:55 am) · 7 replies

Hello all,

I am new to TGE and TSE ( well, I've had em for about 5 hours or so :) ) and I had some quick questions that have eluded me so far.

1: I followed the instructions on a page here to setup that Hammer utility, however, it requires a utility called buildwad that is not in the TSE CVS tree I downloaded. Given the changes to the materials in TSE from TGE I am just assuming that the buildwad code is being rewritten to accomodate the new specs... or am I missing something?

2: I don't quite understand what the Hammer utility is for exactly. I mean, I read the info about it on a page here, but I'm still a bit confused. Do you use it to simply create the interiors and buildings that you can then place with the World Builder?

3: How can I launch the World Builder / Mission Editor? It says I need to load a mission, but I cannot figure out how to do that.

4: How do you rotate / pan / zoom the camera when you launch with the -show command line arg? I got the MAX exporter compiled with the 5.1 libs and everything seems to work fine, and I can get my test box exported and I can view it from a single angle... I need to be able to rotate the camera at least so I can see it from different sides though.

5: Why do the models need a collision box and a bounding box?

6: I am fuzzy on the term ghosting... is this just sending an object's skeleton to a client?

Sorry if these are stupid questions.
TIA, DH

#1
06/23/2004 (10:14 am)
1. Wow, Hammer? I'm not sure what documentation you're using, but the recent ones show you how to setup Quark instead of Hammer. I'd check right here. BuildWad isn't going to be a part of TSE AFAIK, but you can get it from the TGE build tree.

2. Yes, that is it exactly. Since interiors (where "interior" could be a building, or a runway, or a bridge) are not normal mesh objects, you have to use something like QUArK to build them.

3. If you are using TSE and its default mission, then you will not be able to effective launch the world editor due to the way it takes control of the interface. You'll need to take a stripped-down Torque install. I'd suggest using something like the MiniApps (see the tutorial section) or CodeSampler's tutorial missions.

4. The camera control is a bit wonky. You're actually controlling the object, not the camera. Z/X will rotate the object, E/C will tilt it, and W/A/S/D will move it around. (Note, could be wrong on these keys, haven't got Torque in front of me to test it out on.)

5. Collision boxes are there so that the engine doesn't have to use a high-polygon mesh for its collision detection. Coldet on a polygonal basis is very expensive, so the engine forces you to use convex polygons, and the fewer the better. The bounding box is for the Max exporter, and that is used to calculate the total bounding volume of an object -- Anything outside of that BV is considered not a part of the object, so animations of weapons and such won't show up.

6. Ghosting refers to keeping copies of objects on the client side. When a server is running, it has in memory representations of all the objects -- their location, speed, how many hitpoints they contain, etc. The client needs to know this information too, but to send it every frame would quickly max out your bandwidth between server/client. So, what happens is the server sends a "ghost" to the client, which acts like a mirror of the object that is present in the server's memory. That way, from that point onwards, all you need to do is send deltas when an object changes on the server, like it moves to do a different spot. It's a bit more complicated than that, but that's the gist of it.

These aren't stupid questions at all. :)
#2
06/23/2004 (11:28 am)
Hey FW, thanks for the swift reply... sure clears up a few things.

I'm glad the questions weren't too dumb :) Sure hope you are around for the inevitable Stupid Newbie Questions volume 2. heh

Thanks again.
#3
06/28/2004 (3:58 am)
Ok, since volume 1 of my stupid questions is still on the first page, I'll just append some more dumb questions here. :)

A: Is there a list of bugs, or a place where I can report bugs/problems?

B: Are all datablocks transmitted to a connecting client every time they connect to a server... even if they have not changed? If so, is there a way to suppress this behavior so that datablocks are only sent if they have changed? I'm guessing there is not since I haven't found anything that seems to do that yet.

C: I'm pretty sure that the $ in the scripts is to declare a global variable... but just *how* global is it? Are variables declared inside a script removed when the script is over or do they get added into some application global namespace?

D: When exactly are the OnSleep and OnWake GUI callbacks called? Are these like OnFocus and LostFocus events in Windows?

E: I can't figure out how the following Material Datablock members are supposed to work. I have tried adding them in all sorts of ways into my material definitions, but nothing seems to work, and they even seem to negate the effects from any bump maps I have on a texture. The members are: scrollDir, scrollSpeed, rotSpeed,rotPivotOffset, waveType,waveFreq,waveAmp. I looked, but I cannot find any examples of these in the TSE demo anywhere. I have been experimenting primarily with the scrolling animation type... I just can't get anything to happen.

F: Does Torque automatically generate MipMaps from large textures? I mean, it looks like the engine queries the video card to see if it will support MipMaps... but I don't see where they are ever actually generated.

EDIT:
G: Oh, and what the heck is VICON?

TIA, J
#4
06/28/2004 (4:24 am)
A) Bug Forum.

B)Torque uses a highly optimised network model. For objects with states, it only transmits the part that has changed, and sends the minumum amount of data needed.

C)Yes $ is for global variables. These may be access from anywhere in any script.

D)The onWake() call is in inspectPostApply() for guiControl, and onSleep() in inspectPreApply().

inspectPreApply() is called before the object's fields are updated,when changes are being applied.

inspectPostApply() is called after the object's fields are updated.

E)Do something like this after your textures are defined in the material datablock:
animFlags[0] = $scroll;
   scrollDir[0] = "0.0 1.0";
   scrollSpeed[0] = 0.6;

Another example is:
animFlags[0] = $rotate | $wave;
  rotPivotOffset[0] = "-0.5 -0.5";
  rotSpeed[0] = 1.0;

  waveType[0] = $sinWave;
  waveFreq[0] = 0.25;
  waveAmp[0] = 1.0;

F) Mip mapping is handled by the new GFXTextureManager. I would read through its loadTexture() function to see whats going on :)


*edit*

G) Vicon is the root node for a bone subtree. I.e bip01 for a 3dsmax biped.
Hope some of that was a help to you.
#5
06/28/2004 (4:47 am)
Thanks, yeah that was pretty useful... I still don't understand about the datablocks though. I know that Torque will only send deltas once a connection has been established and a session is running, what I don't really know is if those datablocks of static information are sent in thier entirety to a remote client each time they connect to the server. IE, if I had cs files describing datablocks of essentially static information for 1000 different object types, would all of that information have to be transmitted to each client each time they connect before the deltas begin transmission. Or... is there some way to load that static stuff from the client unless its version has changed on the server? Err... maybe I'm just misunderstanding something.

And the global script variables have script scope... not application scope right? ... sorta like Perl?

Thanks for clearing up the scrolling code. I was putting the scrolling vector in parens like this (0.1, 0.1) hehe... It didn't like that.

Also, I just started trying to export sequences from MAX, and I can't find a tutorial or help page that explains all of these options in the sequence helper object. Do you know of any?

Sorry for being such a pain. Thanks again, J
#6
06/28/2004 (5:27 am)
No its not, you can add script variables or set them in C++ using Con::addVariable() and Con::setVariable().

Read through this.

Also im not sure about the datablock thing, someone who knows torque networking a little betetr will have to answer that one :)
#7
07/02/2004 (4:27 pm)
Ok, some more dumb questions.

A: I am stuck on exporting skinned animation from MAX. I keep getting the error that there is a "bone missing from shape". I am attempting to export a skinned hand model. I have added a VICON node ( also tried naming it Bip01 to match a Biped structure. ), and Eye and Cam dummies. I thought that should satisfy the requirements for the "must have" nodes, but apparently not. What else is needed?

I have gotten simple, non-skinned animations exported with no problem... things like bouncing balls and rotating cubes and such, but this is driving me nuts. :)

B: Aside from needing to have the pivot point for a source mesh aligned properly, are there any other requirements? IE, should it go at the feet of a model or at the center of gravity? Should I just align and snap it to the pivot of the bounding box?

C: I'm a bit confused as to how to most efficiently set this model up. I mean... the way I'm doing it right now, I have created the source mesh, and then copied a reference mesh off of it and added the bones and skin to it. Is this going to work? or does the mesh I am animating have to be aligned and positioned in the exact same place where the source mesh that is linked to the start dummy is located? Right now I have it moved back from the source mesh, so it is in a different point in world space. Would it be better to just create a MAX file for the express point of animation, and XRef in the source mesh and do the animation in a whole seperate file?

D: I'm Using IK to animate the bone chain... what should I be keying in order for the export to work? Can I just key the IK Goal or do I need to expressly set keys for each of the bones?

Ugh, sorry if that is none to clear. My brain is fried from fooling with this today. :)

TIA, J