playMaker

Author Topic: Trying to make a vehicle steer  (Read 1811 times)

graniteoctopus

  • Playmaker Newbie
  • *
  • Posts: 3
Trying to make a vehicle steer
« on: July 20, 2013, 05:50:57 AM »
So im working on a racing game in the vein of wipeout and f-zero, floating futuristic vehicles racing along a floating track.

I have almost everything in the game working, except one crucial aspect...STEERING.

ive got an FSM set up that applies force to the vehicle along it's local Z axis whenever im pressing a key, but try as i may i cant get the steering to work properly.

ive tried multiple solutions. I tried rotation transforms and adjusting the torque of the vehicle, and whilst these were fine when force was being applied to move the vehicle forward by holding the acceleration key, the second i released the key and let it move on its own momentum, the vehicle would simply rotate without changing the direction the vehicle is moving in, as if i was drifting.

As such im wondering if anyone knows how to change the direction of a moving vehicle that is being moved through the scene using addforce. any advice would be appreciated, as well as any possible links to written/video tutorials.

thanks.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Trying to make a vehicle steer
« Reply #1 on: July 28, 2013, 05:01:13 PM »
Hi,

 Tricky indeed. basically you should understand that a free floating object does drift very much like an object in water or in space, so you might requiere some fine tuning.

You should approach this as a plane with a magnetic link with the track. so cut down the problem.

--- can you fly a plane realistically?

1: have a box, and a camera following the box. can you have the box give the feeling of fyling like a plane, as you move up and down, left and right?

2: can you have this box flying in an environment? sometimes the environment is too small or too big, so you'll need to ajdust the physics and forces for the plane to fly realistically within the various props

-- can you make a box follow a plane based on a distance?

1: try to constraint a free floating physics box so that it's always within a certain distance of the plane surface ( hint: use raycast to find the distance between the box and the plane, and apply force based on that distance)

2: now, try to push it and have your system counter your action so that it tries to keep it at this distance exactly, you will have some bouncing around and stuff.

-- Now combine both, you should be pretty close to a wipe out type of vehicle.

keep at it, this is far from being the easiest behavior to reproduce.

bye,

 Jean


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Trying to make a vehicle steer
« Reply #2 on: July 28, 2013, 05:51:01 PM »
me again :) could not resist some research.

 http://www.polycount.com/forum/showthread.php?t=93049

bye,

 Jean