rec.autos.simulators

Writing a car simulator

Thomas Hart

Writing a car simulator

by Thomas Hart » Sat, 06 Jul 2002 08:03:03

I'm not sure if this is the purpose of this news group, but I wish to write
a reasonably accurate mathematical simulation of a car for a game project I
am involved with. Now don't misunderstand me, I am not some newbie
programmer asking stupid questions like 'how do I stop the car going through
the hills', the spacialities of it all are sorted, but I have nearly no idea
about the actual functioning of a car. I was wondering if anyone can help?

Some basic questions, probably belying how little I've so far picked up, are
:

- how are wheels connected to the chassis? Are they on suspension only in
one direction, and fixed to moving along a particular line, or is there an
angular range they may inhabit?
- I understand that when you steer, the front wheels turn slightly different
quantities so as to avoid lateral friction. Does anyone have a good
reference for this sort of thing?
- I have been reading up on gear ratios and how to calculate torque based on
RPM and gear - is this enough for a reasonably accurate simulation of the
workings of the engine? How do factors such as the warmth of the engine
affect things?
- is there a good software package, maybe affiliated with some game or
another, that allows me to design a car model and balance various factors in
order to result in both those factors and also centre of mass, mass and
inertia values for the chasis?

I am an undergraduate in maths, so am not scared of complicated calculus
related things, perhaps there is a good text book or online reference
someone could point me at? I had a glance in the library and could see about
20 or 30 books on the aerodynamics of flight, but nothing whatsoever about
cars, which feels a little unfair.

I'm sure there is a lot more to ask I am just not thinking of at this
moment, and that probably some of my questions make little sense or, as I
said, show me to be very lacking of knowledge in many areas. But please help
me?

Thanks in advance, sorry if this isn't the sort of thing this newsgroup is
about,

-Thomas

Jan Verschuere

Writing a car simulator

by Jan Verschuere » Sat, 06 Jul 2002 08:34:00

Cue Doug Milliken for details on how to order his book "Race Car Vehicle
Dynamics" direct from SAE. The complete reference on mathematical modeling
of car behaviours AFAIK. A must read for anyone with a deeper intrest in
racing simulations, IMO, regardless whether one plans to write one or not.
Does wonders for refreshing one's calculus too.

You're on the right group, BTW. Various authors discuss their projects and
the associated problems here. I can't recall how the messages are flagged at
the moment, but I'm sure Ruud, Ashley or one of the others can fill you in
on that.

Jan.
=---

Matthew V. Jessic

Writing a car simulator

by Matthew V. Jessic » Sat, 06 Jul 2002 12:20:52


> "Thomas Harte" wrote...
> > I'm not sure if this is the purpose of this news group,
> > but I wish to write a reasonably accurate mathematical
> > simulation of a car for a game project I am involved
> > with. Now don't misunderstand me, I am not some newbie
> > programmer asking stupid questions like 'how do I stop
> > the car going through the hills', the spacialities of
> > it all are sorted, but I have nearly no idea about the
> > actual functioning of a car. I was wondering if anyone
> > can help?
> > <snip>

> Cue Doug Milliken for details on how to order his book "Race Car Vehicle
> Dynamics" direct from SAE. The complete reference on mathematical modeling
> of car behaviours AFAIK. A must read for anyone with a deeper intrest in
> racing simulations, IMO, regardless whether one plans to write one or not.
> Does wonders for refreshing one's calculus too.

And/Or "Fundamentals of Vehicle Dynamics,"
"Fundamentals of Aerodynamics,"
"Fundamentals of Astrodynamics," (OK, but because it is my  
favorite for vector mathematics review ;) ............

- Matt

M Knor

Writing a car simulator

by M Knor » Sat, 06 Jul 2002 13:10:33

Thomas,

I can't help you with this but would be most interested in the final
product.
I would love a car sim that accuratly reflected the car's performance. I
don't get much from sims where a standard sedan can take a corner at 50MPH.
I would love a program where I could re create my town with ease. I would
want a way of just scanning a mapfrom a street directory, editing it to
remove street names and anything else confusing, then importing that into
the sim editor as a map. Then I would just add in the various levels above
sea level (I know there is a word for it but it escapes me), go into 3D mode
and position trees, gutters, footpaths, houses etc.
I would pay the equivalent of a shop game for something like this. I sure
hope there are others here who think the same.

All the best with your project.

Manfred

Cameron In

Writing a car simulator

by Cameron In » Sat, 06 Jul 2002 14:05:30

Hi Thomas,

check out http://www.racer.nl/

