Game Development Community

Tutorials, explanations, documents, scripts etc....

by Melv May · in Torque Game Engine · 10/22/2001 (12:45 am) · 12 replies

Getting the codebase finished is by far the most important thing at the moment but eveyone already knows that. This is certainly not a complaint to anyone, it's more like a begging letter .

That said, I would like to request from anyone any good sites that don't assume any/little previous knowledge of Tribes1/2 scripting. I've purchased Tribes2 and have been wading through various web-sites written by people of various levels of competency. The competant sites have far too complex scripts that just work without any real explanation and the others spend most of the time describing how to configure notepad or some other editor!

I'm a professional programmer and have been for many years now but I find myself struggling with concepts rather than code.

It's no-ones fault but the pickings are pretty slim when it comes to putting together how the scripts interact with the engine (other than tracing all the calls). I certainly should have more patience but it can be frustrating without key information.

Some people have the time (and energy) to wade though volumes of code and I admire their spirit but my bones must be getting old as I can just about managed 2-3 hours in an evening trying to piece together disjointed scripts.

By the content of some of the posts, most of you guys/gals are waaaaayyyy beyond me. Are you ex-tribe-scripters/mod'rs or should I simply drink more caffeine?

So I beg you. No I plead, does anyone have any ideas on the best way to get 'into' Torque scripting from the bottom-up rather than 'top' down? Do you have any good links or information you're hoarding? I know the answer may simply be "You're screwed" but I have to ask.

Thanks for reading my ramblings and being patient.

Yours most humbly,

Melvyn May
www.cotdteam.com
"City of the Dead: Survivor"

#1
10/22/2001 (9:32 am)
Do you have the 1.1 release? I've included a few more examples, and more comments. None of it really provides any global overview though. You might want to read through the overview in the "official" documentation, if you haven't already done so.

I'm sure there are some T2 scripting tutorials out there somewhere... if anyone knows of any, please post them as resources.
#2
10/22/2001 (9:37 am)
There's a tribes 2 scripting list somewhere that shows what each script command does. I havent used any scripting myself so far, but I'm fairly sure it would be useful to know what script functions are there.

Phil.
#3
10/22/2001 (9:57 am)
the author of this post is not alone, i my self have been doing q3a mods in c for over a year, and though it seems c++ isnt all that different (kinda) the whole structure of the torque engine is way different,

now i dont know about anyone else but i dont really care about tribes2 or scripting , i would like to see doc's on the engine , like where the files are , for basic stuff needed for makeing a game (not a mod) for stuff like weapons,ammo,fire rates,missile speed,damage,selfdamage,playermodels,spawning/items/players/monsters,pickup items,exitpoints,,,,ect.ect.
#4
10/22/2001 (11:53 am)
Well to start with, Torque is heavily scripted. Most of what you talk about; damage, weapon management, fire rates, spawning, item pickup, etc. is all scripted, so there is no avoiding the language :) At least not if you want to work within the current game structure. Besides fixing bugs, and general cleanup (and the web site), our focus has been on getting the demo done, so that it would provide a starting point for developers looking at how a game is put together.

As a quick overview... most objects provide pretty bare bones functionality and export attributes, functions and event callbacks to the scripting language. The player is an example of this, the basic player.cc file adds movement, collision, action animation (animation based on the current move, run, jump, falling etc.) and misc. eye candy (such as foot prints and dust puffs). That's it.. there is no weapon management, or game specific code (though there are some assumptions about what a player can do). The rest is handed off to the scripting language.

So basically the game portion of the engine consists of a collection of objects which each provides some core functionality used by the script to implement the game.

These are the core game classes:

GameBase
The base class for all "game" objects, provides the move interface, game time processing, as well as support for datablocks.

ShapeBase: public GameBase
A loadable shape. Takes care of loading a rendering a .dts object. ShapeBase provides a number of common shape attributes include damage, damage detail management, destruction (exploding, debris), energy as well as features such basic collision. ShapeBase also provides a script interface for managing 4 animation threads and 4 sounds emitters per shape. Last but not least, ShapeBase allows you to mount up to 8 ShapeImages onto mount points defined on a shape.

