Game Development Community

Object Interactivity with Torque

by Roberto D. Rubino · in General Discussion · 11/01/2004 (10:49 am) · 17 replies

Hello all, this is my first post, please forgive me if this topic has been discussed before as I have searched for quite a while on the forum and found nothing (maybe I'm using the wrong terminology to describe what I'm looking for).

How interactive can the worlds created with the Torque out of the box be? That is, can objects in the world be moved around by the player? For example, if I create a house and populate the kitchen with a table with forks and knives on it. Can the player come in and take a fork and knife and put them on the floor? Once the object's location has changed (if it can be changed that is), will it remain in the new position?

If anyone has played Ultima 7 (BG or SI) then you know what I mean. In U7 every object could be moved or interacted with in one way or another. You could walk into a room, double click on a candle to light it, pick it up and throw it at someone, equip it as a weapon, or put it in your inventory. You could open and close doors, windows, shutters, etc.

Basically I'd like to gauge what would need to be done to Torque in order to make something like this possible. I'm a pretty good programmer, I have a MS in Computer Science and I've begun working towards my PhD. I've also worked on quite a few small to medium scale software development projects so I'm not afraid to get my hands dirty modifying code, however the more coding I can avoid the better!

Rob

About the author

Recent Threads


#1
11/01/2004 (11:19 am)
Quote:How interactive can the worlds created with the Torque out of the box be? That is, can objects in the world be moved around by the player? For example, if I create a house and populate the kitchen with a table with forks and knives on it. Can the player come in and take a fork and knife and put them on the floor? Once the object's location has changed (if it can be changed that is), will it remain in the new position?

As long as you save your object data, you'll be fine.

Quote:If anyone has played Ultima 7 (BG or SI) then you know what I mean. In U7 every object could be moved or interacted with in one way or another. You could walk into a room, double click on a candle to light it, pick it up and throw it at someone, equip it as a weapon, or put it in your inventory. You could open and close doors, windows, shutters, etc.

The development time to create a world with this interactivity built in will take a very long time (or more companies would do it). But that is one of the elements that makes U6/7/8/9/Online stand out to me. The world felt real. Most other RPG's work on cinematic storylines and character development. Ultima didn't have to work on that because it was a well established world by the time 6 came around and let us play with everything (though not on the same level as 7). The stories and characters involved were very well developed, though the player characters didn't have much of an arc.

Quote:Basically I'd like to gauge what would need to be done to Torque in order to make something like this possible. I'm a pretty good programmer, I have a MS in Computer Science and I've begun working towards my PhD. I've also worked on quite a few small to medium scale software development projects so I'm not afraid to get my hands dirty modifying code, however the more coding I can avoid the better!
Streaming missions, interiors, large-scale terrain scaling and streaming and working with the chunks to correctly represent your object data will be a huge challenge, as will creating the huge amounts of artwork necessary for the level of interactivity that you desire. I'd recommend starting very small (say a kitchen as in your example, and modeling everything in the kitchen...which will help in every kitchen, as well as get you started on the interactivity side of things; one of my favorite aspects of U7 was that I could make and bake bread). Then you can scale outward.
#2
11/01/2004 (12:07 pm)
Quote:
How interactive can the worlds created with the Torque out of the box be? That is, can objects in the world be moved around by the player? For example, if I create a house and populate the kitchen with a table with forks and knives on it. Can the player come in and take a fork and knife and put them on the floor? Once the object's location has changed (if it can be changed that is), will it remain in the new position?

TGE out of the box is not ready for what you want to do. Granted, the sample.fps allows you to run over ammo clips, health kits, to pick them up. But there is no built in object selection, droping, management. Sample.racing shows how to pretend your a car and race around a track. Not very good examples of creating RPG.

There are bits an pieces of code in the engine for some of it, and there are resources available that allow you to add object selecting and inventory.

But, out of the box. TGE will no cut it. You have some major programming to do to get the object interactivity you are looking for.

It sounds like your doing an RPG. Again, TGE out of the box is not ready to be used for an RPG. You just can't drop in an NPC, add items, add conversation, add interaction. You can't drop in a trigger and have a number of NPC's spawn when triggered. etc.. (Using Never Winter as example)

