2D Bike physics
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]
Hmmm, can''t really help but I will let you know ''las domania'' was probably elastomania. Cracking game.
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.
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.
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.
Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
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.
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.
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.
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
quote:Original post by cwarwickquote: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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement