Jump to content
  • Advertisement

Archived

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

Andos

2D Bike physics

This topic is 5559 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have seen some games with a dirt bike like Trial Bike on www.miniclip.com and played another old game called las domania or something like that. I got interested in the physics behind the bike's movement. How could this be done? [edited by - Andos on September 23, 2003 11:26:37 AM]

Share this post


Link to post
Share on other sites
Advertisement
Like a car but with two wheels instead of four ?

I looked at this a couple of years ago,after doing a 4+ wheeled vehicle simulator, and although I did no coding on it I thought I would work something like this:

Start with a mass on wheels, like a car but with four instead of two wheels.
Add suspension, but make it non-vertical as bike wheels typically move along the forks (front) or around a pivot (rear).
Model the shape of the tyres, e.g. using tori (car wheels are often modelled as sylinders)
Incorporate small gyroscopic effects due to the wheels.
Implement the steering using trail and a semi-intellegent driver.

Other factors, such as friction, drag and the basic dynamics are the same as for cars and other dynamic systems.

The steering is probably the most difficult bit as it''s nothing like a car. To make it at all playable I think you''d need much of the work to be done by an AI driver, who stops the bike falling over: if you ride a bike keeping it upright''s a learned skill that''s probably impossible to reproduce on a game controller. Certainly you need to understand trail as it''s fundamental to the geometry of bike design and dynamics.

Share this post


Link to post
Share on other sites
For a 2D, side-view problem such as the dirt bike game on miniclip.com, a good starting point *might* be a 2D car racing game, e.g., from the side the car effectively has just two wheels also, and steering doesn''t really come into play. But, the interaction with the player might be challenging, e.g., how do you simulate the peddling, which causes a kind of pulsing motion as the bike moves...? I haven''t played any of the bicycle games out there, so I don''t have any strong suggestions, I''m afraid.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

Share this post


Link to post
Share on other sites
Now, I like this canyon glider game on miniclip. Its pseudo-3D, but not really 3D. So it looks more complicated than it is. I also liked that I crashed immediately, got a score of zero, and still received "well done!"

Oh, I just played the trail bike game (they spelled it wrong on the site). Its really cool. And, unfortunately its going to be a bit difficult to adapt a 2D car physics game to this. But, a good starting point would be a 2D rigid body simulation that deals with simple circular masses and simple bars for the rigid body (could be a stiff spring, but this would make it unstable at times). If there were turning then you''d really need to deal with rotational physics, e.g., gyroscopic effects. But you may not have to for just a side scrolling type game.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

Share this post


Link to post
Share on other sites
quote:
Original post by grhodes_at_work
Oh, I just played the trail bike game (they spelled it wrong on the site).


No they didn''t, this is a trials game, trail riding is completly different.

Share this post


Link to post
Share on other sites
I''m experimenting with side-on bike physics at the moment actually... I''m still trying to get collision detection/response working properly though. Once I get the basics of my physics engine down, I''ve got plenty of ideas

Share this post


Link to post
Share on other sites
quote:
Original post by cwarwick
quote:
Original post by grhodes_at_work
Oh, I just played the trail bike game (they spelled it wrong on the site).


No they didn''t, this is a trials game, trail riding is completly different.


Heh heh! Learn something new every day!

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!