Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 


Submitted by Rui Martins, posted on September 06, 2000




Image Description, by Rui Martins



This is the current state of the Art on image quality has all of you can witness. ;-)

[Top Left] The MultiColor Car is cruising with the wheel trails ON.
[Top Right] A closer look of the cars.
[Bottom Left] The inside (pilot) view of a car, when making an Hard Left Turn.
[Bottom Right] A view of the Colored Car with Graphical Debug Turned ON, which enables us to see the actual diferent speeds each wheel has and the Virtual curve Center.

What I have been really trying to make correct is the physical behaviour/handling of the car.

Currently the entire world of Racer is plane FLAT, it's easyer to implement for now. But you can Edit the track file (*.trk) !

The Suspension and Inercia are Implemented, and the timing should also be ok.

But there are two inconsistencies, lets see if any of you can find them out, besides the non implemented Features. ;-)

See ya

P.S. Almost forgot, after all the trouble to make the page, for a runnable demo just go here.

P.P.S There is NO music, NO Sound, no Colision Detection, NO Sliding, NO Speed Limit (air resistance should take care of this when implemented) and NO joystick support (didn't have the time to include it, sorry) which means no Force-FeedBack 8-).

Rui Martins


[prev]
Image of the Day Gallery
www.flipcode.com

[next]

 
Message Center / Reader Comments: ( To Participate in the Discussion, Join the Community )
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
Mace

September 06, 2000, 02:51 AM

Damn nice screenshots.
The gfx reminds me of Stunt Race FX for the SNES...
those where the days. :)
Even though it did not have any textures, it had a very special feeling and a unique look and style.

What im trying to say is:
Conscentrate on the gameplay and not the gfx...
just because a game doesnt look as technically advanced as commersial games today, doesnt mean that it can be as fun to play.

Those of you who have played Liero (Worms with grapple hooks) knows what i mean (find it at http://www.freesmallgames.com/)

 
Alex J. Champandard

September 06, 2000, 04:55 AM

Hey,

It's looking good... you must be using really small time steps for your integration 'cos the movement is really smooth.

Few suggestions: the steering is a bit sensitive, and the friction (or rather damping) seems a bit overkeen.

I'm impressed you managed to get your cars running on a flat plane without any collision detection ;) Hehe... But seriously, you'll start running into trouble when you use anything else but a plane, and try to handle interpenetrating bodies. So make sure you're collision system is up to scratch. I had a nightmare of a time trying to get my simulator not to crash (or not to eat up all the processing power in very long loops) in some conditions.

Btw, the README.TXT file wasn't in the archive when i downloaded it (9:45 GMT).

Alex

 
Dominic

September 06, 2000, 08:47 AM

I like it, i like it a lot!

just from looking @ the screenshots, i could tell that you've focussed on the handling and playability. this is Good Thing.

i'm in a similar position with my app: collision detection and physics simulation are damn tough (much harder than brute force triangle drawing IMO).

 
J-S Perrier

September 06, 2000, 10:04 AM

Hi,
Nice car simulation. Did you use rigid body physic for that? And if so, how many "body" do you have in the simulation? The moves are very nice. When you'll have sliding and damping/friction (which goes together), you'll have something much more realistic.

Regarding the "bug" in the Fog you mentionned on your web page. I didn't encounter this "bug" on my GeForce. And the GeForce does per pixel fog instead of per vertex fog. Which means that the fog is not dependent on the tesselation of the scene (in the per pixel case). In the case you mentionned, I guess that the ground is simply compose of one big square tesselated in 2 triangles. Since the fog is computed per vertex in your case, it will result in having the fartest vertex completely fogged out and the closest vertex not fogged at all. Then, when the rasterizer draws the polygons, it will simply do a linear interpolation in screen space which totally destroy the fog effect. To solve this, you do one thing: tesselate your big square in a greater number of smaller triangles (you can do a 20x20 grid or something like that). This should greatly reduce this effect caused by the per vertex fog.

I hope it helps...

 
Rui Martins

September 06, 2000, 12:07 PM

Sorry if this message gets posted twice, somehow the site or the browser Let me down. after several refreshes I could see it so I reposted it.

> It's looking good... you must be using really small time steps for your integration 'cos the movement is really
> smooth.

That Really depends on the frame rate you are getting.
I draw a frame, notice the time it took (Delta Time), and then I plug it (delta Time) into to my Physics Formulas.
the faster the Frame Rate, the smoother the ride ;))