ShapeImage
Shape Images are not sim objects in the GameBase sense, they are light weight objects which can be attached only to ShapeBase objects and are used to render, animate, and script weapons, backpacks, flags or any other attachable item. We use these instead of ShapeBase objects because they require much less network bandwidth to manage and transmit to clients. The image class provides a scriptable state machine, where states can emit particles, sounds, invoke script functions, run animation sequences, etc. This state machine is used to perform all weapon animation and firing. State data is downloaded to the client for client side state transition prediction. (ShapeImage is declared in shapeBase.h)

StaticShape: public ShapeBase
This is a terminal class for ShapeBase, since you can't create ShapeBase objects on there own (I don't think ShapeBase is an abstract class, but it should be). Since shape base does not provide any form of movement or physics, static shapes are static :) They can animate though, emit sounds, etc., using the scripting interface provided by ShapeBase. Just looking through the code I noticed some T2 power functions, they should not be there and will get stripped out.

Item: public ShapeBase
Items are ShapeBase objects that have some very basic physics. You can through them, they bounce, slide down hills, etc. Physical properties such as mass, drag, friction coefficient (only one) and elasticity are exported as datablock properties. Items can also emit a dynamic light (glowing flags), and optionally rotate and/or be static (for spawned rotating items). Items don't do rigid body physics, basically just a ShapeBase object.

Player: public ShapeBase
A little different than the others since this one is directly controllable by a client. Provide basic player physics: movement, collision, etc., as well as foot puffs, foot prints, water splash and bubbles. Also provides animation based on the player's action, as well as control of other controllable objects. This last one is so that the client can still control "his" player, while the player controls a vehicle.

Camera: public ShapeBase
A controllable flying camera. Operates in two modes: free flying, and attached to an object.

Vehicle: public ShapeBase
I'll just mention this one quickly... vehicles are basically like the player, extends ShapeBase to be a controllable object with rigid body physics, in this case derived classes provide crude flight models and wheel/suspension physics.

Projectile: public GameBase
Doesn't use shape base, which is a fairly heavy weight class, both in terms of memory and network bandwidth. This is your basic linear projectile, supports straight linear/ballistic, has a dynamic light, particle emitter and exposes all it's core attributes in it's datablock. Explosions, damage, etc. is all scripted, the projectile just provides shape rendering and physics.


There are others, but these are sort of the core game classes. To read a little more about object ghost and datablocks, you might try the
tribes networking article Mark and I wrote for CGDC.

I also posted a list of some of the script event callbacks generated by these classes in an earlier plan file.
#5
10/22/2001 (2:41 pm)
hey cool!
i know this is going to be just like when q3a came out iddnt know athing about modding or even the c lang. but i am determined and know i will make somthing fun of this too :)

this info is something worthy of putting on my web server... soon as i find the time . thanks.

There is NoESCape! for dummies like me.Torque References.
#6
10/23/2001 (1:21 am)
Hey thanks guys for the information, it all helps. :)

Especially you Tim as I know you're very busy, thanks.

Melv.
#7
02/02/2003 (3:15 pm)
how do you add a shapebase, like a barriel that explode?

Thanks,

Gabe
#8
02/02/2003 (6:29 pm)
Melv, when I started T2 scripting I came across a community that I just couldnt have made it without. There are some great scripting tuts with comments and explanation. I would highly recomend this to any T2 and Torque scripter.

mn_t2_t2cc.fragland.net/board/

Sam
#9
02/04/2003 (9:26 am)
I've come along way since my original post but you can't get enough script references in my opinion.

Thanks. :)

- Melv.
#10
02/04/2003 (9:36 am)
Melv,

Reading your original post from October of 2001 is pretty humorous.

You may want to check with this guy who was creating these cool 'fx' stuff like sun and plants and such. I'm sure he could help you get up to speed. ;)
#11
02/04/2003 (9:39 am)
Kevin,

Yeah, I learned quite a bit in a few months. :)

It's amazing what you can do without the scripts but it's amazing how much easier any development is using them.

- Melv.
#12
02/04/2003 (12:29 pm)
Hi Melv,
Have you tried this tutorial that I wrote for peopel who have no scripting experience?
www.liquid.nq.net/tutorial/

If you need any further help you are always welcome to send me an email :)