Archived

This topic is now archived and is closed to further replies.

Oxmyx

Arcade-style car simulation without physics

Recommended Posts

I have a terrain and a car that drives on this terrain. Currently the car simply aligns itself with the terrain polygon directly below it. It works fairly well, but the car is completely unsprung and desperately needs some kind of car simulation to make it feel like a car, and not some kind of sticky object. However, I don''t know enough physics to do a real physics engine that could simulate friction, weight transfer, etc. in full detail. How would you design a really simple car model that is fun to play in an arcade-style way, but doesn''t require an entire physics engine to work?

Share this post


Link to post
Share on other sites
It depend on how features you want to include.
Would you like your car to be able to:
- spring
- lean in corners
- skid, drift in corners,
- turn around,
- jump?

Any of these needs some physical modeling. To make the car spring, you have to apply spring-damper physics formulas. And you should use some kind of numeric integration.
Don''t afraid. It''s not that difficult. Just begin it with the most basic things.

Is your work available? I would look at it.

Share this post


Link to post
Share on other sites
I''m not saying that this is the way to go, but I might mention it, since it''s a cheap and easy way to do 3D vehicle physics. It''s a bunch of 3D cars on a heightmap, you can steer one of them, the others are randomly controlled.

it''s based on Thomas Jakobsen''s advanced character phsyics article (easy google), bunch of particles strapped up with stiff constraints. The car is separated into 5 bodies. 4 wheels, and a chassis. The front wheels are steerable (that was on of the tricky parts, actually), the rear wheels are powered (if I remember correctly, the front wheels have no power). arrow keys to move the car (watch out for the braking ), a, w, s, d, tab, capslock for the camera, ''r'' for reseting.

the heightmap and the texture uses a simple perlin noise terrain generation, the vehicles, as I said, are just made of particles and stick constraints. The wheels are rotated by pressing the throttle, this, in turn, moves the particles, which end up colliding with the terrain. They are then put back on the surface of the terrain, and the stick constraints are enforced, and generate automatically fricitonal effects and angular and linear momentum, thus moving the car in the direction it is supposed to. The car also skids, which is a nice side effect of the technique. The major drawback is the top speed, and the general behaviour of the car is highly dependent on fractors that are hard, or impossible to control directly.

The collision between cars is not it''s strongest point

As I said, it''s cheaply made, but gives a good, fun result for little efforts.

if the download fucks up, go to
http://uk.geocities.com/olivier_rebellion/, "3D verlet vehicle on terrain".

Share this post


Link to post
Share on other sites
quote:
Original post by szinkopa
It depend on how features you want to include.
Would you like your car to be able to:
- spring
- lean in corners
- skid, drift in corners,
- turn around,
- jump?

Any of these needs some physical modeling. To make the car spring, you have to apply spring-damper physics formulas. And you should use some kind of numeric integration.
Don't afraid. It's not that difficult. Just begin it with the most basic things.

Is your work available? I would look at it.



I'm afraid that's not possible, since I haven't got enough webspace. But I have a few screenshots: 1, 2, 3

Do you have any site that explains the fundamentals of physics simulation?



oliii: Thanks, I'll have a look into that.

[edited by - Oxmyx on May 19, 2004 9:14:38 PM]

Share this post


Link to post
Share on other sites
the first docs that comes to mind are chris hecker''s physics tutorials.

http://www.d6.com/users/checker/dynamics.htm

it''s a first step, in 2D, but it is a lot easier to understand atr first.

http://freespace.virgin.net/hugo.elias/models/m_main.htm
http://www.cs.unc.edu/~ehmann/RigidTutorial/

for tyre models, http://members.xoom.virgilio.it/adiaforo/epcjk.htm

some basic car dynamics,
http://www.3impact.com/3Impact_Engine/simplecar.htm
http://www.welltall.com/ymc/discovery/car_physics.html

then the classic Physics Of Racing Series, by Brian Beckman
http://www.miata.net/sport/Physics/

and the best of the best
http://www.racer.nl

to be frank, if it''s for an arcade game, and you have little experience in physics, I highly recommend using a physics engine, such as Tokamak or ODE, they have demos of cars driving on terrain already.

http://www.tokamakphysics.com
http://ode.org/
http://www.physicsengine.com

Share this post


Link to post
Share on other sites
Actually I have already tried ODE (the only physics engine I know of where a Delphi conversion exists). But I can''t get it to work properly. My car always topples, and if I lower the center of mass so it doesn''t topple, it behaves strangely.

Share this post


Link to post
Share on other sites
Sites:

Tyre:
http://code.eng.buffalo.edu/dat/sites/tire/tire.html

Driveline and some other docs:
http://www.fs.isy.liu.se/Publications/

Some basic info, not formula:
www.howstuffworks.com


The screenshots are quite good, interesting vehicle , it would be fine if it behaved realistic.

If you are interested in my work, see my profile.

Share this post


Link to post
Share on other sites
I am glad about it. But unfortunatly the code itself is not available, but I can probably answer if you have any question.
In the "Choice of physics" I have already given a lot of hints to nroc to begin making such a sim as mine. It''s basic physics, mostly Newtons laws, like F=m*a (linear motion) and T=I*A (rotational motion). chack it out and try to do the same as nroc.

Share this post


Link to post
Share on other sites
Feel free to nick anything you like from

http://www.rowlhouse.co.uk/jiggle

The cars in there use a raycast for each wheel to generate the suspension forces. Then the drive/grip forces are calculated for each wheel - There''s a lot of scope for improvement.

Another way is to use the raycast for the suspension forces, but for the drive/turning (etc) forces/torques calculate them for the car as a whole - not per wheel. I.e. do things like have a lookup table that tells you what the turning torque will be for a given car speed/steering wheel angle etc.

Share this post


Link to post
Share on other sites