Whirlpool

Questions and answers about the how and why of making maps.
Post Reply
User avatar
jftsang
Private First Class
Private First Class
Posts: 64
Joined: Sat Mar 03, 2007 11:32 am
Location: United Kingdom
Contact:

Whirlpool

Post by jftsang »

I'm trying to make a whirlpool map where the player spins around on a disk and there is a death physics driver in the middle, and the player is spun arounds and sucked inwards. How would I program that using physics drivers? Like this?

Code: Select all


physics
 name centre
 death You were sucked into the whirlpool
end

physics
 name whirlpool_spin
 angular 10.0 [whereever the centre is]
end

physics
 name whirlpool_drag
 [WHAT DO I DO HERE?!?!??!]
end

thank you
User avatar
Spazzy McGee
Sergeant Major
Sergeant Major
Posts: 1405
Joined: Mon Mar 21, 2005 4:59 pm
Location: Planet MoFo, Sheffield Division; United Kingdom

Post by Spazzy McGee »

I think you may have hit a dead end.

As far as I know, you can't have a radial drag towards a central point using one driver, however, you may be able to achieve it by using several segments with different drivers pointing towards the centre, for example in this arrangement:

Image

You use the 'linear' property to do this - see http://my.bzflag.org/w/Physics - you'll have to calculate the directional speed for each of the segments though.

The thing is... I'm not sure how you would achieve both motions at once, using the segments method. You may be able to add the same angular motion to all of the drivers for each segment - you can have to properties per driver.

Code: Select all

