How can I simulate off-road physics W/O a physics engine

Discussion about everything. New games, 3d math, development tips...
Post Reply
eye776
Posts: 94
Joined: Sun Dec 28, 2008 11:07 pm

How can I simulate off-road physics W/O a physics engine

Post by eye776 »

Nothing realistic mind you, I'd actually prefer for it to be "arcadish".
I'm currently looking at using 4 ellipsoids w collision for wheel force modeling and 4 springs attached to a plane.

But I can't get around applying the forces on the springs properly.

Any ideas or articles I could read?
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

Stupid question: why not use a physics engine?
ACE247
Posts: 704
Joined: Tue Mar 16, 2010 12:31 am

Post by ACE247 »

Yeah why not? :?
Instead of asking you could long have integrated irrOde into your project already.
Besides, 'simulating' offroad 'physics' just wont be possible without a 'physics' engine. :lol:
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Don't listen to these boring guys. :P

Just code it like "Asteroids", have a rotation independent of velocity (With a bit of friction unlike Asteroids), and you'll be sliding around on the grass in no time!
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
eye776
Posts: 94
Joined: Sun Dec 28, 2008 11:07 pm

Post by eye776 »

@ACE247, slavik262:
Because a physics engine requires an extra layer of integration, and, for this particular game I don't want to recode the collision for EVERYTHING ELSE apart from the vehicle? :D

@BlindSide:
That part, I already coded. The rotation is dependent on the steer angle, and it adjusts itself over time and works great (for what I'm making) on a flat plane.

Actually I wanted to simulate springs on my car (make it "bounce" a little), and didn't know how exactly I should approach that.
I was thinking adding springs to a plane, and making use of a fake Weight equation to :
1) "push" down on the springs (the "mass" of the car)
2) the "wheels" would also "push" up on the springs
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

eye776 wrote:@ACE247, slavik262:
Because a physics engine requires an extra layer of integration, and, for this particular game I don't want to recode the collision for EVERYTHING ELSE apart from the vehicle? :D
There's a reason games use them: I'll bet you that you'll write more code implementing your own physics than that extra layer of integration. Use the tools you have instead of reinventing the wheel. And as for only applying it to the vehicle, you can just do that. Nobody says you have to make all objects in your game respond to physics.
eye776
Posts: 94
Joined: Sun Dec 28, 2008 11:07 pm

Post by eye776 »

@slavik262:
I can't use a physics engine for this one, because the vehicle (not a race car) is not exactly supposed to flip over (Standard ray-cast cars flip over A LOT).
Writing the necessary motion constraints for this task (any examples here ?) is a much harder/time consuming task (Bullet is a bit easier, but still...) and
this project doesn't warrant the effort.

As a side joke :D if I had the time I WOULD rewrite it from scratch.

Anyway, I'll try some simple spring modeling (constrained by hand not to make the vehicle take-off on every bump) and see if that works.

PS:
@ACE247
Decent vehicle ODE constraints are a college-degree math nightmare to write and deploy. At least if it's still the ODE I remember from my exploits with GLScene and ODE from quite a few years ago.
ACE247
Posts: 704
Joined: Tue Mar 16, 2010 12:31 am

Post by ACE247 »

eye776 wrote:@slavik262:


PS:
@ACE247
Decent vehicle ODE constraints are a college-degree math nightmare to write and deploy. At least if it's still the ODE I remember from my exploits with GLScene and ODE from quite a few years ago.
Its obvious you haven't read my first post correctly. I said irrOde.
Makes things so much easier. :lol:
eye776
Posts: 94
Joined: Sun Dec 28, 2008 11:07 pm

Post by eye776 »

Sorry for not answering sooner.

I did notice you said irrODE, as I was stating irrODE (ODE) has a very bad default vehicle. I would need to write advanced constraints for it just to keep it from flipping over too often.

Since I'm VERY bad at college level math (I'm a CS student and have a s***load of failed math exams), the constraints would be unprofessional, act as bad as if they were written from scratch and (as a bonus) take a lot of processing time.

Physics engines are great when bought in commercial packages with constraints (Unity, Torque) or tightly woven SDK's (PhysX, Havok, Newton), but a nightmare to customize and use when standalone (ODE, Bullet).
Post Reply