This is the web page for a sim that I think you could use for
inspriation.  It also has lots of links to other stuff sim related.

Best of luck!!

Cameron..

Uwe Schuerkam

Writing a car simulator

by Uwe Schuerkam » Sat, 06 Jul 2002 17:57:22


> Hi Thomas,

> check out http://www.racer.nl/

> This is the web page for a sim that I think you could use for
> inspriation.  It also has lots of links to other stuff sim related.

Yep, I was going to say the same thing. Grab the source and
while you're at it, hack up tyre temperatures and brake wear ;-)

Regards,

uwe

--
Uwe Schuerkamp //////////////////////////// http://www.schuerkamp.de/
Herford, Germany \\\\\\\\\\\\\\\\\\\\\\\\\\ (52.0N/8.5E)
PGP Fingerprint:  2E 13 20 22 9A 3F 63 7F  67 6F E9 B1 A8 36 A4 61

Ruud van Ga

Writing a car simulator

by Ruud van Ga » Sat, 06 Jul 2002 21:16:51

On Thu, 4 Jul 2002 23:03:03 +0000 (UTC), "Thomas Harte"


>programmer asking stupid questions like 'how do I stop the car going through
>the hills',

But stopping the car on top of a hill, now that's a more difficult
one! (archive this and later you'll know what I'm talking about)

They can be seen as fixed to 1 line, but that's not a linear line. The
Millikens also just did a new book, with the work of Maurice Olley in
the '30s. Uses simplified suspension movements.
But RCVD is a must: http://www.millikenresearch.com/books.html

That's Ackerman steering. Not really used on racecars. I think
something like:

O-------O
 \_____/
    |

is used (the lower line is the steering axis, the O's are the wheels.
Keeping a 1:1 rotation of the steering wheels is good enough for a
long time to come.

You'll come a long way with just torque multiplied by gear ratios
(gearbox/differential (also called final drive)).
Get in a torque curve (see Dyno2000 as well) and your engine is half
done (turbo's may very well be emulated nicely with 2 torque curves,
but I haven't ventured there yet).

My own game. ;-) www.racer.nl
And F12k2 may also be very interesting. Apart from that, there is
commercial software out there but most are engineering-oriented (i.e.
no nice graphics but graphs).

Most formulae are just polynomials, or some trig (Pacejka). However,
you can simulate the rigid bodies in a LOT of ways.
ODE is a good physics library (www.q12.org/ode) but may be too heavy
on full suspension simulations still (until CPU's get a little
faster). For games, do most your own way for speed.

Vectors & matrices are a must. The dot product is just about the most
important operation there, esp. with suspension simulation (which can
large be avoided btw by just seeing it as a vertical line).

My site contains quite a lot of links, and a technical section (Docs
-> Technical) with some articles on the programming aspects of sims,
varying largely and also grossly incomplete. ;-)

Good luck!

Ruud van Gaal
Free car sim: http://www.racer.nl/
Pencil art  : http://www.marketgraph.nl/gallery/

Jonny Hodgso

Writing a car simulator

by Jonny Hodgso » Sat, 06 Jul 2002 22:07:25


> I'm not sure if this is the purpose of this news group, but I wish to write
> a reasonably accurate mathematical simulation of a car for a game project I
> am involved with. Now don't misunderstand me, I am not some newbie
> programmer asking stupid questions like 'how do I stop the car going through
> the hills', the spacialities of it all are sorted, but I have nearly no idea
> about the actual functioning of a car. I was wondering if anyone can help?

http://gallery.uunet.be/heremanss/

... is written as a setup guide for R/C race cars, but has some
excellent vehicle dynamics stuff.

As an Auto Eng graduate, I'm really scared to know that the guy
who wrote that page is a computer guy, with no formal vehicle
dynamics instruction AFAIK!

Jonny

Thomas Hart

Writing a car simulator

by Thomas Hart » Sat, 06 Jul 2002 23:21:19

Jan Verschueren ...

:) At 78 I may try to order it through a library, but thanks a lot for the
reference!

M Knorr ...

Then unfortunately you probably won't be that interested! My intention is to
write a realistic car simulation, then to make it unrealistic by
underestimating gravity (or car mass, I suppose) and damage, and possibly
providing some vehicles with impossibly bouncy suspension. I consider this a
favourable approach to starting from the premise that if the end result
isn't going to bare a 100% correlation with real life then I can just make
up the maths.