> Few suggestions: the steering is a bit sensitive, and the friction (or rather damping) seems a bit overkeen.

It is , isn't it ?

Well, that's because I haven't coded support for joystick iet.
We have to do a lot o juggling when trying to handle a car with a keyboard, due to its On/Off behaviour.
I had to implement a time constant speed steering, so that the folks with a faster card would be able to stear at normal speed, and NOT lightSpeed ;)

> I'm impressed you managed to get your cars running on a flat plane without any collision detection ;) Hehe...

It was really hard ! 8)
I had to implement some sensors into the cars, just to be able to dodge the world objects. 8))

> So make sure you're collision system is up to scratch.
Thanks for the tip, but that's one of the reasons it isn't done iet. I need some extra time (which I don't have right now) to do it correctly.

> Btw, the README.TXT file wasn't in the archive when i downloaded it (9:45 GMT).

You are right, I will put it in the web page as sson as I finish this post. Sorry about that folks !

> Nice car simulation.

Thanks for the compliment, from all of you guys.

> Did you use rigid body physic for that? And if so, how many "body" do you have in the
> simulation? The moves are very nice.

You could call it Rigid Body Movement, but Not in the sense of a physics (rigid Body) Engine.
The physics (formulas) are all "hardcoded" in the simulator.

> When you'll have sliding and damping/friction (which goes together),
> you'll have something much more realistic.

Next step ! Not much far, if I have the time

> Regarding the "bug" in the Fog you mentionned on your web page. I didn't encounter this "bug" on my
> GeForce. And the GeForce does per pixel fog instead of per vertex fog.

Good News ! But the per pixel fog has to be setup by the application, and the simulator uses per vertes fog, so you shouldn't have seen it any other way !
Notice that the Bug can only be noted, if you go slow, so to be able to stop and see it.
Could you Re-Check ?

> In the case you mentionned, I guess that the ground is simply compose of one big square tesselated in 2 triangles.

Actually an hexagon ( I believe ), but just check the skydome file, you can edit too, it's easy, the opengl way.

> Since the fog is computed per
> vertex in your case, it will result in having the fartest vertex completely fogged out and the closest vertex
> not fogged at all. Then, when the rasterizer draws the polygons, it will simply do a linear interpolation in
> screen space which totally destroy the fog effect.

Thats exactly what is hapenning !
The problem is in the driver, since clipping shouldn't affect the way a poly is drawn, especially the color.
I think that the Fog is beeing applied before the clipping takes place, and the clipping algo, doesn't seem to know anything about linear interpolation of colors.

See ya

 
J-S Perrier

September 06, 2000, 05:50 PM

Hi again,
Just answering some answers...

> Good News ! But the per pixel fog has to be setup by the
> application, and the simulator uses per vertes fog, so
> you shouldn't have seen it any other way !

Well, to be exact, I have a GeForce Quadro (Gloria II) at work. It does the per pixel fog by default. The glHint(GL_FOG_HINT, GL_DONT_CARE), which is the default I think, is per pixel fog anyway. I am not even sure that it is possible to do per vertex fog with this card... I rechecked "racer.exe" and the fog was really nice and smooth.

> The problem is in the driver, since clipping shouldn't
> affect the way a poly is drawn, especially the color.
> I think that the Fog is beeing applied before the clipping takes
> place, and the clipping algo, doesn't seem to know anything about
> linear interpolation of colors.

This is a common problem you'll find also if you do per vertex lighting in OpenGL. The only acceptable trade off (beside buying a more expensive graphic card that does per pixel lighting) is to have a finer tesselation of you objects. In your case, the skydome bottom should have a lot more than 8 vertices. Try subdividing your polygons a couple of times (that can be done after you've loaded your x3d file).

