170 likes | 848 Views
Issues in the Physics of a Motocross Simulation Benoit Chaperot, Colin Fyfe, School of Computing, University of Paisley, Paisley, PA1 2BE, SCOTLAND . Motocross The Force Motivations: Create a game with strong simulation content
E N D
Issues in the Physics of a Motocross Simulation Benoit Chaperot, Colin Fyfe, School of Computing, University of Paisley, Paisley, PA1 2BE, SCOTLAND.
Motocross The Force Motivations: • Create a game with strong simulation content • Use Computational Processing power for physics simulation and AI, not only for graphics • First game to apply rigid body simulation for the control of a motorbike • Investigation of advanced AI and game development techniques
Riding a bike: Theory • A motorbike is by nature stable due to: • Gyroscopic precession: in rotating bodies, an applied force is manifest 90 degrees later in the direction of rotation from where the force was applied. • Rake angle and trail: wobble and weave are diminished because, when the wheel is pointing at an angle other than straight ahead, the contact patch is not in alignment with the direction of travel of the bike. A restoring force is applied to the contact patch by the ground which attempts to force that alignment.
Rake angle and trail: wobble and weave are diminished because, when the wheel is pointing at an angle other than straight ahead, the contact patch is not in alignment with the direction of travel of the bike. A restoring force is applied to the contact patch by the ground which attempts to force that alignment.
Three main forces acting on the bike: • The weight, acting down: Fg= mg • The centrifugal force, acting horizontally, directed towards the outside of the turn: Fc= mv²/r • The contact force, from the contact between the tyres and the ground.
Possible libraries for vehicle simulation: • A general purpose rigid body simulation library: it gives a lot of freedom and flexibility to developers to experiment and implement realistic vehicle simulation • A vehicle simulation library: development is easy however not as much flexibility as when using a general purpose rigid body simulation library • In-house solution: creating an In-house rigid body simulation library may cost a lot of money
Advantages in using Open Dynamics Engine: • Open source project, with a large community of users maintaining it and enhancing it • As fast, accurate and stable as most expensive commercial rigid body simulation packages • Possibility to modify the engine and add the features that are missing for a particular requirement
Simulation model (1/2): • Simulation model done using rigid bodies attached using joints • Joints can be anchor, ball, hinge or other • Bodies generally have one or more associated collision objects • Collision objects can be any shape
Simulation model (2/2): • Bodies have masses and inertia tensors; these can be set independently from the shape of the associated collision objects
Creation of two new collision primitives: • Cones, used with high radius to length ratios: • Better than spheres for wheels: effective radius does not reduce when bike makes angle with the ground • More stable than thin cylinder • Terrain: • More optimized than Triangle Mesh primitive for ground • Can collide with cones (wheels)
Creation of a good simulation model for the bike (1/4): • Indirect action on the handle bar • With: • Ac the current bike roll angle • At the target bike roll angle (mapped as left/right control of player) • v the linear velocity • Cs and Cn two parameters to be determined experimentally
Creation of a good simulation model for the bike (2/4): • Adding a force • instead of using an angular motor for the rear wheel, a force is applied directly on the bike frame • Applying a force directly is appropriate because it conveys the feeling of a continuous thrust one can have while riding a motocross bike
Creation of a good simulation model for the bike (3/4): • Adding torques • The bike frame is attached to the static environment using an angular motor. For the three bike axes, target angles are set for the frame in relation to the ground, and the angular motor applies torques to the frame in order to achieve those target angles • The ODE AMotor joint had to be modified
Creation of a good simulation model for the bike (4/4): • Detaching the rider from the motorbike • A new joint called linear motor, has been implemented. It is very similar to the angular motor, but works with forces and translations instead of torques and rotations • The rider trunk is attached to the bike frame using this joint instead of the fixed joint • The rider with his body weight is now able to absorb part of the shocks
Video • Here
Conclusion: • Simulating a motorbike is more difficult than simulating a car, because a lot more bodies, joints and mechanical phenomena are involved • The simulated bike seems realistic and the game seems fairly easy and fun to play • Still more difficult to play than an arcade game
Future work: • Implement skidding • Optimize the simulation so that more than 6 bikes can race at the same time