The game is a partial remake of a very old PC game named variously either
Stunts or Sports 4d Driving if that helps you get an impression of the type
of track we are talking about. However I am not planning to stick to the
somewhat creaky looking physics in that game. I want realistic car handling,
give or take the necessity to allow cars to drive loops and barrel rolls. A
good frame of reference is actually the old arcade machine Hard Drivin',
which seemed to be very proud about its physics but was based around a whole
load of strange stunts. I'm not actually persuaded about the physics in that
game, but it shows that there is a perceived market for realistically
modeled cars doing crazy things.

Sorry!

Ruud van Gaal ...

Thats good, this is about the only part I've managed to find sufficient
online (i.e. free) references to! And is quite easy to understand, which is
nice.

I'm sure anything I can find offers a faster solution that writing my own
tools, no matter how much interfacing must be done. I'll have a look at your
site, also helpfully suggested by Cameron Ing & Uwe Schuerkamp for
documentation purposes. Although chances are I don't have the machine spec.
to actually play the thing.

So far I have read the siggraph '97 course and Chris Hecker's somewhat less
thorough treatment of the topics in relation to getting the physical shell
to react correctly to collisions and forces. I think I understand and can
implement that part, I'm mostly worried about the differences between
something the shape and with mass and mass distribution of a car and an
actual car. I guess if I got the superficial physicalities correct and also
the torque / gear ratios combination I'd wouldn't be doing badly as a
newcomer to the topic?

My main concerns are that I think this, but then I go and see (sometimes
just mentioned in passing) such topics as 'roll centers', 'differentials'
(not the calculus things, obviously) and 'anti drive' and I very soon stop
thinking this! So I thought I would at least determine whether this was the
right newsgroup and whether I was looking at the right sort of references
before I tried to start making sense of it all.

Thanks! It will, at the very least, save me spending an afternoon on google
trying to figure out which threads here have been mathematically related and
which have not. And I'm sure it will do much more than that.

I feel I will need it. Thanks to everyone who responded! Probably see you
all again in a few weeks when I have some stupid question to ask!

-Thomas

Ruud van Ga

Writing a car simulator

by Ruud van Ga » Sun, 07 Jul 2002 00:43:41

On Fri, 5 Jul 2002 14:21:19 +0000 (UTC), "Thomas Harte"


>Jan Verschueren ...
>>Cue Doug Milliken for details on how to order his book "Race Car Vehicle
>>Dynamics" direct from SAE. The complete reference on mathematical modeling
>>of car behaviours AFAIK. A must read for anyone with a deeper intrest in
>>racing simulations, IMO, regardless whether one plans to write one or not.
>>Does wonders for refreshing one's calculus too.

>:) At 78 I may try to order it through a library, but thanks a lot for the
>reference!

There is a program for the libraries, as Doug noted about a month ago.
Try googling for that.

I develop on Linux on a PII-400, Geforce2MX. Runs 20-50fps on the
basic track. Not exactly high specs. :)
The Mac version (ATI Rage 128 16Mb something) seems to do ~20fps on
Carrera, although addmittedly the textures aren't there yet (still
wildly getting it up & running since last week). The PC version is
running here on a PII-400 as well, but admittedly a GF3, which helps a
lot.

...

That's tough stuff (well, for me, I'm not really that kind of a math
wizard). You might be able to use ODE instead, to rid yourself of
rotational dynamics, and use a variation of either the builtin ODE
collision routines (Tri-Tri requires OpCode, which is more work), or
do some collision checking on your own (I used to look a lot at Dave
Eberly's excellent www.magicsoftware.com site; loads of useful
functions).

That's good then. :)

You can simplify the car by a box with nice Ixx,Iyy,Izz inertia values
(matrix/inertia tensor with only the diagonal having values!=0).
For most cars, the inertia values are less than that of an even box,
since most of the mass is close to the CG (fuel/engine...).

You'll be amazed at how fast you can go from nothing to really nice
looking drivable thing, and then how slow things become when you add
details. Put in a Pacejka-type curve for slip vs. force for 4 wheels,
use a 6DOF box and the thing will look good already.

Ruud van Gaal
Free car sim: http://www.racer.nl/
Pencil art  : http://www.marketgraph.nl/gallery/

Doug Millike

Writing a car simulator

by Doug Millike » Sun, 07 Jul 2002 02:10:45

......<snipped>...

I'm not sure which version of Hard/Race Drivin you tried...or what
condition it was in after all these years.

I was part of the Hard Drivin' development team (part time, consulting on
vehicle dynamics) in the late 1980's.  I'm listed on the credit screen
(press the Abort button when not playing) under "Test Drivers"...I wanted
to be listed as "Vehicle Dynamicist" but Atari was paranoid about giving
that term out to their competitors who were still using very phony physics
for their driving games.

