• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

(Realistic) Sliding?!! Halp

Status
Not open for further replies.
Level 3
Joined
Jun 14, 2007
Messages
56
Yeeah, SUP G

So what I'm trying to do is create a realistic 'sliding' movement style.

A 'car on ice' type situation. And realistic, not like the maze games from war3 where you would have maneouver between objects with complete control over steering, but rather one where you try to steer but you would slide outwards when taking corners, etc

So basically its a question of acceleration!

At the moment:
JASS:
real acceleration = 0.01 (constant)
real x velocity
real y velocity
unit u
real x
real y
point d

if the x of u < the x of point d then
set x velocity = x velocity + acceleration
else
set x velocity = x velocity - acceleration

and then repeat for Y values

and then move unit to his location + x velocity + y velocity

(the above written correctly)


This gives a rough simulation of what I want, he accelerates towards a point and curves out on some corners, but its far from perfect.

So please, people of the interweb may you help me with this functionn?

What am I doing wrong, good sir? Should I be using vectors for acceleration? Or is the effect achieved in a completerly different way?!
 
Level 7
Joined
Apr 23, 2007
Messages
326
Also you need to account for the friction generated by the tires and the object's directed momentum not to mention the surface of the...

Meh try vectors they never hurt anyone.
 
Status
Not open for further replies.
Top