Game Development Community

Rope...

by Viren Thambidorai · in Torque Game Engine · 08/08/2007 (6:28 am) · 11 replies

Hi all,

am wrking on a game where a player is chasing a vehicle via skateboard & rope in his hand. The other end of the rope is ofcrse attached to the vehicle.

i want to make it look like a rope. how can i go about it.
i tried using Line drawing but its toooo thin also i cant apply texture on it, i have tried Laser beam method as well but its lifetime is too low for rope to see. Laser beam was done like a particle, which i found from one of the threads on this forum.

i wanna make it real quick ...

is there any simplest way around??? or any other method u guys know ...

thanks in advance. Am using TGEA :)

#1
08/08/2007 (9:20 am)
Just hack the laser beam code to have an infinite lifetime?
#2
08/08/2007 (9:34 am)
Create a rope mesh with a "hand" node, and a "car" node. Then go into the script for your rope and mount the "hand" node to the player and the "car" node to the car
#3
08/08/2007 (10:19 am)
Yes, use the 3d mesh
and while you are at it, scale back your design a bit.

use instead of rope a metal rod or something rigid.

developing a rope solution without the appropriate skills will be a major roadblock.
#4
08/08/2007 (10:21 am)
Well, as long as the game design is such that there is no slack in the rope at any given time, he should be fine without doing anything too difficult.
#5
08/08/2007 (10:53 am)
Let us know if you get this working Viren! :)
#6
08/08/2007 (12:47 pm)
One idea is to actually create a chain of particles that represent the rope, but then actually model the physics of the player/car connection separately. That is, the rope is just a visual that looks good and isn't the actual "physical" connection.

I a string of particles like this is essentially what Valve's source engine does for wire and rope.
#7
08/09/2007 (12:44 am)
Quote:Just hack the laser beam code to have an infinite lifetime?

Yup, I did these changes.
1. I changed from Projectile::SourceIdTimeoutTicks = 7 to
ProjectileData::SourceIdTimeoutTicks = 4096 . by doing this we made sure that the laser lifetime was increased which was only for shorter duration.
2. Later I tried increasing its lifetime through scripts lifetime = 50000 in Laserdata databalock but tht doesnt seem to help much.

am I goin in right direction or am just doing smthing stupid??

Quote:Create a rope mesh with a "hand" node, and a "car" node. Then go into the script for your rope and mount the "hand" node to the player and the "car" node to the car

@Cory : ya even i thought of it before but never actually worked on it....i think this is the time!

@ Tim : ya i never thought of this can be done using particles! thanks, but i think even laser beam is done in same way as u r saying...correct me if am wrong :)

thanks guys,
waiting for more.

Viren.
#8
08/09/2007 (1:32 am)
Another way to handle it would be to actually use physics, after all that's what you're trying to emulate.

Physx may be a good bet, perhaps using joints as a base.

Like in this video: C4-130-PX-003.mpg
#9
08/09/2007 (5:04 am)
Quote:1. I changed from Projectile::SourceIdTimeoutTicks = 7 to
ProjectileData::SourceIdTimeoutTicks = 4096 . by doing this we made sure that the laser lifetime was increased which was only for shorter duration.
2. Later I tried increasing its lifetime through scripts lifetime = 50000 in Laserdata databalock but tht doesnt seem to help much.
Now, there's your problem right there ;). What you're doing is just making it live longer, rather than making it never die. Have a look in Laser::processTick. You'll see an if block that checks the lifetime of the laser, and if it has been living that long deletes the laser. I'd start there - remove that if block, and the laser should never die.

But I would also look at other implementations - real physics would be cool.
#10
08/09/2007 (6:49 pm)
One thing that would require a lot of scripting, but would look really good, is to actually make the rope up of like 10 different nodes, then in scripting, apply gravity and IK to each one, and when the rope swings or whatever, calculate the closest effected node, and then the IK should work to make the rest of the rope follow it. The structure should look something like this:

1. Store direction and velocity of all nodes.
2. Decipher physics action (arc wider, rest, reverse arc, no slack)
3. Determine greatest effected location, and assign closest node to action (active node)
4. Calculate new direction and velocity according to physics action, and assign to active node.
5. IK all other nodes relative to active node.
#11
08/09/2007 (7:13 pm)
Here is a diagram if the above was really confusing ;)

www.dragonworksmedia.com/temp/diagram.png