We believe that this was the first game of any sort that used "real
physics" like that used in industrial/university driving simulators.  The
first release was obviously very limited in processor power compared to
what can be done now.  For example, that car only had one front and one
rear wheel.  But even the first version had a full driveline with
clutch/auto trans and inertias all through so that the mechanical system
was modeled correctly.

The update game, Race Drivin', has an extra floating point DSP-32 processor
to run the vehicle model and this version has a full 4 wheel model of the
car with proper tire forces, differential between rear wheels, and many
other features of a real car.  The force feedback of the***pit cabinet
versions (not the upright version) uses a direct-drive 90 volt DC motor
that weights about 20 pounds--the steering cues (straight from the vehicle
model) are still much better quality than the steering force available with
any of the home wheels I've tried.

If you stick to the "Speed Track" or "Autocross Track" in Race Drivin'
there are no strange stunts.  The red car (default) parameters are closely
based on the big engine version of the Corvette (400hp at that time).  In
our testing, an experienced Corvette driver/autocrosser was able to slip
right into Race Drivin' and transfer his real driving experience to the
game.
--------

Thanks to all for the nice references to our books.  I'd give you the
www.sae.org links directly for ordering but they are long and always seem
to change--we try to keep our site updated with the latest SAE links.
Start at  www.millikenresearch.com  then go to  books.

-- Doug Milliken
   Milliken Research Associates Inc.
   www.millikenresearch.com/olleyfl.html  <-- review of new book

Thomas Hart

Writing a car simulator

by Thomas Hart » Sun, 07 Jul 2002 08:07:50

By this I did not mean to cause any offense. Although the cinema in
Basingstoke had a Hard Drivin' machine for a large part of the 90's, I have
never played the arcade version. In fact the versions I have played are all
home conversions, including the ZX Spectrum conversion. These retain the
startup text from the arcade machine so continue to boast about a realistic
driving model, however I have the strong belief that they probably do not
duplicate the driving model!

I apologise for any aspersions it sounded as if I were casting.

-Thomas

Thomas Hart

Writing a car simulator

by Thomas Hart » Sun, 07 Jul 2002 09:13:53

Seems to have vanished. It didn't happen to have a mirror, did it?

-Thomas

Ruud van Ga

Writing a car simulator

by Ruud van Ga » Sun, 07 Jul 2002 09:47:19

On Sat, 6 Jul 2002 00:13:53 +0000 (UTC), "Thomas Harte"


>>http://gallery.uunet.be/heremanss/

>>... is written as a setup guide for R/C race cars, but has some
>>excellent vehicle dynamics stuff.

>Seems to have vanished. It didn't happen to have a mirror, did it?

Try http://home.tiscali.be/heremanss/

Ruud van Gaal
Free car sim: http://www.racer.nl/
Pencil art  : http://www.marketgraph.nl/gallery/

Doug Millike

Writing a car simulator

by Doug Millike » Sun, 07 Jul 2002 14:29:13


> >> I'm not actually persuaded about the physics in that
> >> game, but it shows that there is a perceived market for realistically
> >> modeled cars doing crazy things.

> >I'm not sure which version of Hard/Race Drivin you tried...or what
> >condition it was in after all these years.

> By this I did not mean to cause any offense. Although the cinema in
> Basingstoke had a Hard Drivin' machine for a large part of the 90's, I have
> never played the arcade version. In fact the versions I have played are all
> home conversions, including the ZX Spectrum conversion. These retain the
> startup text from the arcade machine so continue to boast about a realistic
> driving model, however I have the strong belief that they probably do not
> duplicate the driving model!

I thought it might be something like that--no offense taken.  The home
conversions were not written by the original game engineers, and as far as
I know only used images from the original arcade game (but I could be wrong
on this -- I've never played anything but arcade versions).

A number of people (including me) still have working Race Drivin' sit-down
cabinet games.  Mine is at a friend's house and will soon be linked for
two-player with another one that he bought used (and repaired).  If you
want to try one, you might post on  rec.games.video.arcade.collecting  to
see if there is one near to you.  While the graphics have very low polygon
count compared to current games, the physics (modeling a sports car, not a
race car) and steering force are still pretty darn good.

-- Doug Milliken


rec.autos.simulators is a usenet newsgroup formed in December, 1993. As this group was always unmoderated there may be some spam or off topic articles included. Some links do point back to racesimcentral.net as we could not validate the original address. Please report any pages that you believe warrant deletion from this archive (include the link in your email). RaceSimCentral.net is in no way responsible and does not endorse any of the content herein.