TGE has a lot of the components, like triggers, like basic NPCs. But it's not tied together. That is something the developer has to do, before he can let a level designer start creating.

It's a big task getting TGE to be use as a RPG. I know, I've added a whole crap load of stuff already myself to mine and I still have a long way to go.



Edit: Grammer Mistakes
#3
11/01/2004 (1:00 pm)
Wow, that was a quick response! I heard that the TGE community was active, but this is quite impressive. The more time I spend on this forum (I've been lurking for some time now), the more I'm impressed.

Quote:As long as you save your object data, you'll be fine.

Is this possible within a building? Wouldn't I have to reprocess the bsp or is that only for walls and such? Where is object data saved? I guess it wouldn't be to hard to create some sort of difference file that has updated location values for objects placed within the world.

Quote:TGE out of the box is not ready for what you want to do. Granted, the sample.fps allows you to run over ammo clips, health kits, to pick them up. But there is no built in object selection, droping, management. Sample.racing shows how to pretend your a car and race around a track. Not very good examples of creating RPG.

As far as object selection and droping is concerned, is there no function in TGE where I could check for a collision between the mouse cursor and an object? For example, project an invisible line from the cursor into the world and collect collisions?

My big concern would be that once I place objects within an interior space, they can't be moved or manipulated. That's a key thing for me.

Simon, you're right, I do have an RPG in mind. However I quite sure that doing something like I describe is a monumental task. In the near term I'm more concerned with using the engine for technical demonstrations of my doctoral projects. My MS specialization was in artificial intelligence and I plan to continue in this area for the PhD. TGE would be a great visualization tool in this regard.

If anyone has any suggestions for another engine that my involve less work that is similarly priced, please don't hesitate to make a suggestion. I'm still in the information gathering stage, but so far every path I've taken has brought me back to garagegames.com

Rob
#4
11/01/2004 (1:10 pm)
Quote:
As far as object selection and droping is concerned, is there no function in TGE where I could check for a collision between the mouse cursor and an object?

Oh there are resources like www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4146 But as to date, they are not part of the TGE Source Code. RayCast is the build in function, but you have to code/script how to use it still.

Quote:
My big concern would be that once I place objects within an interior space, they can't be moved or manipulated. That's a key thing for me.

If you are using the TGE editor, there will be no problem doing this. But if you use a BSP editor to place the objects. Then you can't change them in the TGE Editor.

Quote:
If anyone has any suggestions for another engine that my involve less work that is similarly priced, please don't hesitate to make a suggestion.

As far as I know, there are no other engines in this price range for creating a RPG. Humm.. I guess you could go the route of using an existing RPG game and modding that for about the same price.

oh well. Maybe one day, one of us programmers will release their RPG mods to TGE.
#5
11/01/2004 (2:00 pm)
Though it seems almost too simple to say it:
1. Create any objects as DTS models. Not only will they be more detailed, they will also be directly manipulatible and not run into zoning issues.
2. Create all of your non-destructible geometry as BSP interiors.

Both of those steps will allow you to have maximum use of your objects, since they can me picked up/dropped/thrown/moved to new buildings/etc.

None of the other free or comparatively priced engines have this functionality built in, as they are not designed for a specific type of game. A6 can do it, but you'll be spending a LOT of time C-Scripting. Same wigth Blitz and DBPro. Irrlicht/Quake/2 will all require massive engine changes (as will Torque) to work on the scale you need it to.
#6
11/01/2004 (2:49 pm)
Roberto, right now, in the demo (starter fps), you can shoot your weapon and when the projectile hits the target, the target (e.g. orc player) reacts accordingly by losing health, etc...

So all you have to do is make the weapon and projectile invisible, and then write some script to handle the specific object's response... e.g. light candle, put in inventory, etc. (but instead of a conventional mouse cursor, you use the target reticule, which I think is better and more standard in first-person view RPGs today)

You can already walk over medkits and ammo, so that's where you can start scripting-wise as far as "acquiring" the object and putting it into your inventory.

So basically, make some tweaks to the demo's scripts and you'll probably get what you're looking for.

EDIT -- you can do this with the demo, you don't have to buy the engine to test this.

EDIT -- as for dropping/throwing something on the floor, I'm curious about that... is there a "drop weapon" function built into the demo? Cuz that would effectively be the same thing...
#7
11/01/2004 (2:59 pm)
Quote:
How interactive can the worlds created with the Torque out of the box be? That is, can objects in the world be moved around by the player? For example, if I create a house and populate the kitchen with a table with forks and knives on it. Can the player come in and take a fork and knife and put them on the floor? Once the object's location has changed (if it can be changed that is), will it remain in the new position?
Actually, yes, out of the box you can move objects around. If you hit F11, you get the mission editor, and you can click on objects and move them around. If you save out the mission file, it will remain in that position.

You would have to modify some things so that all that information and tree doesn't pop up, but start with the GuiEditTSCtrl and you are 90% of the way there.
#8
11/02/2004 (4:28 am)
Wow, that was a quick response! I heard that the TGE community was active, but this is quite impressive. The more time I spend on this forum (I've been lurking for some time now), the more I'm impressed.

Quote:As long as you save your object data, you'll be fine.

Is this possible within a building? Wouldn't I have to reprocess the bsp or is that only for walls and such? Where is object data saved? I guess it wouldn't be to hard to create some sort of difference file that has updated location values for objects placed within the world.

Quote:TGE out of the box is not ready for what you want to do. Granted, the sample.fps allows you to run over ammo clips, health kits, to pick them up. But there is no built in object selection, droping, management. Sample.racing shows how to pretend your a car and race around a track. Not very good examples of creating RPG.

As far as object selection and droping is concerned, is there no function in TGE where I could check for a collision between the mouse cursor and an object? For example, project an invisible line from the cursor into the world and collect collisions?

My big concern would be that once I place objects within an interior space, they can't be moved or manipulated. That's a key thing for me.

Simon, you're right, I do have an RPG in mind. However I quite sure that doing something like I describe is a monumental task. In the near term I'm more concerned with using the engine for technical demonstrations of my doctoral projects. My MS specialization was in artificial intelligence and I plan to continue in this area for the PhD. TGE would be a great visualization tool in this regard.

If anyone has any suggestions for another engine that my involve less work that is similarly priced, please don't hesitate to make a suggestion. I'm still in the information gathering stage, but so far every path I've taken has brought me back to garagegames.com

Rob
#9
11/02/2004 (4:54 am)
Let me get this straight, you want to put a table and a fork in a building in torque and be able to go in and pick up the fork and move it some where else.

Well you could set up the fork.cs as you would a weapon.cs and take away the floating and rotation and pick up the fork just like you would a weapon, for puting the fork down, i remeber seeing a drop or throw weapon snippit around here some wheres that will probably be easy to modify the code you are looking for. (would be a peice of cake to do.)

you have found the best engine for what you want already
#10
11/03/2004 (3:40 am)
Wow, that was a quick response! I heard that the TGE community was active, but this is quite impressive. The more time I spend on this forum (I've been lurking for some time now), the more I'm impressed.

Quote:As long as you save your object data, you'll be fine.

Is this possible within a building? Wouldn't I have to reprocess the bsp or is that only for walls and such? Where is object data saved? I guess it wouldn't be to hard to create some sort of difference file that has updated location values for objects placed within the world.

Quote:TGE out of the box is not ready for what you want to do. Granted, the sample.fps allows you to run over ammo clips, health kits, to pick them up. But there is no built in object selection, droping, management. Sample.racing shows how to pretend your a car and race around a track. Not very good examples of creating RPG.

As far as object selection and droping is concerned, is there no function in TGE where I could check for a collision between the mouse cursor and an object? For example, project an invisible line from the cursor into the world and collect collisions?

My big concern would be that once I place objects within an interior space, they can't be moved or manipulated. That's a key thing for me.

Simon, you're right, I do have an RPG in mind. However I quite sure that doing something like I describe is a monumental task. In the near term I'm more concerned with using the engine for technical demonstrations of my doctoral projects. My MS specialization was in artificial intelligence and I plan to continue in this area for the PhD. TGE would be a great visualization tool in this regard.

If anyone has any suggestions for another engine that my involve less work that is similarly priced, please don't hesitate to make a suggestion. I'm still in the information gathering stage, but so far every path I've taken has brought me back to garagegames.com

Rob
#11
11/03/2004 (5:45 am)
Quote:Is this possible within a building? Wouldn't I have to reprocess the bsp or is that only for walls and such? Where is object data saved? I guess it wouldn't be to hard to create some sort of difference file that has updated location values for objects placed within the world.
If you create your objects as a part of the interior (DIF) versus models (DTS), then yes you would have to load a version of the interior without the "BSP fork" built into it. Which is really not the way to go.

Quote:My big concern would be that once I place objects within an interior space, they can't be moved or manipulated. That's a key thing for me.
That's ONLY if you build them into the geometry of the space. For example, if you build a room in QuArK and build the table into the BSP geometry as well, you won't be able to move the table around (without source modificiation such as the pathed interior resource). If you create the table as a DTS model in Blender, Gamespace, Max, Maya, Milkshape, Lightwave, etc, then you'll be able to move the table, destroy the table, put stuff on the table, etc.

Pick and Click (posted earlier in this thread by Simon Duggan) allows you to select objects in a 3D environment.
#12
11/03/2004 (4:14 pm)
Regarding oject locations, when I place objects using the torque editor, that object location data must be saved somewhere and therefore must be loaded into memory when the level loads right?. When refering to a DTS object, is there an object in memory which has x,y,z values for its location? Can the updated locations be written back out to the mission file?

On a similar note, when modifying the engine, can I extend existing classes in order to implement additional functionality or do I have to patch the original source code? I know CVS makes managing that a lot easier but when a new version of TGE is released, that may invalidate the patches?

I'd also like to say that I truly appreciate the replies from everyone here. The fact that there are so many people who are familiar with the engine is very encouraging.

Rob
#13
11/03/2004 (6:29 pm)
Regarding oject locations, when I place objects using the torque editor, that object location data must be saved somewhere and therefore must be loaded into memory when the level loads right?. When refering to a DTS object, is there an object in memory which has x,y,z values for its location? Can the updated locations be written back out to the mission file?

On a similar note, when modifying the engine, can I extend existing classes in order to implement additional functionality or do I have to patch the original source code? I know CVS makes managing that a lot easier but when a new version of TGE is released, that may invalidate the patches?

I'd also like to say that I truly appreciate the replies from everyone here. The fact that there are so many people who are familiar with the engine is very encouraging.

Rob
#14
11/03/2004 (6:34 pm)
Everything is saved to the mission file... objects position data, rotation, scale, everything....

You have your static .dif interiors for like rooms and such, and then within them you place objects... which can be picked up... so everything will work right off the bat. Now, you want the player to be able to throw an object back out right? ....well, the crossbow shoots out an arrow projectile (.dts)... so just change this to the object in the inventory that you want thrown to the ground... but, make the projectile path parabolic so it falls naturally to the ground with the effect of gravity... and whereever it collides with a surface thats where you place the object.
#15
11/04/2004 (8:46 am)
Regarding oject locations, when I place objects using the torque editor, that object location data must be saved somewhere and therefore must be loaded into memory when the level loads right?. When refering to a DTS object, is there an object in memory which has x,y,z values for its location? Can the updated locations be written back out to the mission file?

On a similar note, when modifying the engine, can I extend existing classes in order to implement additional functionality or do I have to patch the original source code? I know CVS makes managing that a lot easier but when a new version of TGE is released, that may invalidate the patches?

I'd also like to say that I truly appreciate the replies from everyone here. The fact that there are so many people who are familiar with the engine is very encouraging.

Rob
#16
11/04/2004 (8:54 am)
Are you clicking submit repeatedly by accident... or just repeating your post?
#17
11/04/2004 (9:15 am)
I think he's refreshing the page, which resubmits the form data.