Double Pendulum

Double Pendulum

Re: Double Pendulum Posted by RealEschaton on Thu Jan 6th 2005 at 4:15am
RealEschaton
19 posts
Posted 2005-01-06 4:15am
19 posts 12 snarkmarks Registered: Dec 30th 2004 Occupation: Student (College) Location: USA
So I've got a decent idea for a gimmick for a HL2-DM map, using a pendulum attached to the base of a larger pendulum (aka a double oscillator). I even built one that works pretty well, swinging down twenty stories and crushing any hapless player caught beneath it with the force of a speeding train. Here's a shot of it from my test map (it's taken in Hammer... so shoot me):

User posted image

Anyway, my problem is that it doesn't swing long enough, reduced to hanging limp after about 30 seconds. If you've never seen one of these things in real life (they're much smaller of course), a well-oiled one can continue swinging for several minutes at the minimum.

Since the pendulum is intended to be a major hazard in the trench it swings through, I need it to continue swinging for a long time at a speed fast enough to squish a player. I was hoping someone on these boards could offer me one of the following:
  • Some way to reduce friction to zero for the entire setup. As far as I can tell, the hinges already have zero friction, so the energy loss must come from somewhere else. This is by far the optimal solution.
  • A setup that inputs energy into the system somehow to keep it moving, without causing unnatural motion.
  • And the last resort, a control system that can quickly reset the double pendulum to its original position.
Re: Double Pendulum Posted by aonomus on Thu Jan 6th 2005 at 4:57am
aonomus
18 posts
Posted 2005-01-06 4:57am
aonomus
member
18 posts 2 snarkmarks Registered: Dec 26th 2004
Well you could use a angular motion sensor on the large pendulum to
determine when to turn on a phys_motor to lengthen movement time.... or
just add phys_thrusters and fiddle with weight/mass values
Re: Double Pendulum Posted by RealEschaton on Thu Jan 6th 2005 at 5:19am
RealEschaton
19 posts
Posted 2005-01-06 5:19am
19 posts 12 snarkmarks Registered: Dec 30th 2004 Occupation: Student (College) Location: USA
<DIV class=quote>
<DIV class=quotetitle>? quoting aonomus</DIV>
<DIV class=quotetext>Well you could use a angular motion sensor on the large pendulum to determine when to turn on a phys_motor to lengthen movement time.... or just add phys_thrusters and fiddle with weight/mass values
</DIV></DIV>

I've considered those options, and have actually built a test case where a phys_motor cranks the large pendulum back into position. Unfortunately, it's a somewhat jerky motion and I have yet to dabble in angle sensors so I have no way of automatically initiating it when movement ceases (without just using a timer).

Using thrusters is what I'll probably end up doing if no one has any ideas about reducing friction. It seems like this sort of thing should be relatively straightforward, but it's possible that all func_physbox objects are affected by air resistance so much that they will always come to a halt.
The devil's in the details; working with either of those options requires a complex cluster of dependent entities and a ton of fine tuning to get working perfectly; I was hoping for an easy way out.
Re: Double Pendulum Posted by Leperous on Thu Jan 6th 2005 at 11:57am
Leperous
3382 posts
Posted 2005-01-06 11:57am
Leperous
Creator of SnarkPit!
member
3382 posts 1635 snarkmarks Registered: Aug 21st 2001 Occupation: Lazy student Location: UK
/offtopic: One of my maths professors proved that several pendulums attached together can be made to stand upright if oscillated fast enough. I wonder if the Source engine realises this :wink:

A phys_hinge entity has a friction property you can specify, so perhaps you can attach the pendulums with one of these entities instead?
Re: Double Pendulum Posted by RealEschaton on Thu Jan 6th 2005 at 9:19pm
RealEschaton
19 posts
Posted 2005-01-06 9:19pm
19 posts 12 snarkmarks Registered: Dec 30th 2004 Occupation: Student (College) Location: USA
<DIV class=quote>
<DIV class=quotetitle>? quoting Leperous</DIV>
<DIV class=quotetext>A phys_hinge entity has a friction property you can specify, so perhaps you can attach the pendulums with one of these entities instead?</DIV></DIV>
That's the entity I'm using, and I have the friction in both of them set to zero (default). I'm going to try assigning everything to a constraint system, maybe the "fighting each other" that's described in the help is causing energy loss somehow.
Re: Double Pendulum Posted by Quaver on Fri Jan 7th 2005 at 1:01am
Quaver
144 posts
Posted 2005-01-07 1:01am
Quaver
member
144 posts 104 snarkmarks Registered: Oct 28th 2003 Occupation: Student Location: London
I think its to do with where its center or gravity is, i havent really caught on to the physics system and contraints, to used to hl1.
Re: Double Pendulum Posted by SaintGreg on Fri Jan 7th 2005 at 4:11am
SaintGreg
212 posts
Posted 2005-01-07 4:11am
212 posts 51 snarkmarks Registered: Dec 3rd 2004
Lep, would that oscillation be constant, or aided by some feedback
mechanism? I can't imagine how even a single upright object could
be stabilized by constant oscillation.
  • I tried making a simple rotating door on a phys_hinge and even with
friction at 0 it slows down. Have you tried making it negative
though?
Re: Double Pendulum Posted by mazemaster on Fri Jan 7th 2005 at 5:36am
mazemaster
890 posts
Posted 2005-01-07 5:36am
890 posts 438 snarkmarks Registered: Feb 12th 2002
Isnt the double pendulum a dynamical system? (can exibit chaotic behavior depending on starting conditions)
Re: Double Pendulum Posted by Tracer Bullet on Fri Jan 7th 2005 at 5:53am
Tracer Bullet
2271 posts
Posted 2005-01-07 5:53am
2271 posts 445 snarkmarks Registered: May 22nd 2003 Occupation: Graduate Student (Ph.D) Location: Seattle WA, USA
<DIV class=quote>
<DIV class=quotetitle>? quoting Leperous</DIV>
<DIV class=quotetext>/offtopic: One of my maths professors proved that several pendulums attached together can be made to stand upright if oscillated fast enough. I wonder if the Source engine realises this :wink: </DIV></DIV>

Do you mean he actually located a local minimum in the potential energy curve? My experience is that Math Profs tend to be a bit out of touch with reality :razz:
Even if there is a local minimum, there could well be enough energy in the system to get it over the activation barrier one way or another...
Re: Double Pendulum Posted by RealEschaton on Fri Jan 7th 2005 at 7:30am
RealEschaton
19 posts
Posted 2005-01-07 7:30am
19 posts 12 snarkmarks Registered: Dec 30th 2004 Occupation: Student (College) Location: USA
To answer mazemaster's question, yes a double pendulum does exibit behavior that varies greatly based on small changes in initial configuration. I'm sure someone with a background in chaos theory could talk in more detail about it, I just think it looks cool :biggrin: .

I have no doubt that in the abstract world of mathematics, it may be possible to maintain a system of vertical pendulums using certain oscillations, but even if it were possible it would be an unstable equillibrium. One atom out of place, or one rounding error in the quadrillionths column would eventually cause it to become dislodged. I can't think of any system of pendulums that would create a stable equillibrium while sticking straight up.

I've had no luck in reducing the friction, but I have come up with a solution that works OK. I've got a small system of func_tracktrains that move around in a square, and hoist the "upper arm" section of the two massive double pendulums. When they hit you, you feel it... depending on how you get hit the corpse velocity sometimes has to be capped by the engine.
Re: Double Pendulum Posted by Chrasher on Fri Jan 7th 2005 at 11:52am
Chrasher
3 posts
Posted 2005-01-07 11:52am
Chrasher
member
3 posts 0 snarkmarks Registered: Jan 6th 2005
what u could do is use some kinda prop_dynamic model becouse the dynamic models never slow down and make a func_physbox around it and set the flag " debris dont collide whit player or other debris . then make the prop_dynamic parent to the physbox . ingame the dynamic model will just push back every thing that blocks it .