Blitz: Easy Car Physics?

Moderator
Posts: 682
Joined: 2002.11
Post: #1
I'm writing a 2D game that involves the player's care and maybe 3-8 other cars. I need them to drive like real cars, without making my head explode. I couldn't follow the sites on the links page. Any help?

Remember, high school sophomore here. Haven't had an insane amount of math.

My web site - Games, music, Python stuff
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #2
This page looks good: http://home.planet.nl/~monstrous/tutcar.html

- Alex Diener
Quote this message in a reply
Sage
Posts: 1,066
Joined: 2004.07
Post: #3
diordna, I tried using that website but it was hard for me to code out what needed to be in there, so if you do figure it out, could you perhaps let me see how you did it? It would help me out a lot.
Quote this message in a reply
Moderator
Posts: 682
Joined: 2002.11
Post: #4
Yeah, that's one of the pages that lost me, sorry Alex. I might just hack something together.

My web site - Games, music, Python stuff
Quote this message in a reply
Member
Posts: 184
Joined: 2004.07
Post: #5
Depending on what you're going for, you can probably fake 2D car physics by just having spaceship physics combined with a continual reduction in velocity (that is, you have two keys to rotate the car left and right, and one key to speed the car up, like a spaceship, but the car would continually be slowing down.) You could add a slight bit more realism to this model by continually changing the velocity of the car to the direction the wheel is pointing.
Quote this message in a reply
Moderator
Posts: 682
Joined: 2002.11
Post: #6
Okey dokey, without any help from those pages and using only 86 lines of BlitzMax code, I have come up with this:

http://diordna.macintoshdevelopers.net/FlocksEntry.sit

The question here is not whether or not it's realistic, it's whether or not it's realistic enough to work *for a game.* Don't nitpick please Smile

My web site - Games, music, Python stuff
Quote this message in a reply
Member
Posts: 118
Joined: 2002.08
Post: #7
while it isn't "realistic" persay (but then...what is realistic?Wink), it does have a nice arcadish feel. You need to add in some friction so the car won't keep moving at the same speed forever.
Quote this message in a reply
Moderator
Posts: 682
Joined: 2002.11
Post: #8
Huh, looks to me like somehow my post got moved down...anyway...

In case I didn't already say this for newcomers...ASDW/Space. WS control speed, space brakes.

I really don't like the hold-to-accelerate-let-go-to-slow-down because then you have to keep tapping it. I really like this right now because you can control how fast you go, and the faster you go the less control you have. I'd like to have both, but that would require me having some sort of gas pedal device which, unlike keyboard keys, has more than just an on/off state.

Any thoughts on how to do both?

My web site - Games, music, Python stuff
Quote this message in a reply
Moderator
Posts: 130
Joined: 2002.04
Post: #9
Instead of controlling your speed in a similair way of Elite, I would use an accelerate button. The longer you hold it, the faster it goes, I think it will feel much more like a car then.

"Gameplay Uber Alles. And if you can make it psychedelic too, great!" - Jeff Minter
Quote this message in a reply
Member
Posts: 370
Joined: 2002.04
Post: #10
Definitely go for the acceleration/friction. But it does feel pretty nice, with the whole swinging back end thing.

Did you ever wonder why we had to run for shelter when the promise of a brave new world unfurled beneath the clear blue sky?
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Easy array question Achithyn 7 3,635 Aug 1, 2006 05:35 AM
Last Post: Achithyn