physics 
 name whirlpool_1 
 angular 10.0 [point of rotation[
 linear 10 0 0
end 
"Life is what happens to you while you're busy making other plans." - John Lennon
anomaly
Private First Class
Private First Class
Posts: 220
Joined: Tue Jul 26, 2005 10:32 pm
Location: Gainesville Florida

Post by anomaly »

Code: Select all

physics
   name whirlpool
   angular 10
   linear 10 0 0 
end
problem is the X value of 10 in the linear option points in the positive X direction. the other side of the disk would need to point in the negative X direction. some other positions on the disk require both X and Y in both the positive and negative directions.

it would be nice to be able to do that, but at this time is might be quite a feat to accomplish.
good luck and please post if you succeed
User avatar
Tedius
Sergeant First Class
Sergeant First Class
Posts: 142
Joined: Tue Sep 19, 2006 6:10 pm
Contact:

Post by Tedius »

Spazzy and anomaly are both correct as usual. I have a square version of what they have suggested running at:
tedius.dyndns.org:5171

my code looks something like this:

Code: Select all

physics
   name spin
    angular 0.05000 0.0 0.0
    linear -50 -50 0
end
physics
   name spin2
   angular 0.05000 0.0 0.0
  linear 50 -50 0
end
physics
   name spin3
   angular 0.05000 0.0 0.0
  linear 50 50 0
end
physics
   name spin4
   angular 0.05000 0.0 0.0
  linear -50 50 0
end
and the 4 quadrants have the phydrv's applied to them as would be expected..

Code: Select all

define NEQuadrant
  mesh
        vertex 200.0 200.0 3.0000000    #0 
        vertex -200.0 200.0 3.0000000   #1  
        vertex -200.0 -200.0 3.0000000  #2   
        vertex 200.0 -200.0 3.0000000   #3  
        face
          vertices 0 1 2 3
          phydrv spin
          matref ocean
        endface 
  end #mesh
enddef
define NWQuadrant
  mesh
        vertex 200.0 200.0 3.0000000    #0 
        vertex -200.0 200.0 3.0000000   #1  
        vertex -200.0 -200.0 3.0000000  #2   
        vertex 200.0 -200.0 3.0000000   #3  
        face
          vertices 0 1 2 3
          phydrv spin2
          matref ocean
        endface 
  end #mesh
enddef
#etc. etc...
An unexpected problem I ran into involves the angular physics driver and frame rate. If my frame rate is very high (>60 or so) I end up spinning uncontrollably as if I hit a patch of black ice. If I turn on Energy saver (capping frame rate at 30fps), my tank acts as normal.
this signature intentionally left blank
User avatar
Enterprise
Private First Class
Private First Class
Posts: 6
Joined: Fri Mar 23, 2007 7:28 pm
Location: Boldly going where no man has gone before

Maelstrom

Post by Enterprise »

Im trying to make the ships for the server, and am drawing on google sketchup, before sending to jftsang to finish off before sending to Tedius. If i draw them on google sketchup is that Ok to be put on the server, or do i need to draw them in another programme?

P.S.
jftsang may not have mentioned this but I was the one that had the idea, I just lack the knowledge and time to make the server and host it. :?
User avatar
TD-Linux
Sergeant
Sergeant
Posts: 724
Joined: Wed Apr 27, 2005 8:26 pm
Location: Mountain View, CA

Re: Maelstrom

Post by TD-Linux »

Enterprise wrote:Im trying to make the ships for the server, and am drawing on google sketchup, before sending to jftsang to finish off before sending to Tedius. If i draw them on google sketchup is that Ok to be put on the server, or do i need to draw them in another programme?

P.S.
jftsang may not have mentioned this but I was the one that had the idea, I just lack the knowledge and time to make the server and host it. :?
Sure, sketchup will work to make meshes. You will then have to run the mesh file through a converter (possibly several) to be able to put it into a map.
User avatar
Peter
Private First Class
Private First Class
Posts: 354
Joined: Tue Jan 23, 2007 5:44 pm
Location: 127.0.0.1
Contact:

Post by Peter »

No need to go off topic with the sketch up thing there is a topic on it in "map editors".
“Roses are #FF0000, violets are #0000FF, all of my base are belong to you.” ~ Nerd on Colour
User avatar
big_daddy2
Private First Class
Private First Class
Posts: 131
Joined: Sat May 06, 2006 1:06 am
Location: the middle of nowhere, USA

Post by big_daddy2 »

why dont u use a texture matrix with a spin value?
User avatar
CannonBallGuy
Private First Class
Private First Class
Posts: 2083
Joined: Wed Apr 12, 2006 1:31 am
Contact:

Post by CannonBallGuy »

A texture matrix involves a moving texture. It will not affect any tanks.
This is a topic about physics.
Image

Merry Christmas!

"Look, if I don't buy booze for the kids, I don't get any incriminating pictures to show to their parents, my business goes down the sink, my girlfriend leaves me and the baby goes on ebay. So help me search..."

"go Play With Toys urself in a dark alley u donkey ******" - Lt-Kirby2007
User avatar
big_daddy2
Private First Class
Private First Class
Posts: 131
Joined: Sat May 06, 2006 1:06 am
Location: the middle of nowhere, USA

Post by big_daddy2 »

i know that but what i was saying was why move a tank and kill it when u can make it look like its spinning and kills it, i mean since u have a death object ur not going to spin, and it wont even look like its spinning


just add a phydrv with a death to the texture matrix :wink:
User avatar
A Meteorite
Private First Class
Private First Class
Posts: 1786
Joined: Thu Apr 28, 2005 12:56 am
Location: California, U.S.
Contact:

Post by A Meteorite »

big_daddy2 wrote:i know that but what i was saying was why move a tank and kill it when u can make it look like its spinning and kills it, i mean since u have a death object ur not going to spin, and it wont even look like its spinning
jftsang does not want the whole disk to have death - he just wants the center to have it and for tanks to be sucked towards the center.
jftsang wrote:I'm trying to make a whirlpool map where the player spins around on a disk and there is a death physics driver in the middle, and the player is spun arounds and sucked inwards.
Image
Owner @ BZFX
Core Admin @ CAN

Email me: bzmet…@gmail.com
Post Reply