1 / 19

Mathematics in Computer Games

Mathematics in Computer Games. Nicolas Redfern. Maths in Games. There are many uses for maths in games: Object interaction/collisions Gravity and other forces Breakable objects Realistic vehicle movement Realistic positional sound Particle systems Lighting. Object Interaction/Collisions.

briar
Download Presentation

Mathematics in Computer Games

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Mathematics in Computer Games Nicolas Redfern

  2. Maths in Games There are many uses for maths in games: • Object interaction/collisions • Gravity and other forces • Breakable objects • Realistic vehicle movement • Realistic positional sound • Particle systems • Lighting

  3. Object Interaction/Collisions • Through use of mechanics, it is possible to allow objects in a game to collide realistically with each other. • Collisions are calculated using the following formula: v2-v1=-e(u2-u1) • u2 and u1 are the velocities before collision, and v2 and v1 are the velocities after collision. • e is the coefficient of restitution. In a game this would be set by the developers.

  4. Gravity • Gravity is simulated in games to ensure that objects fall realistically. • On earth, the acceleration due to gravity is 9.8 m/s2.

  5. Calculating the Height of the Tower • The items all took 2 seconds to fall (t) • Acceleration (a) (due to gravity) is 9.8 m/s2 • The initial velocity was 0 m/s2 (u) • Distance travelled is worked out using: s=ut+½at2 • s=0+9.8 (2)2/2 • s=19.6 m s=? u=0 v= a=9.8 t=2

  6. Momentum in Portal • Portal is an action/puzzle game, that makes use of momentum in its puzzles.

  7. Lighting • Lighting is of immense importance to games. A game can be much more immersive, if the lighting is realistic. • Often, dynamic lights are used, for moving light sources. + = colour luminance(colour)*colour

  8. Illustrative Lighting in Team Fortress 2 Team Fortress 2 uses a cartoon-like look to achieve a unique visual style and comedic effect. It uses complex equations to produce lighting effects.

  9. Character Lighting Equation • This is the equation that determines the lighting for characters in Team Fortress 2: • Spatially-varying directional ambient • Modified Lambertian terms • Unclamped Lambertian term • Scale, bias and exponent • Warping function • Albedo

  10. Realistic positional sound • Many games use positional sound: this is where sound varies depending upon where it is coming from. • Another way in which sound is made more realistic is varying it upon the surrounding, environment. • The Doppler effect can also be simulated in game: as an object moves towards you, the sound becomes lower in pitch, and continues to do so as it moves away. • In Day Of Defeat: Source, another effect is applied: sounds far from the player lack higher frequencies and thus sound more like they naturally would, for example, abrupt pops for gunshots.

  11. Breakable objects • Having objects that can be broken up, adds another level of realism to a game. • Usually, only certain objects can be broken, such as crates and fragile items.

  12. Bibliography • Jason Mitchell, Moby Francke and Dhabih Eng, "Illustrative Rendering in Team Fortress 2," International Symposium on Non-Photorealistic Animation and Rendering, 2007 • Games: • Half-Life 2, Day Of Defeat: Source, Portal and Team Fortress 2 (Valve) • Garry’s Mod (Garry Newman) • Crysis (Crytek)

More Related