happy coding!




 
Marko

September 06, 2000, 06:51 PM

How do you produce the tire trails? Is it something like NURBS or just plotting pixels or lines?

 
TheThief

September 06, 2000, 10:20 PM

Where did you get the physics formulae? I have looked all over the internet for a week, but I only found the Ted Zuvich GDC paper, and that doesn't describe it in detail.

 
Alex J. Champandard

September 07, 2000, 04:26 AM

TheThief,

A very good place to start is Chris Hecker's tutorials and links:

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

If you need more information after that, you're a step ahead of me :P

Alex

 
Rui Martins

September 07, 2000, 07:52 AM

> Well, to be exact, I have a GeForce Quadro (Gloria II) at work. It does the per pixel fog by default.

I seem to remember to have forced it to linear fog (per vertex), I'not sure right now, must check.

> I rechecked "racer.exe" and the fog was really nice and smooth.

Could you send me a picture of it ?
I will post a modified skybox, which will add lines showing the bottom triangles edges, or you could do this yourself in the file. can you ?

> How do you produce the tire trails? Is it something like NURBS or just plotting pixels or lines?

I have a C++ object (tracer), which keeps the last N positions (=>frames), an object (wheel) has been before.
Then I just draw a GL_LINE_STRIP from last to first.
If your frame rate isn't smooth, you will see the lines clearly. (try running several Racer.exe, or other OGL applications at the same time).

> Where did you get the physics formulae?

Bangging my head on the Keyboard! 8)))

> I have looked all over the internet for a week, but I only found the
> Ted Zuvich GDC paper, and that doesn't describe it in detail.

I looked in the web for some info, but there is very few, directly concerning Cars simulation, but there are some with general physics in mind.
Maybe I'll write some paper after I'm done with the simulator, probably with some source to go with.

But I would like to see the "Ted Zuvich GDC paper", where is it ? URL ?

> A very good place to start is Chris Hecker's tutorials and links:
> http://www.d6.com/users/checker/dynamics.htm

As Alex said, this is a very good place to go for info about physics, but it treats it generally, although it as some code examples. Even seen these thow.

Thanks for the input.

See ya

 
NatureMan

September 07, 2000, 09:19 AM

ppl didn't any of you take physics in school? even basics?
any how just imagine you're in a car and think about the forces at work, then experiment...

you have forward acceleration, then, with no force applied, you have momentum which decreases gradually because of friction
around turns you change direction of the force applied, but you still have momentum in your last direction and the friction of each tire holding the car to the road, when one or more tires lose friction the car slides. Any tires that didn't lose friction don't slide, and the car spins. eventually friction will again take hold of the tires, if the car is sideways when that happens it might flip... during all of this your car has a "center of gravity" which depends pretty much where the engine is and how much it weighs and how the weight is distributed through out the car. you need this to figure the behavior of the car during jumps, and when deciding how the car will spin in a slide.

on a friction scale of 0-10, I would put ice at 1 and pavement at 8
and a tree at 9.99999 ;)

and there's more to it than that, but if you think you'll come up with it

acceleration and momentum are vectors. friction is constant
note that center of gravity is not the same as a pivot point!

 
Rui Martins

September 07, 2000, 03:23 PM

Well, those were my thoughts, before starting "Racer".

After messing with some physics, our pseudo theory, gets complicated in reality. 8-(

See ya

 
TheThief

September 07, 2000, 11:41 PM

the paper is at www.gdconf.com

go to archives, then 2000 proceedings

however, you need a free gamasutra id

Chris Hecker's site is good, but it doesn't fit very well with the GDC paper. That's why I was wondering if there are any other sites. I already have a basic euler integrator that supports rigid body physics of boxes.

 
This thread contains 13 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.